/* ==========================================================
   Sepahan v2.19 - Fix Bundle
   ========================================================== */

/* ---------------------------------------------------------
   1. FIX: Vertical scroll interference in horizontal sliders
      Problem: touch-action:pan-x blocks vertical page scroll
      on mobile when finger moves over horizontal sliders.
      Solution: Use touch-action:pan-y on the WRAPPER so the
      browser knows vertical scroll is primary, and let Swiper
      handle its own horizontal gesture natively.
   --------------------------------------------------------- */

/* Remove pan-x that was blocking vertical scrolling */
body .sepahan-image-cats-scroll,
body .sepahan-shop-brands-scroll,
body .sepahan-products-strip-scroll,
body .sepahan-products-15-viewport {
    touch-action: pan-y !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-inline: contain !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

body .sepahan-image-cats-scroll::-webkit-scrollbar,
body .sepahan-shop-brands-scroll::-webkit-scrollbar,
body .sepahan-products-strip-scroll::-webkit-scrollbar,
body .sepahan-products-15-viewport::-webkit-scrollbar {
    display: none !important;
}

/* Swiper containers: allow both axes so browser decides */
.swiper,
.swiper-container,
.amazing-carousel,
.product-carousel,
.product-list-carousel,
.blog-carousel,
.landing-amazing-carousel,
.category-carousel,
.free-mode {
    touch-action: pan-y !important;
}

/* ---------------------------------------------------------
   2. FIX: Product thumbnail gallery on desktop
      Problem: .sepahan-nikan-thumbs had touch-action:pan-x
      which was intercepting clicks on desktop (pointer events
      on the scroll container blocked click propagation).
      Solution: Allow all pointer events on thumbs wrapper,
      only set pan-x on mobile.
   --------------------------------------------------------- */

/* Desktop: no touch-action restriction, clicks must work */
@media (min-width: 901px) {
    .sepahan-nikan-thumbs {
        touch-action: auto !important;
        cursor: default !important;
    }
    .sepahan-nikan-thumb {
        cursor: pointer !important;
        pointer-events: auto !important;
    }
}

/* Mobile: allow horizontal scroll on thumbs strip */
@media (max-width: 900px) {
    .sepahan-nikan-thumbs {
        touch-action: pan-x !important;
        cursor: grab !important;
    }
}

/* Always ensure pointer events are not blocked on thumbs */
.sepahan-nikan-thumb,
.sepahan-nikan-thumb img,
.sepahan-nikan-thumb button,
.woocommerce-product-gallery .flex-control-thumbs li,
.woocommerce-product-gallery .flex-control-thumbs img {
    pointer-events: auto !important;
}

/* ---------------------------------------------------------
   3. FIX: Comment "save info" checkbox responsive layout
   --------------------------------------------------------- */
.comment-form-cookies-consent {
    grid-column: 1 / -1 !important;
    display: flex !important;
    align-items: flex-start !important;
}

.comment-form-cookies-consent label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-size: 13px !important;
    color: var(--sepahan-muted, #64748b) !important;
    line-height: 1.7 !important;
    flex-wrap: nowrap !important;
    cursor: pointer !important;
}

.comment-form-cookies-consent input[type="checkbox"] {
    flex: 0 0 18px !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    accent-color: var(--sepahan-blue, #2563eb) !important;
    cursor: pointer !important;
    border-radius: 4px !important;
}

.comment-form-cookies-consent span {
    flex: 1 !important;
    min-width: 0 !important;
    word-break: break-word !important;
}

/* ---------------------------------------------------------
   4. FIX: Site default color scheme (light/dark initial load)
      Applied via body class: sepahan-default-light or
      sepahan-default-dark — set in PHP before page renders.
   --------------------------------------------------------- */
body.sepahan-force-dark:not(.sepahan-user-toggled-light) {
    background-color: var(--sepahan-dark-bg, #09090b) !important;
    color: var(--sepahan-dark-text, #ffffff) !important;
}

/* ---------------------------------------------------------
   5. FIX: Elementor editor - cart popup must NOT appear
      in preview/editor mode (handled in JS, this is safety)
   --------------------------------------------------------- */
body.elementor-editor-active .sepahan-cart-modal-backdrop,
body.elementor-page-edit .sepahan-cart-modal-backdrop,
.elementor-editor-active .sepahan-cart-modal-backdrop {
    display: none !important;
}

