/* Catalog Drilldown & Product Card Styles */

/* 3D Red Ribbon Tag */
.promo-ribbon-badge {
    position: absolute;
    top: 6px;
    left: -6px;
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 11px;
    padding: 4px 9px;
    border-radius: 4px 6px 6px 1px;
    box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.25);
    z-index: 20;
    font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
    line-height: 1;
    letter-spacing: -0.02em;
}
.promo-ribbon-badge::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 0;
    border-top: 6px solid #6b0000;
    border-left: 6px solid transparent;
    border-bottom-left-radius: 2px;
}

/* Hover Title Expansion */
.hz-card-body {
    position: relative;
}
.hz-title-expand-box {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 0 !important;
    max-height: 60px;
    overflow: hidden;
    transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.hz-product-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: #1f2937 !important;
}
.group:hover .hz-title-expand-box,
.hz-card-item:hover .hz-title-expand-box {
    max-height: 100% !important;
    box-shadow: 0 -4px 12px -2px rgba(0, 0, 0, 0.08);
}
.group:hover .hz-product-title,
.hz-card-item:hover .hz-product-title {
    -webkit-line-clamp: unset !important;
    display: block !important;
    overflow: visible !important;
    color: #1f2937 !important;
}

/* Category Card Hover & Selected Title Expansion */
.cat-title-expand-box {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 25;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.cat-card-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: #111827;
    width: 100%;
    text-align: center;
}
.group:hover .cat-title-expand-box,
.cat-card-stack-l1:hover .cat-title-expand-box,
.cat-card-stack-l2:hover .cat-title-expand-box,
.cat-card-l2-box:hover .cat-title-expand-box,
.cat-card-l3-box:hover .cat-title-expand-box,
.cat-card-main.is-selected .cat-title-expand-box,
.cat-card-l2-box.is-selected .cat-title-expand-box,
.cat-card-l3-box.is-selected .cat-title-expand-box {
    box-shadow: 0 -4px 12px -2px rgba(0, 0, 0, 0.08);
}
.group:hover .cat-card-title,
.cat-card-stack-l1:hover .cat-card-title,
.cat-card-stack-l2:hover .cat-card-title,
.cat-card-l2-box:hover .cat-card-title,
.cat-card-l3-box:hover .cat-card-title,
.cat-card-main.is-selected .cat-card-title,
.cat-card-l2-box.is-selected .cat-card-title,
.cat-card-l3-box.is-selected .cat-card-title {
    -webkit-line-clamp: unset !important;
    display: block !important;
    overflow: visible !important;
}

