/* Product page: video, PDF, 3D assets (BEM) */

.fullproduct-media__mock-hint {
    color: #d6a162;
}

.fullproduct-media__mock-hint a {
    color: #d6a162;
}

.fullproduct-media {
    width: 100%;
    margin-bottom: 60px;
}

.fullproduct-media__title {
    margin-bottom: 20px;
}

.fullproduct-media__title--section {
    margin-top: 36px;
    margin-bottom: 16px;
}

.fullproduct-media>.fullproduct-media__title--section:first-child {
    margin-top: 0;
}

.fullproduct-media__downloads {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.fullproduct-media__row--downloads {
    margin-top: 0;
}

.fullproduct-media__model-dl-bar--standalone {
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: flex-start;
}

.fullproduct-media__model-engage-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    box-sizing: border-box;
    margin: 0;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    font: inherit;
    color: #f6f6f6;
    text-align: center;
    cursor: pointer;
    background: rgba(20, 18, 16, 0.48);
    transition: opacity 0.2s ease, background 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.fullproduct-media__model-card[data-three-card="1"] .fullproduct-media__model-engage-overlay {
    background: rgba(255, 255, 255, 0.38);
    color: #1a1a1a;
}

.fullproduct-media__model-card[data-three-card="1"] .fullproduct-media__model-engage-hint {
    opacity: 0.75;
}

.fullproduct-media__model-card:not([data-model-viewer-ready="1"]) .fullproduct-media__model-engage-overlay {
    pointer-events: none;
    cursor: wait;
}

.fullproduct-media__model-card--active .fullproduct-media__model-engage-overlay {
    opacity: 0;
    pointer-events: none;
}

.fullproduct-media__model-engage-overlay:focus-visible {
    outline: 2px solid #d6a162;
    outline-offset: -2px;
}

.fullproduct-media__model-engage-text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    max-width: 320px;
    line-height: 1.35;
}

.fullproduct-media__model-engage-hint {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.03em;
    opacity: 0.85;
    max-width: 300px;
    line-height: 1.45;
}

.fullproduct-media__video video {
    display: block;
    width: 100%;
    min-height: 400px;
    max-height: min(85vh, 920px);
    aspect-ratio: 16 / 9;
    background: #0d0d0d;
    border-radius: 6px;
}

.fullproduct-media__row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 24px;
}

.fullproduct-media__row>.product-asset-strip {
    max-width: 100%;
}

.fullproduct-media__row--model .fullproduct-media__model-card,
.fullproduct-media__model-card--fullrow {
    flex: 1 1 100%;
    max-width: 100%;
}

.fullproduct-media__model-card {
    flex: 1 1 320px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.fullproduct-media__model-frame {
    display: flex;
    flex-direction: column;
    border-radius: 6px;
    overflow: hidden;
    background: #141210;
}

.fullproduct-media__model-viewport {
    position: relative;
    flex: 1 1 auto;
    min-height: 460px;
    height: 52vh;
    max-height: 720px;
    width: 100%;
}

.fullproduct-media__model-viewport>model-viewer,
.fullproduct-media__model-viewport>.fullproduct-media__model-slot,
.fullproduct-media__model-viewport>canvas.fullproduct-media__model-viewer {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 0;
}

.fullproduct-media__model-viewport>.fullproduct-media__model-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    min-height: 0;
    border-radius: 0;
}

.fullproduct-media__model-dl-bar {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 14px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.55);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.fullproduct-media__model-dl {
    box-sizing: border-box;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 52px;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none !important;
    color: #f6f6f6 !important;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: background 0.15s linear, border-color 0.15s linear;
}

.fullproduct-media__model-dl:hover {
    background: rgba(214, 161, 98, 0.25);
    border-color: rgba(214, 161, 98, 0.45);
    color: #fff !important;
}

.fullproduct-media__model-dl-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    font-size: 18px;
    opacity: 0.95;
}

.fullproduct-media__model-dl-format {
    text-transform: uppercase;
}

.fullproduct-media__model-viewer {
    width: 100%;
    min-height: 280px;
    height: 360px;
    background: #141210;
    border-radius: 6px;
}

.fullproduct-media__model-preview {
    border-radius: 6px;
    overflow: hidden;
    background: #141210;
    min-height: 200px;
    max-height: 360px;
}

.fullproduct-media__model-preview img {
    width: 100%;
    height: 100%;
    max-width: 100% !important;
    margin: 0 !important;
    object-fit: contain;
    display: block;
}

.fullproduct-media__model-preview--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.12em;
    color: #888d92;
    font-size: 14px;
    text-transform: uppercase;
}

.product-asset-strip {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    min-height: 56px;
    padding: 12px 16px;
    border-radius: 6px;
    text-decoration: none;
    color: #fff !important;
    letter-spacing: 0.02em;
    background: #2b2621;
    border: 1px solid rgba(214, 161, 98, 0.15);
    transition: background 0.15s linear, border-color 0.15s linear;
}

.product-asset-strip:hover {
    background: #332b24;
    border-color: rgba(214, 161, 98, 0.35);
}

