/* TERXO 3D — bloque promocional en ficha + página del visor + hero en index */

/* ── Hero 3D en portada de ficha ── */
.hero-3d-wrap {
    display: block;
    position: relative;
    flex-shrink: 0;
    width: min(100%, 255px);
    max-width: 255px;
}

.hero-3d-frame {
    width: 100%;
    min-height: clamp(238px, 50vw, 340px);
    border-radius: 24px;
    background-color: #fff;
    padding: 3px;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
    border: 3px solid #0a0a0a;
    box-shadow: none;
}

.hero-3d-crop {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: calc(clamp(238px, 50vw, 340px) - 6px);
    overflow: hidden;
    border-radius: 18px;
}

.hero-3d-binkies {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: auto;
    background: #fff;
    transform: translate(-50%, -50%) scale(1.34);
    transform-origin: center center;
}

.hero-3d-poster {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    margin: 0 auto;
}

.hero-3d-expand {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 12;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #e53935;
    color: #fff;
    font-family: 'Syne', 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 3px 3px 0 #0a0a0a;
    border: 2px solid #0a0a0a;
    transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.hero-3d-expand:hover {
    background: #c62828;
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 #0a0a0a;
}

.hero-3d-expand:active {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 #0a0a0a;
}

@media (max-width: 900px) {
    .top-panel .hero-3d-wrap {
        width: min(100%, 220px);
        max-width: 220px;
    }

    .hero-3d-frame {
        min-height: clamp(204px, 44vw, 272px);
        border-radius: 22px;
        padding: 3px;
    }

    .hero-3d-crop {
        min-height: calc(clamp(204px, 44vw, 272px) - 6px);
        border-radius: 17px;
    }

    .hero-3d-binkies {
        transform: translate(-50%, -50%) scale(1.32);
    }
}

@media (max-width: 768px) {
    .top-panel:has(.hero-3d-wrap) {
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: 0;
        row-gap: 8px;
        align-items: stretch;
    }

    .top-panel .hero-3d-wrap {
        grid-column: 1;
        grid-row: 3;
        justify-self: start;
        align-self: stretch;
        width: 140px;
        max-width: 140px;
        display: flex;
        flex-direction: column;
        margin: 0;
        z-index: 1;
    }

    .top-panel:has(.hero-3d-wrap) .hero-3d-frame {
        flex: 1 1 auto;
        width: 100%;
        height: 100%;
        min-height: 175px;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        border-top-right-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
        border-right: none !important;
        box-shadow: none !important;
    }

    .top-panel:has(.hero-3d-wrap) .hero-3d-crop {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
    }

    .top-panel:has(.hero-3d-wrap) .variant-selector {
        grid-column: 2;
        grid-row: 3;
        align-self: stretch;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 6px;
        width: 100% !important;
        max-width: none !important;
        min-width: 0;
        min-height: 175px;
        margin: 0;
        padding: 8px 8px 10px;
        box-sizing: border-box;
        background: #fff;
        border: 2px solid #0a0a0a;
        border-left: none;
        box-shadow: none !important;
        position: relative;
        z-index: 20 !important;
        isolation: isolate;
        overflow: visible;
    }

    .top-panel:has(.hero-3d-wrap) .variant-selector.active {
        z-index: 50 !important;
    }

    .top-panel:has(.hero-3d-wrap) .variant-trigger {
        min-height: 52px;
        height: auto;
        flex: 0 0 auto;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        padding: 10px 12px;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
        background: transparent !important;
        cursor: pointer;
        position: relative;
        z-index: 3;
    }

    .top-panel:has(.hero-3d-wrap) .variant-trigger .variant-spec-head {
        gap: 8px;
        align-items: center;
        width: 100%;
    }

    .top-panel:has(.hero-3d-wrap) .variant-trigger .variant-spec-head strong {
        font-size: 0.85rem !important;
        line-height: 1.15;
    }

    .top-panel:has(.hero-3d-wrap) .variant-trigger .variant-market {
        font-size: 0.58rem !important;
        padding: 3px 8px !important;
        line-height: 1.2;
    }

    .top-panel:has(.hero-3d-wrap) .variant-dropdown {
        z-index: 200 !important;
    }

    .top-panel:has(.hero-3d-wrap) .variant-selector .floating-actions {
        position: relative !important;
        z-index: 1;
        top: auto !important;
        right: auto !important;
        flex: 1 1 auto;
        align-self: stretch;
        margin: 0 !important;
        padding: 4px 0 0;
        width: 100% !important;
        max-width: none !important;
        min-height: 0;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(2, minmax(0, 1fr));
        gap: 5px !important;
        align-items: stretch;
        justify-items: stretch;
        overflow: hidden;
    }

    .top-panel:has(.hero-3d-wrap) .variant-selector .floating-actions .action-item:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
    }

    .top-panel:has(.hero-3d-wrap) .variant-selector .floating-actions .action-item:nth-child(2) {
        grid-column: 2;
        grid-row: 1;
    }

    .top-panel:has(.hero-3d-wrap) .variant-selector .floating-actions .action-item:nth-child(3) {
        grid-column: 1;
        grid-row: 2;
    }

    .top-panel:has(.hero-3d-wrap) .variant-selector .floating-actions .action-item--compare {
        grid-column: 2;
        grid-row: 2;
    }

    .top-panel:has(.hero-3d-wrap) .variant-selector .floating-actions .action-item,
    .top-panel:has(.hero-3d-wrap) .variant-selector .floating-actions .action-item--compare {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        height: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        min-height: 42px;
        gap: 5px !important;
        margin: 0 !important;
    }

    .top-panel:has(.hero-3d-wrap) .variant-selector .floating-actions .action-counter > span:not([id]) {
        display: none !important;
    }

    .top-panel:has(.hero-3d-wrap) .variant-selector .floating-actions .action-compare-label {
        display: none !important;
    }

    .top-panel:has(.hero-3d-wrap) .variant-selector .floating-actions .action-button,
    .top-panel:has(.hero-3d-wrap) .variant-selector .floating-actions .btn-compare-detail {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        margin: 0 !important;
        padding: 0 !important;
        flex-shrink: 0;
        box-shadow: 2px 2px 0 #0a0a0a !important;
    }

    .top-panel:has(.hero-3d-wrap) .variant-selector .floating-actions .action-button > span[style] {
        width: 20px !important;
        height: 20px !important;
    }

    .top-panel:has(.hero-3d-wrap) .variant-selector .floating-actions .btn-compare-detail .compare-icon {
        font-size: 1.15rem !important;
        line-height: 1;
    }

    .top-panel:has(.hero-3d-wrap) .variant-selector .floating-actions .action-counter {
        font-size: 0.65rem !important;
        font-weight: 800;
        line-height: 1;
        text-align: center;
        flex: 0 0 auto;
        min-width: 0;
        margin: 0 !important;
    }
}

