/* GemsNY-inspired inline turntable / 360 viewer */
.gtv-shell {
    background: #fff !important;
    box-shadow: 0 8px 40px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.04) !important;
    padding: 0 !important;
    overflow: hidden;
}

.gtv-layout {
    display: flex;
    min-height: 580px;
}

.gtv-rail {
    flex: 0 0 88px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 10px;
    background: linear-gradient(180deg, #fafbfc 0%, #f4f6f8 100%);
    border-right: 1px solid rgba(15, 23, 42, 0.06);
    list-style: none;
    margin: 0;
}

.gtv-rail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    text-align: center;
}

.gtv-rail-item:hover {
    background: rgba(7, 116, 65, 0.06);
    color: #0f172a;
}

.gtv-rail-item.gtv-rail-item--active {
    background: #fff;
    color: #077441;
    box-shadow: 0 4px 16px rgba(7, 116, 65, 0.12);
}

.gtv-rail-item img,
.gtv-rail-item svg {
    width: 32px;
    height: 32px;
    object-fit: contain;
    opacity: 0.85;
}

.gtv-rail-item.gtv-rail-item--active img,
.gtv-rail-item.gtv-rail-item--active svg {
    opacity: 1;
}

.gtv-rail-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.2;
    max-width: 72px;
}

.gtv-stage {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.gtv-viewport {
    position: relative;
    flex: 1;
    min-height: 580px;
    background: radial-gradient(ellipse at center, #ffffff 0%, #f8fafc 55%, #eef2f7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gtv-viewport::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.9) 0%, transparent 55%);
    pointer-events: none;
}

.gtv-tab-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    min-height: 580px;
}

.gtv-tab-content > .tab-pane {
    height: 100%;
    min-height: 580px;
    display: none !important;
}

.gtv-tab-content > .tab-pane.active.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.gtv-spin-host {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 540px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.gtv-spin-host.is-grabbing {
    cursor: grabbing;
}

.gtv-spin-host video,
.gtv-spin-host .gtv-spin-img {
    max-width: 92%;
    max-height: min(520px, 72vh);
    width: auto;
    height: auto;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 18px 36px rgba(15, 23, 42, 0.12));
    transition: filter 0.3s ease;
}

.gtv-spin-host:hover video,
.gtv-spin-host:hover .gtv-spin-img {
    filter: drop-shadow(0 22px 44px rgba(15, 23, 42, 0.16));
}

.gtv-badge {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(7, 116, 65, 0.15);
    color: #077441;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(8px);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.gtv-badge.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.gtv-hint {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    backdrop-filter: blur(10px);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.gtv-hint.is-hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
}

.gtv-hint i {
    font-size: 0.9rem;
    opacity: 0.9;
}

.gtv-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    z-index: 6;
    display: flex;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.1);
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gtv-ctrl-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #077441 0%, #056c5a 100%);
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(7, 116, 65, 0.25);
}

.gtv-ctrl-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 18px rgba(7, 116, 65, 0.35);
}

.gtv-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    z-index: 4;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.gtv-loader.is-done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.gtv-loader-ring {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(7, 116, 65, 0.15);
    border-top-color: #077441;
    border-radius: 50%;
    animation: gtvSpin 0.85s linear infinite;
}

@keyframes gtvSpin {
    to { transform: rotate(360deg); }
}

/* Gallery tab — do not override lightSlider width/height/overflow (breaks horizontal track) */
.gtv-tab-content #img_gallery.active.show {
    display: block !important;
    padding: 16px 20px 20px;
    width: 100%;
    min-height: 520px;
    overflow: visible;
    align-self: stretch;
}

.gtv-tab-content #img_gallery .lSSlideOuter {
    max-width: 100%;
    margin: 0 auto;
}

.gtv-tab-content #img_gallery .lSSlideWrapper {
    overflow: hidden;
}

.gtv-tab-content #img_gallery .lSSlideWrapper .lslide {
    text-align: center;
}

.gtv-tab-content #img_gallery .lSSlideWrapper .lslide img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: min(480px, 62vh);
    height: auto;
    margin: 0 auto;
    border-radius: 12px;
}

.gtv-tab-content #img_gallery .lSGallery {
    margin-top: 14px !important;
}

.gtv-tab-content #img_gallery .lSGallery li {
    border-radius: 8px;
    overflow: hidden;
}

.gtv-tab-content #img_gallery .lSGallery li img {
    display: block;
    width: 100%;
    height: auto;
}

.gtv-tab-content #videoTab.active.show {
    display: block !important;
    padding: 20px;
    width: 100%;
}

.gem-gallery-container.gtv-shell:hover #img_gallery img {
    transform: none;
}

.gem-gallery-container.gtv-shell #video_3d img,
.gem-gallery-container.gtv-shell .gtv-spin-img {
    transform: none !important;
}

@media (max-width: 768px) {
    .gtv-layout {
        flex-direction: column-reverse;
        min-height: auto;
    }

    .gtv-rail {
        flex: none;
        flex-direction: row;
        overflow-x: auto;
        padding: 10px 12px;
        border-right: none;
        border-top: 1px solid rgba(15, 23, 42, 0.06);
    }

    .gtv-rail-item {
        flex: 0 0 auto;
        min-width: 72px;
        padding: 10px 12px;
    }

    .gtv-viewport,
    .gtv-tab-content,
    .gtv-tab-content > .tab-pane {
        min-height: 420px;
    }

    .gtv-spin-host {
        min-height: 380px;
    }

    .gtv-controls {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}
