.card-gallery { min-width: 0; }
.card-gallery-stage {
    overflow: hidden;
    border-radius: 12px;
    background: #f1f2f5;
    touch-action: pan-y pinch-zoom;
}
.card-gallery-photo {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}
.product-visual .card-gallery-photo img {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(68vh, 700px);
    border-radius: 0;
    object-fit: contain;
}
.card-gallery-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: grid;
    place-items: center;
    background: #171d2a;
}
.card-gallery-video iframe {
    width: 100%;
    height: 100%;
    border: 0;
}
.card-gallery-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
}
.card-gallery-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
}
.card-gallery-nav button {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #213765;
    background: #ebedf3;
    cursor: pointer;
}
.card-gallery-nav > button { font-size: 26px; line-height: 1; }
.card-gallery-dots button { width: 38px; background: transparent; font-size: 13px; }
.card-gallery-dots button span {
    width: 9px;
    height: 9px;
    border: 1px solid #566580;
    border-radius: 50%;
    background: #dce2ed;
}
.card-gallery-dots button[aria-pressed="true"] { border-color: #8d9dbb; background: #e4eaf7; }
.card-gallery-dots button[aria-pressed="true"] span { background: #203663; }
.card-gallery-open { overflow: hidden; }
.card-gallery-dialog {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    background: transparent;
}
.card-gallery-dialog[open] {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 52px;
    grid-template-rows: minmax(0, 1fr);
    align-items: center;
    padding: 52px clamp(2px, 4vw, 32px) 14px;
}
.card-gallery-dialog::backdrop { background: rgba(15, 20, 29, .90); backdrop-filter: blur(4px); }
.card-gallery-dialog button:not(.card-gallery-video button) {
    z-index: 1;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    font-size: 29px;
    line-height: 1;
    color: #fff;
    background: #203663;
    cursor: pointer;
}
.card-gallery-close { position: absolute; top: 8px; right: clamp(8px, 4vw, 32px); }
.card-gallery-prev { grid-area: 1 / 1; justify-self: end; }
.card-gallery-next { grid-area: 1 / 3; }
.card-gallery-large {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-area: 1 / 2;
    height: 100%;
    min-height: 0;
    touch-action: pan-y pinch-zoom;
}
.product-visual .card-gallery-large img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: min(100%, calc(100dvh - 66px));
    aspect-ratio: auto;
    object-fit: contain;
    border-radius: 4px;
    background: transparent;
}
.card-gallery-large .card-gallery-video { width: min(100%, 960px, calc((100dvh - 72px)*16/9)); }
.media-editor h3 { margin-top: 0; }
.media-editor-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.media-editor-list { display: grid; padding-left: 0; gap: 6px; }
.media-editor-list:empty { margin: 0; }
.media-editor-list li {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid #dbe1ec;
    border-radius: 8px;
    background: white;
}
.media-editor-thumb {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    object-fit: contain;
    background: #ebedf3;
}
.media-editor-label { overflow-wrap: anywhere; }
.media-editor-label small { display: block; }
.media-editor-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.media-editor-controls .secondary { min-width: 40px; min-height: 40px; padding: 6px 8px; }
.media-editor [data-media-status]:empty { margin: 0; }
@media (max-width: 600px) {
    .card-gallery-dialog[open] {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: minmax(0, 1fr) 44px;
        gap: 6px;
        padding-inline: 8px;
    }
    .card-gallery-large { grid-area: 1 / 1 / 2 / 3; }
    .product-visual .card-gallery-large img { max-height: min(100%, calc(100dvh - 116px)); }
    .card-gallery-prev { grid-area: 2 / 1; }
    .card-gallery-next { grid-area: 2 / 2; }
}
@media (max-width: 420px) {
    .media-editor-list li { grid-template-columns: 36px minmax(0, 1fr); }
    .media-editor-thumb { width: 36px; height: 36px; }
    .media-editor-controls { grid-column: 1 / -1; }
}
