/* Couleurs */
:root {
    --background: #faf2e2;
    --yellow: #eac88e;
    --dark_yellow: #b89d70;
    --blue: #8fc4f7;
    --grey: #D9D9D9;
    --red: #f7594f;
    --green: #2ecc71;
}

.bg-background {
    background-color: var(--grey) !important;
}

.bg-yellow {
    background-color: var(--yellow) !important;
}

/* Réinitialisation de base */
body {
    margin: 0;
    padding: 0;
    font-family: 'Afaacad', sans-serif;
    background-color: var(--background);
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    margin-bottom: 20px;
}

/* Typographie */
.peralta-regular {
    font-family: "Peralta", serif;
    font-weight: 400;
    font-style: normal;
}

.txt-black {
    color: #333;
}

h1 {
    font-family: 'Peralta', serif;
    font-weight: 400;
    font-style: normal;
    font-size: 2rem;
}

h2 {
    font-family: 'Peralta', serif;
    font-weight: 400;
    font-style: normal;
    font-size: 1.5rem;
    color: #333;

}

h3 {
    font-family: 'Peralta', serif;
    font-weight: 400;
    font-style: normal;
    font-size: 1.3rem;
    margin: 0;
    padding: 1em 0;
}

#title_categorie {
    background-color: var(--yellow);
}

#title_produits {
    background-color: var(--blue);
}

#label_quantity {
    margin: 1em 0;
}

h4,
h5 {
    font-family: 'Peralta', serif;
    font-weight: 400;
    font-style: normal;
    font-size: 1.2rem;
    margin: 10px 0;
}

p {
    font-size: 1rem;
    line-height: 1.5;
    color: #333;
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    border: 2px solid #333;
}

.btn-ajouter {
    background-color: var(--yellow);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease-in-out;
}

.btn-primary {
    background-color: var(--blue);
    color: black;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease-in-out;
}

#btn-supprimer {
    background-color: var(--red);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease-in-out;
}

.btn-supprimer {
    background-color: var(--red);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease-in-out;
}

.btn-ajouter:hover {
    background-color: #e5b86b;

}

#btn-supprimer:hover {
    background-color: #b4362d;
}

.btn-supprimer:hover {
    background-color: #b4362d;
}

#btn-edit {
    background-color: var(--green);
}

#btn-edit:hover {
    background-color: #2d9b36;
}

.section_categorie {
    border-radius: 10px;
}

.article_categorie {
    padding: 10px;
    margin: 20px 10px;
}

.article_phare {
    max-width: 1080px;
    margin: 0 auto;
    padding: 20px;
    border-radius: 10px;
    min-height: 400px;
    background-color: var(--blue);
}

header {
    padding: 20px;
}

/* pop up*/
#confirmation-popup {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--green);
    padding: 10px;
    border: #333 2px solid;
    border-radius: 20px;
    z-index: 100;
}
.section_panier #confirmation-popup {
    background-color: var(--red) !important;
}
.panier {
    display: flex;
    flex-direction: column;
}

footer {
    background-color: var(--blue);
    padding: 20px 0;
    text-align: center;
    width: 100%;
}

/* Main Profil */

