/* SS Elementor Product Slider — v2.9.6
 *
 * Native horizontal-scroll architecture. The viewport is a real
 * `overflow-x: auto` scroll container so TikTok / Instagram / Facebook
 * in-app WebViews treat horizontal swipes as scroll (no back gesture).
 *
 * Gesture policy:
 *   html/body:    untouched — native vertical page scroll.
 *   .ss-eps-wrap: `touch-action: pan-y` so non-scroll children pass
 *                 vertical scroll up to the page.
 *   .ss-eps-viewport: `touch-action: pan-x pan-y` — browser owns both
 *                 axes natively. Horizontal becomes scroll, vertical
 *                 bubbles to the page. NO `overflow-y: hidden` — that
 *                 traps vertical touches on iOS and breaks page scroll
 *                 from inside the slider.
 *   .ss-eps-swipe-guard: a transparent strip above the products.
 *                 Horizontal swipes here are forwarded into the viewport
 *                 via JS. Vertical motion passes straight through.
 *
 * Scoping: everything gesture-related lives inside `.ss-eps-wrap`. No
 * body / .elementor / fixed-position overlays.
 */

/* ---------- Global (minimal) ---------- */
html, body {
    -webkit-tap-highlight-color: transparent;
}

/* ---------- Slider wrap ---------- */
.ss-eps-wrap {
    --ss-gap: 24px;
    --ss-card-bg: #fff;
    --ss-card-radius: 24px;
    --ss-shadow: 0 14px 35px rgba(15, 23, 42, .08);
    --ss-border: 1px solid rgba(148, 163, 184, .22);
    --ss-text: #0f172a;
    --ss-muted: #64748b;
    --ss-soft: #eff4ff;
    --ss-soft-hover: #dfe7ff;
    --ss-btn-grad-1: #0f172a;
    --ss-btn-grad-2: #223250;
    --ss-nav-bg: #fff;
    --ss-nav-color: #0f172a;
    position: relative;
    width: 100%;
    /* Non-scroll children pass vertical scroll up to the page. */
    touch-action: pan-y;
    overscroll-behavior-x: contain;
}

.ss-eps-wrap *,
.ss-eps-wrap *::before,
.ss-eps-wrap *::after { box-sizing: border-box; }

/* ---------- Header / section bar ---------- */
.ss-eps-sectionbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; position: relative; z-index: 3; }
.ss-eps-heading { min-width: 0; flex: 1 1 auto; }
.ss-eps-section-title { margin: 0 0 6px; font-size: clamp(24px, 3vw, 48px); line-height: 1.08; font-weight: 800; color: var(--ss-text); letter-spacing: -.02em; }
.ss-eps-section-subtitle { margin: 0; color: var(--ss-muted); font-size: clamp(13px, 1.4vw, 20px); line-height: 1.55; max-width: 720px; }
.ss-eps-toolbar { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; position: relative; z-index: 3; }
.ss-eps-header-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 12px 18px; border-radius: 999px; text-decoration: none; background: var(--ss-soft); color: var(--ss-text); font-weight: 700; font-size: 14px; line-height: 1; white-space: nowrap; transition: background .22s ease, transform .22s ease; -webkit-tap-highlight-color: transparent; touch-action: manipulation; position: relative; z-index: 3; }
.ss-eps-header-btn:hover { transform: translateY(-1px); background: var(--ss-soft-hover); }
.ss-eps-nav { display: flex; align-items: center; gap: 10px; position: relative; z-index: 3; }
.ss-eps-arrow { width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--ss-nav-bg); color: var(--ss-nav-color); box-shadow: 0 8px 22px rgba(15, 23, 42, .08); cursor: pointer; transition: box-shadow .22s ease, transform .22s ease; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; flex: 0 0 auto; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.ss-eps-arrow:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(15, 23, 42, .12); }
.ss-eps-arrow:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

/* ---------- Swipe guard zone ----------
 * Transparent strip positioned directly above the viewport via JS. Catches
 * left/right swipes that start slightly above the products and forwards
 * them into the viewport's scrollLeft. Vertical motion passes through.
 *
 * Hidden by default; JS sets data-ss-guard-ready="1" after computing the
 * correct `top` so the guard never overlays the section bar on first paint.
 * Only enabled on touch devices (no pointer-fine).
 */
