/* ================================================================
   toutagri-shared.css — Header, Footer, Preloader, Scroll-top
   Extrait depuis index.html — partagé par toutes les pages du site
   ================================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,600&family=Barlow+Condensed:wght@300;400;500;600;700&family=Barlow:wght@300;400;500&display=swap');

/* ── Variables ── */
:root {
    --dark:       #152A0A;
    --gold:       #C48A24;
    --gold-light: #DFA840;
    --cream:      #F0EBE0;
    --cream-muted:#A09383;
    --condensed:  'Barlow Condensed', sans-serif;
    --display:    'Cormorant Garamond', Georgia, serif;
    --ease:       cubic-bezier(0.4, 0, 0.2, 1);
    --white:      #ffffff;
}

/* ── Preloader ── */
#preloader {
    position: fixed; inset: 0;
    background: #0F2008;
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.6s var(--ease);
}
#preloader.out { opacity: 0; pointer-events: none; }
.preloader-inner {
    display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.preloader-wordmark {
    font-family: var(--display);
    font-size: 2.4rem;
    font-weight: 300;
    letter-spacing: 12px;
    text-transform: uppercase;
    color: var(--cream);
}
.preloader-wordmark span { color: var(--gold); }
.preloader-bar {
    width: 120px; height: 1px;
    background: #2C4D17;
    position: relative; overflow: hidden;
}
.preloader-bar::after {
    content: '';
    position: absolute; inset-block: 0; left: -100%;
    width: 100%;
    background: var(--gold);
    animation: loadbar 1.2s var(--ease) forwards;
}
@keyframes loadbar { to { left: 0; } }

/* ── Header ── */
#site-header {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 800;
    height: 100px;
    display: flex; align-items: center;
    background: rgba(15, 32, 8, 0.0);
    backdrop-filter: blur(0px);
    border-bottom: 1px solid transparent;
    transition: background 0.4s var(--ease),
                border-color 0.4s var(--ease),
                backdrop-filter 0.4s var(--ease);
}
/* Photo d'en-tête non assombrie : voile discret derrière le header
   pour garder la navigation lisible sans filtrer la photo. */
body[data-page="index"] #site-header:not(.sticky)::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(to bottom, rgba(9,12,7,0.55) 0%, rgba(9,12,7,0.18) 60%, rgba(9,12,7,0) 100%);
    pointer-events: none;
}
body[data-page="index"] #site-header:not(.sticky) .h-nav a,
body[data-page="index"] #site-header:not(.sticky) .h-tagline,
body[data-page="index"] #site-header:not(.sticky) .h-mobile-nums {
    text-shadow: 0 1px 6px rgba(9,12,7,0.85), 0 0 2px rgba(9,12,7,0.6);
}
body[data-page="index"] #site-header:not(.sticky) .h-nav a { color: rgba(245,241,233,0.82); }
body[data-page="index"] #site-header:not(.sticky) .h-mobile-nums { color: rgba(245,241,233,0.82); }

/* Scroll → fond blanc (supprime le vert foncé) */
#site-header.sticky {
    background: rgba(255, 255, 255, 0.70);
    backdrop-filter: blur(20px);
    border-bottom-color: rgba(196,138,36, 0.25);
    box-shadow: 0 2px 20px rgba(20,40,10,0.09);
}
#site-header.sticky .h-nav a { color: rgba(21,42,10,0.6); }
#site-header.sticky .h-nav a:hover,
#site-header.sticky .h-nav a.active { color: #152A0A; }
#site-header.sticky .h-tagline { color: #3a4a30; }
#site-header.sticky .h-mobile-toggle { color: #152A0A; }

