/* ==========================================================================
   Components — Le Comptoir JunaSol
   Boutons, cards, formulaires, nav, footer, bandeaux
   ========================================================================== */

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-6);
    border-radius: var(--r-full);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition:
        background-color var(--dur-fast) var(--ease),
        color var(--dur-fast) var(--ease),
        border-color var(--dur-fast) var(--ease),
        transform var(--dur-fast) var(--ease),
        box-shadow var(--dur-fast) var(--ease);
    white-space: nowrap;
    line-height: 1;
    min-height: 44px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--terre);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    background: var(--terre-dark);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.btn-olive {
    background: var(--olive);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.btn-olive:hover {
    background: var(--olive-dark);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-outline:hover {
    border-color: var(--olive);
    color: var(--olive);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    padding-left: var(--s-3);
    padding-right: var(--s-3);
}
.btn-ghost:hover {
    color: var(--olive);
    background: var(--surface-alt);
}

.btn-lg { padding: var(--s-4) var(--s-8); font-size: 1rem; }
.btn-sm { padding: var(--s-2) var(--s-4); font-size: 0.85rem; min-height: 36px; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border-radius: var(--r-lg);
    padding: var(--s-6);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: relative;
}
.card-lg { padding: var(--s-8); }

.card-hover {
    transition:
        transform var(--dur-fast) var(--ease),
        box-shadow var(--dur-fast) var(--ease),
        border-color var(--dur-fast) var(--ease);
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--olive-light);
}

/* ---------- Formulaires ---------- */
.form-group {
    margin-bottom: var(--s-5);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-4);
}
@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; }
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: var(--s-2);
    color: var(--text);
}
label .required { color: var(--terre); }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="password"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.4;
    transition:
        border-color var(--dur-fast) var(--ease),
        box-shadow var(--dur-fast) var(--ease),
        background-color var(--dur) var(--ease);
    min-height: 44px;
}
textarea {
    min-height: 120px;
    resize: vertical;
}
input:focus,
textarea:focus,
select:focus {
    border-color: var(--olive);
    box-shadow: 0 0 0 3px rgba(107, 142, 61, 0.15);
    outline: none;
}
input::placeholder,
textarea::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: var(--s-3);
}
.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--olive);
    margin-top: 3px;
    flex-shrink: 0;
}
.checkbox-row label {
    margin-bottom: 0;
    font-weight: 400;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.form-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.form-feedback {
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    margin-bottom: var(--s-4);
    font-size: 0.95rem;
}
.form-feedback.success {
    background: rgba(74, 122, 43, 0.12);
    color: var(--success);
    border: 1px solid rgba(74, 122, 43, 0.3);
}
.form-feedback.error {
    background: rgba(184, 74, 46, 0.12);
    color: var(--error);
    border: 1px solid rgba(184, 74, 46, 0.3);
}

/* ---------- Badges / chips / tags ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--s-1);
    padding: 4px var(--s-3);
    border-radius: var(--r-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: var(--surface-alt);
    color: var(--text);
}
.badge-olive  { background: var(--olive);  color: #fff; }
.badge-sable  { background: var(--sable);  color: var(--text); }
.badge-terre  { background: var(--terre);  color: #fff; }
.badge-vrac   { background: var(--sable-light); color: var(--olive-dark); }
.badge-bio    { background: rgba(107,142,61,0.15); color: var(--olive-dark); }
.badge-local  { background: rgba(217,119,66,0.15); color: var(--terre-dark); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-2) var(--s-4);
    border-radius: var(--r-full);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text);
    font-size: 0.88rem;
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease);
}
.chip:hover,
.chip.is-active {
    background: var(--olive);
    color: #fff;
    border-color: var(--olive);
}

/* ---------- Navigation / Header ---------- */
.announce-bar {
    background: var(--olive);
    color: #fff;
    height: var(--bar-h);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}
.announce-bar .open-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 999px;
    background: var(--sable-light);
    margin-right: var(--s-2);
    animation: pulse 2s infinite var(--ease);
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 500;
    background: color-mix(in srgb, var(--bg) 80%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: all var(--dur) var(--ease);
}
.site-header.is-scrolled {
    background: color-mix(in srgb, var(--bg) 95%, transparent);
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-h);
    gap: var(--s-6);
}
.nav-brand {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.4rem;
    letter-spacing: -0.01em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: var(--s-2);
}
.nav-brand .brand-mark {
    width: 36px; height: 36px;
    border-radius: 999px;
    background: var(--olive);
    color: #fff;
    display: grid; place-items: center;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: var(--s-8);
}
.nav-list a {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    padding: var(--s-2) 0;
}
.nav-list a::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--olive);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--dur-fast) var(--ease);
}
.nav-list a:hover::after,
.nav-list a.is-active::after {
    transform: scaleX(1);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--s-3);
}

