/**
 * دیزاین شاپ — تکمیل استایل بدون تغییر کارت محصول (hamta-product-card)
 */

.hamta-design-shop {
    margin-bottom: 2rem;
}

.hamta-design-block {
    margin-bottom: 2.5rem;
}

.hamta-design-head {
    margin-bottom: 1.25rem;
}

.hamta-design-empty {
    color: var(--hamta-muted, #666);
    font-size: 0.95rem;
    margin: 0;
}

/* کاروسل — یک کارت تمام‌عرض در موبایل (مثل گرید فروشگاه)، فلش‌ها روی لبهٔ تصویر */
.hamta-design-carousel {
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    direction: rtl;
}

.hamta-design-carousel__frame {
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.hamta-design-carousel__swiper {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.hamta-design-carousel__swiper .swiper-wrapper {
    align-items: stretch;
}

.hamta-design-carousel__swiper .swiper-slide {
    height: auto;
    box-sizing: border-box;
}

/* قبل از init Swiper (مثلاً Elementor) — پیش‌نمایش چندستونه */
.hamta-design-carousel__swiper:not([data-hamta-swiper="1"]) .swiper-wrapper {
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.hamta-flash-deals__swiper:not([data-hamta-swiper="1"]) .swiper-wrapper {
    gap: 0 !important;
}

.hamta-design-carousel__swiper:not([data-hamta-swiper="1"]) .swiper-slide {
    flex: 0 0 calc((100% - (var(--hamta-per-view, 3) - 1) * 16px) / var(--hamta-per-view, 3));
    max-width: calc((100% - (var(--hamta-per-view, 3) - 1) * 16px) / var(--hamta-per-view, 3));
    scroll-snap-align: start;
}

.hamta-design-carousel__cell {
    width: 100%;
    max-width: 100%;
}

.hamta-design-carousel__cell .hamta-product-card {
    width: 100%;
    max-width: 100%;
    height: 100%;
    margin: 0;
}

.hamta-design-carousel__nav {
    position: absolute !important;
    top: 42% !important;
    margin: 0 !important;
    transform: translateY(-50%) !important;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    padding: 0;
    z-index: 4;
    color: #000;
    background: transparent !important;
    border: none !important;
    border-radius: 0;
    box-shadow: none !important;
    cursor: pointer;
}

.hamta-design-carousel__nav::after {
    font-size: 1.25rem;
    font-weight: 700;
    color: #000;
}

/* RTL: next سمت راست، prev سمت چپ */
.hamta-design-carousel__nav--next {
    right: 0.5rem !important;
    left: auto !important;
}

.hamta-design-carousel__nav--prev {
    left: 0.5rem !important;
    right: auto !important;
}

.hamta-design-carousel__nav:hover,
.hamta-design-carousel__nav:focus-visible {
    background: transparent !important;
    color: #000;
    opacity: 0.75;
}

.hamta-design-carousel__pagination {
    position: static !important;
    bottom: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100%;
    margin: 0 !important;
    margin-top: 1rem !important;
    padding-top: 0.4rem;
    box-sizing: border-box;
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
}

.hamta-design-carousel__pagination.swiper-pagination-horizontal {
    width: 100% !important;
}

.hamta-design-carousel__pagination .swiper-pagination-bullet {
    background: var(--hamta-accent, #2271b1);
    opacity: 0.35;
}

.hamta-design-carousel__pagination .swiper-pagination-bullet-active {
    opacity: 1;
}

.hamta-design-carousel--single .hamta-design-carousel__nav {
    display: none;
}

.hamta-design-carousel--single .hamta-design-carousel__pagination {
    display: none !important;
}

@media (min-width: 768px) {
    .hamta-design-carousel__frame:not(.hamta-flash-deals__frame) {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: clamp(10px, 1.5vw, 18px);
    }

    .hamta-design-carousel__frame:not(.hamta-flash-deals__frame) .hamta-design-carousel__swiper {
        flex: 1 1 auto;
        min-width: 0;
    }

    .hamta-design-carousel__frame:not(.hamta-flash-deals__frame) .hamta-design-carousel__nav {
        position: relative !important;
        top: auto !important;
        transform: none !important;
        inset: auto !important;
        flex: 0 0 auto;
        width: 2.75rem;
        height: 2.75rem;
        min-width: 2.75rem;
        align-self: center;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .hamta-design-carousel__frame:not(.hamta-flash-deals__frame) .hamta-design-carousel__nav--prev,
    .hamta-design-carousel__frame:not(.hamta-flash-deals__frame) .hamta-design-carousel__nav--next {
        right: auto !important;
        left: auto !important;
    }
}

/* اسلایدشو */
.hamta-design-slider {
    position: relative;
    margin-bottom: 1.5rem;
}

.hamta-design-slider__pane {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f0f0f0;
}

.hamta-design-slider__pane--desktop {
    display: none;
}

.hamta-design-slider__pane--mobile {
    display: block;
}

@media (min-width: 768px) {
    .hamta-design-slider__pane--desktop {
        display: block;
    }

    .hamta-design-slider__pane--mobile {
        display: none;
    }
}

.hamta-design-slider__slides {
    position: relative;
    height: var(--hamta-design-slide-h, 220px);
}

.hamta-design-slider__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s ease, visibility 0.45s ease;
    z-index: 0;
}

.hamta-design-slider__slide.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.hamta-design-slider__link {
    display: block;
    width: 100%;
    height: 100%;
}

.hamta-design-slider__link img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hamta-design-slider__controls {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 0.5rem;
}

.hamta-design-slider__btn {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    border: 0;
    background: rgba(255, 255, 255, 0.92);
    color: #222;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.hamta-design-slider__btn:hover {
    background: #fff;
}
