/**
 * Module: Promo Showcase
 * Architecture: 70vh Locked Flexbox Layout + Native Woo Block Scroll-Snap
 */

:root {
    --vtx-promo-bg: #0a0a0a;
    --vtx-promo-text: #cccccc;
    --vtx-promo-title: #ffffff;
    --vtx-promo-accent: #00ff77;
    --vtx-promo-radius: 12px;
    --vtx-promo-bg-img: none;
}

/* ==============================================
 * MAIN WRAPPER (Locked to 70vh)
 * ============================================== */
.vtx-promo-showcase {
    position: relative;
    width: 100%;
    height: 70vh; /* Strict 70% viewport height */
    min-height: 650px; /* Safe fallback so it doesn't break on tiny laptops */
    border-radius: 16px;
    overflow: hidden;
    container-type: inline-size;
    
    background-color: var(--vtx-promo-bg);
    background-image: var(--vtx-promo-bg-img);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Overlay gradient for text readability */
.vtx-promo-showcase::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--vtx-promo-bg) 15%, color-mix(in srgb, var(--vtx-promo-bg) 60%, transparent) 100%);
    z-index: 1;
}

/* Inner wrapper controls maximum stretch */
.vtx-promo__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1440px; /* Prevents ultra-wide monitor blowout */
    margin: 0 auto;
    padding: clamp(15px, 3vw, 30px);
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%; /* Forces inner content to respect the 70vh parent */
}

/* ==============================================
 * TOPBAR
 * ============================================== */
.vtx-promo__topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* Prevents header from squishing */
}

.vtx-promo__heading {
    color: var(--vtx-promo-title);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.vtx-promo__view-all {
    color: var(--vtx-promo-text);
    font-size: 0.9rem;
    text-decoration: none;
    border: 1px solid color-mix(in srgb, var(--vtx-promo-text) 30%, transparent);
    padding: 6px 16px;
    border-radius: 30px;
    transition: all 0.2s ease;
}

.vtx-promo__view-all:hover {
    color: var(--vtx-promo-title);
    border-color: color-mix(in srgb, var(--vtx-promo-title) 80%, transparent);
}

/* ==============================================
 * MEDIA SPLIT (Image Left, Video Right)
 * ============================================== */
.vtx-promo__media-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    
    /* CRITICAL FIX: Forces media to compress instead of exploding height */
    flex: 1 1 auto; 
    min-height: 0; 
}

@container (min-width: 768px) {
    .vtx-promo__media-split {
        grid-template-columns: 3fr 7fr;
        align-items: stretch;
    }
}

.vtx-promo__poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--vtx-promo-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.vtx-promo__video iframe {
    width: 100%;
    height: 100%;
    border-radius: var(--vtx-promo-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* ==============================================
 * INFO & CTA
 * ============================================== */
.vtx-promo__info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    flex-shrink: 0; /* Prevents text from squishing */
}

.vtx-promo__title {
    color: var(--vtx-promo-title);
    font-size: clamp(1.3rem, 3cqw, 2rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.vtx-promo__desc {
    color: var(--vtx-promo-text);
    margin: 0;
    font-size: 0.9rem;
    max-width: 85%;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Truncates long text to save space */
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

.vtx-promo__cta {
    display: inline-flex;
    background: var(--vtx-promo-accent);
    color: #000;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    text-decoration: none;
    transition: opacity 0.2s ease;
    margin-top: 4px;
}

.vtx-promo__cta:hover {
    opacity: 0.8;
}

/* ==============================================
 * NATIVE WOOCOMMERCE BLOCK CAROUSEL
 * ============================================== */
.vtx-promo-showcase.has-css-snap ul.products,
.vtx-promo-showcase.has-css-snap ul.wc-block-product-template {
    display: flex !important; 
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 15px; /* Reduced slightly to save horizontal space */
    padding-bottom: 5px;
    margin-bottom: 0;
    scrollbar-width: none; 
    -ms-overflow-style: none;
    flex-shrink: 0; /* Carousel retains its native height */
}

.vtx-promo-showcase.has-css-snap ul.products::-webkit-scrollbar,
.vtx-promo-showcase.has-css-snap ul.wc-block-product-template::-webkit-scrollbar {
    display: none;
}

.vtx-promo-showcase.has-css-snap ul.products li.product,
.vtx-promo-showcase.has-css-snap ul.wc-block-product-template li.wc-block-product {
    flex: 0 0 calc(65% - 15px); 
    scroll-snap-align: start;
    margin: 0 !important;
    min-width: 0; 
}

@container (min-width: 600px) {
    .vtx-promo-showcase.has-css-snap ul.products li.product,
    .vtx-promo-showcase.has-css-snap ul.wc-block-product-template li.wc-block-product {
        flex: 0 0 calc(33.333% - 15px); 
    }
}

@container (min-width: 1000px) {
    .vtx-promo-showcase.has-css-snap ul.products li.product,
    .vtx-promo-showcase.has-css-snap ul.wc-block-product-template li.wc-block-product {
        flex: 0 0 calc(25% - 15px); 
    }
}

.vtx-promo-showcase .wc-block-components-product-image img { border-radius: 8px; }
.vtx-promo-showcase .wp-block-post-title { color: var(--vtx-promo-title); font-size: 0.95rem !important; text-align: left !important; }
.vtx-promo-showcase .wp-block-woocommerce-product-price { text-align: left !important; color: var(--vtx-promo-text); }