/* Physics Simultaneous Deck Drop & Sequential Deal-Out Across Row */
@media (min-width: 1024px) {
    /* Row 1 (Cards 0..5): Starts immediately */
    .cat-deal-r0-c0 { animation: cardDealCol0 0.85s cubic-bezier(0.25, 1, 0.5, 1) 0s both; }
    .cat-deal-r0-c1 { animation: cardDealCol1 0.85s cubic-bezier(0.25, 1, 0.5, 1) 0s both; }
    .cat-deal-r0-c2 { animation: cardDealCol2 0.85s cubic-bezier(0.25, 1, 0.5, 1) 0s both; }
    .cat-deal-r0-c3 { animation: cardDealCol3 0.85s cubic-bezier(0.25, 1, 0.5, 1) 0s both; }
    .cat-deal-r0-c4 { animation: cardDealCol4 0.85s cubic-bezier(0.25, 1, 0.5, 1) 0s both; }
    .cat-deal-r0-c5 { animation: cardDealCol5 0.85s cubic-bezier(0.25, 1, 0.5, 1) 0s both; }

    /* Row 2 (Cards 6..11): Drops from Row 1 Slot 1 into Row 2 Slot 1 after Row 1 finishes dealing (~0.80s) */
    .cat-deal-r1-c0 { animation: cardDealRow1Col0 0.85s cubic-bezier(0.25, 1, 0.5, 1) 0.80s both; }
    .cat-deal-r1-c1 { animation: cardDealRow1Col1 0.85s cubic-bezier(0.25, 1, 0.5, 1) 0.80s both; }
    .cat-deal-r1-c2 { animation: cardDealRow1Col2 0.85s cubic-bezier(0.25, 1, 0.5, 1) 0.80s both; }
    .cat-deal-r1-c3 { animation: cardDealRow1Col3 0.85s cubic-bezier(0.25, 1, 0.5, 1) 0.80s both; }
    .cat-deal-r1-c4 { animation: cardDealRow1Col4 0.85s cubic-bezier(0.25, 1, 0.5, 1) 0.80s both; }
    .cat-deal-r1-c5 { animation: cardDealRow1Col5 0.85s cubic-bezier(0.25, 1, 0.5, 1) 0.80s both; }

    @keyframes cardDealCol0 {
        0% { opacity: 1; transform: translateY(-45px) scale(0.95); }
        30% { opacity: 1; transform: translateY(0) scale(1); }
        100% { opacity: 1; transform: translateY(0) scale(1); }
    }

    @keyframes cardDealCol1 {
        0% { opacity: 1; transform: translate(calc(-100% - 1.5rem), -45px) scale(0.95); }
        30% { opacity: 1; transform: translate(calc(-100% - 1.5rem), 0) scale(1); }
        42% { opacity: 1; transform: translate(calc(-100% - 1.5rem), 0) scale(1); }
        70% { opacity: 1; transform: translate(0, 0) scale(1); }
        100% { opacity: 1; transform: translate(0, 0) scale(1); }
    }

    @keyframes cardDealCol2 {
        0% { opacity: 1; transform: translate(calc(-200% - 3rem), -45px) scale(0.95); }
        30% { opacity: 1; transform: translate(calc(-200% - 3rem), 0) scale(1); }
        50% { opacity: 1; transform: translate(calc(-200% - 3rem), 0) scale(1); }
        78% { opacity: 1; transform: translate(0, 0) scale(1); }
        100% { opacity: 1; transform: translate(0, 0) scale(1); }
    }

    @keyframes cardDealCol3 {
        0% { opacity: 1; transform: translate(calc(-300% - 4.5rem), -45px) scale(0.95); }
        30% { opacity: 1; transform: translate(calc(-300% - 4.5rem), 0) scale(1); }
        58% { opacity: 1; transform: translate(calc(-300% - 4.5rem), 0) scale(1); }
        86% { opacity: 1; transform: translate(0, 0) scale(1); }
        100% { opacity: 1; transform: translate(0, 0) scale(1); }
    }

    @keyframes cardDealCol4 {
        0% { opacity: 1; transform: translate(calc(-400% - 6rem), -45px) scale(0.95); }
        30% { opacity: 1; transform: translate(calc(-400% - 6rem), 0) scale(1); }
        66% { opacity: 1; transform: translate(calc(-400% - 6rem), 0) scale(1); }
        94% { opacity: 1; transform: translate(0, 0) scale(1); }
        100% { opacity: 1; transform: translate(0, 0) scale(1); }
    }

    @keyframes cardDealCol5 {
        0% { opacity: 1; transform: translate(calc(-500% - 7.5rem), -45px) scale(0.95); }
        30% { opacity: 1; transform: translate(calc(-500% - 7.5rem), 0) scale(1); }
        72% { opacity: 1; transform: translate(calc(-500% - 7.5rem), 0) scale(1); }
        100% { opacity: 1; transform: translate(0, 0) scale(1); }
    }

    /* Row 2 Animations: Drop from Row 1 Slot 1 down into Row 2 Slot 1 */
    @keyframes cardDealRow1Col0 {
        0% { opacity: 0; transform: translateY(calc(-100% - 1.5rem)) scale(0.95); }
        1% { opacity: 1; transform: translateY(calc(-100% - 1.5rem)) scale(0.95); }
        30% { opacity: 1; transform: translateY(0) scale(1); }
        100% { opacity: 1; transform: translateY(0) scale(1); }
    }

    @keyframes cardDealRow1Col1 {
        0% { opacity: 0; transform: translate(calc(-100% - 1.5rem), calc(-100% - 1.5rem)) scale(0.95); }
        1% { opacity: 1; transform: translate(calc(-100% - 1.5rem), calc(-100% - 1.5rem)) scale(0.95); }
        30% { opacity: 1; transform: translate(calc(-100% - 1.5rem), 0) scale(1); }
        42% { opacity: 1; transform: translate(calc(-100% - 1.5rem), 0) scale(1); }
        70% { opacity: 1; transform: translate(0, 0) scale(1); }
        100% { opacity: 1; transform: translate(0, 0) scale(1); }
    }

    @keyframes cardDealRow1Col2 {
        0% { opacity: 0; transform: translate(calc(-200% - 3rem), calc(-100% - 1.5rem)) scale(0.95); }
        1% { opacity: 1; transform: translate(calc(-200% - 3rem), calc(-100% - 1.5rem)) scale(0.95); }
        30% { opacity: 1; transform: translate(calc(-200% - 3rem), 0) scale(1); }
        50% { opacity: 1; transform: translate(calc(-200% - 3rem), 0) scale(1); }
        78% { opacity: 1; transform: translate(0, 0) scale(1); }
        100% { opacity: 1; transform: translate(0, 0) scale(1); }
    }

    @keyframes cardDealRow1Col3 {
        0% { opacity: 0; transform: translate(calc(-300% - 4.5rem), calc(-100% - 1.5rem)) scale(0.95); }
        1% { opacity: 1; transform: translate(calc(-300% - 4.5rem), calc(-100% - 1.5rem)) scale(0.95); }
        30% { opacity: 1; transform: translate(calc(-300% - 4.5rem), 0) scale(1); }
        58% { opacity: 1; transform: translate(calc(-300% - 4.5rem), 0) scale(1); }
        86% { opacity: 1; transform: translate(0, 0) scale(1); }
        100% { opacity: 1; transform: translate(0, 0) scale(1); }
    }

    @keyframes cardDealRow1Col4 {
        0% { opacity: 0; transform: translate(calc(-400% - 6rem), calc(-100% - 1.5rem)) scale(0.95); }
        1% { opacity: 1; transform: translate(calc(-400% - 6rem), calc(-100% - 1.5rem)) scale(0.95); }
        30% { opacity: 1; transform: translate(calc(-400% - 6rem), 0) scale(1); }
        66% { opacity: 1; transform: translate(calc(-400% - 6rem), 0) scale(1); }
        94% { opacity: 1; transform: translate(0, 0) scale(1); }
        100% { opacity: 1; transform: translate(0, 0) scale(1); }
    }

    @keyframes cardDealRow1Col5 {
        0% { opacity: 0; transform: translate(calc(-500% - 7.5rem), calc(-100% - 1.5rem)) scale(0.95); }
        1% { opacity: 1; transform: translate(calc(-500% - 7.5rem), calc(-100% - 1.5rem)) scale(0.95); }
        30% { opacity: 1; transform: translate(calc(-500% - 7.5rem), 0) scale(1); }
        72% { opacity: 1; transform: translate(calc(-500% - 7.5rem), 0) scale(1); }
        100% { opacity: 1; transform: translate(0, 0) scale(1); }
    }
}

