/* =========================================================
   CLE STORIES — Premium Stylesheet
   v1.1.0  ·  PrestaShop 8.x
   Author: Clearis
   ----------------------------------------------------------
   Sumario:
     0. Design tokens (CSS variables · theming · dark mode)
     1. Carousel (track, thumbs, ring gradient)
     2. Navigation arrows (carousel)
     3. Story viewer overlay (modal + ambient bg)
     4. Progress bars
     5. Topbar (title + controls)
     6. Slide container (media, loader, CTA)
     7. Side navigation (prev/next inside viewer)
     8. Share sheet (bottom-sheet)
     9. Transitions (story-to-story + slide-to-slide)
    10. Responsive (mobile, notched devices)
    11. A11y (focus-visible, reduced motion)
   ========================================================= */


/* ============================================
   0. DESIGN TOKENS — Sistema de variables
   ============================================ */
:root {
    /* Brand ring (Instagram-style gradient) */
    --cle-ring-1: #f09433;
    --cle-ring-2: #e6683c;
    --cle-ring-3: #dc2743;
    --cle-ring-4: #cc2366;
    --cle-ring-5: #bc1888;

    /* Surfaces */
    --cle-surface-0: #ffffff;
    --cle-surface-1: #f7f7f8;
    --cle-surface-2: #ededee;
    --cle-text-strong: #111111;
    --cle-text-muted: #7a7a7a;
    --cle-border: rgba(0, 0, 0, 0.08);

    /* Viewer */
    --cle-viewer-bg: #000;
    --cle-modal-radius: 18px;
    --cle-modal-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), 0 8px 18px rgba(0, 0, 0, 0.35);

    /* Thumbnails — defaults to vertical rectangles (original look) */
    --cle-thumb-width: 155px;
    --cle-thumb-gap: 14px;
    --cle-thumb-ring-thickness: 0px;
    --cle-thumb-ring-padding: 0px;
    --cle-thumb-radius: 10px;
    --cle-thumb-aspect: 9 / 14;
    --cle-thumb-seen-color: rgba(0, 0, 0, 0.18);

    /* Topbar / controls */
    --cle-control-bg: rgba(255, 255, 255, 0.16);
    --cle-control-bg-hover: rgba(255, 255, 255, 0.28);
    --cle-control-color: #ffffff;
    --cle-control-blur: 12px;

    /* Progress bar (overridable from BO) */
    --cle-progress-bg: rgba(255, 255, 255, 0.28);
    --cle-progress-fill: #ffffff;
    --cle-progress-height: 3px;
    --cle-progress-gap: 4px;
    --cle-progress-radius: 6px;

    /* CTA */
    --cle-cta-bg: rgba(255, 255, 255, 0.16);
    --cle-cta-color: #ffffff;
    --cle-cta-border: rgba(255, 255, 255, 0.28);
    --cle-cta-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);

    /* Motion */
    --cle-ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
    --cle-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --cle-dur-fast: 180ms;
    --cle-dur-med: 320ms;
    --cle-dur-slow: 520ms;

    /* Safe area for notched devices */
    --cle-safe-top: env(safe-area-inset-top, 0px);
    --cle-safe-bottom: env(safe-area-inset-bottom, 0px);

    /* Z-index scale (avoid magic numbers) */
    --cle-z-thumbs: 1;
    --cle-z-overlay: 99990;
    --cle-z-ambient: 99991;
    --cle-z-modal: 99995;
    --cle-z-progress: 99996;
    --cle-z-topbar: 99997;
    --cle-z-nav: 99998;
    --cle-z-share: 99999;
}

/* Dark mode auto */
@media (prefers-color-scheme: dark) {
    :root {
        --cle-surface-0: #0e0e10;
        --cle-surface-1: #16161a;
        --cle-surface-2: #1f1f24;
        --cle-text-strong: #f4f4f5;
        --cle-text-muted: #a1a1aa;
        --cle-border: rgba(255, 255, 255, 0.08);
        --cle-thumb-seen-color: rgba(255, 255, 255, 0.18);
    }
}


/* ============================================
   1. CAROUSEL — Listado de stories en home
   ============================================ */
.cle-carousel-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 6px 0;
    z-index: var(--cle-z-thumbs);
}

