/* ============================================
   Booth Catalog — Grid + Detail View
   ============================================ */

/* ── Page / Grid ── */

.booth-page-header {
    padding: 4rem 20px 2rem;
    text-align: center
}

.booth-page-header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: -.04em;
    line-height: 1;
    margin: 0 0 .3em
}

.booth-page-header p {
    color: var(--color-dark-gray);
    font-size: 1rem;
    margin: 0
}

.booth-crumbs {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: rgba(128, 128, 128, .08);
    border-radius: 100px;
    padding: 6px 16px;
    margin-bottom: 12px;
    color: var(--color-dark-gray)
}

.booth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 28px;
    padding: 0 20px 80px
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

.booth-hero {
    display: none
}

.booth-card {
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    animation: fadeUp .5s ease both;
    transition: transform .3s, box-shadow .3s;
    background: var(--bg-card, rgba(255, 255, 255, .04));
    border: 1px solid rgba(255, 255, 255, .12)
}

[data-theme="light"] .booth-card {
    border-color: rgba(0, 0, 0, .08)
}

@media(prefers-color-scheme:light) {
    :root:not([data-theme]) .booth-card {
        border-color: rgba(0, 0, 0, .08)
    }
}

.booth-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .15)
}

.booth-card-img-wrap {
    overflow: hidden;
    border-radius: 13px 13px 0 0
}

.booth-card-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    transition: transform .4s
}

.booth-card:hover .booth-card-img {
    transform: scale(1.04)
}

.booth-card-body {
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px
}

.booth-card-title {
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1
}

.booth-card-price {
    font-size: .85rem;
    font-weight: 700;
    color: var(--color-accent, limegreen);
    white-space: nowrap;
    flex-shrink: 0
}

/* ── Detail View Shell ── */

.booth-detail {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: var(--booth-detail-bg, #f0f0f0);
    overflow: hidden;
    opacity: 0;
    transition: opacity .4s ease
}

@media(prefers-color-scheme:dark) {
    :root:not([data-theme]) .booth-detail {
        --booth-detail-bg: #0a0a0a
    }
}

[data-theme="dark"] .booth-detail {
    --booth-detail-bg: #0a0a0a
}

[data-theme="light"] .booth-detail {
    --booth-detail-bg: #f0f0f0
}

.booth-detail.booth-detail-visible {
    opacity: 1
}

/* ── Desktop Layout: side-by-side ── */
@media(min-width:641px) {
    .booth-detail {
        display: none;
        flex-direction: row
    }

    .booth-detail[style*="display: block"],
    .booth-detail[style*="display:block"] {
        display: flex !important
    }

    .booth-canvas-container {
        position: relative;
        flex: 1 1 60%;
        min-width: 0;
        min-height: 100vh;
        overflow: hidden;
        z-index: 1
    }

    .booth-canvas-container>canvas {
        position: absolute;
        top: 0;
        left: 0;
        width: 100% !important;
        height: 100% !important
    }

    .booth-detail-ui {
        position: relative;
        flex: 0 0 380px;
        max-width: 420px;
        z-index: 10;
        overflow-y: auto;
        padding: 24px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        gap: 20px;
        background: inherit;
        border-left: 1px solid rgba(128, 128, 128, .1)
    }

    .booth-detail-ui>* {
        pointer-events: auto
    }

    .booth-detail-top {
        display: flex;
        justify-content: space-between;
        align-items: center
    }

    .booth-detail-hero {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        mix-blend-mode: normal;
        color: var(--color-text);
        pointer-events: none
    }

    .booth-detail-title-text {
        font-size: clamp(1.4rem, 2.5vw, 2.2rem);
        line-height: 1.05;
        letter-spacing: -.03em;
        margin: 0;
        font-weight: 700;
        word-break: break-word
    }

    .booth-detail-bottom {
        display: flex;
        flex-direction: column;
        gap: 16px;
        flex: 1
    }

    .booth-spec-box {
        max-width: 100%;
        min-width: auto;
        background: rgba(128, 128, 128, .06);
        backdrop-filter: blur(20px) saturate(1.8);
        -webkit-backdrop-filter: blur(20px) saturate(1.8);
        border: 1px solid rgba(128, 128, 128, .1);
        border-radius: 14px;
        padding: 14px;
        display: flex;
        flex-direction: column;
        gap: 8px
    }

    .booth-action-group {
        display: flex;
        flex-direction: column;
        gap: 12px
    }

    .booth-detail-gallery {
        display: flex;
        gap: 6px;
        flex-wrap: wrap
    }

    /* Immersive mode on desktop */
    .booth-immersive .booth-canvas-container {
        position: fixed;
        inset: 0;
        z-index: 55;
        flex: none;
        width: 100%;
        height: 100%
    }

    .booth-immersive .booth-detail-ui {
        display: none !important
    }
}

/* ── 2D hero image ── */
.booth-2d-hero {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 2rem;
    box-sizing: border-box;
    background: var(--booth-scene-bg, #0a0a0a)
}

/* ── Buttons (Back, Zoom) ── */

.booth-back-btn,
.booth-zoom-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, .55);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 100px;
    padding: 8px 18px;
    font-size: .8rem;
    font-weight: 600;
    font-family: var(--font-main);
    color: var(--color-text);
    cursor: pointer;
    transition: all .2s
}

