/* ================================================
   HERO SECTION — MercadoLibre-inspired layout
   ================================================ */

/* Wrapper */
.hero-section-wrapper {
    padding-top: 16px;
    /* Extra bottom padding = space for hanging cards + Featured Products gap */
    padding-bottom: 170px;
}

/* Override Bootstrap container width — hero section fills ~90% of viewport */
.hero-section-wrapper .container {
    max-width: 92%;
    width: 92%;
}

/* Main flex layout: slider + sidebar */
.hero-section {
    display: flex;
    gap: 16px;
    border-radius: 14px;
    overflow: visible;  /* allow cards to hang below slider */
}

/* ===== LEFT: Slider Area ===== */
.hero-slider-area {
    flex: 0 0 75%;
    max-width: 75%;
    position: relative;
    /* overflow: visible — lets the product cards hang below */
    overflow: visible;
    background: transparent;
}

/* Inner clip wrapper — clips the banner images with rounded corners */
.hero-slider-clip {
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    background: #1a1a2e;
}

.hero-slider-area .owl-carousel .owl-stage-outer {
    border-radius: 14px;
}

.hero-slide {
    position: relative;
    display: block;
}

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

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

/* ===== Slider Nav ===== */
.hero-slider-clip .owl-nav button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    width: 40px;
    height: 40px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 20px !important;
    color: #333 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.25s ease;
    z-index: 20;
    border: none !important;
    margin: 0 !important;
}

.hero-slider-clip .owl-prev { left: 12px; }
.hero-slider-clip .owl-next { right: 12px; }

.hero-slider-clip .owl-nav button:hover {
    background: #fff !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
    transform: translateY(-50%) scale(1.08);
}

.hero-slider-clip .owl-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 5;
}

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

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

/* ================================================
   PRODUCT CARDS — Centered overlay at slider bottom
   ================================================ */

/* Gradient scrim — only covers bottom area where cards sit */
.hero-products-overlay {
    position: absolute;
    /* Hang below the slider: push cards so info text is outside slider */
    bottom: -120px;
    left: 0;
    right: 0;
    z-index: 20;
    padding: 0 16px;            /* less side padding = bigger cards */
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Inner row — max-width keeps cards centered with equal space each side */
.hero-products-inner {
    display: flex;
    gap: 18px;
    width: 100%;
    max-width: 96%;             /* wider = bigger cards */
    margin: 0 auto;
    justify-content: center;
}

/* ===== Animations ===== */
@keyframes heroCardShimmer {
    0%   { transform: translateX(-100%) skewX(-12deg); }
    100% { transform: translateX(250%) skewX(-12deg); }
}

@keyframes heroBorderPulse {
    0%, 100% {
        box-shadow: 0 4px 24px rgba(59, 130, 246, 0.18),
                    0 0 0 1.5px rgba(59, 130, 246, 0.28);
    }
    50% {
        box-shadow: 0 8px 36px rgba(99, 102, 241, 0.26),
                    0 0 0 2px rgba(99, 102, 241, 0.38);
    }
}

/* ===== Single Card ===== */
.hero-product-card {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    color: inherit !important;
    position: relative;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    border: 1.5px solid rgba(59, 130, 246, 0.16);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.18),
        0 2px 8px rgba(0, 0, 0, 0.10),
        0 0 0 1px rgba(59, 130, 246, 0.08);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.35s ease,
                border-color 0.35s ease;
    cursor: pointer;
}

/* Shimmer line */
.hero-product-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.55), transparent);
    transform: skewX(-12deg);
    z-index: 4;
    pointer-events: none;
    opacity: 0;
}

.hero-product-card:hover::after {
    opacity: 1;
    animation: heroCardShimmer 0.7s ease-in-out;
}

/* Hover */
.hero-product-card:hover {
    transform: translateY(-8px);
    border-color: rgba(59, 130, 246, 0.5);
    animation: heroBorderPulse 2.4s ease-in-out infinite;
}

/* ===== Image Area ===== */
.hero-product-img {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;        /* square = more image height */
    overflow: hidden;
    background: linear-gradient(160deg, #f5f8ff 0%, #eef1f8 100%);
    flex-shrink: 0;
}

.hero-product-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(59,130,246,0.06), rgba(99,102,241,0.03));
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 2;
    pointer-events: none;
}