/* Circle thumbnails (Instagram-style) — override variables */
.cle-thumbs-circle {
    --cle-thumb-width: 96px;
    --cle-thumb-aspect: 1 / 1;
    --cle-thumb-radius: 50%;
    --cle-thumb-ring-thickness: 2.5px;
    --cle-thumb-ring-padding: 3px;
}
.cle-thumbs-circle .cle-story-card {
    background:
        conic-gradient(
            from 180deg at 50% 50%,
            var(--cle-ring-1),
            var(--cle-ring-2),
            var(--cle-ring-3),
            var(--cle-ring-4),
            var(--cle-ring-5),
            var(--cle-ring-1)
        );
}
/* Rectangle mode (default): simple dark card, no gradient ring, no shadow */
.cle-thumbs-rectangle .cle-story-card {
    background: #1a1a1a;
    box-shadow: none;
    padding: 0;
}
.cle-thumbs-rectangle .cle-story-card::after { display: none; }  /* no inner white gap */
.cle-thumbs-rectangle .cle-story-cover {
    inset: 0;
    border-radius: inherit;
}

.cle-stories-bar {
    display: flex;
    gap: var(--cle-thumb-gap);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 2px 12px;
    width: 100%;
}

.cle-stories-bar::-webkit-scrollbar {
    display: none;
}

/* Subtle gradient fades at edges to hint there's more */
.cle-carousel-wrapper::before,
.cle-carousel-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity var(--cle-dur-med) ease;
}
.cle-carousel-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--cle-surface-0), transparent);
}
.cle-carousel-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--cle-surface-0), transparent);
}
.cle-carousel-wrapper.has-prev::before { opacity: 1; }
.cle-carousel-wrapper.has-next::after { opacity: 1; }

/* ---- Thumb ---- */
.cle-story-thumb {
    position: relative; /* ← needed so .cle-story-info (absolute in rectangle mode) is anchored to the thumb, not to the body */
    flex: 0 0 auto;
    cursor: pointer;
    width: var(--cle-thumb-width);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
    transition: transform var(--cle-dur-fast) var(--cle-ease-out);
}

.cle-story-thumb:active {
    transform: scale(0.96);
}

/* The gradient ring (uses padding trick — no SVG needed) */
.cle-story-card {
    position: relative;
    width: 100%;
    aspect-ratio: var(--cle-thumb-aspect);
    border-radius: var(--cle-thumb-radius);
    padding: var(--cle-thumb-ring-padding);
    background:
        conic-gradient(
            from 180deg at 50% 50%,
            var(--cle-ring-1),
            var(--cle-ring-2),
            var(--cle-ring-3),
            var(--cle-ring-4),
            var(--cle-ring-5),
            var(--cle-ring-1)
        );
    box-shadow: none;
    transition: transform var(--cle-dur-med) var(--cle-ease-out);
    overflow: hidden;
    isolation: isolate;
}

.cle-story-thumb:hover .cle-story-card {
    transform: translateY(-2px);
    box-shadow: none;
}

/* Animated gradient ring (only on circle mode) */
.cle-thumbs-circle .cle-story-thumb:not(.is-seen) .cle-story-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: conic-gradient(
        from 0deg at 50% 50%,
        var(--cle-ring-1),
        var(--cle-ring-3),
        var(--cle-ring-5),
        var(--cle-ring-1)
    );
    z-index: -1;
    animation: cle-ring-spin 6s linear infinite;
}

@keyframes cle-ring-spin {
    to { transform: rotate(360deg); }
}

/* Seen state — neutral ring */
.cle-story-thumb.is-seen .cle-story-card {
    background: var(--cle-thumb-seen-color);
}
.cle-story-thumb.is-seen .cle-story-card::before {
    display: none;
}

/* Inner white gap to separate ring from cover */
.cle-story-card::after {
    content: "";
    position: absolute;
    inset: var(--cle-thumb-ring-thickness);
    background: var(--cle-surface-0);
    border-radius: inherit;
    z-index: 0;
}

.cle-story-cover {
    position: absolute;
    inset: calc(var(--cle-thumb-ring-thickness) + 2px);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: inherit;
    transition: transform var(--cle-dur-slow) var(--cle-ease-out);
    z-index: 1;
}

.cle-story-thumb:hover .cle-story-cover {
    transform: scale(1.06);
}

/* Skeleton fallback when no cover */
.cle-story-cover:empty {
    background:
        linear-gradient(135deg, var(--cle-surface-2) 0%, var(--cle-surface-1) 100%);
}

.cle-story-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: linear-gradient(135deg, var(--cle-ring-3), var(--cle-ring-5));
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 999px;
    z-index: 3;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(220, 39, 67, 0.45);
    font-family: inherit;
}