.main-Profil {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.main-Profil>section {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 10px;
    background-color: var(--blue);
}

.main-Profil>section:nth-child(3) {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.main-Profil>section:nth-child(3) div {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-around;
    gap: 20px;
}


/* Ancre */
.ancre {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--blue);
    color: var(--background);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    font-size: 1.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
    border-color: white;
    border-style: solid;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;

}

.ancre:hover {
    background-color: var(--yellow);
}

.section_phare,
.section {
    background-color: var(--blue);
    padding: 20px;
    text-align: center;
    margin: 20px 0;
}

.section_phare {
    background-color: var(--yellow);
}

.section_products {
    text-align: center;
}

.section h2,
.section h3 {
    color: var(--background);
    font-size: 1.5rem;
}

.form,
.description {
    background-color: var(--grey);
    padding: 20px;
    border-radius: 10px;
}

.form>div {
    display: flex;
    flex-direction: column;
    margin: 10px 0;
}

form>div>input {
    width: 80%;
}

a {
    text-decoration: none;
    color: #333;
}

.card_categorie {
    background-color: var(--yellow);
    padding: 20px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    cursor: pointer;
}

.active-category,
.card_categorie:hover {
    border: #333 3px solid;
}

.card_categorie img {
    width: 250px;
    height: 250px;
    object-fit: contain;
}

.section_phare .card_produit,
.section_products .card_produit {
    background-color: var(--blue);
    width: 300px;
    border-radius: 10px;
    margin: 20px 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 20px;
}

.card_produit_img {
    width: 100%;
    height: 200px;
    object-fit: contain;
}

/* Flexbox */
.flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-no-wrap {
    flex-wrap: nowrap;
}

.column {
    flex-direction: column;
}

.space-center {
    justify-content: center;
}

.space-around {
    justify-content: space-around;
}

.space-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.justify-center {
    justify-content: center !important;
}

.justify-between {
    justify-content: space-between;
}

.vertical-center {
    align-items: center;
}

.text-center {
    text-align: center;
}

.gap {
    gap: 20px;
}

.small-gap {
    gap: 10px;
}

.box-shadow {
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
}

.m-t {
    margin-top: 20px;
}

tr>td {
    color: #333;
}

.td-action {
    display: flex;
    gap: 10px;
    flex-direction: column;
    height: 100%;
    align-content: center;

}

/* Images */
.logo {
    height: 100px;
    object-fit: contain;
}

.hw-50px {
    height: 50px;
    width: 50px;
}

/* Hover pour l'icône Profil*/

.profil-container {
    position: relative;
}

.profil-img:hover+.profil-menu,
.profil-container:hover .profil-menu {
    display: block;
    opacity: 1;
    transition: opacity 0.5s ease-in;
}

.profil-menu {
    display: block;
    opacity: 0;
    position: absolute;
    top: 60px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding: 1px;
    z-index: 10;
    min-width: 100px;
    transition: opacity 0.5s ease-in 1s;
    /* Délai de 1 seconde avant de disparaître */
}

.profil-container:hover .profil-menu {
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.profil-menu a {
    display: block;
    padding: 8px 10px;
    color: #333;
    text-decoration: none;
    transition: background 0.3s;
}

.profil-menu a:hover {
    background-color: #f2f2f2;
}


/* MODAL PROFIL */

.modal {
    display: none;
    position: fixed;
    z-index: 3;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    width: 50%;
    padding: 20px;
    border: 1px solid #888;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.modal-content h3 {
    color: #333;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal-content form div {
    margin-bottom: 15px;
}

.modal-content form label {
    display: block;
    margin-bottom: 5px;
}

.modal-content form input {
    width: 90%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.modal-content form button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: #007BFF;
    color: #fff;
    cursor: pointer;
}

.modal-content form button:hover {
    background-color: #0056b3;
}

.submit {
    margin: 10px 0;
}

/* Autocompletion */

#suggestion {
    border: 1px solid #ccc;
    width: 210px;
    background-color: white;
    position: absolute;
    z-index: 1;
    padding: 0;
    margin: 0;
    list-style-type: none;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}

#suggestion div {
    padding: 8px 10px;
    cursor: pointer;
    border-bottom: 1px solid #f1f1f1;
}

#suggestion div:hover {
    background-color: #f1f1f1;
}

#search {
    padding: 8px;
    width: 200px;
    border: 1px solid #333;
    border-radius: 5px;
}

/* Formulaire */
input[type="text"],
input[type="email"],
input[type="password"],
select {
    padding: 10px;
    border-radius: 10px;
    border: 2px solid #33333350;
    width: 80%;
    height: min-content;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
    border: 2px solid #333;
}

.container-form {
    width: 70%;
}

.form-container {
    width: 100%;
}

.form-button {
    margin: 10px;
}

.main-form {
    display: flex;
    justify-content: center;
}



/* burger */
.burger {
    display: none;
}

.bar {
    width: 30px;
    height: 3px;
    background-color: #333;
    margin: 6px 0;
}

.hide_desktop {
    display: none;
}

/* Carousel */
.carousel {
    position: relative;
}

.carousel-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-item {
    position: relative;
    display: none;
    float: left;
    width: 100%;
    margin-right: -100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transition: transform 0.6s ease-in-out;
}

.carousel-item.active,
.carousel-item-next,
.carousel-item-prev {
    display: block;
}

.carousel-item-next,
.carousel-item-prev {
    position: absolute;
    top: 0;
}

.carousel-item-next.carousel-item-left,
.carousel-item-prev.carousel-item-right {
    transform: translateX(0);
}

.carousel-item-next,
.active.carousel-item-right {
    transform: translateX(100%);
}

