/* =============================================================
   NEOVIA — Barre d'ajout au panier collante (fiches produit)
   Remonte du bas quand le bouton principal sort du champ.

   Réécrite sur les tokens du thème (2026-08-28). La version
   précédente codait toutes ses couleurs en dur, dont un magenta
   #C2185B pour le prix et des survols rose Material (#FCE4EC,
   #F8BBD9) qui n'existent nulle part dans la charte — et son
   bouton n'avait NI fond NI couleur NI rayon, donc le navigateur
   le rendait en bouton natif gris, bordure « outset », Arial.
   ============================================================= */

.sticky-atc {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    background: var(--white);
    border-top: 1px solid var(--border-soft);
    box-shadow: 0 -4px 24px rgba(61, 46, 40, 0.10);
    transform: translateY(105%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Laisse passer le menu mobile quand il est ouvert */
body.menu-is-open .sticky-atc { z-index: 88; }

.sticky-atc.is-visible { transform: translateY(0); }

.sticky-atc__inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem var(--gap);
    /* Encoche iOS : sans ça la barre passe sous l'indicateur d'accueil */
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    max-width: var(--container);
    margin: 0 auto;
}

/* ── Produit ───────────────────────────────────────────── */
.sticky-atc__info {
    flex: 1 1 auto;
    min-width: 0;   /* sinon le nom long empêche la barre de se réduire */
}

.sticky-atc__name {
    margin: 0 0 0.1rem;
    font-family: var(--font-head);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--charcoal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sticky-atc__meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.3;
    color: var(--text-soft);
}

/* Le prix reprend la couleur du prix de la fiche — il était en magenta. */
.sticky-atc__price {
    margin: 0;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--charcoal);
    font-variant-numeric: tabular-nums;
}

.sticky-atc__price del {
    margin-right: 0.35rem;
    font-weight: 400;
    color: var(--text-soft);
}

.sticky-atc__price ins { text-decoration: none; }

.sticky-atc__sep { opacity: 0.35; }
.sticky-atc__selection { color: var(--text-soft); }

/* ── Contrôles ─────────────────────────────────────────── */
.sticky-atc__controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.sticky-atc__qty {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--white);
}

.sticky-atc__qty-btn {
    width: 40px;
    height: 44px;   /* cible tactile */
    display: grid;
    place-items: center;
    background: transparent;
    border: none;
    font-size: 1.1rem;
    color: var(--charcoal);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.sticky-atc__qty-btn:hover { background: var(--bg-wash); }
.sticky-atc__qty-btn:active { background: var(--blush); }
.sticky-atc__qty-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sticky-atc__qty-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.sticky-atc__qty-val {
    min-width: 34px;
    padding: 0 0.25rem;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--charcoal);
    user-select: none;
    font-variant-numeric: tabular-nums;
}

/* ── Bouton ────────────────────────────────────────────────
   Même traitement que .pd-atc-btn de la fiche : le bouton collant
   est le même geste, il ne doit pas avoir l'air d'un autre bouton. */
.sticky-atc__cta {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0.85rem 1.6rem;
    background: linear-gradient(135deg, var(--espresso) 0%, #4f3a32 100%);
    color: var(--white);
    font-family: var(--font-head);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(61, 46, 40, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.07);
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.sticky-atc__cta:hover {
    background: linear-gradient(135deg, var(--espresso-hover) 0%, var(--espresso) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(61, 46, 40, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.sticky-atc__cta:active { transform: translateY(0); }

.sticky-atc__cta:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring), 0 4px 16px rgba(61, 46, 40, 0.28);
}

.sticky-atc__cta.is-adding {
    opacity: 0.7;
    pointer-events: none;
}

/* ── Petits écrans ─────────────────────────────────────── */
@media (max-width: 767px) {
    .sticky-atc__inner {
        gap: 0.75rem;
        padding: 0.7rem 1rem;
        padding-bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px));
    }
    .sticky-atc__cta { padding: 0.8rem 1.25rem; }
}

@media (max-width: 400px) {
    .sticky-atc__inner {
        gap: 0.6rem;
        padding: 0.65rem 0.875rem;
        padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
    }
    .sticky-atc__name { font-size: 0.72rem; }
    .sticky-atc__price { font-size: 0.88rem; }
    .sticky-atc__qty-btn { width: 34px; height: 40px; }
    .sticky-atc__qty-val { min-width: 28px; font-size: 0.85rem; }
    .sticky-atc__cta {
        padding: 0.75rem 1rem;
        font-size: 0.75rem;
        letter-spacing: 0.05em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sticky-atc,
    .sticky-atc__cta,
    .sticky-atc__qty-btn { transition: none; }
    .sticky-atc__cta:hover { transform: none; }
}
