/* ==========================================================================
MEGAMART STOREFRONT: Consolidated Catalog & Responsive Stylesheet
========================================================================== */

/* 1. Core Framework Layout Containers */
.catalog-main-wrapper {
    padding-bottom: 5rem;
}

/* 2. Filter Result Headers Bar */
.search-results-banner {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    padding: 1rem !important;
    border-radius: 6px !important;
    margin-bottom: 1.5rem !important;
}
.found-items-count {
    color: #64748b;
    margin-left: 0.5rem;
}
.clear-filters-link {
    float: right;
    color: #b12704;
    font-weight: 700;
}

/* 3. Unified Product Flex Card Structural Mesh (Desktop Default) */
.standard-card-layout {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    height: 100% !important;
    overflow: hidden !important;
    position: relative !important;
    margin: 0 !important;
}
.card-image-wrapper {
    background: #ffffff !important;
    height: 180px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
    position: relative !important;
    width: 100% !important;
    margin: 0 !important;
}
.card-discount-ribbon {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 5 !important;
    font-weight: 700 !important;
    font-size: 0.68rem !important;
    padding: 0.3rem 0.6rem !important;
    border-radius: 0 0 6px 0 !important;
    background-color: #db2828 !important;
    color: #ffffff !important;
}
.card-img-contain {
    max-height: 140px !important;
    max-width: 100% !important;
    width: auto !important;
    object-fit: contain !important;
}

/* 4. Desktop Card Content Typography Elements */
.card-body-padding {
    padding: 1.2rem !important;
    flex-grow: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    border: none !important;
}
.card-meta-wrapper {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.4rem !important;
    align-items: flex-start !important;
    margin-bottom: 0.6rem !important;
}
.dynamic-cyan-label {
    font-weight: 600 !important;
    font-size: 0.68rem !important;
    color: #00b5ad !important;
    background: rgba(0,181,173,0.02) !important;
    padding: 3px 8px !important;
    border-color: rgba(0,181,173,0.15) !important;
}
.sku-text-muted {
    color: #94a3b8;
    font-family: monospace;
    font-size: 0.72rem;
    display: block;
    margin-top: 0.1rem;
}
.sku-code-block {
    background: #f1f5f9;
    padding: 1px 4px;
    border-radius: 3px;
    color: #475569;
    font-family: monospace;
}
.card-title-clamp {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    line-height: 1.4 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    height: 2.8rem !important;
    margin: 0 !important;
}