.cle-story-thumb.is-seen .cle-story-badge {
    display: none;
}

/* Title — by default sits BELOW the thumbnail (circle / Instagram look) */
.cle-story-info {
    width: 100%;
    text-align: center;
    padding: 0 2px;
}

.cle-story-title {
    color: var(--cle-text-strong);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    max-width: 100%;
}

/* Rectangle mode: title OVERLAYS the cover with bottom gradient (original look) */
.cle-thumbs-rectangle .cle-story-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 10px 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 60%, transparent 100%);
    z-index: 3;
    text-align: left;
    /* Match the card's rounded corners so the overlay never bleeds outside */
    border-bottom-left-radius: var(--cle-thumb-radius);
    border-bottom-right-radius: var(--cle-thumb-radius);
    pointer-events: none;
}
.cle-thumbs-rectangle .cle-story-title {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    -webkit-line-clamp: 3;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}


/* ============================================
   2. CAROUSEL ARROWS
   ============================================ */
.cle-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--cle-surface-0);
    border: 1px solid var(--cle-border);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    color: var(--cle-text-strong);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--cle-dur-fast) var(--cle-ease-out),
                box-shadow var(--cle-dur-fast) var(--cle-ease-out),
                opacity var(--cle-dur-fast) var(--cle-ease-out);
    line-height: 1;
    padding: 0;
}

.cle-arrow:hover {
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}
.cle-arrow:active {
    transform: translateY(-50%) scale(0.94);
}
.cle-arrow-prev { left: -10px; }
.cle-arrow-next { right: -10px; }


/* ============================================
   3. VIEWER OVERLAY (full-screen viewer)
   ============================================ */
.cle-stories-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--cle-z-overlay);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.92);
    animation: cle-overlay-in var(--cle-dur-med) var(--cle-ease-out);
    padding: max(16px, var(--cle-safe-top)) 16px max(16px, var(--cle-safe-bottom));
}

.cle-stories-overlay[hidden] { display: none; }

@keyframes cle-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.cle-stories-overlay.is-closing {
    animation: cle-overlay-out var(--cle-dur-med) var(--cle-ease-out) forwards;
}
@keyframes cle-overlay-out {
    to { opacity: 0; }
}

/* Ambient blurred background — 2 layers for crossfade */
.cle-ambient-bg {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background-size: cover;
    background-position: center;
    filter: blur(48px) saturate(170%) brightness(0.55);
    z-index: var(--cle-z-ambient);
    opacity: 0;
    transition: opacity var(--cle-dur-slow) ease;
    will-change: opacity;
}

.cle-ambient-bg.active {
    opacity: 1;
}

.cle-ambient-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at center,
        rgba(0, 0, 0, 0.25) 0%,
        rgba(0, 0, 0, 0.65) 100%
    );
    z-index: calc(var(--cle-z-ambient) + 1);
    pointer-events: none;
}

/* Modal wrapper allows clipping of slide transitions */
.cle-stories-modal-wrapper {
    position: relative;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 9 / 16;
    max-height: min(92vh, 820px);
    z-index: var(--cle-z-modal);
    overflow: hidden;
    border-radius: var(--cle-modal-radius);
    box-shadow: var(--cle-modal-shadow);
    transform: translateZ(0);
}

.cle-stories-modal {
    position: absolute;
    inset: 0;
    background: var(--cle-viewer-bg);
    overflow: hidden;
    border-radius: var(--cle-modal-radius);
    transform: translateX(0);
    opacity: 1;
    transition: transform var(--cle-dur-slow) var(--cle-ease-out),
                opacity var(--cle-dur-med) var(--cle-ease-out);
    will-change: transform, opacity;
}

/* Top fade so the topbar/progress are always readable */
.cle-stories-modal::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 130px;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.35) 60%,
        rgba(0, 0, 0, 0) 100%
    );
    pointer-events: none;
    z-index: 30;
}

/* Bottom fade for CTA legibility */
.cle-stories-modal::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 160px;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0.20) 60%,
        rgba(0, 0, 0, 0) 100%
    );
    pointer-events: none;
    z-index: 30;
}


/* ============================================
   4. PROGRESS BARS
   ============================================ */
.cle-progress {
    position: absolute;
    top: calc(12px + var(--cle-safe-top));
    left: 12px;
    right: 12px;
    height: var(--cle-progress-height);
    z-index: var(--cle-z-progress);
    display: flex;
    gap: var(--cle-progress-gap);
    pointer-events: none;
}

