/**
 * Feuille de Style pour Soleil Rousse - VERSION FINALE COMPLETE
 * Palette : #d91208 (Rouge Passion), #ffade8 (Rose Poudre), #F9F5F0 (Beige Doux)
 */

/* --- 1. FONDATIONS & VARIABLES --- */
@import url('https://fonts.googleapis.com/css2?family=Climate+Crisis&family=Jost:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    /* Palette de couleurs */
    --rouge-passion: #d91208;
    --rose-poudre: #ffade8;
    --beige-doux: #F9F5F0;
    --noir-profond: #1a1a1a;
    --gris-texte: #555;
    --blanc-pur: #FFFFFF;
    --bordures: #EAE0D5;

    /* Typographie */
    --font-titres: 'Climate Crisis', sans-serif;
    --font-corps: 'Jost', sans-serif;

    /* Tokens de Design */
    --radius-s: 8px;
    --radius-m: 16px;
    --max-width: 1200px;
    --shadow-subtil: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* Reset et Configuration Critique */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

/* 
 * IMPORTANT : Cette configuration permet au header sticky de fonctionner
 * tout en empêchant le scroll horizontal indésirable.
 */
html,
body {
    overflow-x: clip;
    /* Coupe ce qui dépasse horizontalement */
    overflow-y: visible;
    /* Garde le scroll vertical normal */
    width: 100%;
}

body {
    font-family: var(--font-corps);
    color: var(--gris-texte);
    background-color: var(--blanc-pur);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* Empêche le scroll quand le menu mobile est ouvert */
body.mobile-menu-open {
    overflow: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-titres);
    color: var(--rouge-passion);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

a {
    color: var(--rouge-passion);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--noir-profond);
}

/* --- 2. HEADER & NAVIGATION (STICKY) --- */
/* --- 2. HEADER & NAVIGATION --- */
header {
    /* ON ENLÈVE LE FOND ET LE FILTRE ICI (pour libérer le menu mobile) */
    background: transparent;
    backdrop-filter: none;
    border-bottom: none;
    /* On gère la bordure dans le pseudo-élément */

    /* Configuration Sticky */
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;

    padding: 1.5rem 0;
    transition: all 0.3s ease;

    /* Nécessaire pour positionner le calque de fond */
    position: sticky;
    /* Isoler le contexte d'empilement pour que le ::before ne cache pas le contenu */
    isolation: isolate;
}

/* NOUEAU : On crée le fond flouté dans un élément séparé */
header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    /* Le style est appliqué ici */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--bordures);

    /* On le met derrière le contenu du header */
    z-index: -1;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-titres);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--noir-profond);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--gris-texte);
    font-weight: 500;
    position: relative;
    padding-bottom: 5px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--rouge-passion);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--noir-profond);
}

.cart-icon-link {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background-color: var(--rouge-passion);
    color: var(--blanc-pur);
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 50%;
    padding: 2px 6px;
    line-height: 1;
}

/* --- 3. HERO SECTION & LOGO SVG --- */
.hero-section {
    position: relative;
    height: 100vh;
    /* Plein écran */
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--blanc-pur);
    padding: 0;
    margin: 0;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Image de fond */
    background: url('images/hero.webp') no-repeat center center/cover;
    z-index: -1;
}

.hero-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.hero-content {
    z-index: 1;
}

/* Style du Logo SVG Hero */
.hero-logo {
    display: block;
    margin: 0 auto 2rem auto;

    width: 300px;
    height: auto;
    max-width: 80vw;

    fill: #FFFFFF;

    /* Permet d'afficher les éléments qui sortent du viewBox */
    overflow: visible;
}

/* Sécurité pour forcer la couleur blanche */
.hero-logo path,
.hero-logo rect,
.hero-logo circle {
    fill: #FFFFFF;
}

.hero-content p {
    font-size: 1.4rem;
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

/* --- 4. SECTIONS CONTENU (Valeurs, Atelier) --- */
.values-section {
    padding: 5rem 0;
    background-color: var(--beige-doux);
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    text-align: center;
}

.value-item svg {
    color: var(--rouge-passion);
    margin-bottom: 1rem;
    width: 32px;
    height: 32px;
}

.value-item h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.featured-collection {
    padding: 5rem 0;
    background-color: var(--blanc-pur);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title span {
    font-size: 2.5rem;
    border-bottom: 2px solid var(--rouge-passion);
    padding-bottom: 0.5rem;
}

.atelier-section {
    padding: 5rem 0;
    background-color: var(--beige-doux);
}

.atelier-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.atelier-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-m);
}

.atelier-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