.ss-eps-swipe-guard {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 60px;
    z-index: 1;                 /* below section bar (z:3), above background */
    background: transparent;
    pointer-events: none;       /* off until JS positions */
    visibility: hidden;
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
}
.ss-eps-wrap[data-ss-guard-ready="1"] .ss-eps-swipe-guard {
    top: var(--ss-guard-top, 0px);
    visibility: visible;
    pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
    /* Desktop: guard not needed; mouse drag is on the viewport. */
    .ss-eps-swipe-guard { display: none !important; }
}

/* ---------- Viewport (the real horizontal scroll container) ----------
 * `overflow-x: auto` makes this a legitimate scroll container, so TikTok /
 * Instagram / Facebook WebViews treat horizontal swipes as scroll instead
 * of as their native back gesture.
 *
 * IMPORTANT: `overflow-y` is `visible`, NOT `hidden`. With `hidden`, iOS
 * WebKit traps vertical touches inside the container and the page can't
 * scroll vertically when the finger lands on the slider. `visible` allows
 * vertical pan to bubble naturally to the page.
 *
 * `touch-action: pan-x pan-y` is the gesture contract: browser owns both
 * axes. Horizontal becomes scroll on this container; vertical bubbles up.
 * Pinch-zoom is excluded.
 *
 * `overscroll-behavior-x: contain` keeps horizontal overscroll inside the
 * slider so it never chains into the page / WebView (this is what stops
 * end-of-scroll from being interpreted as a "back" gesture).
 */
.ss-eps-viewport {
    position: relative;
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
    overscroll-behavior-x: contain;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    /* Hide scrollbar but keep scroll. */
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Scroll-snap as `proximity` (not mandatory) — mandatory snap fights
     * the user's flick on slower devices and feels sticky on iOS WebKit
     * builds. Proximity gives the same "lands on a slide" feel without
     * interrupting fast scrolls. */
    scroll-snap-type: none;
    scroll-behavior: smooth;
    /* z-index so it sits above any absolutely-positioned siblings. */
    z-index: 2;
}
.ss-eps-viewport::-webkit-scrollbar { width: 0; height: 0; display: none; }
.ss-eps-viewport.is-dragging { cursor: grabbing; scroll-behavior: auto !important; scroll-snap-type: none !important; }

/* The track is a flex strip; the viewport scrolls it horizontally. We do
 * NOT use `width: max-content` because that interacts badly with
 * `flex: 0 0 auto` + `min-width` (children shrink-wrap to content). Instead
 * the track flows naturally and slides have explicit widths set via JS. */
.ss-eps-track {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--ss-gap);
    align-items: stretch;
    /* Padding-right ensures the last slide can reach scroll-snap-align: start
     * — without it, scroll-snap can refuse to land on the last slide. */
    padding-right: 1px;
}

.ss-eps-slide {
    flex: 0 0 auto;
    /* JS sets explicit pixel width on init. CSS fallback for pre-JS state. */
    width: calc((100% - (var(--ss-gap) * 3)) / 4);
    min-width: 0;
    scroll-snap-align: start;
    /* No scroll-snap-stop:always — that prevents fast-flicking past multiple
     * slides at once and feels broken to users. */
}

/* Images don't eat touches. */
.ss-eps-thumb,
.ss-eps-thumb img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
.ss-eps-thumb img { pointer-events: none; }

/* ---------- Card ---------- */
.ss-eps-card {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--ss-card-bg);
    border: var(--ss-border);
    border-radius: var(--ss-card-radius);
    box-shadow: var(--ss-shadow);
    transition: transform .28s ease, box-shadow .28s ease;
    text-decoration: none;
}
.ss-eps-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(15, 23, 42, .12); }

.ss-eps-thumb-link {
    display: block;
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

.ss-eps-thumb {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f8fafc;
}
.ss-eps-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.ss-eps-card:hover .ss-eps-thumb img { transform: scale(1.035); }

.ss-eps-badge {
    position: absolute;
    top: 12px;
    inset-inline-start: 12px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: .02em;
    text-transform: uppercase;
    z-index: 2;
}

.ss-eps-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }

