.g3d-gallery {
    --g3d-active-bg: #222;
    --g3d-active-text: #fff;
    --g3d-inactive-bg: #fff;
    --g3d-inactive-text: #222;
    --g3d-border: #d9d9d9;
    --g3d-active-border: #222;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    overflow: hidden;
    color: inherit;
    font-family: inherit;
}
.g3d-gallery, .g3d-gallery * { box-sizing: border-box; }
.g3d-tabs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0 auto 22px;
    padding: 2px 0 7px;
    overflow-x: auto;
    scrollbar-width: thin;
    white-space: nowrap;
}
.g3d-tab, .g3d-more {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 7px 15px;
    border: 1px solid var(--g3d-border);
    border-radius: 20px;
    background: var(--g3d-inactive-bg);
    color: var(--g3d-inactive-text);
    font: inherit;
    font-size: 13px;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.g3d-tab.is-active {
    border-color: var(--g3d-active-border);
    background: var(--g3d-active-bg);
    color: var(--g3d-active-text);
}
.g3d-more { border-style: dashed; }
.g3d-stage {
    position: relative;
    width: 100%;
    height: clamp(320px, 42vw, 500px);
    overflow: hidden;
    isolation: isolate;
    touch-action: pan-y;
}
.g3d-card {
    position: absolute;
    top: 0;
    left: 50%;
    width: clamp(220px, 36vw, 410px);
    height: 100%;
    overflow: hidden;
    border-radius: 16px;
    background: #ececec;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .17);
    opacity: .92;
    transform-origin: center center;
    transition: transform .42s cubic-bezier(.2,.7,.2,1), opacity .35s ease, filter .35s ease;
    will-change: transform;
    cursor: zoom-in;
}
.g3d-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.g3d-card.g3d-center { z-index: 5; opacity: 1; transform: translateX(-50%) scale(1); }
.g3d-card.g3d-left-1 { z-index: 4; transform: translateX(calc(-50% - 66%)) scale(.82); }
.g3d-card.g3d-right-1 { z-index: 4; transform: translateX(calc(-50% + 66%)) scale(.82); }
.g3d-card.g3d-left-2 { z-index: 2; opacity: .66; filter: saturate(.84); transform: translateX(calc(-50% - 118%)) scale(.68); }
.g3d-card.g3d-right-2 { z-index: 2; opacity: .66; filter: saturate(.84); transform: translateX(calc(-50% + 118%)) scale(.68); }
.g3d-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 18px auto 0;
}
.g3d-arrow {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--g3d-border);
    border-radius: 50%;
    background: #fff;
    color: #222;
    font: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background-color .2s ease, transform .2s ease;
}
.g3d-arrow:hover { background: #f4f4f4; transform: translateY(-1px); }
.g3d-arrow:disabled { cursor: default; opacity: .45; }
.g3d-gallery button:focus-visible { outline: 2px solid #2271b1; outline-offset: 3px; }
.g3d-gallery .g3d-tabs[hidden] { display: none; }
.g3d-card:focus-visible { outline: 3px solid #6d66ed; outline-offset: 3px; }
.g3d-lightbox {
    box-sizing: border-box;
    position: fixed;
    display: flex;
    width: min(94vw, 1120px);
    height: min(92vh, 850px);
    max-width: none;
    max-height: none;
    align-items: center;
    justify-content: center;
    margin: auto;
    padding: 48px 70px 24px;
    overflow: visible;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 18px;
    background: #101116;
    color: #fff;
    box-shadow: 0 28px 100px rgba(0,0,0,.45);
}
.g3d-lightbox:not([open]) { display: none; }
.g3d-lightbox::backdrop { background: rgba(9,10,18,.84); backdrop-filter: blur(7px); }
.g3d-lightbox__frame { display: grid; width: 100%; height: 100%; place-items: center; }
.g3d-lightbox__image { display: block; max-width: 100%; max-height: 100%; border-radius: 10px; object-fit: contain; }
.g3d-lightbox__close, .g3d-lightbox__arrow {
    position: absolute;
    z-index: 2;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    color: #fff;
    font: inherit;
    font-size: 22px;
    cursor: pointer;
}
.g3d-lightbox__close { top: 13px; right: 15px; font-size: 29px; }
.g3d-lightbox__arrow { top: 50%; transform: translateY(-50%); }
.g3d-lightbox__previous { left: 14px; }
.g3d-lightbox__next { right: 14px; }
.g3d-lightbox__close:hover, .g3d-lightbox__arrow:hover { background: rgba(255,255,255,.2); }
@media (max-width: 760px) {
    .g3d-tabs { justify-content: flex-start; margin-bottom: 15px; }
    .g3d-stage { height: clamp(320px, 92vw, 460px); }
    .g3d-card { width: min(88vw, 400px); border-radius: 13px; }
    .g3d-card.g3d-left-1 { transform: translateX(calc(-50% - 84%)) scale(.79); }
    .g3d-card.g3d-right-1 { transform: translateX(calc(-50% + 84%)) scale(.79); }
    .g3d-card.g3d-left-2 { transform: translateX(calc(-50% - 116%)) scale(.64); }
    .g3d-card.g3d-right-2 { transform: translateX(calc(-50% + 116%)) scale(.64); }
    .g3d-controls { margin-top: 13px; }
}
@media (max-width: 380px) {
    .g3d-stage { height: clamp(310px, 94vw, 390px); }
    .g3d-card { width: 88vw; }
    .g3d-card.g3d-left-1 { transform: translateX(calc(-50% - 86%)) scale(.75); }
    .g3d-card.g3d-right-1 { transform: translateX(calc(-50% + 86%)) scale(.75); }
}
@media (max-width: 600px) {
    .g3d-lightbox { width: 100vw; height: 100vh; height: 100dvh; padding: 66px 14px 25px; border: 0; border-radius: 0; }
    .g3d-lightbox__image { max-height: 84vh; max-height: 84dvh; }
    .g3d-lightbox__previous { left: 9px; }
    .g3d-lightbox__next { right: 9px; }
}
@media (prefers-reduced-motion: reduce) {
    .g3d-gallery *, .g3d-gallery *::before, .g3d-gallery *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