@media (max-width: 640px) {
    .top-panel .hero-3d-wrap {
        width: 140px;
        max-width: 140px;
        margin: 0;
    }

    .top-panel:has(.hero-3d-wrap) .hero-3d-frame {
        width: 100%;
        min-height: 175px;
        border-radius: 26px;
        border-top-right-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
        padding: 2px;
        border-width: 2px;
        box-shadow: none;
    }

    .top-panel:has(.hero-3d-wrap) .hero-3d-crop {
        min-height: 0;
        border-radius: 22px;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }

    .hero-3d-binkies {
        transform: translate(-50%, -50%) scale(1.36);
    }

    .hero-3d-poster {
        width: 100%;
        max-height: none;
    }

    .hero-3d-expand {
        top: 6px;
        right: 6px;
        width: 30px;
        height: 30px;
        border-radius: 8px;
        font-size: 1.35rem;
        box-shadow: 2px 2px 0 #0a0a0a;
    }
}

/* ── Bloque compacto en ficha (neobrutalista blanco, móvil-first) ── */
.viewer3d-block {
    width: 100%;
    min-width: 0;
    margin-top: 0 !important;
    padding: 16px 0 !important;
    max-width: none !important;
    border-top: 3px solid #0a0a0a !important;
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
}

.viewer3d-block::before {
    display: none !important;
}