.carousel-item-prev,
.active.carousel-item-left {
    transform: translateX(-100%);
}

.carousel-control-prev,
.carousel-control-next {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 15%;
    text-align: center;
    opacity: 0.5;
    height: 100%;
    transition: opacity 0.15s ease-in-out;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

.carousel-control-prev {
    left: 0;
}

.carousel-control-next {
    right: 0;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    display: inline-block;
    width: 30px;
    height: 30px;
    background: no-repeat 50%/100% 100%;
}

.carousel-control-prev-icon {
    background-image: url('data:image/svg+xml;charset=utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="%2380808080" viewBox="0 0 8 8"%3E%3Cpath d="M4.707 1.707L3.414 0.414 0 4l3.414 3.586 1.293-1.293L2.586 4z"/%3E%3C/svg%3E');
}

.carousel-control-next-icon {
    background-image: url('data:image/svg+xml;charset=utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="%2380808080" viewBox="0 0 8 8"%3E%3Cpath d="M3.293 1.707L4.586 0.414 8 4l-3.414 3.586-1.293-1.293L5.414 4z"/%3E%3C/svg%3E');
}

.carousel-control-product {
    position: absolute;
    top: 0;
    left: 15%;
    width: 70%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.carousel-indicators {
    position: absolute;
    right: 0;
    bottom: 10px;
    left: 0;
    z-index: 15;
    display: flex;
    justify-content: center;
    padding-left: 0;
    margin-right: 15%;
    margin-left: 15%;
    list-style: none;
}

.carousel-indicators li {
    position: relative;
    flex: 0 1 auto;
    width: 30px;
    height: 3px;
    margin-right: 3px;
    margin-left: 3px;
    background-color: #fff;
    cursor: pointer;
    transition: opacity 0.6s ease;
}

.carousel-indicators .active {
    opacity: 1;
}

.carousel-caption {
    position: absolute;
    right: 15%;
    bottom: 10px;
    z-index: 2;
    min-width: min-content;
    width: 20%;
    margin: auto;
    text-align: center;
    background-color: #FFFFFF80;
    border-radius: 10px;
    padding: 5px;
}

.carousel-caption p {
    margin: 0;
}

.carousel-item {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.carousel-item.active {
    opacity: 1;
    min-height: 410px;
}

.dropdown {
    position: relative;
    display: inline-block;
    padding: 40px;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    padding: 12px 16px;
    z-index: 1;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.articles {
    background-color: var(--blue);
    padding: 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.article_phare img,
.articles img {
    width: 100%;
    height: 400px;
    object-fit: contain;
}

.articles ul {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.articles li {
    list-style-type: none;
}

.article_produit {
    padding: 20px;
    align-items: center;
    gap: 10px;
}

.chapters {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px;
}

.chapters a {
    text-decoration: none;
    color: var(--blue);
    background-color: var(--red);
    padding: 10px 15px;
    border-radius: 5px;
}

.chapters a:hover {
    background-color: var(--white);
}

/* Page Détail */


.card_produit_img_detail {
    background-color: var(--blue);
    border-radius: 10px;
    max-width: 50%;
    height: 400px;
    padding: 10px;
    margin: 10px;
}

.detail_buying {
    border: 1px #333 dashed;
    padding: 10px;
    margin: 10px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;

}

.quantity-container {
    display: flex;
    align-items: center;
}

.quantity-container button {
    width: 35px;
    height: 35px;
    text-align: center;
    cursor: pointer;
    margin: 0 5px;
}

.quantity-container input {
    width: 50px;
    height: 30px;
    text-align: center;
    border: 1px solid #ccc;
    margin: 0 5px;
}

.quantity-container button,
.quantity-container input {
    border: 1px solid #ccc;
    background-color: white;
    transform: 3s ease-in-out;
}

.quantity-container input:focus,
.quantity-container button:hover,
.quantity-container input:hover {
    background-color: #F0F0F0;
}

.input_quantite::-webkit-outer-spin-button,
.input_quantite::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.description {
    margin: 10px;
    padding: 10px;
    border-radius: 10px;
}

.description h3 {
    padding: 0;
}

.section_detail,
.article_detail {
    justify-content: space-around;
}

/* Panier */
.section_panier {
    background-color: var(--blue);
    padding: 20px;
    text-align: center;
    margin: 20px 0;
}

.cart-container {
    display: flex;
    padding: 20px;
    gap: 20px;
}

.cart-items {
    flex: 3;
}

.cart-items h2 {
    margin-bottom: 15px;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--background);
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    gap: 10px;
}

.cart-item img {
    width: 75px;
    height: 75px;
    object-fit: contain;
    border-radius: 4px;
}

.cart-item span {
    flex: 1;
}

.price {
    margin-left: auto;
}

.prix-produit {
    font-weight: bold;
}

.quantity {
    width: 40px;
    padding: 5px;
    text-align: center;
}

/* Récapitulatif du panier */
.cart-summary {
    flex: 1;
    padding: 15px;
    border-left: 2px solid var(--background);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-summary p {
    margin: 0;
}


/* PAGE404 */

.error-img {
    width: 750px;
    height: 400px;
    border-radius: 20px;
}

.error-p {
    justify-content: center;
}

/* Media queries */

@media screen and (max-width: 768px) {

    .section_products a {
        width: 100%;
    }

    .hide_mobile {
        display: none;
    }

    /* Menu*/
    .burger {
        display: block;
    }

    .off-screen-menu {
        background-color: #333;
        height: 100vh;
        width: 100%;
        max-width: 450px;
        position: fixed;
        top: 0;
        left: -450px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        font-size: 2rem;
        transition: 0.3s ease;
        z-index: 3;
    }

    .off-screen-menu li {
        list-style: none;
        margin: 20px 0;

    }

    .off-screen-menu a {
        color: var(--background);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 20px
    }

    .off-screen-menu.active {
        left: 0px;
    }

    .ham-menu {
        height: 50px;
        width: 50px;
        position: relative;
        z-index: 3;
    }

    .ham-menu span {
        height: 5px;
        width: 100%;
        background-color: #333;
        border-radius: 25px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        transition: 0.3s ease;
    }

    .ham-menu span:nth-child(1) {
        top: 25%;
    }

    .ham-menu span:nth-child(3) {
        top: 75%;
    }

    .ham-menu.active span:nth-child(1) {
        top: 50%;
        transform: translate(-50%, -50%) rotate(45deg);
        background-color: var(--blue);
    }

    .ham-menu.active span:nth-child(2) {
        opacity: 0;
    }

    .ham-menu.active span:nth-child(3) {
        top: 50%;
        transform: translate(-50%, -50%) rotate(-45deg);
        background-color: var(--blue);

    }

    /* Index */
    .section_phare {
        padding: 0;
    }

    .carousel-caption {
        width: 80%;
        right: 0;
        left: 0;
        background-color: #FFFFFF80;
    }

    .article_phare {
        border-radius: 0;
    }

    .article_produit {
        padding: 10px 0;
        gap: 0;
    }

    .section_phare .card_produit,
    .section_products .card_produit {
        margin: 15px 0;
        padding: 20px 0;
        width: 100%;
        border-radius: 0;
    }

    .card_categorie img {
        height: 110px;
        width: 110px;
    }

    /* PAGE404 */
    .error-img {
        width: 300px;
        height: 200px;
    }

    /* Page détail */

    .section_detail {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .card_produit_img_detail {
        width: 100%;
        max-width: none;
        border-radius: 0;
        margin: 0;
        margin-bottom: 20px;
        padding: 20px 0;

    }


    .article_detail {
        width: 100%;
    }

    /* Connexion */

    .container-form {
        width: 90%;
    }

    /* Autocompletion */
    #suggestion {
        display: none;
    }

    /* Panier */
    .section_panier,
    .cart-container,
    .cart-item {
        padding: 10px 0;
        border-radius: 0;
    }

    .cart-container {
        flex-direction: column;
        gap: 10px;
    }

    .cart-item img {
        width: 50px;
        height: 50px;
    }

    .cart-summary {
        border-left: none;
        padding: 0;
    }

    /* Profil */
    .main-Profil {
        gap: 1 0px;
    }

    .main-Profil>section {
        width: 100%;
        border-radius: 0;
        gap: 0;
    }

    .main-Profil>section:nth-child(2) {
        order: 3;
    }


    .main-Profil>section:nth-child(1) {
        order: 2;
    }

    .main-Profil>section:nth-child(3) {
        order: 1;
    }

    .modal-content {
        width: 80%;

    }
}

@media screen and (max-width: 500px) {
    #nom_panier {
        display: none;
    }

    .section_panier .btn {
        padding: 5px 10px;
    }

    .section_panier h4 {
        font-size: 1rem;
    }
}