* {
    box-sizing: border-box
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
}


/* main hero slider area */
/* main hero slider area */
.slider-container-hero {
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
    margin: auto;
}

.slider-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #102c38;
}

.slides-wrapper-hero {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide-hero {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.65s cubic-bezier(0.25, 0.1, 0.15, 1.0);
    will-change: transform;
    pointer-events: none;
}

.slide-hero {
    transform: translateX(100%);
    /* default: hidden off right */
    z-index: 5;
}

.slide-hero.active-hero {
    transform: translateX(0);
    /* current slide centered */
    z-index: 10;
}

.slide-hero.exit-left-hero {
    transform: translateX(-100%);
    /* exiting to left */
    z-index: 8;
}

/* navigation row */
.nav-row-hero {
    width: 100%;
    position: absolute;
    bottom: 1em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.4rem;
    padding: 0 0.5rem;
    z-index: 20;
}

.dashes-hero {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 20;
    margin: auto;
}

.dash-hero {
    width: .5rem;
    height: 0.5rem;
    border-radius: 1rem;
    background: #666;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.25s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    z-index: 20;
}

.dash-hero.active-dash-hero {
    background: #333;
}

.dash-hero:hover {
    background: rgba(255, 255, 255, 0.7);
}

/* arrow buttons */
.arrow-hero {
    background: #ddd3;
    position: absolute;
    top: 45%;
    border: 1px solid #00000000;
    width: 1.6rem;
    height: 3.2rem;
    border-radius: .1em;
    font-size: 1em;
    font-weight: 400;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.5);
    line-height: 1;
    user-select: none;
    z-index: 15;
}

.next-arrow-hero {
    right: 0;
}

.previous-arrow-hero {
    left: 0;
}

.arrow-hero:hover {
    background: #fff6;
    border: 1px solid #334;
}

.arrow-hero:active {
    transform: scale(0.98);
    background: #1f4155;
}

/* Slider 2 */
.slider-wrapper {
    width: 100%;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(2px);
    padding: 1.8rem 1.5rem;
    box-shadow: 0 20px 35px -8px rgba(0, 10, 30, 0.3);
}

.slider-wrapper:first-of-type {
    background: rgba(230, 240, 255, 0.5);
}

.slider-wrapper:last-of-type {
    background: rgba(240, 230, 255, 0.5);
}

h2 {
    margin: 0 0 0.5rem 0.25rem;
    font-weight: 500;
    color: #1e293b;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    background: #334155;
    color: white;
    font-size: 0.7rem;
    font-weight: 400;
    padding: 0.2rem 0.8rem;
    border-radius: 30px;
    opacity: 0.8;
}

.direction-badge {
    background: #2d3b4f;
    color: #a5f3fc;
    font-size: 0.7rem;
    padding: 0.2rem 1rem 0.2rem 0.7rem;
    border-radius: 30px;
    margin-left: 0.5rem;
    gap: 0.3rem;
    display: inline-flex;
    align-items: center;
}

.direction-badge::before {
    content: "▶";
    font-size: 0.6rem;
    background: #38bdf8;
    color: #0f172a;
    padding: 0.2rem 0.4rem;
    border-radius: 50%;
    margin-right: 0.3rem;
}

.direction-badge.right::before {
    transform: rotate(180deg);
}

/* main slider container */
.slider-container1 {
    width: 100%;
    overflow: hidden;
    border-radius: 1.5rem;
    background: #0f172a10;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.02), 0 8px 20px rgba(0, 10, 30, 0.1);
    cursor: grab;
    touch-action: pan-y pinch-zoom;
}

.slider-container1.dragging,
.slider-container1.dragging * {
    cursor: grabbing !important;
    user-select: none;
    /* Prevent text selection while dragging */
    -webkit-user-select: none;
}

.slider-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform;
}

.slider-track.no-transition {
    transition: none !important;
}

