/*
 * Domaine des Arbres Blancs — compléments à maquette.css (feuille compilée de la maquette Lovable).
 * Ici : polices auto-hébergées, menu mobile plein écran, panneau du panier, choix du retrait,
 * formulaires et pages WooCommerce, contenus libres.
 */

/* ------------------------------------------------------------------ Polices */
@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url("../fonts/montserrat-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Cormorant Garamond";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/cormorant-garamond-600-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Un élément masqué par [hidden] le reste, même si un composant pose display:flex. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body.adb-bloque { overflow: hidden; }

/* Barre d'administration WordPress : les panneaux fixes passent dessous. */
body.admin-bar .adb-sheet,
body.admin-bar .adb-mobile-panel { top: var(--wp-admin--admin-bar--height, 32px); }

/* ---------------------------------------------------- En-tête : < 1024 px */
@media (width < 1024px) {
    .desktop-nav { display: none; }
    .mobile-menu-toggle { display: inline-flex; }
    .brand-place { display: none; }
}

/* Menu mobile : panneau plein écran (règle de l'agence, la maquette posait un volet latéral). */
.adb-mobile-panel {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding: 16px 20px 32px;
    background: var(--background);
    animation: adb-fondu .2s ease-out;
}
.adb-mobile-panel__haut { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.adb-mobile-panel__haut .brand img { width: 38px; height: 46px; object-fit: contain; }
.adb-mobile-panel__haut .brand-name { font-size: 18px; }
.adb-mobile-panel__texte { color: var(--muted-foreground); margin-top: 8px; }
.adb-mobile-panel .mobile-nav { font-size: 20px; gap: 6px; margin-top: 18px; }
.adb-mobile-panel .mobile-nav a { border-bottom: 1px solid var(--border); padding-block: 10px; }
.adb-mobile-panel .mobile-nav a[data-status=active] { font-weight: 600; }
.adb-mobile-panel__cta { margin-top: 24px; }
.adb-mobile-panel__cta a { width: 100%; }

/* ------------------------------------------------------------- Panier (Sheet) */
.adb-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: color-mix(in oklab, var(--foreground) 50%, transparent);
    animation: adb-fondu .3s ease-out;
}
.adb-sheet {
    width: 100%;
    max-width: 470px;
    animation: adb-glisse .4s cubic-bezier(.16, 1, .3, 1);
    overflow: hidden;
}
.adb-cart-body { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.adb-cart-empty { display: flex; flex-direction: column; align-items: flex-start; }
.cart-line h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.cart-total > a { width: 100%; }
.adb-cart-page .cart-lines { margin-top: 0; overflow: visible; }
.adb-cart-page { max-width: 720px; }
.adb-cart-page .cart-total > a { width: auto; }
[data-adb-panier-contenu].adb-occupe { opacity: .6; pointer-events: none; transition: opacity .15s; }
@keyframes adb-glisse { from { transform: translateX(100%); } to { transform: none; } }
@keyframes adb-fondu { from { opacity: 0; } to { opacity: 1; } }

/* Annonce « ajouté au panier » (classe .live-announcement de la maquette). */
.live-announcement { animation: adb-fondu .2s ease-out; }

/* Quantité saisissable (fiche produit) dans le contrôle de la maquette. */
.quantity-control .adb-qte {
    width: 32px;
    min-height: 44px;
    padding: 0;
    border: 0;
    text-align: center;
    font-variant-numeric: tabular-nums;
    background: transparent;
    -moz-appearance: textfield;
}
.quantity-control .adb-qte::-webkit-inner-spin-button,
.quantity-control .adb-qte::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* --------------------------------------------- Choix du retrait (boutons radio) */
.adb-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.adb-fieldset legend { padding: 0; width: 100%; }
.adb-choix { position: relative; }
.adb-choix:has(input:checked) {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}
.adb-choix:has(input:checked):hover { background: color-mix(in oklab, var(--primary) 90%, transparent); color: var(--primary-foreground); }
.adb-choix:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
.date-option span { font-weight: 400; }
.slot-option span, .point-option span { font-weight: 400; }
.date-options:empty::before { content: "Aucune date de retrait disponible prochainement pour ce lieu."; color: var(--muted-foreground); grid-column: 1 / -1; }

/* ---------------------------------------------------------- Formulaires WooCommerce */
.field label .required, .field abbr.required { color: var(--ladybird); text-decoration: none; border: 0; }
.field .optional { color: var(--muted-foreground); font-weight: 400; }
.field .woocommerce-input-wrapper { display: block; }
.field input[type=checkbox], .field input[type=radio] { width: auto; min-height: 0; }
.adb-fields-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
.adb-fields-grid .form-row-wide { grid-column: 1 / -1; }
.adb-fields-grid .field { margin-block: 10px; }
.adb-check label, .woocommerce-form__label-for-checkbox { display: flex; align-items: center; gap: 10px; }
.adb-wc input.input-text, .adb-wc select, .adb-wc textarea,
.woocommerce-form-login input.input-text, .woocommerce-form-coupon input.input-text {
    border: 1px solid var(--input);
    background: var(--card);
    border-radius: 6px;
    width: 100%;
    min-height: 48px;
    padding: 12px;
}
.adb-wc .form-row, .woocommerce-form-login .form-row { display: grid; gap: 7px; margin-block: 14px; }
.adb-wc button[type=submit]:not([class*=inline-flex]), .woocommerce-Button, .woocommerce-button,
.woocommerce-form-login__submit, .woocommerce-form-coupon button, .adb-wc .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding-inline: 24px;
    border-radius: 6px;
    background: var(--primary);
    color: var(--primary-foreground);
    font-weight: 500;
    cursor: pointer;
    transition: background .15s;
}
.adb-wc .button:hover, .woocommerce-Button:hover, .woocommerce-button:hover, .woocommerce-form-login__submit:hover { background: color-mix(in oklab, var(--primary) 90%, transparent); }
.woocommerce-form-login .woocommerce-form-login__rememberme { display: flex; align-items: center; gap: 8px; margin-block: 12px; }
.lost_password a, .woocommerce-LostPassword a { text-decoration: underline; text-underline-offset: 4px; }

/* Notices */
.woocommerce-notices-wrapper:empty { display: none; }
.woocommerce-error, .woocommerce-message, .woocommerce-info, .wc-block-components-notice-banner {
    list-style: none;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    background: var(--card);
    border-radius: 6px;
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
}
.woocommerce-error { border-left-color: var(--ladybird); flex-direction: column; align-items: flex-start; }
.woocommerce-message .button, .woocommerce-info .button { order: 2; margin-left: auto; min-height: 40px; padding-inline: 16px; border-radius: 6px; background: var(--primary); color: var(--primary-foreground); }
.woocommerce-info a:not(.button), .woocommerce-message a:not(.button) { text-decoration: underline; text-underline-offset: 4px; font-weight: 600; }
.adb-notice-ok { color: var(--foreground); display: flex; gap: 10px; align-items: center; }
.adb-notice-erreur { color: var(--ladybird); }

/* Connexion / code promo proposés au-dessus de la commande */
.woocommerce-form-login, .checkout_coupon {
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 28px;
    max-width: 640px;
}
.checkout_coupon { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.checkout_coupon p { margin: 0; }
.checkout_coupon .form-row-first { flex: 1; }

/* ----------------------------------------------------------------- Commande */
.adb-checkout-main { min-width: 0; }
.drive-layout .adb-checkout-main h2 { margin-block: 0 18px; font-size: 26px; }
#payment { margin-top: 6px; }
#payment .wc_payment_methods { list-style: none; display: grid; gap: 10px; margin: 0 0 20px; padding: 0; }
#payment .wc_payment_method {
    border: 1px solid var(--input);
    background: var(--card);
    border-radius: 6px;
    padding: 14px 16px;
}
#payment .wc_payment_method:has(input:checked) { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
#payment .wc_payment_method > label { font-weight: 600; cursor: pointer; margin-left: 8px; }
#payment .wc_payment_method img { display: inline-block; max-height: 24px; vertical-align: middle; margin-left: 6px; }
#payment .payment_box { color: var(--muted-foreground); margin-top: 8px; font-size: 15px; }
#payment .payment_box p { margin: 0; }
#payment .place-order { display: grid; gap: 16px; }
#payment .woocommerce-terms-and-conditions-wrapper { color: var(--muted-foreground); font-size: 15px; }
#payment .woocommerce-terms-and-conditions-wrapper a { text-decoration: underline; text-underline-offset: 3px; color: var(--foreground); }
#payment .woocommerce-privacy-policy-text p { margin: 0; }
.adb-commander { justify-self: start; }
.adb-commander::after {
    content: "";
    width: 16px;
    height: 16px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m12 5 7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m12 5 7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.drive-layout .adb-checkout-main h2.mt-10 { margin-top: 40px; }
.woocommerce-account-fields { margin-top: 4px; }
#payment .woocommerce-terms-and-conditions-wrapper .form-row { margin-top: 10px; }
#payment .woocommerce-terms-and-conditions-wrapper .required { color: var(--ladybird); text-decoration: none; }
.blockUI.blockOverlay { background: color-mix(in oklab, var(--background) 60%, transparent) !important; }

.adb-review { border-top: 1px solid var(--border); }
.adb-review-lines { list-style: none; margin: 0; padding: 0; }
.adb-review-lines li { display: flex; justify-content: space-between; gap: 16px; padding-block: 12px; border-bottom: 1px solid var(--border); }
.adb-review-totals { margin: 12px 0 0; }
.adb-review-totals > div { display: flex; justify-content: space-between; gap: 16px; padding-block: 6px; color: var(--muted-foreground); }
.adb-review-totals dd { margin: 0; }
.adb-review-totals .cart-total-row { color: var(--foreground); margin-top: 8px; border-top: 1px solid var(--border); padding-top: 14px; }
.adb-review-totals .cart-total-row small { display: block; font-size: 13px; font-weight: 400; color: var(--muted-foreground); }

/* Commande reçue, détails de commande, compte */
.adb-retrait-recap { display: flex; gap: 10px; align-items: flex-start; color: var(--foreground); }
.woocommerce-order-overview { list-style: none; display: flex; flex-wrap: wrap; gap: 12px 32px; padding: 0; margin: 0 0 32px; }
.woocommerce-order-overview li { color: var(--muted-foreground); }
.woocommerce-order-overview strong { display: block; color: var(--foreground); }
.woocommerce-thankyou-order-received { font-size: 20px; margin-bottom: 20px; }
.adb-wc h2 { font-size: 26px; margin-block: 32px 16px; }
.adb-wc table { width: 100%; border-collapse: collapse; margin-bottom: 24px; background: var(--card); }
.adb-wc th, .adb-wc td { text-align: left; padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.adb-wc address { font-style: normal; line-height: 1.7; }

.woocommerce-account .adb-wc > .woocommerce { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; align-items: start; }
.woocommerce-MyAccount-navigation ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.woocommerce-MyAccount-navigation a { display: flex; align-items: center; min-height: 44px; padding-left: 16px; border-left: 2px solid transparent; margin-left: -1px; }
.woocommerce-MyAccount-navigation .is-active a { border-left-color: var(--primary); font-weight: 600; }
.woocommerce-MyAccount-navigation a:hover { text-decoration: underline; text-underline-offset: 4px; }
.woocommerce-account:not(.logged-in) .adb-wc > .woocommerce { display: block; max-width: 640px; }
.woocommerce-account .u-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.woocommerce-account:not(.logged-in) .adb-wc > .woocommerce:has(.u-columns) { max-width: none; }
.woocommerce-MyAccount-content p { margin-bottom: 14px; }
.woocommerce-MyAccount-content a:not(.button):not(.woocommerce-button) { text-decoration: underline; text-underline-offset: 4px; }
.woocommerce-password-strength { font-size: 14px; margin-top: 6px; }

/* ---------------------------------------------------------- Boutique */
.season-tabs a[aria-current] { pointer-events: none; }
.catalog-tools select { cursor: pointer; }
.catalog-tools input[type=checkbox] { accent-color: var(--primary); }
.adb-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 40px; }
.adb-pagination .page-numbers {
    display: inline-grid;
    place-items: center;
    min-width: 44px;
    min-height: 44px;
    padding-inline: 12px;
    border: 1px solid var(--input);
    border-radius: 6px;
    background: var(--background);
}
.adb-pagination .page-numbers.current { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.adb-pagination svg { width: 16px; height: 16px; }
.product-card .product-bottom a[role=button] { flex-shrink: 0; }
.product-image img { margin: 0 auto; }

/* ---------------------------------------------------------- Contenus libres */
.adb-prose:not([class*=space-y]) p { margin-bottom: 14px; }
.adb-prose ul { list-style: disc; padding-left: 22px; margin-bottom: 14px; }
.adb-prose ol { list-style: decimal; padding-left: 22px; margin-bottom: 14px; }
.adb-prose a { text-decoration: underline; text-underline-offset: 4px; }
.adb-prose h2 { font-size: 26px; margin-block: 28px 12px; }
.adb-prose h3 { font-size: 20px; margin-block: 22px 10px; }

/* Champ piège du formulaire de contact */
.adb-piege { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------------------------------------------------------- Responsive */
@media (width <= 1000px) {
    .woocommerce-account .adb-wc > .woocommerce { grid-template-columns: 1fr; gap: 28px; }
}
@media (width <= 760px) {
    .adb-fields-grid, .woocommerce-account .u-columns { grid-template-columns: 1fr; }
    .adb-sheet { max-width: 100%; }
    .adb-commander { justify-self: stretch; }
}

/* Sous 768 px, tout est centré (règle de l'agence) — hors formulaires, listes et panier. */
@media (width < 768px) {
    .page-intro, .section-heading, .hero-copy, .story-grid > div, .home-pickup-inner > div,
    .family-features > div, .reassurance-item, .order-process-list li, .footer-intro, .footer-grid,
    .product-detail > div:last-child, .drive-summary, .empty-state, .site-wrap.section > h2,
    .site-wrap.section > p, .reassurance .site-wrap.section, article.border-b, .footer-bottom,
    .adb-checkout-main > h2, .adb-fieldset legend h2, .rayon-copy { text-align: center; }
    .breadcrumb, .section-heading, .order-process-list li, .reassurance-item, .footer-intro, .footer-grid h2,
    .footer-grid a, .footer-hours > p:first-child, .pickup-flow, .add-row, .footer-bottom,
    .adb-checkout-main h2, .site-wrap.section h2.flex, .eyebrow.flex, .product-detail .flex { justify-content: center; }
    .section-heading { flex-direction: column; align-items: center; }
    .reassurance-item, .order-process-list li { flex-direction: column; display: flex; align-items: center; }
    .family-features > div > svg, .reassurance-item svg { margin-inline: auto; }
    .footer-intro, .footer-bottom { align-items: center; }
    .text-link { justify-content: center; }
    .story-grid .text-link, .family-features .text-link, .reassurance .text-link, article .text-link { display: flex; }
    .page-intro p, .max-w-2xl, .max-w-3xl { margin-inline: auto; }
    .hero-copy > a, .home-pickup-inner a[class*=inline-flex], .site-wrap.section > a[class*=inline-flex] { width: 100%; }
    .catalog-tools { justify-content: center; }
    .season-tabs { justify-content: center; }
    .product-info { text-align: center; }
    .product-bottom { justify-content: center; flex-direction: column; }
    .footer-grid address, .footer-hours { text-align: center; }
    .footer-hours dl > div { text-align: center; }
    .footer-grid ul { display: grid; justify-items: center; }
    .point-option, .date-option, .slot-option { text-align: center; align-items: center; }
}

/* ---------------------------------------------------------- Recherche en direct */
.adb-search-results {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline: 0;
    z-index: 40;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 12px 32px oklch(38% .054 151.2 / .12);
    padding: 6px;
    max-height: min(70vh, 460px);
    overflow-y: auto;
}
.adb-search-results a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 6px;
}
.adb-search-results a[aria-selected=true], .adb-search-results a:hover { background: var(--muted); }
.adb-search-results .adb-sr-titre { font-weight: 500; }
.adb-search-results .adb-sr-info { display: block; color: var(--muted-foreground); font-size: 14px; }
.adb-search-results .adb-sr-type {
    flex-shrink: 0;
    font-size: 13px;
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 8px;
}
.adb-search-results p { padding: 10px 12px; color: var(--muted-foreground); }
.adb-search-results .adb-sr-tout { justify-content: flex-start; font-weight: 600; border-top: 1px solid var(--border); border-radius: 0 0 6px 6px; margin-top: 4px; }

/* Texte réservé aux lecteurs d'écran (WordPress, WooCommerce : « Obligatoire », « Quantité »…). */
.screen-reader-text {
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    position: absolute !important;
    overflow: hidden;
    word-wrap: normal !important;
}
.screen-reader-text:focus { clip-path: none; width: auto; height: auto; padding: 12px; background: var(--card); z-index: 100; }
