.ston-scroll-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.ston-scroll-container .ston-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity .5s ease;
    pointer-events: none;
}

.ston-scroll-container .ston-canvas.is-visible {
    opacity: 1;
}

/* ── لایه‌های متن ورود/خروج ───────────────────── */
/* .ston-layer فقط مسئول جای‌گذاری روی صفحه‌ست (position transform) و هیچ‌وقت توسط GSAP لمس نمی‌شه */
.ston-layer {
    position: absolute;
    z-index: 2;
    max-width: 90%;
    box-sizing: border-box;
    pointer-events: none;
}

.ston-pos-top-left      { top: 0;   left: 0; }
.ston-pos-top-center    { top: 0;   left: 50%; transform: translateX(-50%); text-align: center; }
.ston-pos-top-right     { top: 0;   right: 0; }
.ston-pos-center-left   { top: 50%; left: 0;   transform: translateY(-50%); }
.ston-pos-center-center { top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.ston-pos-center-right  { top: 50%; right: 0;  transform: translateY(-50%); }
.ston-pos-bottom-left   { bottom: 0; left: 0; }
.ston-pos-bottom-center { bottom: 0; left: 50%; transform: translateX(-50%); text-align: center; }
.ston-pos-bottom-right  { bottom: 0; right: 0; }

/* .ston-layer-inner همون چیزیه که GSAP انیمیشن opacity/transform روش اجرا می‌کنه */
.ston-layer-inner {
    padding: 24px;
    opacity: 0;
    visibility: hidden;
}

/* اگه کاربر حرکت رو در سیستم‌عاملش غیرفعال کرده، همه‌چیز رو مستقیم و بدون انیمیشن نشون بده */
@media (prefers-reduced-motion: reduce) {
    .ston-scroll-container .ston-canvas,
    .ston-layer-inner {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        transition: none !important;
    }
}

/* ══════════════════ Horizontal Scroll ══════════════════ */
.ston-h-scroll-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.ston-h-track {
    display: flex;
    height: 100%;
    align-items: center;
    will-change: transform;
}

.ston-h-panel {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    background: #1a1a1a;
    color: #fff;
    text-decoration: none;
    transition: transform .4s ease;
}

.ston-h-hover-scale:hover {
    transform: scale(1.02);
}

.ston-h-panel-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.ston-h-panel-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.ston-h-panel-body {
    position: relative;
    z-index: 2;
    padding: 24px;
}

.ston-h-panel-title {
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.ston-h-panel-text {
    margin: 0;
    font-size: 0.9rem;
}

/* ══════════════════ Split Text ══════════════════ */
.ston-split-text {
    display: inline-block;
}

.ston-split-text .ston-word,
.ston-split-text .ston-char {
    will-change: transform, opacity;
}

/* ══════════════════ SVG Draw ══════════════════ */
.ston-svg-draw {
    display: inline-block;
    max-width: 100%;
}

.ston-svg-draw svg {
    width: 100%;
    height: auto;
    display: block;
}

/* ══════════════════ Marquee ══════════════════ */
.ston-marquee {
    position: relative;
    overflow: hidden;
    width: 100%;
    white-space: nowrap;
}

.ston-marquee-track {
    display: flex;
    align-items: center;
    width: max-content;
    will-change: transform;
}

/* هر .ston-marquee-set یک نسخه‌ی کامل از آیتم‌هاست؛ JS به تعداد لازم از همین کپی می‌کنه
   تا حداقل ۲ برابر عرض کانتینر پر بشه و لوپ همیشه بدون‌پرش باشه */
.ston-marquee-set {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 60px;
}

.ston-marquee-item {
    display: inline-flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    white-space: nowrap;
}

.ston-marquee-item img {
    max-height: 60px;
    width: auto;
    display: block;
}

.ston-marquee-fade {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%);
}

/* ══════════════════ Counter ══════════════════ */
.ston-counter-box {
    display: inline-block;
}

.ston-counter-wrap {
    font-size: 3rem;
    font-weight: 700;
    display: inline-block;
    direction: ltr; /* اعداد همیشه چپ‌به‌راست نمایش داده بشن، حتی در سایت‌های راست‌چین */
}

.ston-counter-label {
    font-size: 1rem;
    opacity: 0.8;
}

/* ══════════════════ Magnetic Button ══════════════════ */
.ston-magnetic-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 600;
    will-change: transform;
    cursor: pointer;
}