.viewer3d-block-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    padding: 12px 14px;
    background: #ffffff;
    color: #0a0a0a;
    border: 3px solid #0a0a0a;
    border-radius: 0;
    box-shadow: 4px 4px 0 #0a0a0a;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.viewer3d-block-inner:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #0a0a0a;
}

.viewer3d-block-inner:active {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 #0a0a0a;
}

.viewer3d-block-thumb {
    position: relative;
    flex: 0 0 52px;
    width: 52px;
    height: 64px;
    border-radius: 0;
    background: #fff;
    border: 3px solid #0a0a0a;
    box-shadow: 3px 3px 0 #6ee7ff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer3d-block-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 4px;
}

.viewer3d-thumb-badge {
    position: absolute;
    bottom: -1px;
    right: -1px;
    font-family: 'Syne', 'Montserrat', sans-serif;
    font-size: 0.5rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #0a0a0a;
    background: #6ee7ff;
    border: 2px solid #0a0a0a;
    border-radius: 0;
    padding: 2px 5px;
    line-height: 1;
    box-shadow: 2px 2px 0 #0a0a0a;
}

.viewer3d-block-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.viewer3d-block-head {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.viewer3d-block-copy h3 {
    font-family: 'Syne', 'Montserrat', sans-serif !important;
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: #0a0a0a !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    white-space: nowrap;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.viewer3d-block-model {
    font-size: 0.72rem;
    font-weight: 700;
    color: #0a0a0a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.viewer3d-block-desc {
    font-size: 0.68rem;
    line-height: 1.35;
    color: #3a3a3a;
    margin: 0;
    font-weight: 500;
}

.viewer3d-block-arrow {
    flex: 0 0 auto;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: #0a0a0a;
    margin-left: auto;
    padding-left: 8px;
}

@media (min-width: 640px) {
    .viewer3d-block {
        padding: 20px 0 !important;
    }

    .viewer3d-block-inner {
        gap: 16px;
        padding: 14px 18px;
    }

    .viewer3d-block-thumb {
        flex: 0 0 60px;
        width: 60px;
        height: 72px;
        box-shadow: 4px 4px 0 #6ee7ff;
    }

    .viewer3d-block-copy h3 {
        font-size: 0.9rem !important;
    }

    .viewer3d-block-model {
        font-size: 0.78rem;
    }

    .viewer3d-block-desc {
        font-size: 0.72rem;
    }
}

/* ── Página del visor 3D ── */
.viewer3d-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: calc(var(--viewer3d-vh, 1vh) * 100);
    background: #0d0d12;
    color: #f5f5f5;
    font-family: 'Montserrat', sans-serif;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
}

.viewer3d-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: calc(var(--viewer3d-vh, 1vh) * 100);
    height: 100vh;
    height: 100dvh;
    height: calc(var(--viewer3d-vh, 1vh) * 100);
}

.viewer3d-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-shrink: 0;
    padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(64px, calc(16px + env(safe-area-inset-right)));
    border-bottom: 3px solid #0a0a0a;
    background: #111118;
}

.viewer3d-header-copy {
    min-width: 0;
}