/* Pages sans hero : header blanc fixe */
body:not([data-page="index"]) #site-header {
    background: rgba(255, 255, 255, 0.70);
    backdrop-filter: blur(20px);
    border-bottom-color: rgba(196,138,36, 0.25);
    box-shadow: 0 2px 20px rgba(20,40,10,0.09);
}
body:not([data-page="index"]) .h-nav a { color: rgba(21,42,10,0.6); }
body:not([data-page="index"]) .h-nav a:hover,
body:not([data-page="index"]) .h-nav a.active { color: #152A0A; }
body:not([data-page="index"]) .h-tagline { color: #3a4a30; }
body:not([data-page="index"]) .h-mobile-toggle { color: #152A0A; }

.header-wrap {
    width: 100%; max-width: 1440px;
    margin: 0 auto;
    padding: 0 48px;
    display: flex; align-items: center; gap: 0;
}

/* 1. Logo */
.h-logo { flex-shrink: 0; margin-right: 20px; padding: 8px 0; }
.h-logo img {
    height: 84px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s;
}
.h-logo a:hover img { transform: translateY(-2px); }

/* 3. Tagline visible */
.h-divider {
    width: 1px; height: 28px;
    background: rgba(196,138,36,0.35);
    flex-shrink: 0; margin: 0 20px;
}
.h-tagline {
    font-family: var(--condensed);
    font-size: clamp(15px, 1.4vw, 20px); font-weight: 600;
    letter-spacing: 2px; text-transform: uppercase;
    color: rgba(240,235,224,0.85);
    white-space: nowrap; flex-shrink: 0;
}

/* 2. Nav police x1.3 */
.h-nav {
    flex: 1;
    display: flex; justify-content: flex-end; align-items: center;
    gap: 32px;
}
.h-nav a {
    font-family: var(--condensed);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(240,235,224,0.65);
    position: relative;
    transition: color 0.3s;
}
.h-nav a::after {
    content: '';
    position: absolute; bottom: -5px; left: 0;
    width: 0; height: 1px;
    background: var(--gold);
    transition: width 0.35s var(--ease);
}
.h-nav a:hover, .h-nav a.active { color: var(--cream); }
.h-nav a:hover::after, .h-nav a.active::after { width: 100%; }

/* 4. CTA avec numéros mobiles */
.h-cta-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; margin-left: 40px; }
.h-cta {
    font-family: var(--condensed);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--dark);
    background: var(--gold);
    padding: 10px 20px;
    transition: background 0.3s;
    white-space: nowrap;
}
.h-cta:hover { background: var(--gold-light); }
.h-mobile-nums {
    font-family: var(--condensed);
    font-size: clamp(12px, 1.1vw, 16px); font-weight: 600;
    letter-spacing: 1px;
    color: rgba(240,235,224,0.55);
    white-space: nowrap;
}
#site-header.sticky .h-mobile-nums,
body:not([data-page="index"]) .h-mobile-nums { color: #5a6e50; }

/* mobile toggle */
.h-mobile-toggle {
    display: none;
    background: none; border: none;
    color: var(--cream); font-size: 20px; cursor: pointer;
    margin-left: auto;
}

/* mobile nav drawer */
#site-header.mobile-nav-open .h-nav {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 100px; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(24px);
    padding: 16px 24px 24px;
    gap: 0;
    border-bottom: 2px solid rgba(196,138,36,0.25);
    box-shadow: 0 8px 32px rgba(20,40,10,0.12);
    z-index: 799;
    justify-content: flex-start;
    align-items: flex-start;
}
#site-header.mobile-nav-open .h-nav a {
    color: rgba(21,42,10,0.7) !important;
    font-size: 15px;
    padding: 14px 0;
    width: 100%;
    border-bottom: 1px solid rgba(196,138,36,0.1);
    letter-spacing: 2px;
}
#site-header.mobile-nav-open .h-nav a:last-child { border-bottom: none; }
#site-header.mobile-nav-open .h-nav a:hover,
#site-header.mobile-nav-open .h-nav a.active { color: #152A0A !important; }

