/* ================================================
   HERO SECTION — 3-Column Layout
   Left: Recommended Product | Center: Banner + Products | Right: 2 Ads
   ================================================ */

/* Wrapper */
.hero-section-wrapper {
    padding-top: 16px;
    padding-bottom: 20px;
}

/* Override Bootstrap container width */
.hero-section-wrapper .container {
    max-width: 92%;
    width: 92%;
}

/* Main flex layout: 3 columns */
.hero-section {
    display: flex;
    gap: 16px;
    border-radius: 14px;
    overflow: visible;
    align-items: stretch;
    height: calc(100vh - 160px);
    min-height: 500px;
    max-height: 700px;
}

/* ================================================
   LEFT COLUMN — Recommended Product / Deal of the Day
   Uses existing .deal_of_the_day / .recommended-product-card styles
   ================================================ */
.hero-left-col {
    flex: 0 0 22%;
    max-width: 22%;
    display: flex;
}

/* Ensure the card fills the hero height and scrolls if content overflows */
.hero-left-col .deal_of_the_day {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 10px;
}

.hero-left-col .recommended-product-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ================================================
   CENTER COLUMN — Banner Slider + 3 Products
   ================================================ */
.hero-center-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

/* --- Row 1: Banner Slider --- */
.hero-center-banner {
    flex: 1;
    min-height: 0;
}

.hero-center-banner-clip {
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    background: #1a1a2e;
    height: 100%;
}

.hero-center-banner-clip .owl-carousel,
.hero-center-banner-clip .owl-stage-outer,
.hero-center-banner-clip .owl-stage,
.hero-center-banner-clip .owl-item {
    height: 100%;
}

.hero-center-slide {
    position: relative;
    display: block;
    height: 100%;
}

.hero-center-slide a {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-center-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Slider Nav Arrows */
.hero-center-banner-clip .owl-nav button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4) !important;
    border-radius: 0 !important;
    width: 40px;
    height: 60px;
    box-shadow: none !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 20px !important;
    color: #fff !important;
    transition: all 0.3s ease;
    z-index: 20;
    border: none !important;
    margin: 0 !important;
}

.hero-center-banner-clip .owl-nav button * {
    background: transparent !important;
    box-shadow: none !important;
}

.hero-center-banner-clip .owl-prev { left: 10px; }
.hero-center-banner-clip .owl-next { right: 10px; }

.hero-center-banner-clip .owl-nav button:hover {
    background: rgba(0, 0, 0, 0.7) !important;
    transform: translateY(-50%);
}

/* Slider Dots */
.hero-center-banner-clip .owl-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 25;
}

.hero-center-banner-clip .owl-dots .owl-dot span {
    width: 9px;
    height: 9px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 5px;
    display: block;
    transition: all 0.3s ease;
}

.hero-center-banner-clip .owl-dots .owl-dot.active span {
    background: #fff;
    width: 24px;
    border-radius: 5px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* --- Row 2: 3 Latest Product Cards --- */
.hero-center-products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    flex: 0 0 auto;
}

.hero-center-product-card {
    background: #f4f9ff;
    border: 1px solid #c2deff;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.hero-center-product-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 128, 0.1);
    transform: translateY(-2px);
}

.hero-center-product-card .product-single-hover {
    border-radius: 0;
    border: none;
}

/* ── Compact product cards inside hero center ─────────────── */
.hero-center-product-card .ml-card-img {
    aspect-ratio: 4 / 3 !important;
    padding: 8px !important;
}

.hero-center-product-card .ml-card-img a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
}

.hero-center-product-card .ml-card-img img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

.hero-center-product-card .ml-card-body {
    padding: 6px 12px 2px !important;
}

.hero-center-product-card .ml-card-title {
    font-size: 13px !important;
    margin-bottom: 3px !important;
    -webkit-line-clamp: 2;
}

.hero-center-product-card .ml-price-original {
    font-size: 11px !important;
    margin-bottom: 0 !important;
}

.hero-center-product-card .ml-price-row {
    margin-bottom: 1px !important;
}

.hero-center-product-card .ml-price-current,
.hero-center-product-card .ml-price-single {
    font-size: 18px !important;
}

.hero-center-product-card .ml-price-off {
    font-size: 11px !important;
}

.hero-center-product-card .ml-installments {
    font-size: 11px !important;
    margin-top: 1px !important;
}

.hero-center-product-card .ml-shipping {
    font-size: 11px !important;
    margin-top: 2px !important;
}