.cle-story-segment {
    flex: 1;
    background: var(--cle-progress-bg);
    border-radius: var(--cle-progress-radius);
    overflow: hidden;
    position: relative;
}

.cle-story-segment-fill {
    background: var(--cle-progress-fill);
    width: 0%;
    height: 100%;
    border-radius: inherit;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.35);
    will-change: width;
}


/* ============================================
   5. TOPBAR (title + control buttons)
   ============================================ */
.cle-story-topbar {
    position: absolute;
    top: calc(24px + var(--cle-safe-top));
    left: 14px;
    right: 14px;
    z-index: var(--cle-z-topbar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    pointer-events: none;
}

.cle-story-title-top {
    flex: 1;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 8px;
    letter-spacing: 0.1px;
}

.cle-story-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: auto;
}

.cle-control {
    background: var(--cle-control-bg) !important;
    backdrop-filter: blur(var(--cle-control-blur));
    -webkit-backdrop-filter: blur(var(--cle-control-blur));
    border: none !important;
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--cle-dur-fast) var(--cle-ease-out),
                transform var(--cle-dur-fast) var(--cle-ease-out);
    color: var(--cle-control-color);
    -webkit-tap-highlight-color: transparent;
}

.cle-control:hover {
    background: var(--cle-control-bg-hover) !important;
}
.cle-control:active {
    transform: scale(0.92);
}

.cle-icon-svg {
    width: 18px !important;
    height: 18px !important;
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)) !important;
    pointer-events: none;
}

.cle-close-x {
    color: #fff;
    font-size: 26px;
    line-height: 1;
    font-weight: 300;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
    pointer-events: none;
}

/* Hide mute control when the active slide is an image */
.cle-slide-is-image .cle-toggle-mute {
    display: none;
}


/* ============================================
   6. SLIDE CONTAINER (media, loader, CTA)
   ============================================ */
.cle-slide-container {
    position: absolute;
    inset: 0;
    background: #000;
    z-index: 5;
    overflow: hidden;
}

.cle-slide-container img,
.cle-slide-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    animation: cle-media-in var(--cle-dur-med) var(--cle-ease-out);
    background: #000;
}

@keyframes cle-media-in {
    from { opacity: 0; transform: scale(1.02); }
    to   { opacity: 1; transform: scale(1); }
}

/* Premium loader (visible while media downloads) */
.cle-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 42px;
    margin: -21px 0 0 -21px;
    border: 3px solid rgba(255, 255, 255, 0.22);
    border-top-color: #fff;
    border-radius: 50%;
    z-index: 25;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--cle-dur-fast) ease;
    animation: cle-spin 0.9s linear infinite;
}
.cle-slide-container.is-loading .cle-loader {
    opacity: 1;
}
@keyframes cle-spin {
    to { transform: rotate(360deg); }
}

/* Dim overlay when paused via long-press */
.cle-slide-container::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--cle-dur-fast) ease;
    z-index: 20;
}
.cle-stories-overlay.is-holding .cle-slide-container::after {
    opacity: 1;
}

/* CTA button (overridable BG/text from settings) */
.cle-cta-wrapper {
    position: absolute;
    bottom: calc(28px + var(--cle-safe-bottom));
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 60;
    pointer-events: none;
}

.cle-cta-button {
    pointer-events: auto;
    padding: 11px 22px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    border-radius: 999px;
    text-decoration: none !important;
    color: var(--cle-cta-color) !important;
    background: var(--cle-cta-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--cle-cta-border);
    transition: transform var(--cle-dur-fast) var(--cle-ease-out),
                background var(--cle-dur-fast) ease,
                box-shadow var(--cle-dur-fast) ease;
    box-shadow: var(--cle-cta-shadow);
    min-width: 140px;
    text-align: center;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cle-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.cle-cta-button:active {
    transform: translateY(0) scale(0.97);
}


/* ============================================
   7. SIDE NAVIGATION (prev/next inside viewer)
   ============================================ */
.cle-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    font-weight: 400;
    cursor: pointer;
    z-index: var(--cle-z-nav);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--cle-dur-fast) ease,
                transform var(--cle-dur-fast) var(--cle-ease-out),
                opacity var(--cle-dur-fast) ease;
    opacity: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    padding: 0;
}

