/* ========================================
   PAGE CATÉGORIE
======================================== */

.category-page {
    display: none;

    width: 100%;
    max-width: 900px;

    margin: 0 auto;

    padding: 0 18px 50px;
}

.category-page.active {
    display: block;
}


/* ========================================
   HEADER CATÉGORIE
======================================== */

.category-hero {
    position: relative;

    width: 100%;
    height: 200px;

    overflow: hidden;

    border-radius: 0;

    background-size: cover;
    background-position: center;

    display: flex;
    align-items: center;
    justify-content: center;
}


/* DÉGRADÉ */

.category-hero::before {
    content: "";

    position: absolute;
    inset: 0;

    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.90) 0%,
        rgba(0, 0, 0, 0.70) 25%,
        rgba(0, 0, 0, 0.35) 60%,
        rgba(0, 0, 0, 0) 80%
    );
}


/* TITRE */

.category-hero h1 {
    position: absolute;

    left: 65px;
    bottom: 17px;

    margin: 0;

    color: #fff;

    font-family: "Cormorant Garamond", Georgia, serif;

    font-size: 42px;
    font-weight: 650;

    line-height: 1;

    z-index: 2;
}


/* ========================================
   RETOUR
======================================== */

.category-back {
    position: absolute;

    bottom: 18px;
    left: 22px;

    z-index: 3;

    width: 35px;
    height: 35px;

    border: none;
    background: transparent;

    cursor: pointer;
}

.category-back::before {
    content: "";

    position: absolute;

    width: 16px;
    height: 16px;

    border-left: 4px solid #fff;
    border-bottom: 4px solid #fff;

    transform: rotate(45deg);

    left: 9px;
    top: 8px;
}


/* ========================================
   PRODUITS
======================================== */

.category-products {
    margin-top: 40px;

    display: flex;
    flex-direction: column;
}


/* ========================================
   SOUS-CATÉGORIES
======================================== */

.product-section {
    margin-top: 40px;
}

.product-section:first-child {
    margin-top: 0;
}


.product-section-title {
    margin: 0 0 20px 0;

    padding-bottom: 11px;

    color: #2b2119;

    font-family: "Cormorant Garamond", Georgia, serif;

    font-size: 28px;
    font-weight: 600;

    line-height: 1.2;

    border-bottom: 2px solid rgba(43, 33, 25, 0.35);
}


/* ========================================
   PRODUIT
======================================== */

.product-item {
    padding: 12px 4px;

    border-bottom: 1px solid rgba(43, 33, 25, 0.12);

    color: #2b2119;
}


/* NOM + PRIX */

.product-main {
    display: flex;

    align-items: baseline;
    justify-content: space-between;

    gap: 20px;
}


.product-name {
    font-family: "Montserrat", Arial, Helvetica, sans-serif;

    font-size: 14px;
    font-weight: 500;
}


.product-price {
    margin-left: auto;

    text-align: right;

    font-family: "Montserrat", Arial, Helvetica, sans-serif;

    font-size: 13px;
    font-weight: 500;

    white-space: nowrap;
}


/* ========================================
   INGRÉDIENTS
======================================== */

.product-ingredients {
    margin-top: 8px;

    font-family: "Montserrat", Arial, Helvetica, sans-serif;

    font-size: 13px;
    font-weight: 400;

    line-height: 1.5;

    color: #2b2119;
	max-width: 82%;
}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 699px) {

    .category-page {
        padding-left: 12px;
        padding-right: 12px;
    }


    .category-back {
        bottom: 20px;
        left: 22px;
    }


    .category-hero {
        height: 150px;

        border-radius: 0;
    }


    .category-hero h1 {
        font-size: 44px;
    }


    .category-products {
        margin-top: 35px;
    }


    .product-section {
        margin-top: 40px;
    }


    .product-section:first-child {
        margin-top: 0;
    }


    .product-section-title {
        margin-bottom: 15px;

        font-size: 28px;
    }


    .product-item {
        padding: 13px 3px;
    }


    .product-name {
        font-size: 13px;
    }


    .product-price {
        font-size: 12px;
    }


    .product-ingredients {
        font-size: 12px;

        line-height: 1.45;
		max-width: 76%;
    }
	
}


/* ========================================
   NAVIGATION AU SCROLL
======================================== */

/* Barre de retour aux catégories
   Apparaît uniquement après le header */

.category-scroll-header {
    position: fixed;

    top: 0;
    left: 50%;

    transform: translate(-50%, -100%);

    width: min(900px, 100%);

    height: 52px;

    display: flex;
    align-items: center;

    padding: 0 18px;

    background: rgba(250, 247, 242, 0.96);

    border-bottom: 1px solid rgba(43, 33, 25, 0.12);

    box-shadow: 0 3px 12px rgba(43, 33, 25, 0.08);

    z-index: 100;

    opacity: 0;

    transition:
        transform 0.3s ease,
        opacity 0.3s ease;
}


/* Visible après le scroll */

.category-scroll-header.visible {
    transform: translate(-50%, 0);

    opacity: 1;
}


/* Flèche */

.category-scroll-back {
    width: 34px;
    height: 34px;

    margin: 0 10px 0 0;

    padding: 0;

    border: none;

    background: transparent;

    cursor: pointer;

    position: relative;
}