.hero-center-product-card .ml-card-footer {
    padding: 2px 12px 6px !important;
}

.hero-center-product-card .atc-add-btn {
    height: 28px !important;
    font-size: 13px !important;
}

.hero-center-product-card .atc-qty-delete,
.hero-center-product-card .atc-qty-plus {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
}

.hero-center-product-card .atc-qty-display {
    height: 28px !important;
    font-size: 11px !important;
}

.hero-center-product-card .ml-discount-badge {
    font-size: 11px !important;
    padding: 1px 6px !important;
}

/* ================================================
   RIGHT COLUMN — Ad Sidebar (2 slots)
   ================================================ */
.hero-right-col {
    flex: 0 0 22%;
    max-width: 22%;
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 16px;
}

.hero-ad-slot {
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    background: #f0f0f0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    min-height: 0;
}

.hero-ad-slot:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
    transform: translateY(-2px);
}

.hero-ad-slot a {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-ad-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-ad-slot video,
.hero-ad-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    background: #000;
    -webkit-user-select: none;
    user-select: none;
}

/* Add a gradient border specifically for video slots */
.hero-ad-video-slot {
    background: linear-gradient(135deg, var(--web-primary) 0%, var(--web-secondary) 100%);
}

.hero-ad-video-slot video,
.hero-ad-video-slot .hero-ad-video {
    inset: 4px;
    width: calc(100% - 8px);
    height: calc(100% - 8px);
    border-radius: 10px;
}

.hero-ad-link-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: block;
    cursor: pointer;
}

.hero-ad-img-link {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}

.hero-ad-img-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-ad-slot .hero-ad-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    z-index: 6;
}

.hero-ad-video-slot .hero-ad-badge {
    right: auto;
    left: 8px;
}

/* Custom Video Controls overlay */
.custom-video-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: opacity 0.3s ease;
}


.cvc-btn {
    background: transparent;
    border: none;
    color: #333;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, color 0.2s ease;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.cvc-btn:hover {
    transform: scale(1.1);
    color: #000;
}

.hero-ad-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #dfe6e9 0%, #b2bec3 100%);
    color: #636e72;
    font-size: 14px;
    font-weight: 500;
}

/* ================================================
   HERO VIDEO MODAL
   ================================================ */
.hero-ad-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.hero-ad-modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.hero-ad-modal-dialog {
    position: relative;
    height: 85vh; /* Base height */
    aspect-ratio: 9 / 16; /* Exact Instagram Reel aspect ratio */
    width: auto;
    max-width: 90vw; /* Prevent overflow on small screens */
    max-height: calc(90vw * 16 / 9); /* Maintain 9:16 on small screens */
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(60px) scale(0.95);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    transition-delay: 0.1s;
    display: flex;
    flex-direction: column;
}

.hero-ad-modal-backdrop.show .hero-ad-modal-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.hero-ad-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.hero-ad-modal-close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg);
}

.hero-ad-modal-video-container {
    width: 100%;
    flex: 1; /* Takes all available height except footer */
    min-height: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* Added for absolute positioning of controls */
}

.hero-ad-modal-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover ensures it fills the portrait shape */
    outline: none;
    cursor: pointer;
}

/* Custom Modal Video Controls Overlay */
.hero-ad-modal-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    display: flex;
    flex-direction: column;
    padding: 24px 16px 12px 16px;
    z-index: 10;
}

.modal-video-progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 12px;
    position: relative;
    transition: height 0.2s ease;
}

.modal-video-progress-container:hover {
    height: 8px;
}

.modal-video-progress-bar {
    height: 100%;
    background: var(--web-primary, #007bff);
    border-radius: 4px;
    width: 0%;
    pointer-events: none; /* Let clicks pass to container */
}

.modal-video-controls-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.modal-video-btn {
    background: transparent;
    border: none;
    color: #fff;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.modal-video-btn:hover {
    opacity: 1;
    transform: scale(1.15);
    background: rgba(255, 255, 255, 0.1);
}

.hero-ad-modal-footer {
    padding: 20px;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 1px solid #eee;
}

.hero-ad-modal-footer .btn {
    padding: 10px 30px;
    font-size: 16px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 128, 0.15);
    transition: all 0.3s ease;
}

.hero-ad-modal-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 128, 0.25);
}

/* ================================================
   RESPONSIVE
   ================================================ */