.viewer3d-header-copy h1 {
    font-family: 'Syne', 'Montserrat', sans-serif;
    font-size: clamp(0.9rem, 4.5vw, 1.35rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0 0 2px;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.viewer3d-header-copy p {
    margin: 0;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6ee7ff;
    font-weight: 700;
}

.viewer3d-hint {
    margin: 6px 0 0 !important;
    font-size: 0.62rem !important;
    letter-spacing: 0.04em !important;
    text-transform: none !important;
    color: rgba(255, 255, 255, 0.55) !important;
    font-weight: 500 !important;
}

.viewer3d-color-active {
    margin: 4px 0 0 !important;
    font-size: 0.72rem !important;
    letter-spacing: 0.02em !important;
    text-transform: none !important;
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 600 !important;
}

.viewer3d-body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
}

.viewer3d-parts {
    flex: 0 0 min(300px, 38vw);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    border-left: 3px solid #0a0a0a;
    background: #111118;
    z-index: 4;
}

.viewer3d-parts[hidden] {
    display: none !important;
}

.viewer3d-parts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 2px solid rgba(110, 231, 255, 0.25);
}

.viewer3d-parts-header h2 {
    margin: 0;
    font-family: 'Syne', 'Montserrat', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.viewer3d-parts-close {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 2px solid #fff;
    background: transparent;
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.viewer3d-parts-list {
    list-style: none;
    margin: 0;
    padding: 8px;
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
}

.viewer3d-parts-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    margin-bottom: 4px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.viewer3d-parts-item:hover,
.viewer3d-parts-item.is-active {
    border-color: #6ee7ff;
    background: rgba(110, 231, 255, 0.12);
}

.viewer3d-parts-item.is-active {
    box-shadow: inset 4px 0 0 #6ee7ff;
}

.viewer3d-parts-detail {
    padding: 10px 12px 12px;
    overflow: hidden;
    flex: 0 0 auto;
    font-size: 0.72rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.82);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.viewer3d-parts-detail strong {
    display: block;
    margin-bottom: 6px;
    font-family: 'Syne', 'Montserrat', sans-serif;
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6ee7ff;
}

.viewer3d-parts-detail p {
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.viewer3d-swap {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(13, 13, 18, 0.55);
    z-index: 3;
    pointer-events: none;
}

.viewer3d-swap[hidden] {
    display: none !important;
}

.viewer3d-binkies--fading {
    opacity: 0.35;
    transition: opacity 0.25s ease;
}

.viewer3d-stage--swapping .viewer3d-binkies {
    transition: opacity 0.25s ease;
}

.viewer3d-binkies:not(.viewer3d-binkies--fading) {
    opacity: 1;
    transition: opacity 0.25s ease;
}

.viewer3d-stage--rotating .viewer3d-binkies {
    transition: opacity 0.2s ease;
}

.viewer3d-close {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    width: 48px;
    height: 48px;
    border-radius: 0;
    background: #ff6b6b;
    border: 3px solid #0a0a0a;
    color: #0a0a0a;
    text-decoration: none;
    font-size: 1.6rem;
    font-weight: 800;
    font-family: 'Syne', 'Montserrat', sans-serif;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 200;
    box-shadow: 4px 4px 0 #0a0a0a;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.viewer3d-close:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #0a0a0a;
    background: #ff8585;
    color: #0a0a0a;
}

.viewer3d-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    background:
        radial-gradient(circle at 50% 35%, rgba(110, 231, 255, 0.12), transparent 55%),
        #0d0d12;
}

.viewer3d-model {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    --poster-color: transparent;
    background: transparent;
}

.viewer3d-model[hidden] {
    display: none !important;
}

.viewer3d-binkies {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    display: block;
    background: #0d0d12;
    transform-origin: center center;
    transition: transform 0.45s ease, opacity 0.25s ease;
}

.viewer3d-stage--binkies {
    background: #0d0d12;
}

.viewer3d-page--binkies .viewer3d-layout {
    display: flex;
    flex-direction: column;
}

.viewer3d-binkies-credit {
    position: absolute;
    bottom: max(8px, env(safe-area-inset-bottom));
    right: max(10px, env(safe-area-inset-right));
    margin: 0;
    font-size: 0.58rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    pointer-events: none;
    z-index: 1;
}

.viewer3d-loading,
.viewer3d-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    text-align: center;
    background: rgba(13, 13, 18, 0.82);
    z-index: 2;
}

.viewer3d-loading[hidden],
.viewer3d-error[hidden] {
    display: none !important;
}

.viewer3d-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(110, 231, 255, 0.25);
    border-top-color: #6ee7ff;
    border-radius: 50%;
    animation: viewer3d-spin 0.8s linear infinite;
}

