/**
 * GIWT Header & Footer — Styles
 * Reproduit fidèlement la maquette validée "Ma Formation Bien-Être"
 *
 * Palette : Vert sauge + Or doux + Terracotta CTA
 * Typo : Lora (display) + Open Sans (body)
 */

/* ═════════════════════════════════════════════════════════════════
 *  VARIABLES (palette + typo + UI)
 * ═════════════════════════════════════════════════════════════════ */
:root {
    --ghf-primary: #5c7c5c;
    --ghf-primary-dark: #4a6349;
    --ghf-primary-deep: #2E4032;
    --ghf-primary-light: #e8f0e8;
    --ghf-accent: #c9a962;
    --ghf-accent-dark: #A88E48;
    --ghf-accent-light: #f5f0e1;
    --ghf-cta: #B8543A;
    --ghf-cta-dark: #8B3D26;
    --ghf-cta-light: #D67854;
    --ghf-dark: #1a1a1a;
    --ghf-text: #333333;
    --ghf-text-light: #666666;
    --ghf-bg: #fdfcfa;
    --ghf-white: #ffffff;
    --ghf-border: #e5e5e5;

    --ghf-font-display: 'Lora', Georgia, serif;
    --ghf-font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    --ghf-radius-sm: 8px;
    --ghf-radius-md: 12px;
    --ghf-shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --ghf-shadow-md: 0 4px 20px rgba(0,0,0,0.08);
}

/* ═════════════════════════════════════════════════════════════════
 *  HEADER
 * ═════════════════════════════════════════════════════════════════ */
.giwt-hf-header {
    background: var(--ghf-white);
    border-bottom: 1px solid var(--ghf-border);
    position: sticky;
    top: 0;
    z-index: 100;
    font-family: var(--ghf-font-body);
    box-shadow: var(--ghf-shadow-sm);
}
.giwt-hf-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 14px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* — Logo */
.giwt-hf-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}
.giwt-hf-logo-mark {
    width: 48px;
    height: 48px;
    background: var(--ghf-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ghf-font-display);
    font-size: 26px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(92, 124, 92, 0.3);
}
.giwt-hf-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}
.giwt-hf-logo-name {
    font-family: var(--ghf-font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--ghf-primary-deep);
    letter-spacing: -0.005em;
}
.giwt-hf-logo-signature {
    font-size: 10px;
    color: var(--ghf-text-light);
    letter-spacing: 0.08em;
    margin-top: 4px;
    font-weight: 500;
}
.giwt-hf-logo-signature strong {
    color: var(--ghf-cta);
    font-weight: 700;
}

/* — Navigation principale */
.giwt-hf-nav-main {
    display: flex;
    gap: 24px;
    align-items: center;
}
.giwt-hf-nav-link {
    color: var(--ghf-text);
    font-size: 14px;
    font-weight: 500;
    padding: 6px 0;
    text-decoration: none;
    transition: color 0.2s;
}
.giwt-hf-nav-link:hover {
    color: var(--ghf-cta);
}
.giwt-hf-nav-cta {
    background: var(--ghf-primary) !important;
    color: white !important;
    padding: 10px 18px !important;
    border-radius: var(--ghf-radius-sm);
    font-size: 13px;
    font-weight: 700 !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(92, 124, 92, 0.25);
    transition: all 0.2s;
}
.giwt-hf-nav-cta:hover {
    background: var(--ghf-primary-dark) !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(92, 124, 92, 0.35);
}
.giwt-hf-nav-blog {
    background: var(--ghf-cta);
    color: white !important;
    padding: 8px 16px;
    border-radius: var(--ghf-radius-sm);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.giwt-hf-nav-blog:hover {
    background: var(--ghf-cta-dark);
}

/* v1.0.7 — CTA terracotta "Ateliers en présentiel" (spécificité renforcée) */
.giwt-hf-header .giwt-hf-nav-main .giwt-hf-nav-link.giwt-hf-nav-workshops,
.giwt-hf-nav-workshops {
    background: #B8543A !important;
    background: var(--ghf-cta) !important;
    color: #ffffff !important;
    padding: 10px 20px !important;
    border-radius: var(--ghf-radius-sm) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0.03em !important;
    box-shadow: 0 2px 10px rgba(184, 84, 58, 0.35) !important;
    transition: all 0.2s !important;
    position: relative !important;
    overflow: hidden !important;
    text-decoration: none !important;
}
.giwt-hf-nav-workshops::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
    pointer-events: none;
}
.giwt-hf-header .giwt-hf-nav-main .giwt-hf-nav-link.giwt-hf-nav-workshops:hover,
.giwt-hf-nav-workshops:hover {
    background: #8B3D26 !important;
    background: var(--ghf-cta-dark) !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 16px rgba(184, 84, 58, 0.45) !important;
}
.giwt-hf-nav-workshops:hover::before {
    transform: translateX(100%);
}