.ss-eps-title { margin: 0; color: var(--ss-text); font-size: clamp(16px, 1.2vw, 20px); line-height: 1.35; font-weight: 800; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ss-eps-title a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.ss-eps-title a:hover { color: #2563eb; }

.ss-eps-price { margin: 0; color: var(--ss-muted); font-size: clamp(13px, 1vw, 15px); line-height: 1.4; font-weight: 600; }
.ss-eps-price .amount { font-weight: 800; color: var(--ss-text); font-size: 1.06em; }
.ss-eps-price del { opacity: .55; margin-inline-end: 6px; }

.ss-eps-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }

.ss-eps-secondary-btn,
.ss-eps-cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    border: 0;
    border-radius: 16px;
    padding: 13px 14px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.1;
    cursor: pointer;
    transition: background .22s ease, transform .22s ease, box-shadow .22s ease;
    min-height: 46px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    font-family: inherit;
}
.ss-eps-secondary-btn { background: var(--ss-soft); color: var(--ss-text); }
.ss-eps-secondary-btn:hover { background: var(--ss-soft-hover); }
.ss-eps-secondary-btn-light { background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .18); }

.ss-eps-cart-form { display: flex; flex-direction: column; gap: 8px; margin: 0; }

.ss-eps-qty {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    align-items: center;
    border: 1px solid rgba(148, 163, 184, .32);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    min-width: 0;
}
.ss-eps-qty-btn {
    border: 0;
    background: #f8fafc;
    height: 40px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    color: var(--ss-text);
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}
.ss-eps-qty-btn:hover { background: var(--ss-soft); }
.ss-eps-qty-btn:active { background: var(--ss-soft-hover); }
.ss-eps-qty-input {
    width: 100%;
    height: 40px;
    border: 0;
    text-align: center;
    font-size: 14px;
    font-weight: 800;
    color: var(--ss-text);
    padding: 0 4px;
    -moz-appearance: textfield;
    background: #fff;
    cursor: text;
}
.ss-eps-qty-input::-webkit-outer-spin-button,
.ss-eps-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.ss-eps-cart-btn {
    background: linear-gradient(135deg, var(--ss-btn-grad-1), var(--ss-btn-grad-2));
    color: #fff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .16);
}
.ss-eps-cart-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(15, 23, 42, .2); }
.ss-eps-cart-btn.is-loading { opacity: .8; pointer-events: none; }
.ss-eps-cart-btn.is-added { background: linear-gradient(135deg, #16a34a, #15803d); }
.ss-eps-cart-btn:disabled { cursor: not-allowed; opacity: .7; }

.ss-eps-cart-icon { display: inline-flex; line-height: 1; flex: 0 0 auto; }
.ss-eps-cart-text { display: inline-block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-eps-cart-message { min-height: 16px; font-size: 12px; font-weight: 700; color: #16a34a; line-height: 1.2; }

.ss-eps-category-card .ss-eps-body { justify-content: flex-end; }

.ss-eps-endcard { justify-content: center; align-items: stretch; text-decoration: none; background: radial-gradient(circle at top left, #2563eb 0, #0f172a 72%); -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.ss-eps-endcard .ss-eps-title { color: #fff; }
.ss-eps-endcard-inner { padding: 24px 18px; display: flex; flex-direction: column; justify-content: center; gap: 14px; min-height: 100%; text-align: center; align-items: center; }
.ss-eps-end-badge { width: 52px; height: 52px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .18); font-size: 26px; color: #fff; font-weight: 800; }

.ss-eps-dots { display: flex; justify-content: center; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.ss-eps-dot { width: 9px; height: 9px; border-radius: 999px; background: rgba(15, 23, 42, .18); cursor: pointer; transition: width .22s ease, background .22s ease; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.ss-eps-dot.is-active { width: 28px; background: #0f172a; }

.ss-eps-empty { padding: 18px; border-radius: 18px; background: #fff7ed; color: #9a3412; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .ss-eps-wrap { --ss-gap: 18px; }
    .ss-eps-slide { width: calc((100% - var(--ss-gap)) / 2); }
    .ss-eps-sectionbar { align-items: flex-start; flex-direction: column; }
    .ss-eps-toolbar { width: 100%; justify-content: space-between; }
    .ss-eps-body { padding: 16px; }
    .ss-eps-secondary-btn, .ss-eps-cart-btn { min-height: 44px; padding: 12px 13px; }
}

@media (max-width: 767px) {
    .ss-eps-wrap { --ss-gap: 12px; padding-left: 10px; padding-right: 10px; }
    .ss-eps-sectionbar { gap: 14px; margin-bottom: 14px; }
    .ss-eps-section-title { font-size: clamp(21px, 7vw, 30px); }
    .ss-eps-section-subtitle { font-size: 13px; line-height: 1.45; }
    .ss-eps-toolbar { width: 100%; gap: 8px; align-items: center; }
    .ss-eps-header-btn { flex: 1 1 auto; min-width: 0; min-height: 40px; padding: 10px 14px; font-size: 12px; }
    .ss-eps-nav { gap: 8px; }
    .ss-eps-arrow { width: 40px; height: 40px; font-size: 20px; }
    .ss-eps-swipe-guard { height: 72px; }
    .ss-eps-slide { width: calc(100% - 8px); }
    .ss-eps-card { border-radius: 18px; }
    .ss-eps-body { padding: 12px; gap: 8px; }
    .ss-eps-title { font-size: 15px; line-height: 1.3; }
    .ss-eps-price { font-size: 12px; }
    .ss-eps-actions { gap: 8px; }
    .ss-eps-secondary-btn, .ss-eps-cart-btn { min-height: 40px; padding: 10px 12px; border-radius: 14px; font-size: 12px; gap: 6px; }
    .ss-eps-qty { grid-template-columns: 32px minmax(0, 1fr) 32px; border-radius: 12px; }
    .ss-eps-qty-btn { height: 34px; font-size: 16px; }
    .ss-eps-qty-input { height: 34px; font-size: 12px; }
    .ss-eps-cart-message { font-size: 11px; min-height: 14px; }
    .ss-eps-endcard-inner { padding: 20px 14px; gap: 12px; }
    .ss-eps-end-badge { width: 46px; height: 46px; font-size: 22px; }
    .ss-eps-dots { gap: 7px; margin-top: 14px; }
    .ss-eps-dot { width: 8px; height: 8px; }
    .ss-eps-dot.is-active { width: 24px; }
}

@media (max-width: 480px) {
    .ss-eps-wrap { --ss-gap: 10px; }
    .ss-eps-slide { width: 100%; }
    .ss-eps-section-title { font-size: 20px; }
    .ss-eps-section-subtitle { font-size: 12px; }
    .ss-eps-header-btn { padding: 9px 12px; font-size: 11px; }
    .ss-eps-arrow { width: 36px; height: 36px; font-size: 18px; }
    .ss-eps-body { padding: 10px; }
    .ss-eps-title { font-size: 14px; }
    .ss-eps-price { font-size: 11px; }
    .ss-eps-secondary-btn, .ss-eps-cart-btn { min-height: 36px; padding: 9px 10px; font-size: 11px; border-radius: 12px; }
    .ss-eps-qty { grid-template-columns: 28px minmax(0, 1fr) 28px; }
    .ss-eps-qty-btn { height: 30px; font-size: 15px; }
    .ss-eps-qty-input { height: 30px; font-size: 11px; }
    .ss-eps-cart-icon svg { transform: scale(.9); }
}

@media (prefers-reduced-motion: reduce) {
    .ss-eps-card, .ss-eps-thumb img, .ss-eps-secondary-btn, .ss-eps-cart-btn, .ss-eps-arrow, .ss-eps-dot { transition: none; }
    .ss-eps-card:hover { transform: none; }
    .ss-eps-card:hover .ss-eps-thumb img { transform: none; }
    .ss-eps-viewport { scroll-behavior: auto; }
}
