/* ==========================================================================
   EasySell Catalog — Frameless Wheel-Rotation Carousel (No Outer Box)
   Inclinaison en roue + flou progressif de profondeur + barre de séparation.
   Compatible avec Sable, Véloce, Nova & IA Adaptative (100% Web).
   ========================================================================== */

/* Suppression de la grande box de catégorie sur TOUS les templates */
.shelf-container,
body.template-veloce .shelf-container,
body.template-nova .shelf-container {
    --shelf-card-w: 278px;
    --shelf-gap: 8px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 0 !important;
    padding: 10px 0 38px !important;
    margin-bottom: 14px !important;
    gap: 8px !important;
    position: relative;
}

/* Barre de séparation élégante entre chaque rayon */
.shelf-container::after {
    content: "";
    position: absolute;
    left: 6%;
    right: 6%;
    bottom: 6px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--border-hover, rgba(15, 23, 42, 0.16)) 24%,
        var(--border-hover, rgba(15, 23, 42, 0.16)) 76%,
        transparent 100%
    );
    pointer-events: none;
}

.shelf-container:last-child::after {
    display: none;
}

body.template-veloce .shelf-container::after {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(56, 189, 248, 0.28) 28%,
        rgba(56, 189, 248, 0.28) 72%,
        transparent 100%
    );
}

/* En-tête épuré directement posé sur la page */
.shelf-header,
body.template-veloce .shelf-header,
body.template-nova .shelf-header {
    border-bottom: none !important;
    padding: 0 4px 4px !important;
    margin-bottom: 0 !important;
}

/* Scène pleine largeur de la roue */
.shelf-orb-stage {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 0;
}

.shelf-orb-stage .shelf-scroll-row {
    position: relative;
    display: flex !important;
    align-items: stretch;
    gap: var(--shelf-gap) !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Padding vertical généreux pour que les cartes inclinées + arc bas ne soient jamais coupées */
    padding: 20px calc(50% - var(--shelf-card-w) / 2) 44px !important;
    margin: 0 !important;
    cursor: grab;
    user-select: none;
}

.shelf-orb-stage .shelf-scroll-row.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
    scroll-behavior: auto;
}

.shelf-orb-stage .shelf-scroll-row::-webkit-scrollbar {
    display: none;
}

.shelf-orb-stage .shelf-scroll-row.is-single {
    justify-content: center;
    padding: 12px 16px 22px !important;
    cursor: default;
}