.theme-toggle,
.nav-burger {
    width: 40px; height: 40px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease);
}
.theme-toggle:hover,
.nav-burger:hover {
    border-color: var(--olive);
    color: var(--olive);
}
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav-burger { display: none; }

.cart-badge {
    position: relative;
    padding-right: var(--s-2);
}
.cart-badge .count {
    position: absolute;
    top: -6px; right: -6px;
    background: var(--terre);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    padding: 0 5px;
    display: grid; place-items: center;
    line-height: 1;
}
.cart-badge .count:empty { display: none; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--surface-alt);
    padding: var(--s-16) 0 var(--s-6);
    margin-top: var(--s-24);
    border-top: 1px solid var(--border);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
    gap: var(--s-10);
    margin-bottom: var(--s-12);
}
@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-8); }
}
@media (max-width: 560px) {
    .footer-grid { grid-template-columns: 1fr; }
}
.footer-col h4 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    margin-bottom: var(--s-4);
    color: var(--text);
}
.footer-col a {
    display: block;
    color: var(--muted);
    padding: var(--s-1) 0;
    font-size: 0.92rem;
}
.footer-col a:hover { color: var(--olive); }

.footer-slogan {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--muted);
    margin-bottom: var(--s-4);
    max-width: 32ch;
}
.footer-socials {
    display: flex;
    gap: var(--s-3);
    margin-top: var(--s-4);
}
.footer-socials a {
    width: 40px; height: 40px;
    padding: 0;
    border-radius: 999px;
    background: var(--surface);
    display: grid; place-items: center;
    border: 1px solid var(--border);
    color: var(--text);
    transition: all var(--dur-fast) var(--ease);
}
.footer-socials a:hover {
    background: var(--olive);
    color: #fff;
    border-color: var(--olive);
}
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--s-6);
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.85rem;
    gap: var(--s-4);
    flex-wrap: wrap;
}
.footer-bottom a { color: var(--muted); }
.footer-bottom a:hover { color: var(--olive); }

/* ---------- Newsletter inline (footer & section) ---------- */
.newsletter-form {
    display: flex;
    gap: var(--s-2);
    margin-top: var(--s-3);
}
.newsletter-form input[type="email"] {
    flex: 1;
    min-height: 44px;
}

/* ---------- Éléments flottants ---------- */
.floating-whatsapp,
.back-to-top {
    position: fixed;
    bottom: var(--s-6);
    z-index: 400;
    width: 52px; height: 52px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--dur-fast) var(--ease);
    border: none;
}
.floating-whatsapp {
    right: var(--s-6);
    background: #25D366;
    color: #fff;
}
.floating-whatsapp:hover { transform: scale(1.08); }

.back-to-top {
    right: calc(var(--s-6) + 64px);
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
}
.back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.back-to-top:hover {
    background: var(--olive);
    color: #fff;
    border-color: var(--olive);
}

/* ---------- Bandeau cookies ---------- */
.cookie-banner {
    position: fixed;
    bottom: var(--s-4);
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    max-width: 640px;
    width: calc(100% - var(--s-8));
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    padding: var(--s-4) var(--s-6);
    box-shadow: var(--shadow-lg);
    z-index: 450;
    display: flex;
    gap: var(--s-4);
    align-items: center;
    justify-content: space-between;
    opacity: 0;
    pointer-events: none;
    transition: all var(--dur) var(--ease);
    flex-wrap: wrap;
}
.cookie-banner.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.cookie-banner p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--muted);
    flex: 1;
    min-width: 220px;
}
.cookie-banner .actions {
    display: flex;
    gap: var(--s-2);
}