/* Mobile menu : variante discrète pour Ateliers (juste un accent terracotta) */
.giwt-hf-mobile-link-workshops {
    color: var(--ghf-cta) !important;
    font-weight: 600 !important;
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
}
.giwt-hf-mobile-link-workshops::after {
    content: '→';
    color: var(--ghf-cta);
    font-weight: 700;
    font-size: 18px;
    transition: transform 0.2s;
    margin-left: 8px;
}
.giwt-hf-mobile-link-workshops:hover {
    color: var(--ghf-cta-dark) !important;
}
.giwt-hf-mobile-link-workshops:hover::after {
    transform: translateX(4px);
}

/* — Actions (recherche, panier, burger) */
.giwt-hf-nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.giwt-hf-icon-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ghf-text);
    transition: all 0.2s;
    position: relative;
    text-decoration: none;
}
.giwt-hf-icon-btn:hover {
    background: var(--ghf-accent-light);
    color: var(--ghf-primary-deep);
}
.giwt-hf-cart-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--ghf-cta);
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.giwt-hf-cart-count-zero {
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

/* — Burger mobile (caché par défaut) */
/* v1.0.8 — !important pour blinder contre les CSS qui pourraient écraser */
.giwt-hf-burger {
    display: none !important;
}

/* — Mobile menu */
.giwt-hf-mobile-menu {
    display: none;
    flex-direction: column;
    background: white;
    border-top: 1px solid var(--ghf-border);
    padding: 16px 32px;
    box-shadow: var(--ghf-shadow-md);
}
.giwt-hf-mobile-menu.is-open {
    display: flex;
}
.giwt-hf-mobile-link {
    color: var(--ghf-text);
    font-size: 16px;
    font-weight: 500;
    padding: 12px 0;
    text-decoration: none;
    border-bottom: 1px solid var(--ghf-border);
    transition: color 0.2s;
}
.giwt-hf-mobile-link:last-child {
    border-bottom: none;
}
.giwt-hf-mobile-link:hover {
    color: var(--ghf-cta);
}

/* ═════════════════════════════════════════════════════════════════
 *  FOOTER
 * ═════════════════════════════════════════════════════════════════ */
.giwt-hf-footer {
    background: var(--ghf-primary-deep);
    color: rgba(255, 255, 255, 0.7);
    padding: 56px 0 24px;
    font-family: var(--ghf-font-body);
    font-size: 13px;
    line-height: 1.6;
}
.giwt-hf-footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
}
.giwt-hf-footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}
.giwt-hf-footer-col {
    min-width: 0;
}

/* — Brand column */
.giwt-hf-footer-brand {
    margin-bottom: 16px;
}
.giwt-hf-footer-logo-name {
    font-family: var(--ghf-font-display);
    color: white;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.1;
}
.giwt-hf-footer-logo-signature {
    color: var(--ghf-cta-light);
    font-size: 11px;
    letter-spacing: 0.08em;
    margin-top: 4px;
    font-weight: 500;
}
.giwt-hf-footer-logo-signature strong {
    color: var(--ghf-cta-light);
    font-weight: 700;
}
.giwt-hf-footer-tagline {
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    margin: 0 0 20px;
    font-size: 13px;
}
.giwt-hf-footer-payment {
    font-size: 11px;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
}