.hero-product-card:hover .hero-product-img-overlay {
    opacity: 1;
}

.hero-product-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;        /* show full product, no crop */
    padding: 12px;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.hero-product-card:hover .hero-product-img img {
    transform: scale(1.08);
}

/* ===== Discount Badge ===== */
.hero-discount-badge {
    position: absolute;
    top: 9px;
    left: 9px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 9px;
    border-radius: 8px;
    letter-spacing: 0.4px;
    line-height: 1.3;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

/* ===== Info Block ===== */
.hero-product-info {
    padding: 9px 11px 11px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #fff;
    border-top: 1px solid rgba(59, 130, 246, 0.08);
}

.hero-product-name {
    font-size: 13.5px;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    color: #1e293b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
    letter-spacing: -0.01em;
}

.hero-product-card:hover .hero-product-name {
    color: #2563eb;
}

.hero-product-pricing {
    display: flex;
    align-items: baseline;
    gap: 5px;
    flex-wrap: wrap;
}

.hero-product-price {
    font-size: 16px;
    font-weight: 900;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
}

.hero-product-price-old {
    font-size: 11px;
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 500;
    -webkit-text-fill-color: #94a3b8;
}

/* ===== RIGHT: Sidebar Ads — 2-slot grid ===== */
.hero-sidebar {
    flex: 0 0 calc(25% - 16px);
    max-width: calc(25% - 16px);
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 16px;
    height: 600px;   /* matches slider height */
}

.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;   /* allow grid to control height */
}

.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;
    /* Prevent right-click context menu from showing video controls */
    -webkit-user-select: none;
    user-select: none;
}

/* Transparent link overlay sits on top of video, intercepts clicks for navigation */
.hero-ad-link-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: block;
    cursor: pointer;
}

/* Image ad link */
.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;                /* above link overlay */
}

.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;
}

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

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

    .hero-slider-area {
        flex: 0 0 auto;
        max-width: 100%;
    }

    .hero-slide img {
        height: 420px;
    }

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

    .hero-products-overlay {
        padding: 16px 28px 16px;
    }

    .hero-products-inner {
        max-width: 94%;
        gap: 10px;
    }

    /* Sidebar goes horizontal (2 cols) on tablet */
    .hero-sidebar {
        flex: 0 0 auto;
        max-width: 100%;
        height: auto;
        grid-template-rows: none;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

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

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

    .hero-section {
        gap: 10px;
        border-radius: 10px;
    }

    .hero-slider-area {
        border-radius: 10px;
    }

    .hero-slide img {
        height: 260px;
    }

    .hero-products-overlay {
        padding: 12px 12px 12px;
    }

    .hero-products-inner {
        max-width: 100%;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding-bottom: 2px;
    }

    .hero-products-inner::-webkit-scrollbar {
        display: none;
    }

    .hero-product-card {
        flex: 0 0 120px;
        min-width: 120px;
    }

    .hero-product-name {
        font-size: 11px;
        -webkit-line-clamp: 2;
    }

    .hero-product-price {
        font-size: 13px;
    }

    .hero-discount-badge {
        font-size: 10px;
        padding: 3px 7px;
    }

    /* Mobile sidebar: 2-col grid */
    .hero-sidebar {
        height: auto;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: none;
        gap: 10px;
    }

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

    .hero-slider-area .owl-nav button {
        width: 32px;
        height: 32px;
        font-size: 16px !important;
    }

    .hero-slider-area .owl-dots {
        bottom: 8px;
    }

    .hero-slider-area .owl-dots .owl-dot span {
        width: 8px;
        height: 8px;
    }

    .hero-slider-area .owl-dots .owl-dot.active span {
        width: 22px;
    }
}

/* Small mobile */
@media (max-width: 400px) {
    .hero-slide img {
        height: 200px;
    }

    .hero-product-card {
        flex: 0 0 105px;
        min-width: 105px;
    }

    .hero-product-name {
        font-size: 10px;
    }

    .hero-product-price {
        font-size: 12px;
    }
}