.cat-drop-card:hover {
    z-index: 40 !important;
}

@media (max-width: 1023px) {
    @keyframes cardDropInMobile {
        0% {
            opacity: 0;
            transform: translateY(-16px) scale(0.96);
        }
        100% {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
    .cat-drop-card {
        opacity: 1 !important;
        animation: cardDropInMobile 0.35s cubic-bezier(0.25, 1, 0.5, 1) both;
    }
}

/* Base Stack Positioning */
.cat-card-stack-l1 {
    position: relative;
    width: 100%;
    height: 240px;
    min-height: 240px;
    z-index: 1;
    transition: z-index 0.2s ease;
}
@media (min-width: 640px) {
    .cat-card-stack-l1 {
        height: 380px;
        min-height: 380px;
    }
}
@media (min-width: 1024px) {
    .cat-card-stack-l1 {
        height: 370px;
        min-height: 370px;
    }
}
.cat-card-stack-l2,
.cat-card-l2-box {
    position: relative;
    width: 100%;
    height: 265px;
    min-height: 265px;
    z-index: 1;
    transition: z-index 0.2s ease;
}
@media (min-width: 640px) {
    .cat-card-stack-l2,
    .cat-card-l2-box {
        height: 260px;
        min-height: 260px;
    }
}
@media (min-width: 1024px) {
    .cat-card-stack-l2,
    .cat-card-l2-box {
        height: 260px;
        min-height: 260px;
    }
}

.cat-card-l3-box {
    position: relative;
    width: 100%;
    height: 255px;
    min-height: 255px;
    z-index: 1;
    transition: z-index 0.2s ease;
}
@media (min-width: 640px) {
    .cat-card-l3-box {
        height: 250px;
        min-height: 250px;
    }
}
@media (min-width: 1024px) {
    .cat-card-l3-box {
        height: 250px;
        min-height: 250px;
    }
}
.cat-fan-main {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    z-index: 20 !important;
    transform: translate(0, 0) rotate(0deg);
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.35s ease;
}
.cat-fan-sub {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    opacity: 0 !important;
    pointer-events: none;
    transform: translate(0, 0) rotate(0deg);
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease, box-shadow 0.35s ease;
}

/* Hover Cascade: Level 1 Category Stacks (Desktop) */
@media (min-width: 768px) {
    .cat-card-stack-l1:hover {
        z-index: 35 !important;
    }
    .cat-card-stack-l1:hover .cat-fan-main {
        transform: translate(-18px, -18px) !important;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    }
    .cat-card-stack-l1:hover .cat-fan-sub {
        opacity: 1 !important;
    }
    .cat-card-stack-l1:hover .cat-fan-sub-1 {
        transform: translate(12px, 12px) !important;
        box-shadow: 0 14px 20px -4px rgba(0, 0, 0, 0.1);
    }
    .cat-card-stack-l1:hover .cat-fan-sub-2 {
        transform: translate(26px, 26px) !important;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    }
    .cat-card-stack-l1:hover .cat-fan-sub-3 {
        transform: translate(40px, 40px) !important;
        box-shadow: 0 6px 10px -2px rgba(0, 0, 0, 0.06);
    }

    /* Hover Cascade: Level 2 Compact Category Stacks */
    .cat-card-stack-l2:hover {
        z-index: 35 !important;
    }
    .cat-card-stack-l2:hover .cat-fan-main {
        transform: translate(-10px, -10px) !important;
        box-shadow: 0 14px 18px -4px rgba(0, 0, 0, 0.1);
    }
    .cat-card-stack-l2:hover .cat-fan-sub {
        opacity: 1 !important;
    }
    .cat-card-stack-l2:hover .cat-fan-sub-l2-1 {
        transform: translate(8px, 8px) !important;
    }
    .cat-card-stack-l2:hover .cat-fan-sub-l2-2 {
        transform: translate(16px, 16px) !important;
    }
}
