/* Gallery-only stylesheet. It does not replace or restyle the existing showroom navigation. */
.kia-gallery-page,
.kia-gallery-page *,
.kia-gallery-page *::before,
.kia-gallery-page *::after { box-sizing: border-box; }

.kia-gallery-page {
    width: min(100%, 1640px);
    margin: 0 auto;
    padding: 48px 24px 72px;
    background: #fff;
    color: #05141f;
    overflow: hidden;
}
.kia-gallery-page [hidden] { display: none !important; }
.kia-gallery-page .kia-section-heading { margin: 0 auto 28px; text-align: center; }
.kia-gallery-page .kia-section-heading h1 {
    margin: 0;
    padding: 0;
    color: #05141f;
    font: inherit;
    font-size: clamp(32px, 3.2vw, 48px);
    font-weight: 700;
    line-height: 1.15;
    text-transform: uppercase;
}
.kia-gallery-page .kia-section-heading p {
    margin: 10px 0 0;
    color: #52616c;
    font-size: 16px;
    line-height: 1.5;
}
.kia-gallery-page .kia-gallery-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 28px;
    margin: 0 0 12px;
}
.kia-gallery-page .kia-gallery-filters button {
    position: relative;
    min-height: 46px;
    margin: 0;
    padding: 8px 2px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #34434e;
    font: inherit;
    font-size: 18px;
    line-height: 1.3;
    text-transform: uppercase;
    cursor: pointer;
}
.kia-gallery-page .kia-gallery-filters button[aria-pressed="true"] {
    border-bottom-color: #05141f;
    color: #05141f;
    font-weight: 700;
}
.kia-gallery-page .kia-gallery-count {
    min-height: 22px;
    margin: 0 0 18px;
    color: #64727c;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
}
.kia-gallery-page .kia-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
}
.kia-gallery-page .kia-gallery-card {
    position: relative;
    min-width: 0;
    margin: 0;
    background: #edf0f2;
    overflow: hidden;
}
.kia-gallery-page .kia-gallery-card > a {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    color: #05141f;
    text-decoration: none;
}
.kia-gallery-page .kia-gallery-card img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    transition: transform .25s ease;
}
.kia-gallery-page .kia-gallery-card > a:hover img { transform: scale(1.02); }
.kia-gallery-page .kia-gallery-expand {
    position: absolute;
    right: 0;
    bottom: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 14px;
    background: #05141f;
    color: #fff;
    font-size: 14px;
    line-height: 1.3;
}
.kia-gallery-page .kia-gallery-expand svg {
    display: block;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}
.kia-gallery-page .kia-image-failure {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    padding: 20px;
    color: #52616c;
    text-align: center;
}
.kia-gallery-page .kia-empty-state {
    margin: 28px 0 0;
    padding: 28px;
    background: #f3f5f6;
    text-align: center;
}
.kia-gallery-page :is(a, button):focus-visible {
    outline: 3px solid #1376b8;
    outline-offset: 3px;
}

.kia-gallery-page .kia-gallery-dialog {
    width: min(1200px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 58px 24px 20px;
    border: 0;
    background: #05141f;
    color: #fff;
    overflow: hidden;
}
.kia-gallery-page .kia-gallery-dialog::backdrop { background: rgba(0, 0, 0, .84); }
.kia-gallery-page .kia-dialog-close {
    position: absolute;
    top: 12px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, .65);
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}
.kia-gallery-page .kia-dialog-close svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}
.kia-gallery-page .kia-dialog-stage {
    display: grid;
    place-items: center;
    width: 100%;
    height: min(72dvh, 760px);
    overflow: hidden;
    touch-action: pan-y;
}
.kia-gallery-page .kia-dialog-stage img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.kia-gallery-page .kia-dialog-controls {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}
.kia-gallery-page .kia-dialog-controls button {
    display: grid;
    place-items: center;
    width: 48px;
    min-height: 44px;
    margin: 0;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .55);
    background: transparent;
    color: #fff;
    cursor: pointer;
}
.kia-gallery-page .kia-dialog-controls button:disabled { opacity: .35; cursor: default; }
.kia-gallery-page .kia-dialog-controls svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}
.kia-gallery-page .kia-dialog-controls p { margin: 0; text-align: center; }
.kia-gallery-page [data-gallery-error] {
    margin: 12px 0 0;
    color: #fff;
    text-align: center;
}
.kia-gallery-page [data-gallery-error] a { color: #fff; text-decoration: underline; }
.kia-gallery-page [data-gallery-retry] {
    min-height: 32px;
    padding: 4px 8px;
    border: 1px solid #fff;
    background: transparent;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

@media (max-width: 1023px) {
    .kia-gallery-page .kia-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .kia-gallery-page { padding: 34px 16px 52px; }
    .kia-gallery-page .kia-gallery-grid { grid-template-columns: 1fr; gap: 16px; }
    .kia-gallery-page .kia-gallery-dialog {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        padding: 54px 10px 14px;
    }
    .kia-gallery-page .kia-dialog-stage { height: 62dvh; }
    .kia-gallery-page .kia-dialog-controls { grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; }
    .kia-gallery-page .kia-dialog-controls button { width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .kia-gallery-page .kia-gallery-card img { transition: none; }
}