/* Reveal arrows on viewer hover (desktop only) */
@media (hover: hover) {
    .cle-stories-modal-wrapper:hover .cle-nav { opacity: 1; }
}
@media (hover: none) {
    .cle-nav { display: none; }
}

.cle-nav:hover {
    background: rgba(255, 255, 255, 0.32);
    transform: translateY(-50%) scale(1.06);
}
.cle-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.cle-nav.prev { left: 12px; }
.cle-nav.next { right: 12px; }


/* ============================================
   8. SHARE SHEET (bottom-sheet)
   ============================================ */
.cle-share-modal {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: var(--cle-z-share);
    animation: cle-fade-in var(--cle-dur-fast) ease;
}

.cle-share-modal[hidden] { display: none; }

.cle-share-sheet {
    background: var(--cle-surface-0);
    width: 100%;
    max-width: 420px;
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    padding: 18px 18px calc(18px + var(--cle-safe-bottom));
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: cle-slide-up var(--cle-dur-med) var(--cle-ease-out);
    color: var(--cle-text-strong);
}

/* Drag handle */
.cle-share-sheet::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    background: var(--cle-surface-2);
    border-radius: 999px;
    margin: 0 auto 12px;
}

.cle-share-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 16px;
}

.cle-share-close-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--cle-text-muted);
    line-height: 1;
    padding: 4px 6px;
    border-radius: 8px;
    transition: background var(--cle-dur-fast) ease;
}
.cle-share-close-btn:hover {
    background: var(--cle-surface-2);
}

.cle-share-option {
    padding: 14px;
    border-radius: 14px;
    background: var(--cle-surface-1);
    text-decoration: none;
    font-weight: 600;
    color: var(--cle-text-strong);
    border: 1px solid var(--cle-border);
    cursor: pointer;
    text-align: center;
    transition: background var(--cle-dur-fast) ease,
                transform var(--cle-dur-fast) var(--cle-ease-out);
    font-size: 14px;
}
.cle-share-option:hover {
    background: var(--cle-surface-2);
    transform: translateY(-1px);
}
.cle-share-option:active {
    transform: translateY(0) scale(0.99);
}

.cle-share-cancel {
    margin-top: 6px;
    padding: 14px;
    border-radius: 14px;
    background: var(--cle-text-strong);
    color: var(--cle-surface-0);
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: opacity var(--cle-dur-fast) ease,
                transform var(--cle-dur-fast) var(--cle-ease-out);
}
.cle-share-cancel:hover { opacity: 0.9; }
.cle-share-cancel:active { transform: scale(0.99); }


/* ============================================
   9. TRANSITIONS — between stories / slides
   ============================================ */
.cle-stories-modal.exit-left {
    transform: translateX(-110%);
    opacity: 0;
}
.cle-stories-modal.exit-right {
    transform: translateX(110%);
    opacity: 0;
}
.cle-stories-modal.enter-right {
    transition: none !important;
    transform: translateX(110%);
    opacity: 0;
}
.cle-stories-modal.enter-left {
    transition: none !important;
    transform: translateX(-110%);
    opacity: 0;
}
.cle-stories-modal.story-active {
    transform: translateX(0);
    opacity: 1;
}

/* Drag-to-dismiss (vertical swipe-down) */
.cle-stories-modal-wrapper.is-dragging .cle-stories-modal {
    transition: none !important;
}


/* ============================================
   10. RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
    :root {
        --cle-thumb-width: 72px;
        --cle-thumb-gap: 10px;
    }

    .cle-arrow { display: none !important; }

    .cle-stories-overlay {
        padding: 0;
        background: #000;
    }

    .cle-stories-modal-wrapper {
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }
    .cle-stories-modal { border-radius: 0; }
    .cle-story-title { font-size: 11px; }
    .cle-control { width: 34px; height: 34px; }
    .cle-icon-svg { width: 16px !important; height: 16px !important; }
}

@media (max-width: 380px) {
    :root {
        --cle-thumb-width: 130px;
        --cle-thumb-gap: 8px;
    }
}

/* ============================================
   11. ACCESSIBILITY
   ============================================ */
.cle-story-thumb:focus-visible,
.cle-control:focus-visible,
.cle-nav:focus-visible,
.cle-arrow:focus-visible,
.cle-cta-button:focus-visible,
.cle-share-option:focus-visible,
.cle-share-cancel:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgba(220, 39, 67, 0.55);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .cle-thumbs-circle .cle-story-thumb:not(.is-seen) .cle-story-card::before { animation: none !important; }
}
