/*
================================================

Space Vanta Theme 1.0

Module:
Bundle Hero Preview

File:
public/bundle-template/bundle-hero/preview/layout.css

Version:
4.0

Responsibility:
Preview Drawer Structure / Layout / Responsive

Architecture:
- Fixed Preview Drawer
- Horizontal Bundle Option Rail
- Single Option Adaptive Layout
- Multiple Option Spatial Layout
- Responsive Bottom Sheet

Does NOT define:
- Brand Surface
- Brand Typography
- Product Visual Styling
- CTA Interaction

================================================
*/


/* =================================================
   1. Preview Root
================================================= */

.sv-bundle-hero-preview {

    position: fixed;

    inset: 0;

    z-index: 9999;

    visibility: hidden;

    pointer-events: none;

}


/* =================================================
   2. Active State
================================================= */

.sv-bundle-hero-preview.is-active {

    visibility: visible;

    pointer-events: auto;

}


/* =================================================
   3. Overlay
================================================= */

.sv-bundle-hero-preview__overlay {

    position: absolute;

    inset: 0;

}


/* =================================================
   4. Preview Panel
================================================= */

.sv-bundle-hero-preview__panel {

    position: absolute;

    top: 0;
    right: 0;
    bottom: 0;

    display: flex;

    flex-direction: column;

    width: min(520px, 90vw);

    padding: 36px;

    overflow: hidden;

    transform:
        translateX(100%);

    transition:
        transform 420ms cubic-bezier(0.22, 1, 0.36, 1);

}


/* =================================================
   5. Active Panel
================================================= */

.sv-bundle-hero-preview.is-active .sv-bundle-hero-preview__panel {

    transform:
        translateX(0);

}


/* =================================================
   6. Header
================================================= */

.sv-bundle-hero-preview__header {

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 24px;

    flex: 0 0 auto;

    padding-bottom: 22px;

}


/* =================================================
   7. Close Button
================================================= */

.sv-bundle-hero-preview__close {

    flex: 0 0 auto;

    cursor: pointer;

}


/* =================================================
   8. Preview Content
================================================= */

.sv-bundle-hero-preview__content {

    display: flex;

    flex-direction: row;

    align-items: stretch;

    gap: 20px;

    flex: 1 1 auto;

    min-width: 0;
    min-height: 0;

    overflow-x: auto;

    overflow-y: auto;

    padding:
        4px 2px 24px;

    scroll-behavior: smooth;

    scroll-snap-type:
        x proximity;

    -webkit-overflow-scrolling: touch;

}


/* =================================================
   9. Option Section
================================================= */

.sv-bundle-hero-preview__section {

    flex:
        0 0 min(360px, 76vw);

    width:
        min(360px, 76vw);

    min-width: 0;

    margin: 0;

    scroll-snap-align: start;

}


/* =================================================
   10. Single Option
================================================= */

.sv-bundle-hero-preview__content>.sv-bundle-hero-preview__section:only-child {

    flex:
        0 1 420px;

    width:
        min(420px, 100%);

    max-width: 420px;

    margin-left: auto;

    margin-right: auto;

}


/* =================================================
   11. Option Counter
================================================= */

.sv-bundle-hero-preview__content {

    counter-reset:
        sv-bundle-option;

}


.sv-bundle-hero-preview__section {

    counter-increment:
        sv-bundle-option;

}


/* =================================================
   12. Generic Section Heading
================================================= */

.sv-bundle-hero-preview__section-heading {

    display: flex;

    align-items: center;

    gap: 12px;

    margin-bottom: 18px;

}


/* =================================================
   13. Included Products Legacy Structure
================================================= */

.sv-bundle-hero-preview__products {

    display: flex;

    flex-direction: column;

    gap: 12px;

}


/* =================================================
   14. Legacy Included Product
================================================= */

.sv-bundle-hero-preview-product {

    display: grid;

    grid-template-columns:
        72px minmax(0, 1fr);

    gap: 16px;

    align-items: center;

}


/* =================================================
   15. Legacy Included Product Media
================================================= */

.sv-bundle-hero-preview-product__media {

    width: 72px;

    height: 72px;

    overflow: hidden;

}


/* =================================================
   16. Legacy Option Grid
================================================= */

.sv-bundle-preview-option {

    min-width: 0;

}


/* =================================================
   17. Horizontal Scrollbar
================================================= */

.sv-bundle-hero-preview__content::-webkit-scrollbar {

    height: 4px;

    width: 4px;

}


.sv-bundle-hero-preview__content::-webkit-scrollbar-track {

    background: transparent;

}


.sv-bundle-hero-preview__content::-webkit-scrollbar-thumb {

    border-radius: 999px;

}


/* =================================================
   18. Mobile
================================================= */

@media (max-width: 768px) {


    .sv-bundle-hero-preview__panel {

        top: auto;
        right: 0;
        bottom: 0;
        left: 0;

        width: 100%;

        max-height: 85vh;

        padding:
            28px 20px 24px;

        border-radius:
            24px 24px 0 0;

        transform:
            translateY(100%);

    }


    .sv-bundle-hero-preview.is-active .sv-bundle-hero-preview__panel {

        transform:
            translateY(0);

    }


    .sv-bundle-hero-preview__header {

        gap: 16px;

        padding-bottom: 18px;

    }


    .sv-bundle-hero-preview__content {

        gap: 14px;

        padding:
            4px 1px 18px;

    }


    .sv-bundle-hero-preview__section {

        flex:
            0 0 min(330px, 82vw);

        width:
            min(330px, 82vw);

    }


    .sv-bundle-hero-preview__content>.sv-bundle-hero-preview__section:only-child {

        flex:
            0 1 420px;

        width:
            min(420px, 100%);

        max-width: 420px;

    }


    .sv-bundle-hero-preview-product {

        grid-template-columns:
            64px minmax(0, 1fr);

        gap: 14px;

    }


    .sv-bundle-hero-preview-product__media {

        width: 64px;

        height: 64px;

    }

}


/* =================================================
   19. Reduced Motion
================================================= */

@media (prefers-reduced-motion: reduce) {

    .sv-bundle-hero-preview__panel {

        transition: none;

    }


    .sv-bundle-hero-preview__content {

        scroll-behavior: auto;

    }

}