/* 5. Desktop Card Purchase Action Footers */
.card-actions-footer {
    padding: 1rem 1.2rem !important;
    background: #f8fafc !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-top: 1px solid #f1f5f9 !important;
    margin: 0 !important;
    width: 100% !important;
}
.strike-price-muted {
    text-decoration: line-through;
    color: #94a3b8;
    font-size: 0.75rem;
    display: block;
    line-height: 1;
}
.active-deal-price {
    color: #b12704;
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1.1;
}
.standard-dark-price {
    color: #0f172a;
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1.1;
}
.action-inputs-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
}
.compact-qty-select {
    padding: 0.35rem !important;
    min-width: 48px !important;
    height: 32px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    font-size: 0.85rem !important;
}
.amzn-buy-btn {
    background-color: #f0c14b !important;
    color: #111111 !important;
    font-weight: 600 !important;
    padding: 0.6rem 1rem !important;
    border-radius: 4px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 6. Catalog Empty States */
.empty-state-box {
    background: #ffffff !important;
    padding: 4rem 2rem !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
}
.reset-catalog-btn {
    background-color: #f0c14b !important;
    color: #111111 !important;
    margin-top: 1rem !important;
}

/* 7. Amazon Style Flash Promotion Hero Banner */
.promo-hero-banner {
    background: linear-gradient(135deg, #131921 0%, #232f3e 100%) !important;
    color: #ffffff !important;
    padding: 2.5rem !important;
    border-radius: 6px !important;
    border: none !important;
    margin-bottom: 3rem !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
}
.hero-decorative-watermark {
    position: absolute;
    right: -20px;
    top: -20px;
    font-size: 12rem;
    color: rgba(240, 193, 75, 0.04);
    font-weight: 900;
    font-family: sans-serif;
    pointer-events: none;
}
.hero-badge-label {
    background-color: #f0c14b !important;
    color: #111111 !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    margin-bottom: 1rem !important;
}
.hero-main-title {
    font-size: 2.5rem !important;
    font-weight: 800 !important;
    margin: 0 0 0.5rem 0 !important;
    color: #ffffff !important;
    letter-spacing: -0.5px !important;
}
.hero-subtitle {
    font-size: 1.1rem;
    color: #cbd5e1;
    max-width: 550px;
    line-height: 1.5;
}
.hero-deal-box {
    background: rgba(255,255,255,0.05);
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
}
.hero-deal-box-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #a4b0be;
    display: block;
}
.hero-deal-box-percentage {
    font-size: 3.5rem;
    font-weight: 800;
    color: #f0c14b;
    margin: 0.2rem 0;
}
.hero-deal-box-footer {
    color: #cbd5e1;
}

/* 8. Desktop Section Lane Layouts */
.lane-section-spacing { margin-bottom: 3.5rem; }
.trending-section-spacing { margin-bottom: 2rem; }
.lane-header-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.2rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}
.lane-title {
    font-weight: 800 !important;
    color: #1e293b !important;
    margin: 0 !important;
    font-size: 1.4rem !important;
    letter-spacing: -0.3px !important;
}
.lane-icon-margin { color: #f0c14b; margin-right: 0.5rem; }
.lane-icon-margin-alt { color: #e67e22; margin-right: 0.5rem; }
.lane-subtitle { color: #64748b; font-size: 0.9rem; font-weight: 600; }
.lane-img-contain { max-height: 120px !important; max-width: 100% !important; width: auto !important; object-fit: contain !important; }

.card-body-padding-alt { padding: 1rem !important; flex-grow: 1 !important; display: flex !important; flex-direction: column !important; justify-content: space-between !important; border: none !important; }
.card-meta-wrapper-alt { display: flex !important; flex-direction: column !important; gap: 0.2rem !important; align-items: flex-start !important; margin-bottom: 0.4rem !important; }
.card-title-clamp-alt { font-size: 0.95rem !important; font-weight: 700 !important; color: #1e293b !important; line-height: 1.3 !important; display: -webkit-box !important; -webkit-line-clamp: 2 !important; -webkit-box-orient: vertical !important; overflow: hidden !important; height: 2.5rem !important; margin: 0 !important; }
.card-actions-footer-alt { padding: 0.8rem 1rem !important; background: #f8fafc !important; display: flex !important; align-items: center !important; justify-content: space-between !important; border-top: 1px solid #f1f5f9 !important; margin: 0 !important; width: 100% !important; }
.compact-qty-select-alt { padding: 0.2rem !important; min-width: 42px !important; height: 28px !important; font-size: 0.8rem !important; }

/* 9. Markdown Red Hot Deals Specific Variant Selection */
.lane-header-row-red { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1.2rem; border-bottom: 2px solid #e2e8f0; padding-bottom: 0.5rem; }
.lane-title-red { font-weight: 800 !important; color: #db2828 !important; margin: 0 !important; font-size: 1.4rem !important; letter-spacing: -0.3px !important; }
.lane-subtitle-red { color: #db2828; font-size: 0.9rem; font-weight: 700; }
.standard-card-layout-red { background: #ffffff !important; border: 1px solid #fca5a5 !important; border-radius: 6px !important; display: flex !important; flex-direction: column !important; justify-content: space-between !important; height: 100% !important; overflow: hidden !important; position: relative !important; margin: 0 !important; }
.card-image-wrapper-red { background: #ffffff !important; height: 160px !important; display: flex !important; align-items: center !important; justify-content: center !important; padding: 1rem !important; border-bottom: 1px solid #fee2e2 !important; position: relative !important; width: 100% !important; margin: 0 !important; }
.card-discount-ribbon-red { position: absolute !important; top: 0 !important; left: 0 !important; z-index: 5 !important; font-weight: 700 !important; font-size: 0.68rem !important; padding: 0.3rem 0.6rem !important; border-radius: 0 0 6px 0 !important; background-color: #db2828 !important; }
.card-actions-footer-red { padding: 0.8rem 1rem !important; background: #fff5f5 !important; display: flex !important; align-items: center !important; justify-content: space-between !important; border-top: 1px solid #fee2e2 !important; margin: 0 !important; width: 100% !important; }
.active-deal-price-red { color: #db2828; font-weight: 700; font-size: 1.1rem; line-height: 1.1; }
.amzn-buy-btn-red { background-color: #db2828 !important; color: #ffffff !important; font-weight: 600 !important; padding: 0.5rem 0.8rem !important; font-size: 0.85rem !important; height: 28px !important; display: flex !important; align-items: center !important; justify-content: center !important; }

/* 10. Load More Action Row Pagination Styling */
.ui.load-more-container {
    padding-top: 3.5rem !important;
    padding-bottom: 2rem !important;
    text-align: center !important;
    width: 100% !important;
    clear: both !important;
}

.ui.button.black#load-more-btn {
    min-width: 240px !important;
    padding: 1.25rem 2.5rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    border-radius: 4px !important;
    transition: background 0.2s ease, transform 0.1s ease !important;
}

.ui.button.black#load-more-btn:hover {
    background: #27272a !important;
}

.ui.button.black#load-more-btn:active {
    transform: scale(0.98) !important;
}

/* 11. Column Elevation & Dropdown Overlap Fix */
#product-grid .column {
    position: relative;
    z-index: 1;
}

#product-grid .column:has(.ui.active.dropdown),
#product-grid .column:has(.ui.visible.dropdown) {
    z-index: 9999 !important;
}

#product-grid .column:has(.loading.disabled) {
    z-index: 9998 !important;
}

.ui.card.product-card,
.ui.card.product-card .extra.content {
    overflow: visible !important;
}

/* ==========================================================================
12. Mobile Responsive Overrides & Mobile Category Gateway
========================================================================== */

/* Mobile Quick Category Gateway Chips Bar */
.mobile-category-gateway {
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.mobile-category-chips {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 0.4rem;
    scrollbar-width: none; /* Hide scrollbar for clean app look */
    -webkit-overflow-scrolling: touch;
}

.mobile-category-chips::-webkit-scrollbar {
    display: none;
}

.mobile-chip-link {
    flex: 0 0 auto;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: background 0.2s, border-color 0.2s;
}

.mobile-chip-link:active,
.mobile-chip-link:hover {
    background: #f0c14b;
    border-color: #d97706;
    color: #0f172a;
}

/* Gateway Section Button Styling */
.gateway-action-container {
    text-align: center;
    margin-top: 1.5rem;
    padding: 1rem 0;
}

.gateway-show-more-btn {
    background-color: #0f172a !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-radius: 6px !important;
    padding: 0.85rem 1.8rem !important;
    font-size: 0.85rem !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    transition: transform 0.15s ease, background 0.2s ease !important;
}

.gateway-show-more-btn:hover {
    background-color: #1e293b !important;
}

.gateway-show-more-btn:active {
    transform: scale(0.97) !important;
}

@media (max-width: 767.98px) {

    /* Force Grid into Single-Line Horizontal Scroll Container */
    .mobile-scroll-row,
    .ui.grid.descriptive-catalog.grid-gap-override {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 10px !important;
        padding-bottom: 12px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 0.5rem !important;
        scrollbar-width: thin;
        scrollbar-color: #cbd5e1 transparent;
    }

    /* Webkit Scrollbar Styling for Horizontal Rows */
    .mobile-scroll-row::-webkit-scrollbar,
    .ui.grid.descriptive-catalog.grid-gap-override::-webkit-scrollbar {
        height: 4px;
    }

    .mobile-scroll-row::-webkit-scrollbar-thumb,
    .ui.grid.descriptive-catalog.grid-gap-override::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }

    /* Column Width for Mobile Horizontal Grid Cards */
    .mobile-scroll-row > .column,
    .ui.grid.descriptive-catalog.grid-gap-override > .column {
        flex: 0 0 155px !important;
        width: 155px !important;
        max-width: 155px !important;
        min-width: 155px !important;
        padding: 0 !important;
        margin: 0 !important;
        scroll-snap-align: start;
    }

    /* Product Card Base Layout Override */
    .standard-card-layout,
    .standard-card-layout-red,
    .mobile-scroll-row .ui.card.store-product-card,
    .descriptive-catalog .ui.card.store-product-card,
    .product-card-compact {
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 8px !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        background: #ffffff !important;
        overflow: hidden !important;
    }

    /* Compact Image Dimensions */
    .card-image-wrapper,
    .card-image-wrapper-red,
    .store-product-card .image,
    .product-card-compact .image-wrapper {
        height: 110px !important;
        width: 100% !important;
        background: #f8fafc !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 6px !important;
        position: relative !important;
    }

    .card-img-contain,
    .store-product-card .image img,
    .product-card-compact .image-wrapper img {
        max-height: 98px !important;
        max-width: 90% !important;
        width: auto !important;
        object-fit: contain !important;
    }

    /* HIDE non-essential items on mobile cards to keep height compact */
    .hide-on-mobile,
    .card-meta-wrapper,
    .card-meta-wrapper-alt,
    .dynamic-cyan-label,
    .store-product-card .description,
    .store-product-card .extra.content,
    .store-product-card .rating-row,
    .store-product-card .stock-status-badge {
        display: none !important;
    }

    /* Card Body Content Spacing */
    .card-body-padding,
    .card-body-padding-alt,
    .store-product-card .content,
    .product-card-compact .compact-content {
        padding: 8px !important;
        display: flex !important;
        flex-direction: column !important;
        flex-grow: 1 !important;
        justify-content: space-between !important;
    }

    /* Compact Title Heights */
    .card-title-clamp,
    .card-title-clamp-alt,
    .store-product-card .header.product-title,
    .product-card-compact .product-title {
        font-size: 0.82rem !important;
        font-weight: 700 !important;
        color: #0f172a !important;
        line-height: 1.25 !important;
        height: 2.5em !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        margin-bottom: 4px !important;
    }

    /* Hide quantity selection dropdown inside card footers on mobile */
    .compact-qty-select,
    .compact-qty-select-alt,
    .action-inputs-wrapper select,
    .card-actions-footer select,
    .card-actions-footer-alt select,
    .card-actions-footer-red select {
        display: none !important;
    }

    /* Action Footer Alignment */
    .card-actions-footer,
    .card-actions-footer-alt,
    .card-actions-footer-red,
    .store-product-card .price-row,
    .product-card-compact .price-row {
        padding: 6px 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 4px !important;
        background: #f8fafc !important;
        border-top: 1px solid #f1f5f9 !important;
        margin: 0 !important;
        width: 100% !important;
    }

    .action-inputs-wrapper {
        width: 100% !important;
        display: flex !important;
        justify-content: flex-end !important;
    }

    /* Fix Buy Buttons to prevent text spilling on mobile */
    .amzn-buy-btn,
    .amzn-buy-btn-red,
    .store-product-card .add-cart-btn-mobile {
        white-space: nowrap !important;
        font-size: 0.72rem !important;
        font-weight: 700 !important;
        padding: 0.4rem 0.6rem !important;
        height: 28px !important;
        line-height: 1 !important;
        border-radius: 4px !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        min-width: 0 !important;
    }

    /* Ultra-Compact Out-of-Stock / Unavailable Button on Mobile */
    .deep-muted-oos-btn,
    .ui.disabled.button.deep-muted-oos-btn,
    .ui.disabled.button.fluid.deep-muted-oos-btn {
        height: 26px !important;
        min-height: 26px !important;
        font-size: 0.68rem !important;
        font-weight: 700 !important;
        padding: 0.25rem 0.4rem !important;
        line-height: 1 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 3px !important;
        margin: 0 !important;
        border-radius: 4px !important;
    }

    .deep-muted-oos-btn .icon,
    .ui.disabled.button.deep-muted-oos-btn .icon {
        font-size: 0.68rem !important;
        margin: 0 !important;
    }

    .strike-price-muted {
        display: none !important; /* Hide strikethrough price on small cards if space is tight */
    }

    .active-deal-price,
    .standard-dark-price,
    .active-deal-price-red,
    .store-product-card .product-price-val {
        font-size: 0.88rem !important;
        font-weight: 800 !important;
        line-height: 1 !important;
    }

    /* Section Lane Headers Adjustment */
    .lane-section-spacing,
    .trending-section-spacing {
        margin-bottom: 1.5rem !important;
    }

    /* Mobile Gateway Show More CTA Button Fix */
    .gateway-show-more-btn {
        width: 100% !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.75rem !important;
        letter-spacing: 0px !important;
        white-space: normal !important;
        line-height: 1.3 !important;
    }

    .lane-header-row,
    .lane-header-row-red {
        display: flex !important;
        align-items: baseline !important;
        justify-content: space-between !important;
        margin-bottom: 0.4rem !important;
        padding-right: 0.25rem !important;
    }

    .lane-title,
    .lane-title-red {
        font-size: 1.1rem !important;
        font-weight: 800 !important;
    }

    .lane-subtitle,
    .lane-subtitle-red {
        font-size: 0.75rem !important;
        color: #64748b !important;
    }

}