.slide {
    flex: 0 0 25%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem;
    /* Remove fixed aspect ratio */
}

/* Card height based on viewport */
.slide .card {
    background-color: #fff;
    display: block;
    width: 100%;
    height: auto;
    /* Let height be determined by content */
    /* min-height: 380px;  */
    max-height: 500px;
    /* Maximum height for large screens */
    border-radius: 1.2rem;
    box-shadow: 0 8px 16px -6px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    transition: transform 0.3s ease-out, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
    z-index: 1;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.dragging .card,
.dragging .product-image,
.dragging .product-info {
    cursor: grabbing !important;
}

/* Responsive card heights */
@media screen and (min-width: 2000px) {
    .slide {
        flex: 1 0 12.5%;
        width: 12.5%;
    }
}

@media screen and (max-width: 1999px) {
    .slide {
        flex: 1 0 12.5%;
        width: 12.5%;
    }
}

@media screen and (max-width: 1500px) {
    .slide {
        flex: 1 0 16%;
        width: 16%;
    }
}

@media screen and (max-width: 1200px) {
    .slide {
        flex: 1 0 25%;
        width: 25%;
    }
}

@media screen and (max-width: 900px) {
    .slide {
        flex: 1 0 25%;
    }

    .slide .card {
        min-height: 300px;
        max-height: 380px;
    }
}

@media screen and (max-width: 700px) {
    .slide {
        flex: 1 0 33%;
    }

    .slide .card {
        min-height: 280px;
        max-height: 350px;
    }
}

@media screen and (max-width: 500px) {
    .slide {
        flex: 1 0 50%;
    }

    .slide .card {
        min-height: 260px;
        max-height: 320px;
    }
}

/* Product image - now with flexible height */
.product-image {
    height: 180px;
    /* Fixed height instead of percentage */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 0.3s ease;
    position: relative;
    z-index: 1;
}


/* Only show video when both loaded AND hovered */
.slide.video-loaded:hover .product-video {
    opacity: 1;
    z-index: 3;
}

.slide.video-loaded:hover .product-image {
    opacity: 0;
}


/* Product info - flexible based on content */
.product-info {
    padding: 0.8rem;
    background: white;
    flex: 1;
    /* Take remaining space */
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    position: relative;
    z-index: 2;
}

/* Better text handling */
.product-description {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.2rem;
    /* Reserve space for 2 lines */
}

.product-seller {
    font-size: 0.7rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.price-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.2rem 0;
}

.product-price {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.product-discount {
    font-size: 0.7rem;
    background: #22c55e;
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 20px;
    font-weight: 500;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.75rem;
    color: #f59e0b;
    flex-wrap: wrap;
}

.product-rating span {
    color: #64748b;
    margin-left: 0.1rem;
    font-size: 0.7rem;
}

.stars {
    display: flex;
    gap: 0.1rem;
    flex-shrink: 0;
}

.star-filled {
    color: #f59e0b;
}

.star-empty {
    color: #e2e8f0;
}

/* Only show video on hover for slides that have video */
.slide:has(video) .product-image {
    transition: opacity 0.3s ease;
}

.slide:has(video):hover .product-video {
    opacity: 1;
    z-index: 3;
}

.slide:has(video):hover .product-image {
    opacity: 1;
}

/* Product info - always visible */
.product-info {
    padding: 0.8rem;
    background: white;
    height: 40%;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    position: relative;
    z-index: 2;
}

.product-description {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-seller {
    font-size: 0.7rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.product-seller::before {
    content: "👤";
    font-size: 0.6rem;
    opacity: 0.7;
}

.price-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.product-price {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.product-discount {
    font-size: 0.7rem;
    background: #22c55e;
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 20px;
    font-weight: 500;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.75rem;
    color: #f59e0b;
}

.product-rating span {
    color: #64748b;
    margin-left: 0.1rem;
}

.stars {
    display: flex;
    gap: 0.1rem;
}

.star-filled {
    color: #f59e0b;
}

.star-empty {
    color: #e2e8f0;
}

.drag-hint {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    margin-top: 1rem;
    color: #475569;
    font-size: 0.85rem;
    align-items: center;
}

.video-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.video-badge svg {
    width: 16px;
    height: 16px;
    fill: white;
    margin-left: 2px;
    /* Slight offset for play icon */
}

.slide:hover .video-badge {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.9);
}

/* Loading indicator - shown while video loads */
.video-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 180px;
    /* Match video height */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    /* Higher z-index to appear above image */
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    background: transparent;
}

.slide.loading .video-loading {
    opacity: 1;
}

/* Adjust loading height for different screens */
/* Adjust heights for different screens */
@media screen and (max-width: 700px) {

    .product-image,
    .product-video,
    .video-loading {
        height: 150px;
    }
}

@media screen and (max-width: 500px) {

    .product-image,
    .product-video,
    .video-loading {
        height: 130px;
    }
}

@media screen and (min-width: 2000px) {

    .product-image,
    .product-video,
    .video-loading {
        height: 220px;
    }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 1s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    /* Add shadow for better visibility */
    background: rgba(0, 0, 0, 0.3);
    /* Semi-transparent background for spinner */
    backdrop-filter: blur(4px);
    /* Slight blur effect behind spinner */
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Adjust loading height for different screens */
@media screen and (max-width: 700px) {
    .video-loading {
        height: 150px;
    }
}

@media screen and (max-width: 500px) {
    .video-loading {
        height: 130px;
    }
}

@media screen and (min-width: 2000px) {
    .video-loading {
        height: 220px;
    }
}

.product-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 180px;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
    background-color: transparent;
}


.slide:has(video).video-loaded .product-video {
    opacity: 0;
}

.slide:has(video).video-loaded:hover .product-video {
    opacity: 1;
    z-index: 3;
}

.slide:has(video).video-loaded:hover .product-image {
    opacity: 0;
}

/* Show video when playing on desktop */
.slide.video-loaded.video-playing .product-video {
    opacity: 1;
    z-index: 3;
}

.slide.video-loaded.video-playing .product-image {
    opacity: 0;
}

@media (hover: none) and (pointer: coarse) {
    .video-badge {
        width: 44px;
        /* Larger touch target */
        height: 44px;
        background: rgba(0, 0, 0, 0.8);
        z-index: 30;
        /* Higher z-index to ensure tapability */
        pointer-events: auto;
        /* Make it clickable on mobile */
        cursor: pointer;
    }

    .video-badge:active {
        transform: scale(0.95);
    }

    /* Prevent card link from opening when badge is tapped */
    .video-badge~* {
        pointer-events: none;
    }
}

/* Mobile video playing state */
.video-badge.playing {
    opacity: 0.5;
    background: rgba(0, 0, 0, 0.9);
}

/* Ensure video is visible on mobile when playing */
@media (hover: none) and (pointer: coarse) {
    .slide .product-video {
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .slide .product-video[style*="playing"] {
        opacity: 1;
        z-index: 25;
    }

    .slide .product-image {
        transition: opacity 0.3s ease;
    }

    .slide.video-playing .product-image {
        opacity: 0;
    }

    .slide.video-playing .product-video {
        opacity: 1;
        z-index: 25;
    }
}


/* main slider container – all classes end with 'merchant' suffix */
.slider-merchant {
    width: 100%;
    max-width: 1920px;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.slider-viewport-merchant {
    overflow: hidden;
    cursor: grab;
    touch-action: pan-y pinch-zoom;
}

.slider-viewport-merchant.dragging-merchant {
    cursor: grabbing;
}

.slider-viewport-merchant.dragging-merchant * {
    pointer-events: none !important;
    /* Prevent children from interfering with drag */
}

.slider-track-merchant {
    display: flex;
    gap: 16px;
    transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
    will-change: transform;
}

/* slide card */
.slide-merchant {
    flex: 0 0 calc(100% - 12px);
    max-width: 400px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.02);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* row 1: master + two small squares */
.slide-row-1-merchant {
    display: flex;
    gap: 8px;
    width: 100%;
}

.master-product-merchant {
    width: 60%;
    aspect-ratio: 1 / 1;
    background: #e6eef9;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: linear-gradient(145deg, #dfe8f0 0%, #f0f5fb 100%);
    font-size: 0.9rem;
    text-align: center;
    padding: 0.25rem;
    text-decoration: none;
    color: #1e2f4e;
    font-weight: 500;
}

.master-product-merchant:hover {
    background: #d0ddec;
}

.small-products-col-merchant {
    width: 40%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.small-product-merchant {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #dde5ef;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: linear-gradient(145deg, #d3dde9, #e5eef7);
    font-size: 0.8rem;
    color: #1f3a5f;
    font-weight: 500;
    text-decoration: none;
}

.small-product-merchant:hover {
    background: #c8d3e2;
}

/* row2: logo, shop, buttons */
.slide-row-2-merchant {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    flex-wrap: wrap;
}

.logo-square-merchant {
    width: 52px;
    height: 52px;
    background: #b7c8dd;
    border-radius: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #253c5c;
    font-weight: 600;
    font-size: 1.4rem;
    text-decoration: none;
}

.shop-details-merchant {
    flex: 1;
    min-width: 120px;
}

.shop-name-merchant {
    font-weight: 700;
    font-size: 1.1rem;
    color: #0f263e;
    line-height: 1.3;
    text-decoration: none;
}

.rating-merchant {
    font-size: 0.85rem;
    color: #5e6f88;
    display: flex;
    align-items: center;
    gap: 4px;
}

.followers-merchant {
    font-size: 0.75rem;
    color: #798aa5;
}

.action-group-merchant {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.explore-btn-merchant {
    background: #1e2f4e;
    border: none;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 18px;
    border-radius: 40px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 6px 14px rgba(18, 40, 70, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    display: inline-block;
}

.explore-btn-merchant:hover {
    background: #143048;
    transform: scale(0.97);
}

.heart-btn-merchant {
    background: none;
    border: 1.5px solid #d0dae8;
    font-size: 1.5rem;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adc0da;
    background: white;
    cursor: pointer;
    transition: 0.2s;
    padding-bottom: 4px;
    text-decoration: none;
    pointer-events: auto;
    /* Ensure buttons remain clickable when not dragging */
}

.heart-btn-merchant::before {
    content: "♡";
}

.heart-btn-merchant:hover {
    border-color: #ff8ba3;
    color: #ff6b8b;
}

/* arrows */
.arrow-merchant {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 44px;
    box-shadow: 0 6px 18px rgba(0, 10, 30, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    border: 1px solid rgba(0, 0, 0, 0.02);
    color: #1f3a60;
    line-height: 1;
}

.arrow-left-merchant {
    left: 8px;
}

.arrow-right-merchant {
    right: 8px;
}

@media (max-width: 480px) {
    .arrow-merchant {
        width: 38px;
        height: 38px;
        font-size: 1.8rem;
    }
}

/* responsive slides */
@media (min-width: 640px) {
    .slide-merchant {
        flex: 0 0 calc((100% - 16px * 1) / 2);
    }
}

@media (min-width: 1024px) {
    .slide-merchant {
        flex: 0 0 calc((100% - 16px * 2) / 3);
    }
}

@media (min-width: 1400px) {
    .slide-merchant {
        flex: 0 0 calc((100% - 16px * 3) / 4);
    }
}

.demo-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    width: 100%;
    justify-content: center;
}

.demo-wrapper .slider-merchant {
    flex: 1 1 500px;
    min-width: 300px;
}

h3 {
    margin-bottom: 0.5rem;
    color: #1e2f4e;
}




/* Responsive styles */