.ston-magnetic-btn-inner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    will-change: transform;
    pointer-events: none;
}

.ston-cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s ease;
}

.ston-cursor-icon svg,
.ston-cursor-icon i {
    width: 100%;
    height: 100%;
    font-size: inherit;
}

html.ston-cursor-hide-native,
html.ston-cursor-hide-native * {
    cursor: none !important;
}

@media (hover: none) {
    .ston-cursor { display: none !important; }
}

/* ══════════════════ Draggable Card Stack (fan/rotary picker model) ══════════════════ */
.ston-card-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
    padding: 60px 0;
    overflow: hidden; /* کارت‌های کناری که بیرون از عرض picker می‌افتن رو می‌بره */
}

.ston-picker {
    position: relative;
    /* width/height دقیقش با JS (بر اساس تعداد و اندازه‌ی کارت‌ها) ست می‌شه */
}

.ston-cell {
    position: absolute;
    top: 0;
    left: 0;
    cursor: grab;
    touch-action: pan-y; /* درگ افقیه، پس اسکرول عمودی صفحه نباید مسدود بشه */
}

.ston-cell:active { cursor: grabbing; }

.ston-cell-content {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #eeeeee;
    display: block;
    text-decoration: none;
    color: inherit;
}

.ston-cell-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    -webkit-user-drag: none;
}

.ston-card-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px;
    background: rgba(0,0,0,.45);
    color: #fff;
}

.ston-card-title { margin: 0 0 6px; font-size: 1.1rem; }
.ston-card-text { margin: 0; opacity: .85; font-size: .85rem; }

.ston-card-nav-wrap {
    display: flex;
    gap: 16px;
}

.ston-card-nav {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.ston-card-nav:hover { background: rgba(0,0,0,.85); }

/* ══════════════════ Index Carousel ══════════════════ */
.ston-idx-carousel {
    width: 100%;
}

.ston-idx-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.ston-idx-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.ston-idx-title {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    line-height: 1.25;
}

.ston-idx-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ston-idx-count {
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    margin-inline-end: 6px;
}

.ston-idx-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #2a2a2e;
    background: transparent;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease, opacity .2s ease;
}

.ston-idx-btn svg { width: 20px; height: 20px; }

.ston-idx-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.ston-idx-track-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    cursor: grab;
}

.ston-idx-track-wrap::-webkit-scrollbar { display: none; }
.ston-idx-track-wrap.is-dragging { cursor: grabbing; user-select: none; }

.ston-idx-track {
    display: flex;
    gap: 22px;
}

.ston-idx-card {
    flex: 0 0 calc((100% - (var(--ston-idx-visible, 3) - 1) * var(--ston-idx-gap, 22px)) / var(--ston-idx-visible, 3));
    min-width: 0; /* جلوگیری از سرریز flex در مرورگرهایی که پیش‌فرض min-width:auto دارن */
    display: flex;
    flex-direction: column;
    background: #18181a;
    border: 1px solid #232326;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .25s ease, border-color .25s ease;
}

.ston-idx-card:hover {
    transform: translateY(var(--ston-idx-lift, -4px));
}

.ston-idx-card-media {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.ston-idx-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    -webkit-user-drag: none;
}

.ston-idx-stripe {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.ston-idx-card-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0,0,0,.5);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.ston-idx-card-placeholder .ston-idx-card-media {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ston-idx-plus {
    font-size: 2.5rem;
    color: rgba(255,255,255,.35);
    line-height: 1;
}

.ston-idx-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ston-idx-card-num {
    font-size: 0.75rem;
    font-weight: 700;
    direction: ltr;
}

.ston-idx-card-body h3 {
    margin: 0;
    font-size: 1.15rem;
}

.ston-idx-card-body p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.5;
}

.ston-idx-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.ston-idx-tag {
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    font-size: 0.72rem;
}

.ston-idx-progress {
    position: relative;
    width: 100%;
    height: 2px;
    background: #232326;
    border-radius: 2px;
    margin-top: 24px;
    overflow: hidden;
}

.ston-idx-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: #eb1f27;
    border-radius: 2px;
    transition: width .15s ease;
}