/* --- 5. PRODUITS & UI COMPONENTS --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem;
}

.product-card {
    background: var(--blanc-pur);
    border: 1px solid var(--bordures);
    border-radius: var(--radius-s);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: var(--shadow-subtil);
}

.product-card-link-area {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-image {
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 1rem 1.2rem;
    text-align: center;
    flex-grow: 1;
}

.product-info h3 {
    font-family: var(--font-titres);
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.product-price {
    font-family: var(--font-corps);
    font-size: 1rem;
    color: var(--gris-texte);
}

.product-card-actions {
    padding: 0 1.2rem 1.2rem;
}

.add-to-cart-quick-btn {
    width: 100%;
    padding: 0.7rem;
    background-color: var(--blanc-pur);
    color: var(--rouge-passion);
    border: 1px solid var(--rouge-passion);
    border-radius: var(--radius-s);
    cursor: pointer;
    font-family: var(--font-corps);
    font-weight: 500;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
}

.product-card:hover .add-to-cart-quick-btn {
    opacity: 1;
    transform: translateY(0);
}

.add-to-cart-quick-btn:hover {
    background-color: var(--rouge-passion);
    color: var(--blanc-pur);
}

.cta-button,
.cta-button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 2rem;
    font-family: var(--font-corps);
    font-size: 1rem;
    font-weight: 500;
    border: 1px solid;
    border-radius: var(--radius-s);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cta-button {
    background: var(--rouge-passion);
    color: var(--blanc-pur);
    border-color: var(--rouge-passion);
}

.cta-button:hover {
    background: var(--noir-profond);
    border-color: var(--noir-profond);
    transform: translateY(-2px);
}

.cta-button-secondary {
    background: transparent;
    color: var(--rouge-passion);
    border-color: var(--rouge-passion);
}

.cta-button-secondary:hover {
    background: var(--rouge-passion);
    color: var(--blanc-pur);
}

.cta-center {
    text-align: center;
    margin-top: 3rem;
}

/* --- 6. FOOTER --- */
footer {
    background-color: var(--beige-doux);
    padding: 4rem 0 2rem;
    margin-top: 5rem;
    border-top: 1px solid var(--bordures);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-grid h4 {
    margin-bottom: 1rem;
}

.footer-grid a {
    display: inline-block;
    margin-bottom: 0.5rem;
    color: var(--gris-texte);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid var(--bordures);
    padding-top: 2rem;
    color: #999;
}

/* --- 7. AMÉLIORATIONS UI/UX (Toast, Animation) --- */
main.fade-in-start {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s, transform 0.5s;
}

main.fade-in-end {
    opacity: 1;
    transform: translateY(0);
}

.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: var(--radius-s);
    color: #fff;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: bottom 0.5s;
    z-index: 9999;
}

.toast.show {
    bottom: 20px;
}

.toast-success {
    background-color: #28a745;
}

.toast-error {
    background-color: var(--rouge-passion);
}

.hidden {
    display: none !important;
}

/* --- 8. MENU MOBILE FULL SCREEN (COMPLET) --- */
#mobile-menu-toggle {
    display: none;
}

@media (max-width: 992px) {

    /* Bouton Burger / Croix */
    #mobile-menu-toggle {
        display: block;
        z-index: 3000;
        /* Toujours visible au dessus du menu */
        position: relative;
    }

    /* Styles des lignes SVG pour l'animation */
    #mobile-menu-toggle svg line {
        transition: all 0.3s ease;
        transform-origin: center;
    }

    /* Quand le menu est ouvert : Bouton fixe + Animation Croix */
    body.mobile-menu-open #mobile-menu-toggle {
        position: fixed;
        top: 1.5rem;
        right: 1.5rem;
    }

    /* Ligne du haut -> Rotation 45° */
    body.mobile-menu-open #mobile-menu-toggle svg line:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    /* Ligne du milieu -> Disparaît */
    body.mobile-menu-open #mobile-menu-toggle svg line:nth-child(2) {
        opacity: 0;
    }

    /* Ligne du bas -> Rotation -45° */
    body.mobile-menu-open #mobile-menu-toggle svg line:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    /* CONTAINER DU MENU FULL SCREEN */
    #main-nav {
        position: fixed !important;
        top: 0;
        left: 0;

        width: 100vw;
        height: 100vh;
        height: 100dvh;
        /* Hauteur dynamique mobile */

        background-color: var(--blanc-pur);
        z-index: 2000;

        display: flex;
        justify-content: center;
        align-items: center;

        /* Caché par défaut */
        opacity: 0;
        visibility: hidden;
        transform: scale(0.95);
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
    }

    /* ETAT OUVERT */
    body.mobile-menu-open #main-nav {
        opacity: 1;
        visibility: visible;
        transform: scale(1);
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0s;
    }

    /* STYLE DES LIENS */
    .nav-links {
        display: flex;
        flex-direction: column;
        text-align: center;
        gap: 2.5rem;
        width: 100%;
    }

    .nav-links li {
        width: 100%;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.5s ease;
    }

    /* Animation Cascade des liens */
    body.mobile-menu-open .nav-links li {
        opacity: 1;
        transform: translateY(0);
    }

    body.mobile-menu-open .nav-links li:nth-child(1) {
        transition-delay: 0.1s;
    }

    body.mobile-menu-open .nav-links li:nth-child(2) {
        transition-delay: 0.2s;
    }

    body.mobile-menu-open .nav-links li:nth-child(3) {
        transition-delay: 0.3s;
    }

    body.mobile-menu-open .nav-links li:nth-child(4) {
        transition-delay: 0.4s;
    }

    .nav-links a {
        font-size: 2.5rem;
        font-family: var(--font-titres);
        color: var(--noir-profond);
        display: block;
    }
}

@media (max-width: 768px) {
    .atelier-grid {
        grid-template-columns: 1fr;
    }

    .atelier-image {
        order: -1;
    }
}