/* ============================================================
   AUDACIEUSE — Boutique en ligne
   Styles complémentaires à Tailwind (chargé via CDN dans store.html).
   Ne contient que ce qui est peu pratique en classes utilitaires :
   tiroir panier, fenêtre variantes, toast, squelettes de chargement.
   ============================================================ */

:root {
    --plum-700: #5A104C;
    --plum-600: #73215F;
    --plum-300: #C98BB9;
    --plum-100: #F3E1EE;
}

/* L'attribut [hidden] doit TOUJOURS l'emporter sur les utilitaires Tailwind
   (.flex, .grid, .block…). Sans ça les 3 vues du panier s'empilent sur mobile. */
[hidden] { display: none !important; }

/* Police script Allura : fortes hampes -> on sécurise l'interligne */
.font-script { line-height: 1.15; padding-bottom: .06em; }

/* Masquer les barres de défilement horizontales (puces de catégories) */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Marge iOS pour la barre de navigation basse mobile */
.safe-bottom { padding-bottom: env(safe-area-inset-bottom); }

/* ---------- Tiroir panier & fenêtre variantes ---------- */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(36, 6, 31, .45);
    opacity: 0;
    transition: opacity .25s ease;
    z-index: 60;
}
.overlay.is-open { opacity: 1; }

.drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 420px;
    max-width: 92vw;
    background: #fff;
    z-index: 61;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    box-shadow: -20px 0 50px rgba(36, 6, 31, .15);
}
.drawer-panel.is-open { transform: translateX(0); }

.modal-card {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -48%);
    width: 460px;
    max-width: 92vw;
    max-height: 88vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 20px;
    z-index: 61;
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    box-shadow: 0 30px 70px rgba(36, 6, 31, .3);
}
.modal-card.is-open { opacity: 1; transform: translate(-50%, -50%); }

/* ---------- Zoom photo produit (lightbox) ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgb(20, 4, 17); /* opaque : aucune couleur de la page ne doit transparaître */
    opacity: 0;
    transition: opacity .22s ease;
}
.lightbox.is-open { opacity: 1; }
.lightbox-inner {
    position: relative;
    width: min(920px, 100%);
    max-height: calc(100vh - 48px);
    display: grid;
    grid-template-columns: 1fr;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    transform: scale(.96);
    transition: transform .22s ease;
    box-shadow: 0 40px 90px rgba(23, 3, 19, .5);
}
.lightbox.is-open .lightbox-inner { transform: scale(1); }
.lightbox-media {
    background: linear-gradient(160deg, var(--plum-100), var(--plum-300));
    aspect-ratio: 4 / 5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-media img { width: 100%; height: 100%; object-fit: cover; }
.lightbox-spinner {
    position: relative;
    z-index: 1;
    width: 34px;
    height: 34px;
    border: 3px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 999px;
    animation: lightbox-spin .8s linear infinite;
}
@keyframes lightbox-spin { to { transform: rotate(360deg); } }
.lightbox-body { padding: 22px 24px 24px; }
.lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    height: 38px;
    width: 38px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: var(--plum-700);
    box-shadow: 0 4px 14px rgba(23, 3, 19, .25);
}
@media (min-width: 720px) {
    .lightbox-inner { grid-template-columns: 1.05fr .95fr; }
    .lightbox-media { aspect-ratio: auto; height: 100%; min-height: 380px; }
    .lightbox-body { align-self: center; padding: 32px 34px; }
}

/* Ligne variante sélectionnable dans la fenêtre produit */
.variant-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--plum-100);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.variant-row:hover { border-color: var(--plum-300); }
.variant-row.is-selected {
    border-color: var(--plum-700);
    background: #FAF3F8;
}
.variant-row.is-out {
    opacity: .45;
    cursor: not-allowed;
    background: #f7f7f8;
}

/* Stepper quantité */
.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--plum-100);
    border-radius: 999px;
    overflow: hidden;
}
.qty-stepper button {
    width: 34px;
    height: 34px;
    background: #fff;
    border: 0;
    font-size: 16px;
    color: var(--plum-700);
    cursor: pointer;
}
.qty-stepper button:disabled { color: #ccc; cursor: not-allowed; }
.qty-stepper span {
    min-width: 34px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 14px;
}

/* ---------- Diaporama hero ---------- */
.hero-slide {
    position: absolute;
    inset: 0;
    height: 100%;
    width: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.1s ease;
}
.hero-slide.is-active { opacity: 1; }
.hero-dot {
    height: 6px;
    width: 6px;
    border-radius: 999px;
    border: 0;
    padding: 0;
    background: rgba(255, 255, 255, .55);
    cursor: pointer;
    transition: width .25s ease, background .25s ease;
}
.hero-dot.is-active { width: 18px; background: #fff; }
@media (prefers-reduced-motion: reduce) {
    .hero-slide { transition: none; }
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 84px;
    transform: translate(-50%, 20px);
    background: var(--plum-700);
    color: #fff;
    padding: 12px 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    z-index: 80;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    box-shadow: 0 12px 30px rgba(36, 6, 31, .25);
}
.toast.is-open { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 1024px) { .toast { bottom: 32px; } }

/* ---------- Squelettes de chargement ---------- */
.skeleton {
    background: linear-gradient(90deg, #f0e9ef 25%, #e4d5e0 37%, #f0e9ef 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease infinite;
    border-radius: 12px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- Champs du formulaire de commande ---------- */
.ck-input {
    width: 100%;
    border: 1px solid var(--plum-100);
    background: #F6F4F6;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    color: #221D20;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.ck-input:focus {
    border-color: var(--plum-300);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(201, 139, 185, .25);
}
.ck-input::placeholder { color: #A85E9B; opacity: .7; }
select.ck-input { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A85E9B' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
select.ck-input:disabled { opacity: .55; }

/* Mode de livraison (domicile / stopdesk) */
.ck-mode { display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
    border: 1px solid var(--plum-100); background: #F6F4F6; border-radius: 12px;
    padding: 11px 10px; font-size: 13px; font-weight: 500; color: #6b5f68;
    transition: border-color .15s ease, background .15s ease, color .15s ease; text-align: center; }
.ck-mode input { position: absolute; opacity: 0; pointer-events: none; }
.ck-mode:has(input:checked) { border-color: var(--plum-700); background: #fff; color: var(--plum-700); box-shadow: 0 0 0 2px rgba(90,16,76,.12); }

/* ---------- États actifs navigation catégories ---------- */
.cat-link { color: rgba(34, 29, 32, .7); transition: color .15s ease; }
.cat-link:hover { color: var(--plum-700); }
.cat-link.is-active { color: var(--plum-700); font-weight: 600; }

.cat-chip { background: #F3E1EE; color: var(--plum-700); transition: background .15s ease, color .15s ease; }
.cat-chip.is-active { background: var(--plum-700); color: #fff; }

@media (prefers-reduced-motion: reduce) {
    .overlay, .drawer-panel, .modal-card, .toast, .skeleton,
    .lightbox, .lightbox-inner { transition: none; animation: none; }
}
