/* ==========================================================================
   MHB STORE — Bento Grid Architecture Engine v2.0
   Gradient hairline borders · cursor-tracked spotlight · fluid product cards
   ========================================================================== */

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    margin-bottom: 48px;
}

/* Skip rendering offscreen catalog content until scrolled near */
#bentoCatalogGrid,
.products-catalog-grid {
    content-visibility: auto;
    contain-intrinsic-size: auto 900px;
}

/* --------------------------------------------------------------------------
   Core Card — layered glass slab with gradient hairline & inner highlight
   -------------------------------------------------------------------------- */
.bento-card {
    --mx: 50%;
    --my: 50%;
    position: relative;
    /* Solid-leaning translucent gradient — no backdrop-filter (GPU-cheap) */
    background: linear-gradient(165deg, rgba(18, 18, 26, 0.55) 0%, rgba(10, 10, 16, 0.75) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    overflow: hidden;
    transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s var(--ease);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* hairline top highlight */
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* Cursor-tracked spotlight sheen (coordinates injected by animations.js) */
.bento-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(420px circle at var(--mx) var(--my), rgba(200, 245, 66, 0.09), transparent 65%);
    opacity: 0;
    transition: opacity 0.4s var(--ease);
    pointer-events: none;
    z-index: 0;
}

.bento-card:hover::before {
    opacity: 1;
}

/* Corner aurora bloom on hover */
.bento-card::after {
    content: '';
    position: absolute;
    top: -70px;
    left: -70px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.14) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.45s var(--ease);
    pointer-events: none;
    z-index: 0;
}

.bento-card:hover::after {
    opacity: 1;
}

.bento-card:hover {
    border-color: var(--border-glow);
    box-shadow: 0 24px 54px rgba(0, 0, 0, 0.45), 0 0 42px rgba(200, 245, 66, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Keep card content above the decorative layers */
.bento-card > * {
    position: relative;
    z-index: 1;
}

/* Span Utilities */
.span-12 { grid-column: span 12; }
.span-9  { grid-column: span 9; }
.span-8  { grid-column: span 8; }
.span-7  { grid-column: span 7; }
.span-6  { grid-column: span 6; }
.span-5  { grid-column: span 5; }
.span-4  { grid-column: span 4; }
.span-3  { grid-column: span 3; }

.row-span-2 { grid-row: span 2; }

@media (max-width: 900px) {
    .bento-grid {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }
    .span-12, .span-9, .span-8, .span-7, .span-6, .span-5, .span-4, .span-3 {
        grid-column: span 1 !important;
    }
    .row-span-2 {
        grid-row: span 1 !important;
    }
    .hero-card {
        min-height: auto !important;
        padding: 24px !important;
    }
    .hero-title {
        font-size: 1.55rem !important;
    }
    .hero-desc {
        font-size: 0.88rem !important;
    }
}

/* --------------------------------------------------------------------------
   Hero Feature Card
   -------------------------------------------------------------------------- */
.hero-card {
    min-height: 480px;
    background: linear-gradient(150deg, rgba(14, 14, 20, 0.94) 0%, rgba(8, 8, 13, 0.97) 100%);
    padding: 40px;
}

.hero-bg-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.32;
    transition: transform 0.8s var(--ease), opacity 0.8s var(--ease);
    z-index: 0;
    /* cinematic bottom fade so text always reads */
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.25) 0%, #000 75%);
    mask-image: linear-gradient(to top, rgba(0,0,0,0.25) 0%, #000 75%);
}

.hero-card:hover .hero-bg-image {
    transform: scale(1.05);
    opacity: 0.42;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-title {
    font-size: clamp(1.7rem, 3.2vw, 2.5rem);
    font-weight: 900;
    line-height: 1.18;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.hero-desc {
    font-size: 0.98rem;
    color: var(--text-muted);
    line-height: 1.75;
    max-width: 440px;
}

.hero-price-tag {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.price-main {
    font-size: clamp(1.3rem, 2.2vw, 1.65rem);
    font-weight: 900;
    background: var(--grad-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.price-old {
    font-size: 1.05rem;
    text-decoration: line-through;
    color: var(--text-faint);
}

/* --------------------------------------------------------------------------
   Category Vibe Card
   -------------------------------------------------------------------------- */
.category-vibe-card {
    min-height: 230px;
    background: linear-gradient(150deg, rgba(200, 245, 66, 0.055) 0%, rgba(14, 14, 20, 0.85) 100%);
}

.category-vibe-card img {
    position: absolute;
    left: -18px;
    bottom: -18px;
    width: 168px;
    height: 168px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.6));
    transition: transform 0.5s var(--ease-spring);
}

.category-vibe-card:hover img {
    transform: scale(1.1) rotate(-5deg);
}

/* --------------------------------------------------------------------------
   Metric & Promo Cards
   -------------------------------------------------------------------------- */
.metric-card {
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.035) 0%, rgba(12, 12, 18, 0.85) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
}

.metric-num {
    font-size: clamp(1.7rem, 2.6vw, 2.2rem);
    font-weight: 700;
    line-height: 1;
    font-family: var(--font-en);
    background: var(--grad-aurora);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.metric-label {
    font-size: 0.87rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.7;
}

.promo-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.16) 0%, rgba(14, 14, 20, 0.92) 100%);
    border-color: rgba(139, 92, 246, 0.28);
}

.promo-card:hover {
    border-color: rgba(139, 92, 246, 0.5);
}

.promo-code-box {
    background: rgba(0, 0, 0, 0.42);
    border: 1px dashed rgba(200, 245, 66, 0.55);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-en);
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--accent);
    margin-top: 12px;
    text-shadow: 0 0 20px rgba(200, 245, 66, 0.35);
}