/* ── Footer ── */
#footer {
    background: var(--dark);
    border-top: 2px solid rgba(196,138,36,0.35);
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 22px 48px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}
.footer-logo img {
    width: clamp(70px, 8vw, 110px);
    height: clamp(70px, 8vw, 110px);
    object-fit: contain;
}
.footer-slogan {
    font-family: var(--condensed);
    font-size: clamp(16px, 1.6vw, 21px);
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--gold);
    margin-top: 8px;
}
.footer-divider {
    width: 60px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 14px auto;
}
.footer-contact-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 0;
    width: 100%;
    white-space: nowrap;
}
.fc-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 7px;
    padding: 0 clamp(10px, 1.8vw, 24px);
    position: relative;
}
.fc-item + .fc-item::before {
    content: '·';
    position: absolute;
    left: 0;
    transform: translateX(-50%);
    color: rgba(196,138,36,0.5);
    font-size: 18px;
    line-height: 1;
}
.fc-item i {
    color: var(--gold);
    font-size: clamp(16px, 1.4vw, 18px);
    flex-shrink: 0;
}
.fc-item a, .fc-item span {
    font-family: var(--condensed);
    font-size: clamp(17px, 1.6vw, 21px);
    letter-spacing: 0.5px;
    color: var(--cream);
    line-height: 1;
    transition: color 0.3s;
    white-space: nowrap;
}
.fc-item a:hover { color: var(--gold); }
.footer-bottom {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(196,138,36,0.1);
    width: 100%;
    display: flex; align-items: center; justify-content: space-between;
}
.footer-bottom p {
    font-family: var(--condensed);
    font-size: clamp(10px, 0.9vw, 12px); letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(160,147,131,0.6);
}
.footer-social { display: flex; gap: 12px; }
.footer-social a {
    width: 32px; height: 32px;
    border: 1px solid rgba(196,138,36,0.2);
    display: flex; align-items: center; justify-content: center;
    color: rgba(160,147,131,0.6); font-size: 11px;
    transition: border-color 0.3s, color 0.3s;
}
.footer-social a:hover { border-color: var(--gold); color: var(--gold); }

/* ── Scroll-to-top ── */
#scroll-top {
    position: fixed; bottom: 32px; right: 32px;
    width: 46px; height: 46px;
    background: var(--gold); color: var(--dark);
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    opacity: 0; transform: translateY(14px);
    transition: opacity 0.35s, transform 0.35s, background 0.3s;
    z-index: 700;
}
#scroll-top.show { opacity: 1; transform: translateY(0); }
#scroll-top:hover { background: var(--gold-light); }

/* ── Responsive header/footer ── */
@media (max-width: 1200px) {
    .h-tagline { display: none !important; }
    .h-divider { display: none !important; }
}
@media (max-width: 768px) {
    .header-wrap { padding: 0 20px; }
    .h-nav { display: none; }
    .h-cta-wrap { display: none; }
    .h-mobile-toggle { display: block; }
    .h-logo img { width: 90px; }
    .footer-inner { padding: 20px 16px 14px; }
    .footer-contact-row { flex-wrap: wrap; justify-content: center; gap: 8px 0; }
    .fc-item { padding: 4px clamp(8px, 2vw, 16px); }
    .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
}

/* ── Badge « fiche technique » sur les cartes produits ──────────
   Les pages catégories définissent .prod-card__img-wrap sans
   position ; on l'ancre ici pour positionner le badge.          */
.prod-card__img-wrap { position: relative; }
.prod-card__badge {
    position: absolute; left: 10px; bottom: 10px;
    z-index: 2;
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--condensed);
    font-size: 10.5px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--gold);
    background: rgba(15, 32, 8, 0.82);
    backdrop-filter: blur(4px);
    padding: 5px 10px;
    border-radius: 2px;
    pointer-events: none;
    opacity: 0; transform: translateY(6px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.prod-card:hover .prod-card__badge { opacity: 1; transform: translateY(0); }
@media (hover: none) {
    .prod-card__badge { opacity: 1; transform: none; }
}