/* Tablet */
@media (max-width: 991px) {
    .hero-section {
        flex-wrap: wrap;
        height: auto;
        min-height: auto;
        max-height: none;
    }

    .hero-section-wrapper .container {
        max-width: 96%;
        width: 96%;
    }

    .hero-left-col {
        flex: 0 0 100%;
        max-width: 100%;
        /* Let the deal of the day adapt naturally */
    }

    .hero-center-col {
        flex: 0 0 calc(60% - 8px);
        max-width: calc(60% - 8px);
    }
    
    .hero-center-banner-clip {
        min-height: auto;
        height: auto;
    }

    .hero-center-banner-clip .owl-carousel,
    .hero-center-banner-clip .owl-stage-outer,
    .hero-center-banner-clip .owl-stage,
    .hero-center-banner-clip .owl-item {
        height: auto;
    }

    .hero-center-slide {
        height: auto;
    }

    .hero-center-slide img {
        height: auto;
        object-fit: cover;
    }

    .hero-right-col {
        flex: 0 0 calc(40% - 8px);
        max-width: calc(40% - 8px);
        grid-template-rows: 1fr 1fr;
    }

    .hero-ad-slot {
        min-height: 140px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .hero-section-wrapper {
        padding-top: 8px;
        padding-bottom: 12px;
    }

    .hero-section {
        flex-direction: column;
        gap: 10px;
        height: auto;
    }

    .hero-left-col {
        display: none; /* Hide on mobile devices as requested */
    }

    .hero-center-col {
        flex: 0 0 auto;
        max-width: 100%;
    }

    .hero-center-banner-clip {
        aspect-ratio: auto;
        min-height: auto;
        height: auto;
    }

    .hero-right-col {
        flex: 0 0 auto;
        max-width: 100%;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
        gap: 10px;
    }

    /* Make the 3 latest products horizontally scrollable (swipeable) on mobile */
    .hero-center-products {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
        padding-bottom: 8px; /* space for scrollbar */
        scrollbar-width: none; /* Hide scrollbar Firefox */
    }
    
    .hero-center-products::-webkit-scrollbar {
        display: none; /* Hide scrollbar Chrome/Safari */
    }

    .hero-center-product-card {
        flex: 0 0 calc(45% - 12px); /* show 45% of card to reduce size */
        scroll-snap-align: start;
    }

    .hero-center-product-card .ml-card-img {
        aspect-ratio: 4 / 3 !important;
        padding: 6px !important;
    }

    .hero-center-product-card .ml-price-current,
    .hero-center-product-card .ml-price-single {
        font-size: 16px !important;
    }

    .hero-ad-slot {
        min-height: 120px;
        border-radius: 10px;
    }

    .hero-center-banner-clip .owl-nav button {
        width: 36px;
        height: 36px;
        font-size: 17px !important;
    }

    .hero-center-banner-clip .owl-dots {
        bottom: 6px;
    }

    .hero-center-banner-clip .owl-dots .owl-dot span {
        width: 7px;
        height: 7px;
    }

    .hero-center-banner-clip .owl-dots .owl-dot.active span {
        width: 18px;
    }

    /* Responsive buttons on mobile */
    .deal_of_the_day .btn.btn--primary,
    .hero-left-col .btn.btn--primary {
        font-size: 13px;
        padding: 8px 16px;
        width: auto;
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Product card add-to-cart buttons */
    .hero-center-product-card .atc-add-btn,
    .product-with-bg .atc-add-btn {
        font-size: 12px;
        padding: 0 6px;
        height: 32px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hero-center-product-card .atc-qty-delete,
    .hero-center-product-card .atc-qty-plus {
        width: 28px;
        height: 28px;
        min-width: 28px;
        font-size: 13px;
    }

    .hero-center-product-card .atc-qty-display {
        height: 28px;
        font-size: 11px;
        padding: 0 6px;
    }
}

/* Small mobile */
@media (max-width: 400px) {
    .hero-center-product-card {
        flex: 0 0 calc(55% - 12px); /* smaller cards on very small screens */
    }

    /* Tighter buttons on very small screens */
    .deal_of_the_day .btn.btn--primary,
    .hero-left-col .btn.btn--primary {
        font-size: 12px;
        padding: 7px 12px;
    }

    .product-with-bg .atc-add-btn {
        font-size: 11px;
        padding: 0 4px;
        height: 30px;
    }

    .product-with-bg .atc-qty-delete,
    .product-with-bg .atc-qty-plus {
        width: 28px;
        height: 28px;
        min-width: 28px;
        font-size: 13px;
    }

    .product-with-bg .atc-qty-display {
        height: 28px;
        font-size: 11px;
        padding: 0 6px;
    }
}
