.ge-p599-3d,
.ge-p599-3d__stage {
    width: 100%;
    height: 100%;
    min-width: 0;
}

.ge-p599-3d {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #eef3f1;
    color: #1f2d22;
}

.ge-p599-3d__stage {
    position: relative;
    isolation: isolate;
}

.ge-p599-3d__poster,
.ge-p599-3d__viewer {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #eef3f1;
}

.ge-p599-3d__poster {
    z-index: 1;
    transition: opacity 180ms ease;
}

.ge-p599-3d__viewer {
    z-index: 2;
    opacity: 0;
    touch-action: pan-y;
    transition: opacity 180ms ease;
}

.ge-p599-3d__viewer--ready {
    opacity: 1;
}

/* ── Спиннер загрузки: деликатный, в углу, без текста ─────────────── */
.ge-p599-3d__spinner {
    position: absolute;
    z-index: 3;
    right: 14px;
    bottom: 14px;
    display: none;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 2.5px solid rgba(55, 72, 54, 0.20);
    border-top-color: #374836;
    background: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: ge-p599-3d-spin 0.8s linear infinite;
}
.ge-p599-3d[data-state="loading"] .ge-p599-3d__spinner {
    display: block;
}
@keyframes ge-p599-3d-spin {
    to { transform: rotate(360deg); }
}

/* ── Бейдж «360°»: подсказка «объект вращается» (верх-левый угол) ─── */
.ge-p599-3d__spin-badge {
    position: absolute;
    z-index: 4;
    left: 12px;
    top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px 5px 7px;
    border-radius: 999px;
    border: 1px solid rgba(55, 72, 54, 0.14);
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(31, 45, 34, 0.12);
    color: #374836;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    pointer-events: none;
}
.ge-p599-3d__spin-badge svg {
    width: 16px;
    height: 16px;
    display: block;
}
/* нет 3D (ошибка) — бейдж не показываем */
.ge-p599-3d[data-state="error"] .ge-p599-3d__spin-badge {
    display: none;
}

/* ── Панель запуска (fallback: нет JS/IO/WebGL) ───────────────────── */
.ge-p599-3d__launch-panel {
    position: absolute;
    z-index: 4;
    inset: auto 0 0;
    display: grid;
    justify-items: center;
    padding: 40px 16px 16px;
    background: linear-gradient(to bottom, transparent, rgba(238, 243, 241, 0.96) 46%);
}

.ge-p599-3d__button {
    min-height: 40px;
    max-width: 100%;
    padding: 9px 16px;
    border: 1px solid #374836;
    border-radius: 8px;
    background: #374836;
    color: #fff;
    font: inherit;
    font-size: 14px;
    line-height: 1.2;
    cursor: pointer;
    transition: background 160ms ease;
}
.ge-p599-3d__button:hover {
    background: #253126;
}
.ge-p599-3d__button:disabled {
    cursor: wait;
    opacity: 0.76;
}

/* ── Иконочные кнопки управления: матовое стекло, брендовый зелёный ─ */
.ge-p599-3d__controls {
    position: absolute;
    z-index: 4;
    right: 12px;
    bottom: 12px;
    display: flex;
    gap: 8px;
}
.ge-p599-3d__controls[hidden],
.ge-p599-3d__launch-panel[hidden] {
    display: none !important;
}

.ge-p599-3d__iconbtn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(55, 72, 54, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #374836;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(31, 45, 34, 0.12);
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}
.ge-p599-3d__iconbtn:hover {
    background: #374836;
    color: #fff;
    transform: translateY(-1px);
}
.ge-p599-3d__iconbtn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.ge-p599-3d__button:focus-visible,
.ge-p599-3d__iconbtn:focus-visible,
.ge-p599-3d__thumb-button:focus-visible {
    outline: 3px solid #f4b942;
    outline-offset: 2px;
}

/* ── Статус: только для скринридеров (визуально скрыт) ────────────── */
.ge-p599-3d__status {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ── Распознаваемый 3D-тайл (только при ≥2 фото) ──────────────────── */
.ge-p599-3d__thumb-button {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: inherit;
    background: #eef3f1;
    cursor: pointer;
}
.ge-p599-3d__thumb-button img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ge-p599-3d__thumb-button::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(31, 45, 34, 0.35), transparent 55%);
}
.ge-p599-3d__thumb-badge {
    position: absolute;
    z-index: 2;
    left: 6px;
    bottom: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 7px 3px 5px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #374836;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
}
.ge-p599-3d__thumb-badge svg {
    width: 13px;
    height: 13px;
}

.ge-p599-3d__noscript {
    position: absolute;
    z-index: 5;
    right: 12px;
    bottom: 12px;
    left: 12px;
    margin: 0;
    padding: 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    line-height: 1.35;
    text-align: center;
}

@media (max-width: 430px) {
    .ge-p599-3d__controls {
        right: 8px;
        bottom: 8px;
        gap: 6px;
    }
    .ge-p599-3d__iconbtn {
        width: 38px;
        height: 38px;
    }
    .ge-p599-3d__button {
        min-height: 38px;
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ge-p599-3d__poster,
    .ge-p599-3d__viewer {
        transition: none;
    }
    .ge-p599-3d__spinner {
        animation-duration: 1.6s;
    }
    .ge-p599-3d__iconbtn {
        transition: none;
    }
}

/* ── Мобильный: жёстко фиксируем высоту 3D-галереи (solo) ─────────────
   Тема задаёт .single-product-gallery--main через aspect-ratio + max-height,
   что разные движки (в т.ч. реальный iOS Safari) считают по-разному и блок
   может вырасти и поджать характеристики. Здесь высота детерминирована. */
@media (max-width: 860px) {
    .single-product-gallery--main.ge-p599-3d--solo {
        aspect-ratio: auto !important;
        height: 300px !important;
        max-height: 300px !important;
        margin-bottom: 16px;
    }
}