@keyframes viewer3d-spin {
    to { transform: rotate(360deg); }
}

.viewer3d-fallback-link {
    color: #6ee7ff;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 2px solid #6ee7ff;
}

.viewer3d-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
    padding: 12px 16px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    border-top: 3px solid #0a0a0a;
    background: #111118;
}

.viewer3d-colors {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
}

.viewer3d-colors-label {
    font-family: 'Syne', 'Montserrat', sans-serif;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    margin-right: 2px;
    flex-shrink: 0;
}

.viewer3d-color-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 3px solid #fff;
    border-radius: 0;
    background: var(--viewer3d-color, #6ee7ff);
    box-shadow: 3px 3px 0 #0a0a0a;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.viewer3d-color-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 #6ee7ff;
}

.viewer3d-color-btn.is-active {
    outline: 3px solid #6ee7ff;
    outline-offset: 2px;
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 #fff;
}

.viewer3d-toolbar[hidden] {
    display: none !important;
}

.viewer3d-btn {
    padding: 12px 18px;
    min-height: 44px;
    background: #6ee7ff;
    color: #0a0a0a;
    border: 3px solid #fff;
    box-shadow: 4px 4px 0 #fff;
    font-family: 'Syne', 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.viewer3d-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0 #6ee7ff;
}

.viewer3d-btn--ghost {
    background: transparent;
    color: #fff;
}

@media (max-width: 768px) {
    .viewer3d-close {
        width: 44px;
        height: 44px;
        font-size: 1.45rem;
    }

    .viewer3d-body {
        flex-direction: column;
    }

    .viewer3d-parts {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        flex: none;
        width: 100%;
        max-height: min(58vh, 420px);
        overflow: hidden;
        border-left: 0;
        border-top: 3px solid #0a0a0a;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
    }

    .viewer3d-parts-list {
        padding: 6px 8px;
    }

    .viewer3d-parts-item {
        padding: 7px 9px;
        margin-bottom: 3px;
        font-size: 0.68rem;
    }

    .viewer3d-header {
        padding-top: max(10px, env(safe-area-inset-top));
        padding-bottom: 10px;
    }

    .viewer3d-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .viewer3d-colors {
        order: -1;
        width: 100%;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

    .viewer3d-colors::-webkit-scrollbar {
        display: none;
    }

    .viewer3d-colors[hidden] {
        display: none !important;
    }

    .viewer3d-btn {
        width: 100%;
    }

    .viewer3d-loading,
    .viewer3d-error {
        padding: 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .viewer3d-header-copy h1 {
        font-size: clamp(0.82rem, 4.2vw, 1rem);
    }

    .viewer3d-header-copy p {
        font-size: 0.62rem;
    }

    .viewer3d-color-btn {
        width: 44px;
        height: 44px;
    }

    .viewer3d-colors-label {
        font-size: 0.62rem;
    }
}

@media (min-width: 769px) {
    .viewer3d-header {
        gap: 16px;
        padding: 16px 20px;
        padding-top: max(16px, env(safe-area-inset-top));
        padding-right: max(72px, calc(20px + env(safe-area-inset-right)));
    }

    .viewer3d-header-copy h1 {
        margin-bottom: 4px;
    }

    .viewer3d-header-copy p {
        font-size: 0.78rem;
    }

    .viewer3d-close {
        top: max(20px, env(safe-area-inset-top));
        right: max(20px, env(safe-area-inset-right));
        width: 52px;
        height: 52px;
        font-size: 1.75rem;
    }

    .viewer3d-toolbar {
        gap: 12px;
        padding: 14px 20px 20px;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    .viewer3d-color-btn {
        width: 34px;
        height: 34px;
    }

    .viewer3d-btn {
        font-size: 0.78rem;
        width: auto;
    }
}