.booth-back-btn:hover,
.booth-zoom-btn:hover {
    background: rgba(255, 255, 255, .75)
}

/* ── Scene-aware glass overrides ── */

.booth-scene-dark .booth-back-btn,
.booth-scene-dark .booth-theme-btn,
.booth-scene-dark .booth-zoom-btn,
.booth-scene-dark .booth-spec-box,
.booth-scene-dark .booth-shop-link {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .9)
}

.booth-scene-dark .booth-back-btn:hover,
.booth-scene-dark .booth-theme-btn:hover,
.booth-scene-dark .booth-zoom-btn:hover {
    background: rgba(255, 255, 255, .15)
}

.booth-scene-dark .booth-spec-header,
.booth-scene-dark .booth-spec-desc,
.booth-scene-dark .booth-variant-price {
    color: rgba(255, 255, 255, .55)
}

.booth-scene-dark .booth-detail-hero {
    color: rgba(255, 255, 255, .9)
}

.booth-scene-light .booth-back-btn,
.booth-scene-light .booth-theme-btn,
.booth-scene-light .booth-zoom-btn,
.booth-scene-light .booth-spec-box,
.booth-scene-light .booth-shop-link {
    background: rgba(0, 0, 0, .06);
    border-color: rgba(0, 0, 0, .1);
    color: #222
}

.booth-scene-light .booth-back-btn:hover,
.booth-scene-light .booth-theme-btn:hover,
.booth-scene-light .booth-zoom-btn:hover {
    background: rgba(0, 0, 0, .12)
}

.booth-scene-light .booth-spec-header,
.booth-scene-light .booth-spec-desc,
.booth-scene-light .booth-variant-price {
    color: rgba(0, 0, 0, .55)
}

.booth-scene-light .booth-detail-hero {
    color: #111
}

/* Theme toggle button – round glass circle */
.booth-theme-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: inherit;
    transition: background .15s ease;
    box-sizing: border-box;
    flex-shrink: 0;
}

.booth-theme-btn:hover {
    background: rgba(255, 255, 255, .18)
}

.booth-theme-btn svg {
    display: block;
    width: 16px;
    height: 16px;
    transform: translateX(0.25px)
}

@media(prefers-color-scheme:dark) {

    :root:not([data-theme]) .booth-back-btn,
    :root:not([data-theme]) .booth-zoom-btn {
        background: rgba(18, 18, 18, .6);
        border-color: rgba(255, 255, 255, .08)
    }

    :root:not([data-theme]) .booth-back-btn:hover,
    :root:not([data-theme]) .booth-zoom-btn:hover {
        background: rgba(18, 18, 18, .8)
    }
}

[data-theme="dark"] .booth-back-btn,
[data-theme="dark"] .booth-zoom-btn {
    background: rgba(18, 18, 18, .6);
    border-color: rgba(255, 255, 255, .08)
}

[data-theme="dark"] .booth-back-btn:hover,
[data-theme="dark"] .booth-zoom-btn:hover {
    background: rgba(18, 18, 18, .8)
}

/* ── Spec box ── */

.booth-spec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-dark-gray);
    border-bottom: 1px solid rgba(128, 128, 128, .15);
    padding-bottom: 6px
}

.booth-spec-price {
    color: var(--color-accent);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -.02em
}

.booth-spec-variants {
    display: flex;
    flex-direction: column;
    gap: 4px
}

.booth-variant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .75rem;
    padding: 4px 0;
    border-bottom: 1px solid rgba(128, 128, 128, .08)
}

.booth-variant-name {
    font-weight: 500
}

.booth-variant-price {
    font-weight: 600;
    color: var(--color-dark-gray);
    font-size: .7rem
}

.booth-spec-desc {
    font-size: .75rem;
    line-height: 1.6;
    color: var(--color-dark-gray);
    max-height: 120px;
    overflow-y: auto;
    margin-top: 4px;
    font-weight: 450
}

@media(prefers-color-scheme:dark) {
    :root:not([data-theme]) .booth-spec-box {
        background: rgba(18, 18, 18, .6);
        border-color: rgba(255, 255, 255, .08)
    }
}

[data-theme="dark"] .booth-spec-box {
    background: rgba(18, 18, 18, .6);
    border-color: rgba(255, 255, 255, .08)
}

/* ── Shop link ── */