/* — Titres de colonnes */
.giwt-hf-footer h4 {
    font-family: var(--ghf-font-display);
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 14px;
    line-height: 1.2;
}

/* — Listes */
.giwt-hf-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.giwt-hf-footer li {
    margin-bottom: 8px;
    line-height: 1.5;
}
.giwt-hf-footer a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.2s;
}
.giwt-hf-footer a:hover {
    color: var(--ghf-cta-light);
}

/* — Footer bottom */
.giwt-hf-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    flex-wrap: wrap;
    gap: 12px;
}
.giwt-hf-footer-social {
    display: flex;
    align-items: center;
    gap: 10px;
}
.giwt-hf-footer-social a {
    font-size: 18px;
    text-decoration: none;
    transition: transform 0.2s;
    display: inline-block;
}
.giwt-hf-footer-social a:hover {
    transform: translateY(-2px);
}

/* ═════════════════════════════════════════════════════════════════
 *  RESPONSIVE
 * ═════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    /* Sur tablette : on cache les liens non-CTA, mais on garde Catalogue + Ateliers visibles */
    .giwt-hf-nav-main .giwt-hf-nav-link:not(.giwt-hf-nav-cta):not(.giwt-hf-nav-blog):not(.giwt-hf-nav-workshops) {
        display: none;
    }
    .giwt-hf-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
    .giwt-hf-footer-brand-col {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .giwt-hf-header-inner {
        padding: 12px 20px;
        gap: 12px;
    }
    .giwt-hf-logo-name {
        font-size: 18px;
    }
    .giwt-hf-logo-mark {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
    /* v1.0.8 — Burger UNIQUEMENT sur vrai mobile, avec !important pour blinder */
    .giwt-hf-burger {
        display: flex !important;
    }
    .giwt-hf-nav-main {
        display: none;
    }
    .giwt-hf-footer {
        padding: 40px 0 20px;
    }
    .giwt-hf-footer-inner {
        padding: 0 20px;
    }
}

@media (max-width: 600px) {
    .giwt-hf-logo-text {
        display: none; /* Sur très petit écran on garde juste le M */
    }
    .giwt-hf-footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .giwt-hf-footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ═════════════════════════════════════════════════════════════════
 *  RESET CONTEXTE — éviter conflits avec thème/Elementor
 * ═════════════════════════════════════════════════════════════════ */
.giwt-hf-header *,
.giwt-hf-footer * {
    box-sizing: border-box;
}
.giwt-hf-header button {
    font-family: var(--ghf-font-body);
}

/* Compensation pour body / padding-top éventuel */
body.admin-bar .giwt-hf-header {
    top: 32px;
}
@media (max-width: 782px) {
    body.admin-bar .giwt-hf-header {
        top: 46px;
    }
}

/* ═════════════════════════════════════════════════════════════════
 *  SEARCH OVERLAY (v1.0.3)
 * ═════════════════════════════════════════════════════════════════ */
.giwt-hf-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
}

.giwt-hf-search-overlay.is-open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

.giwt-hf-search-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(46, 64, 50, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.giwt-hf-search-overlay-inner {
    position: relative;
    max-width: 720px;
    margin: 80px auto 0;
    padding: 0 20px;
    transform: translateY(-20px);
    transition: transform 0.3s ease 0.05s;
}

.giwt-hf-search-overlay.is-open .giwt-hf-search-overlay-inner {
    transform: translateY(0);
}

.giwt-hf-search-form {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border-radius: 16px;
    padding: 8px 8px 8px 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.giwt-hf-search-label {
    display: flex;
    align-items: center;
    color: #5c7c5c;
    flex-shrink: 0;
}

.giwt-hf-search-label svg {
    display: block;
}

.giwt-hf-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 17px;
    color: #2E4032;
    padding: 14px 0;
    -webkit-appearance: none;
    appearance: none;
}

.giwt-hf-search-input::placeholder {
    color: #999;
    font-weight: 400;
}

.giwt-hf-search-submit {
    background: #B8543A;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.giwt-hf-search-submit:hover {
    background: #8B3D26;
}

.giwt-hf-search-close {
    background: #f0f0f0;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.giwt-hf-search-close:hover {
    background: #e0e0e0;
    color: #2E4032;
}

.giwt-hf-search-suggestions {
    margin-top: 24px;
    text-align: center;
    color: white;
    font-size: 14px;
}

.giwt-hf-search-suggestions-label {
    display: inline-block;
    margin-right: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    letter-spacing: 0.04em;
}

.giwt-hf-search-suggestion {
    display: inline-block;
    margin: 4px 6px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    color: white;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s, transform 0.15s;
}

.giwt-hf-search-suggestion:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

/* Screen reader only */
.giwt-hf-search-label .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

/* Responsive mobile */
@media (max-width: 768px) {
    .giwt-hf-search-overlay-inner {
        margin-top: 60px;
        padding: 0 16px;
    }

    .giwt-hf-search-form {
        flex-wrap: wrap;
        padding: 12px;
    }

    .giwt-hf-search-input {
        font-size: 16px; /* >= 16px évite zoom iOS */
        padding: 10px 0;
        width: 100%;
    }

    .giwt-hf-search-submit {
        flex: 1;
        padding: 12px;
    }

    .giwt-hf-search-suggestions {
        font-size: 12px;
    }

    .giwt-hf-search-suggestion {
        font-size: 12px;
        padding: 5px 10px;
    }
}

/* ═════════════════════════════════════════════════════════════════
 *  SEARCH LIVE RESULTS (v1.0.4)
 * ═════════════════════════════════════════════════════════════════ */
.giwt-hf-search-results {
    margin-top: 16px;
    max-height: 60vh;
    overflow-y: auto;
}

.giwt-hf-search-results:empty {
    display: none;
}

.giwt-hf-search-loading {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    padding: 32px 20px;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.giwt-hf-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #c9a962;
    border-radius: 50%;
    animation: giwt-hf-spin 0.8s linear infinite;
}

@keyframes giwt-hf-spin {
    to { transform: rotate(360deg); }
}

.giwt-hf-search-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    padding: 28px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.giwt-hf-search-empty strong {
    color: white;
}

.giwt-hf-search-empty a {
    display: inline-block;
    margin-top: 12px;
    color: #c9a962;
    text-decoration: none;
    font-weight: 600;
}

.giwt-hf-search-empty a:hover {
    color: white;
}

.giwt-hf-search-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.giwt-hf-search-results-list li {
    border-bottom: 1px solid #f0f0f0;
}

.giwt-hf-search-results-list li:last-child {
    border-bottom: none;
}

.giwt-hf-search-result-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    text-decoration: none !important;
    color: #2E4032;
    transition: background 0.15s;
}

.giwt-hf-search-result-link:hover {
    background: #faf8f3;
    text-decoration: none;
}

.giwt-hf-search-result-image {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: #e8f0e8;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
}

.giwt-hf-search-result-body {
    flex: 1;
    min-width: 0;
}

.giwt-hf-search-result-title {
    display: block;
    font-family: 'Lora', Georgia, serif;
    font-size: 15px;
    font-weight: 600;
    color: #2E4032;
    line-height: 1.3;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.giwt-hf-search-result-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #666;
}

.giwt-hf-search-result-cat {
    color: #5c7c5c;
    font-weight: 600;
}

.giwt-hf-search-result-price {
    color: #B8543A;
    font-weight: 700;
    font-size: 14px;
    margin-left: auto;
}

.giwt-hf-search-see-all {
    display: block;
    margin-top: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    text-align: center;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s, transform 0.15s;
}

.giwt-hf-search-see-all:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Bouton suggestion (auparavant lien) — comportement bouton */
button.giwt-hf-search-suggestion {
    font-family: 'Open Sans', sans-serif;
    cursor: pointer;
}

/* Responsive : sur mobile, image plus petite */
@media (max-width: 600px) {
    .giwt-hf-search-result-image {
        width: 44px;
        height: 44px;
    }

    .giwt-hf-search-result-title {
        font-size: 14px;
    }

    .giwt-hf-search-result-price {
        font-size: 13px;
    }
}