.copy-btn {
    cursor: pointer;
    font-size: 0.74rem;
    color: var(--text-muted);
    letter-spacing: 0;
    transition: color 0.2s ease, transform 0.2s var(--ease);
}

.copy-btn:hover {
    color: var(--accent);
    transform: scale(1.06);
}

/* --------------------------------------------------------------------------
   Product Cards
   -------------------------------------------------------------------------- */
.bento-product-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    height: 100%;
}

.product-img-wrapper {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: #08080c;
}

/* subtle scanline shimmer on product imagery */
.product-img-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(6, 6, 10, 0.85) 0%, rgba(6, 6, 10, 0.15) 38%, transparent 65%);
    pointer-events: none;
    z-index: 1;
}

.bento-product-card.span-6 .product-img-wrapper {
    height: 340px;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s var(--ease), filter 0.7s var(--ease);
    filter: saturate(0.94) contrast(1.03);
}

.bento-product-card:hover .product-img {
    transform: scale(1.07);
    filter: saturate(1.08) contrast(1.05);
}

.product-actions-overlay {
    position: absolute;
    bottom: 16px;
    right: 16px;
    left: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.35s var(--ease);
    z-index: 2;
}

.bento-product-card:hover .product-actions-overlay {
    opacity: 1;
    transform: translateY(0);
}

.icon-action-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(12, 12, 18, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-strong);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s var(--ease-spring);
}

.icon-action-btn:hover {
    background: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
    transform: scale(1.12) translateY(-2px);
    box-shadow: 0 8px 24px var(--glow);
}

.product-body {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    justify-content: space-between;
}

.product-category {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-family: var(--font-en);
}

.product-title {
    font-size: 1.03rem;
    font-weight: 800;
    line-height: 1.45;
    transition: color 0.25s ease;
}

.bento-product-card:hover .product-title {
    color: var(--accent);
}

.product-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    gap: 10px;
}

.product-price {
    font-size: 1.12rem;
    font-weight: 900;
    color: var(--text);
    white-space: nowrap;
}

.add-cart-btn-sm {
    background: rgba(200, 245, 66, 0.13);
    color: var(--accent);
    border: 1px solid rgba(200, 245, 66, 0.24);
    padding: 8px 17px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.28s var(--ease);
}

.add-cart-btn-sm:hover {
    background: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
    box-shadow: 0 6px 20px var(--glow);
    transform: translateY(-2px);
}

.add-cart-btn-sm:active {
    transform: translateY(0) scale(0.96);
}

/* --------------------------------------------------------------------------
   Filter Tabs — segmented control
   -------------------------------------------------------------------------- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
    overflow-x: auto;
    padding: 6px;
    padding-bottom: 6px;
    background: rgba(255, 255, 255, 0.032);
    border: 1px solid var(--border);
    border-radius: 99px;
    width: fit-content;
    max-width: 100%;
    scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-tab {
    padding: 9px 21px;
    border-radius: 99px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s var(--ease);
}

.filter-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.filter-tab.active {
    background: var(--grad-accent);
    color: var(--accent-text);
    box-shadow: 0 5px 22px var(--glow);
}

/* --------------------------------------------------------------------------
   Scroll-reveal staging (activated by animations.js — safe without JS)
   -------------------------------------------------------------------------- */
.pre-reveal {
    opacity: 0;
    transform: translateY(26px);
}

.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
    .pre-reveal {
        opacity: 1;
        transform: none;
    }
}