/* Dessin de la flèche */

.category-scroll-back::before {
    content: "";

    position: absolute;

    width: 13px;
    height: 13px;

    border-left: 3px solid #2b2119;
    border-bottom: 3px solid #2b2119;

    transform: rotate(45deg);

    left: 9px;
    top: 8px;
}


/* Nom de la catégorie */

.category-scroll-title {
    font-family: "Cormorant Garamond", Georgia, serif;

    font-size: 22px;
    font-weight: 600;

    color: #2b2119;
}


.category-note {
    margin: 18px 0 0;
    padding: 0 4px;

    color: rgba(43, 33, 25, 0.75);

    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 15px;
    font-style: italic;
    line-height: 1.5;

    text-align: center;
}


/* ========================================
   BOUTON RETOUR EN HAUT
======================================== */

.category-scroll-top {
    position: fixed;

    right: 25px;
    bottom: 25px;

    width: 44px;
    height: 44px;

    border: none;
    border-radius: 50%;

    background: #2b2119;

    color: #fff;

    font-family: Arial, sans-serif;

    font-size: 20px;
    font-weight: 600;

    cursor: pointer;

    z-index: 99;

    opacity: 0;
    visibility: hidden;

    transform: translateY(10px);

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease,
        transform 0.3s ease;
}


/* Visible après le scroll */

.category-scroll-top.visible {
    opacity: 1;

    visibility: visible;

    transform: translateY(0);
}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 699px) {

    .category-scroll-header {
        height: 48px;

        padding: 0 12px;
    }


    .category-scroll-title {
        font-size: 20px;
    }


    .category-scroll-top {
        right: 16px;
        bottom: 18px;

        width: 42px;
        height: 42px;
    }
	
	.category-note {
        margin-top: 15px;
        font-size: 14px;
    }

}


/* ========================================
   HEADER PRINCIPAL AU SCROLL
======================================== */

.header {
    transition:
        transform 0.3s ease,
        opacity 0.3s ease;
}

.header.header-hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

/* ========================================
   PRIX UNITAIRES ET FORMULES
======================================== */

.product-prices {
    display: grid;
    grid-template-columns: 62px 68px;
    gap: 8px;
    flex-shrink: 0;
    align-items: baseline;
}

/* Alignement des prix dans les colonnes */

.product-prices .product-price {
    margin-left: 0;
    text-align: right;
}

/* Intitulés des colonnes */

.product-price-headings {
    display: flex;
    justify-content: flex-end;
    margin: 0 4px 6px;
}

.product-price-headings .product-prices span {
    font-family: "Montserrat", sans-serif;
    font-size: 9px;
    color: rgba(43, 33, 25, 0.65);
    text-align: right;
    white-space: nowrap;
}

/* Prix formule légèrement plus marqué */

.product-price-formula {
    font-family: "Montserrat", Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #2b2119;
    text-align: right;
    white-space: nowrap;
}

/* Adaptation mobile */

@media (max-width: 699px) {

    .product-prices {
        grid-template-columns: 59px 64px;
        gap: 6px;
    }

    .product-price-headings .product-prices span {
        font-size: 10px;
    }

    .product-price-formula {
        font-size: 12px;
    }

}

/* ========================================
   TITRE DE SECTION ET EN-TÊTES DES PRIX
======================================== */

.product-section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;

    column-gap: 12px;
    row-gap: 4px;

    margin-bottom: 12px;
    padding-bottom: 11px;

    border-bottom: 2px solid rgba(43, 33, 25, 0.35);
}

/* Le trait est maintenant porté par le bloc complet */

.product-section-heading .product-section-title {
    flex: 1 1 auto;

    margin: 0;
    padding: 0;

    border-bottom: none;
}

/* Les intitulés restent alignés avec les prix */

.product-section-heading .product-price-headings {
    flex: 0 0 auto;

    margin: 0 4px 0 auto;
}


/* Mention de transparence sur les images générées par IA */

.ai-photo-credit {
    position: absolute;
    right: 10px;
    bottom: 9px;
    z-index: 2;

    padding: 4px 7px;

    font-family: "Montserrat", Arial, sans-serif;
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.3px;

    color: rgba(255, 255, 255, 0.9);
    background: rgba(30, 24, 19, 0.45);

    border-radius: 3px;
    pointer-events: none;
}

/* Mention IA sur mobile */
@media (max-width: 699px) {
    .category-hero .ai-photo-credit {
        right: 4px;
        bottom: 6px;
        font-size: 7px;
        padding: 3px 5px;
    }
}


.formula-note {
    margin: -10px 0 0;
    text-align: center;
    font-family: "Montserrat", Arial, sans-serif;
    font-size: 11px;
    color: rgba(43, 33, 25, 0.7);
}

.formula-note-icon {
    flex-shrink: 0;
    font-size: 20px;
    font-weight: 600;
    color: #8b694c;
}

.formula-link {
    color: #2b2119;
    text-decoration: underline;
    text-decoration-color: rgba(43, 33, 25, 0.4);
    text-underline-offset: 3px;
    cursor: pointer;
}

.formula-link:hover {
    color: #a87848;
}