.booth-shop-link {
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, .55);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 100px;
    padding: 12px 24px;
    color: var(--color-text);
    text-decoration: none;
    transition: all .25s
}

.booth-shop-link:hover {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
    box-shadow: 0 0 24px rgba(50, 205, 50, .2)
}

@media(prefers-color-scheme:dark) {
    :root:not([data-theme]) .booth-shop-link {
        background: rgba(18, 18, 18, .6);
        border-color: rgba(255, 255, 255, .08)
    }
}

[data-theme="dark"] .booth-shop-link {
    background: rgba(18, 18, 18, .6);
    border-color: rgba(255, 255, 255, .08)
}

.booth-arrows {
    font-size: .7rem;
    letter-spacing: -2px
}

/* ── Gallery thumbnails ── */

.booth-gallery-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color .2s, transform .2s;
    opacity: .7
}

.booth-gallery-thumb:hover,
.booth-gallery-thumb.active {
    border-color: var(--color-accent);
    transform: scale(1.08);
    opacity: 1
}

.booth-gallery-3d-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: rgba(50, 205, 50, .12);
    color: var(--color-accent);
    font-size: .55rem;
    font-weight: 700;
    letter-spacing: .05em
}

/* ── Product nav arrows ── */

.booth-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, .35);
    backdrop-filter: blur(12px) saturate(1.6);
    -webkit-backdrop-filter: blur(12px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .85);
    font-size: 1.3rem;
    line-height: 1;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background .2s, color .2s, opacity .25s, transform .2s;
    opacity: .75;
    padding: 0
}

.booth-nav-prev {
    left: 16px
}

.booth-nav-next {
    right: 16px
}

.booth-nav-arrow:hover {
    background: rgba(0, 0, 0, .55);
    color: #fff;
    opacity: 1;
    transform: translateY(-50%) scale(1.08)
}

.booth-nav-arrow:active {
    transform: translateY(-50%) scale(.95)
}

.booth-nav-arrow.booth-nav-hidden {
    opacity: 0;
    pointer-events: none
}

/* ── Immersive mode (ALL viewports) ── */

.booth-canvas-container {
    transition: border-radius .5s cubic-bezier(.4, 0, .2, 1)
}

/* UI panel collapsed (layout) */
.booth-ui-collapsed {
    flex-basis: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    border-left-color: transparent !important;
    overflow: hidden !important
}

.booth-immersive .booth-nav-arrow {
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease
}

.booth-immersive .booth-zoom-btn {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60
}

/* Iris FAB remains visible on all views */

/* ── Mobile ── */
@media(max-width:640px) {
    .booth-detail {
        position: fixed;
        overflow-y: auto;
        flex-direction: column !important
    }

    .booth-detail[style*="display: block"],
    .booth-detail[style*="display:block"] {
        display: block !important
    }

    .booth-canvas-container {
        position: sticky;
        top: 0;
        height: 45vh;
        min-height: 260px;
        overflow: hidden
    }

    .booth-detail-ui {
        position: relative;
        min-height: auto;
        padding: 14px;
        pointer-events: auto;
        display: flex;
        flex-direction: column;
        gap: 14px
    }

    .booth-detail-top {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 60;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 14px;
        background: linear-gradient(to bottom, rgba(0, 0, 0, .45) 0%, transparent 100%)
    }

    .booth-detail-ui>* {
        pointer-events: auto
    }

    .booth-detail-hero {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        mix-blend-mode: normal;
        color: var(--color-text);
        padding: 0
    }

    .booth-detail-bottom {
        flex-direction: column;
        align-items: stretch
    }

    .booth-spec-box {
        max-width: 100%;
        background: rgba(128, 128, 128, .06);
        backdrop-filter: blur(20px) saturate(1.8);
        -webkit-backdrop-filter: blur(20px) saturate(1.8);
        border: 1px solid rgba(128, 128, 128, .1);
        border-radius: 14px;
        padding: 14px;
        display: flex;
        flex-direction: column;
        gap: 8px
    }

    .booth-action-group {
        align-items: stretch;
        text-align: center;
        margin-top: 8px;
        margin-bottom: 24px
    }

    .booth-shop-link {
        display: flex;
        width: 100%;
        justify-content: center
    }

    .booth-detail-gallery {
        display: flex;
        gap: 6px;
        justify-content: center;
        order: -1;
        margin-top: 0;
        padding: 10px 14px 0
    }

    .booth-detail-title-text {
        font-size: clamp(1.5rem, 8vw, 3rem)
    }

    /* Immersive mode mobile */
    .booth-immersive .booth-canvas-container {
        position: fixed;
        inset: 0;
        height: auto;
        min-height: auto;
        border-radius: 0;
        z-index: 55;
        transform: scale(1)
    }

    .booth-immersive .booth-detail-ui {
        opacity: 0;
        transform: translateY(20px);
        pointer-events: none;
        max-height: 0;
        overflow: hidden
    }
}