.shelf-orb-stage .shelf-scroll-row > .catalog-card,
.shelf-orb-stage .shelf-scroll-row > .pack-card {
    flex: 0 0 var(--shelf-card-w) !important;
    width: var(--shelf-card-w) !important;
    max-width: var(--shelf-card-w) !important;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    transform-origin: center center;
    backface-visibility: hidden;
    animation: none !important;
    opacity: 1;
    transition-property: box-shadow, border-color;
    transition-duration: 240ms;
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

.shelf-orb-stage .shelf-scroll-row.is-animated > .catalog-card,
.shelf-orb-stage .shelf-scroll-row.is-animated > .pack-card {
    will-change: transform, opacity, filter;
}

/* Produit central parfaitement net et mis en valeur */
.shelf-orb-stage .catalog-card.is-shelf-center,
.shelf-orb-stage .pack-card.is-shelf-center {
    border-color: var(--brand, #8A6B58) !important;
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.05),
        0 24px 48px -18px rgba(15, 23, 42, 0.25),
        0 0 0 1.5px var(--brand, #8A6B58) !important;
}

/* Produits latéraux inclinés & floutés — tap pour faire tourner au centre */
.shelf-orb-stage .catalog-card.is-shelf-side,
.shelf-orb-stage .pack-card.is-shelf-side {
    cursor: pointer;
}

.shelf-orb-stage .catalog-card.is-shelf-side img,
.shelf-orb-stage .pack-card.is-shelf-side img {
    pointer-events: none;
}

/* Flèches directionnelles adaptatives */
.shelf-orb-nav {
    position: absolute;
    top: 44%;
    transform: translateY(-50%);
    z-index: 45;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1.5px solid var(--border-hover, rgba(15, 23, 42, 0.16));
    background: var(--bg-card, #FFFFFF);
    color: var(--ink-900, #0F172A);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 26px -6px rgba(0, 0, 0, 0.28);
    transition-property: transform, background-color, color, border-color, box-shadow;
    transition-duration: 180ms;
    transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.shelf-orb-nav.is-prev { left: 10px; }
.shelf-orb-nav.is-next { right: 10px; }

.shelf-orb-nav:hover {
    background: var(--brand, #8A6B58);
    color: var(--ink-btn-text, #FFFFFF);
    border-color: var(--brand, #8A6B58);
    transform: translateY(-50%) scale(1.06);
}

.shelf-orb-nav:active {
    transform: translateY(-50%) scale(0.96);
}

/* ═══ CADRAN DE ROUE CENTRÉ (DIAL BAR + COMPTEUR) ═══ */
.shelf-orb-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: -18px auto 0;
    padding: 0 12px;
    width: 100%;
    max-width: 340px;
}

.shelf-orb-dial {
    position: relative;
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: var(--border, rgba(15, 23, 42, 0.12));
    cursor: pointer;
    overflow: hidden;
}

/* Zone tactile élargie pour le cadran */
.shelf-orb-dial::after {
    content: "";
    position: absolute;
    inset: -12px 0;
}

.shelf-orb-dial-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    min-width: 18px;
    border-radius: 999px;
    background: var(--brand, #8A6B58);
    transition-property: left, width;
    transition-duration: 240ms;
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

.shelf-orb-counter {
    font-variant-numeric: tabular-nums;
    font-size: 11.5px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--bg-soft, #F5EFEB);
    border: 1px solid var(--border, rgba(15, 23, 42, 0.1));
    color: var(--ink-900, #1E293B);
    flex-shrink: 0;
}

/* ─── TEMPLATE 2 : VÉLOCE (Glow Néon + Roue marquée) ─── */
body.template-veloce .shelf-orb-stage .catalog-card.is-shelf-center,
body.template-veloce .shelf-orb-stage .pack-card.is-shelf-center {
    border-color: var(--brand, #38BDF8) !important;
    box-shadow:
        0 22px 48px -14px rgba(0, 0, 0, 0.78),
        0 0 32px -6px var(--brand, rgba(56, 189, 248, 0.5)),
        0 0 0 1.5px var(--brand, #38BDF8) !important;
}

body.template-veloce .shelf-orb-nav {
    background: rgba(15, 23, 42, 0.85);
    color: #F8FAFC;
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 26px -8px rgba(0, 0, 0, 0.7);
}

body.template-veloce .shelf-orb-dial {
    background: rgba(255, 255, 255, 0.14);
}

body.template-veloce .shelf-orb-counter {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    color: #F8FAFC;
}

/* ─── TEMPLATE 3 : NOVA (Pop Retail Net) ─── */
body.template-nova .shelf-orb-stage .catalog-card.is-shelf-center,
body.template-nova .shelf-orb-stage .pack-card.is-shelf-center {
    border-color: var(--brand, #E11D48) !important;
    box-shadow:
        0 20px 44px -14px rgba(15, 23, 42, 0.24),
        0 0 0 2px var(--brand, #E11D48) !important;
}

/* ─── MOBILE : Pleine largeur écran avec cartes voisines inclinées visibles ─── */
@media (max-width: 768px) {
    .shelf-container,
    body.template-veloce .shelf-container,
    body.template-nova .shelf-container {
        --shelf-card-w: min(59vw, 228px);
        --shelf-gap: 8px;
        padding: 8px 0 32px !important;
    }

    .shelf-orb-stage {
        margin: 0 -16px;
        width: calc(100% + 32px);
    }

    .shelf-orb-stage .shelf-scroll-row {
        padding: 18px calc(50% - var(--shelf-card-w) / 2) 42px !important;
    }

    .shelf-orb-nav {
        width: 36px;
        height: 36px;
        opacity: 0.94;
    }
    .shelf-orb-nav.is-prev { left: 8px; }
    .shelf-orb-nav.is-next { right: 8px; }

    .shelf-orb-footer {
        max-width: 240px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .shelf-orb-stage .shelf-scroll-row {
        scroll-behavior: auto !important;
    }
    .shelf-orb-stage .catalog-card,
    .shelf-orb-stage .pack-card {
        transform: none !important;
        filter: none !important;
        transition: none !important;
    }
}