.product-asset-strip__icon {
    flex-shrink: 0;
    font-size: 18px;
    opacity: 0.9;
}

.product-asset-strip__label {
    flex: 1 1 auto;
    text-align: left;
    line-height: 140%;
}

.product-asset-strip__badge {
    flex-shrink: 0;
    min-width: 52px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-align: center;
    text-transform: uppercase;
    background: #9c6b1c;
    color: #fff !important;
}

.product-asset-strip__badge--3d {
    background: #065d79;
}

.product-asset-strip--video .product-asset-strip__badge {
    background: #5c3566;
}

@media (max-width: 767px) {
    .product-asset-strip {
        width: 100%;
    }

    .fullproduct-media {
        margin-bottom: 40px;
    }

    .fullproduct-media__video video {
        min-height: 220px;
        max-height: min(72vh, 560px);
    }

    .fullproduct-media__model-viewport {
        min-height: 320px;
        height: 44vh;
        max-height: 520px;
    }

    .fullproduct-media__model-viewer {
        height: 260px;
        min-height: 220px;
    }
}

/* Light theme (see theme-toggle: data-theme on documentElement) */
:root[data-theme="light"] .fullproduct-media__title {
    color: var(--color-white);
}

:root[data-theme="light"] .fullproduct-media__video video,
:root[data-theme="light"] .fullproduct-media__video--pending {
    background: #e8e8e8;
}

:root[data-theme="light"] .fullproduct-media__model-viewer,
:root[data-theme="light"] .fullproduct-media__model-preview,
:root[data-theme="light"] .fullproduct-media__model-slot {
    background: #e8e8e8;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .fullproduct-media__model-preview--empty {
    color: #5c5f63;
}

:root[data-theme="light"] .product-asset-strip {
    background: #ece8e2;
    color: #1a1a1a !important;
    border-color: rgba(0, 0, 0, 0.1);
}

:root[data-theme="light"] .product-asset-strip:hover {
    background: #e0d9cf;
    border-color: rgba(0, 0, 0, 0.14);
}

:root[data-theme="light"] .product-asset-strip__icon {
    color: #4a4a4a;
}

:root[data-theme="light"] .fullproduct-media__mock-hint {
    color: #6b563d;
}

:root[data-theme="light"] .fullproduct-media__mock-hint a {
    color: #8b5a1a;
}

:root[data-theme="light"] .fullproduct-media__model-frame {
    background: #e8e8e8;
}

:root[data-theme="light"] .fullproduct-media__model-dl-bar {
    background: rgba(255, 255, 255, 0.94);
    border-top-color: rgba(0, 0, 0, 0.08);
}

:root[data-theme="light"] .fullproduct-media__model-dl {
    color: #1a1a1a !important;
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

:root[data-theme="light"] .fullproduct-media__model-dl:hover {
    background: rgba(214, 161, 98, 0.22);
    border-color: rgba(156, 107, 28, 0.35);
    color: #1a1a1a !important;
}

:root[data-theme="light"] .fullproduct-media__model-dl-icon {
    color: #333;
}

:root[data-theme="light"] .fullproduct-media__model-dl-bar--standalone {
    border-color: rgba(0, 0, 0, 0.1);
}

:root[data-theme="light"] .fullproduct-media__model-engage-overlay {
    color: #1a1a1a;
    background: rgba(232, 232, 232, 0.42);
}

:root[data-theme="light"] .fullproduct-media__model-engage-hint {
    color: #333;
    opacity: 0.9;
}

/* Lazy placeholders */
.fullproduct-media__video--pending .fullproduct-media__video-el--pending {
    min-height: 400px;
}

.fullproduct-media__model-slot {
    box-sizing: border-box;
    position: relative;
    width: 100%;
    min-height: 280px;
    height: 360px;
    border-radius: 6px;
    background: #141210;
}

.fullproduct-media__model-viewport .fullproduct-media__model-slot {
    height: 100%;
    min-height: 0;
}

.fullproduct-media__model-slot[data-three-runtime="1"] {
    background: #e4e4e4;
}

.fullproduct-media__model-slot .fullproduct-media__model-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.fullproduct-media__model-slot--loading::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(214, 161, 98, 0.25);
    border-top-color: #d6a162;
    border-radius: 50%;
    animation: product-media-spin 0.9s linear infinite;
}

.fullproduct-media__model-slot--loading {
    position: relative;
}

.fullproduct-media__model-slot--error::after {
    content: "Не удалось загрузить 3D";
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 14px;
    color: #888d92;
    padding: 16px;
    text-align: center;
}

:root[data-theme="light"] .fullproduct-media__model-slot--error::after {
    color: #5c5f63;
}

.fullproduct-media__models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 20px;
}

.fullproduct-media__model-format-badge {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: #065d79;
    color: #fff;
}

:root[data-theme="light"] .fullproduct-media__model-format-badge {
    background: #0a7fa6;
}

@media (max-width: 767px) {
    .fullproduct-media__models-grid {
        grid-template-columns: 1fr;
    }
}

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