.rtk9-gallery {
    --rtk9-dg-surface: #0b0b0b;
    --rtk9-dg-border: rgba(200, 167, 46, 0.28);
    --rtk9-dg-border-hover: rgba(200, 167, 46, 0.55);
    --rtk9-dg-active: #c8a72e;
    --rtk9-dg-badge-bg: #c8a72e;
    --rtk9-dg-badge-text: #050505;
    --rtk9-dg-badge-available-bg: #39d353;
    --rtk9-dg-badge-available-text: #041b0a;
    --rtk9-dg-badge-reserved-bg: #c8a72e;
    --rtk9-dg-badge-reserved-text: #050505;
    --rtk9-dg-badge-sold-bg: #6b7280;
    --rtk9-dg-badge-sold-text: #ffffff;
    --rtk9-dg-arrow-bg: rgba(0, 0, 0, 0.66);
    --rtk9-dg-arrow-bg-hover: rgba(0, 0, 0, 0.88);
    --rtk9-dg-arrow-text: #c8a72e;
    --rtk9-dg-radius: 10px;
    --rtk9-dg-columns: 5;
    --rtk9-dg-thumb-gap: 10px;

    width: 100%;
    min-width: 0;
    font-family: Inter, Manrope, Arial, sans-serif;
}

.rtk9-gallery *,
.rtk9-gallery *::before,
.rtk9-gallery *::after,
.rtk9-gallery-lightbox *,
.rtk9-gallery-lightbox *::before,
.rtk9-gallery-lightbox *::after {
    box-sizing: border-box;
}

.rtk9-gallery button,
.rtk9-gallery-lightbox button {
    font: inherit;
}

.rtk9-gallery__stage {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3.15;
    overflow: hidden;
    border: 1px solid var(--rtk9-dg-border);
    border-radius: var(--rtk9-dg-radius);
    background: var(--rtk9-dg-surface);
    touch-action: pan-y;
}

.rtk9-gallery__main-media {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: inherit;
    background: transparent;
    color: inherit;
    cursor: default;
}

.rtk9-gallery__arrow:focus-visible,
.rtk9-gallery__thumbnail:focus-visible,
.rtk9-gallery__dot:focus-visible,
.rtk9-gallery-lightbox button:focus-visible {
    outline: 2px solid var(--rtk9-dg-active, #c8a72e);
    outline-offset: 2px;
}

.rtk9-gallery__main-image,
.rtk9-gallery__main-video {
    display: block;
    width: 100%;
    height: 100%;
    object-position: center center;
    user-select: none;
    -webkit-user-drag: none;
}

.rtk9-gallery__main-image {
    object-fit: cover;
}

.rtk9-gallery--lightbox .rtk9-gallery__main-image {
    cursor: zoom-in;
}

.rtk9-gallery__main-video {
    object-fit: contain;
    background: #000;
    cursor: default;
}

.rtk9-gallery__main-image[hidden],
.rtk9-gallery__main-video[hidden] {
    display: none !important;
}


.rtk9-gallery__badge {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--rtk9-dg-badge-bg);
    color: var(--rtk9-dg-badge-text);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.22);
}

.rtk9-gallery--badge-status-available .rtk9-gallery__badge {
    background: var(--rtk9-dg-badge-available-bg);
    color: var(--rtk9-dg-badge-available-text);
}

.rtk9-gallery--badge-status-reserved .rtk9-gallery__badge {
    background: var(--rtk9-dg-badge-reserved-bg);
    color: var(--rtk9-dg-badge-reserved-text);
}

.rtk9-gallery--badge-status-sold .rtk9-gallery__badge {
    background: var(--rtk9-dg-badge-sold-bg);
    color: var(--rtk9-dg-badge-sold-text);
}

.rtk9-gallery__arrow {
    position: absolute;
    top: 50%;
    z-index: 6;
    display: grid;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    place-items: center;
    border: 1px solid var(--rtk9-dg-border);
    border-radius: 50%;
    background: var(--rtk9-dg-arrow-bg);
    color: var(--rtk9-dg-arrow-text);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.28);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.rtk9-gallery__arrow:hover {
    background: var(--rtk9-dg-arrow-bg-hover);
    border-color: var(--rtk9-dg-border-hover);
    transform: translateY(-50%) scale(1.06);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
}

.rtk9-gallery__arrow--previous {
    left: 14px;
}

.rtk9-gallery__arrow--next {
    right: 14px;
}

.rtk9-gallery__arrow svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rtk9-gallery--no-arrows .rtk9-gallery__arrow {
    display: none !important;
}

.rtk9-gallery__thumbnails {
    display: grid;
    grid-template-columns: repeat(var(--rtk9-dg-columns), minmax(0, 1fr));
    gap: var(--rtk9-dg-thumb-gap);
    margin-top: var(--rtk9-dg-thumb-gap);
}

.rtk9-gallery--no-thumbnails .rtk9-gallery__thumbnails {
    display: none !important;
}

.rtk9-gallery__thumbnail {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: 1px solid var(--rtk9-dg-border);
    border-radius: 8px;
    background: var(--rtk9-dg-surface);
    cursor: pointer;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.rtk9-gallery__thumbnail:hover {
    border-color: var(--rtk9-dg-border-hover);
    transform: translateY(-2px);
}

.rtk9-gallery__thumbnail.is-active {
    border: 2px solid var(--rtk9-dg-active);
    box-shadow: 0 0 0 2px rgba(200, 167, 46, 0.15);
}

.rtk9-gallery__thumbnail img,
.rtk9-gallery__video-frame {
    display: block;
    width: 100%;
    height: 100%;
}

.rtk9-gallery__thumbnail img {
    object-fit: cover;
    object-position: center center;
    transition: transform 250ms ease;
}

.rtk9-gallery__thumbnail:hover img {
    transform: scale(1.04);
}

.rtk9-gallery__thumbnail.is-video::after {
    content: "▶";
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.16);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.75);
    pointer-events: none;
}

.rtk9-gallery__video-frame {
    background: radial-gradient(circle at center, rgba(200, 167, 46, 0.16), transparent 48%), linear-gradient(135deg, #090909, #181307);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.rtk9-gallery__video-frame::before {
    content: "Video";
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: rgba(255, 255, 255, 0.72);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rtk9-gallery__dots {
    position: absolute;
    right: 16px;
    bottom: 14px;
    left: 16px;
    z-index: 6;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 7px;
    pointer-events: none;
}

.rtk9-gallery__dot {
    width: 8px;
    height: 8px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.58);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    pointer-events: auto;
    transition: width 180ms ease, background-color 180ms ease, opacity 180ms ease;
}

.rtk9-gallery__dot:hover {
    background: rgba(255, 255, 255, 0.9);
}

.rtk9-gallery__dot.is-active {
    width: 22px;
    border-radius: 999px;
    background: var(--rtk9-dg-active);
}

.rtk9-gallery--no-dots .rtk9-gallery__dots {
    display: none !important;
}

.rtk9-gallery-empty {
    padding: 18px;
    border: 1px dashed #c3c4c7;
    border-radius: 8px;
    color: #646970;
    text-align: center;
}

/* Shared lightbox: one DOM instance is reused by every RTK9 Gallery widget. */
body.rtk9-gallery-lightbox-open {
    overflow: hidden;
}

.rtk9-gallery-lightbox {
    --rtk9-dg-active: #c8a72e;
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    background: rgba(0, 0, 0, 0.96);
    color: #fff;
}

.rtk9-gallery-lightbox.is-open {
    display: block;
}

.rtk9-gallery-lightbox__viewport {
    position: absolute;
    inset: 56px 72px 54px;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.rtk9-gallery-lightbox__media-wrap {
    position: relative;
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
}

.rtk9-gallery-lightbox__image,
.rtk9-gallery-lightbox__video {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.rtk9-gallery-lightbox__image {
    cursor: zoom-in;
    transition: transform 180ms ease;
}

.rtk9-gallery-lightbox.is-zoomed .rtk9-gallery-lightbox__image {
    max-width: none;
    max-height: none;
    cursor: zoom-out;
    transform: scale(1.65);
}

.rtk9-gallery-lightbox__image[hidden],
.rtk9-gallery-lightbox__video[hidden] {
    display: none !important;
}

.rtk9-gallery-lightbox__toolbar {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    display: flex;
    gap: 6px;
}

.rtk9-gallery-lightbox__tool,
.rtk9-gallery-lightbox__arrow {
    display: grid;
    margin: 0;
    padding: 0;
    place-items: center;
    border: 0;
    background: rgba(0, 0, 0, 0.38);
    color: #fff;
    cursor: pointer;
}

.rtk9-gallery-lightbox__tool {
    width: 38px;
    height: 38px;
    border-radius: 50%;
}

.rtk9-gallery-lightbox__tool:hover,
.rtk9-gallery-lightbox__arrow:hover {
    background: rgba(255, 255, 255, 0.12);
}

.rtk9-gallery-lightbox__tool svg,
.rtk9-gallery-lightbox__arrow svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rtk9-gallery-lightbox__arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    transform: translateY(-50%);
}

.rtk9-gallery-lightbox__arrow--previous {
    left: 14px;
}

.rtk9-gallery-lightbox__arrow--next {
    right: 14px;
}

.rtk9-gallery-lightbox__counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    z-index: 4;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    transform: translateX(-50%);
}

.rtk9-gallery-lightbox__dots {
    position: absolute;
    right: 72px;
    bottom: 17px;
    left: 72px;
    z-index: 5;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 7px;
    pointer-events: none;
}

.rtk9-gallery-lightbox__dot {
    width: 8px;
    height: 8px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.58);
    pointer-events: auto;
    cursor: pointer;
}

.rtk9-gallery-lightbox__dot.is-active {
    width: 22px;
    border-radius: 999px;
    background: var(--rtk9-dg-active);
}

@media (min-width: 768px) and (max-width: 1024px) {
    .rtk9-gallery__stage {
        aspect-ratio: 4 / 4.65;
    }

    .rtk9-gallery__arrow {
        width: 38px;
        height: 38px;
    }

    .rtk9-gallery__arrow svg {
        width: 19px;
        height: 19px;
    }
}

@media (max-width: 767px) {
    .rtk9-gallery__stage {
        aspect-ratio: 4 / 3.25;
        border-radius: 8px;
    }

    .rtk9-gallery__badge {
        top: 12px;
        right: 12px;
        left: auto;
        min-height: 27px;
        padding: 5px 10px;
        font-size: 10px;
    }

    .rtk9-gallery__arrow {
        display: grid;
        width: 36px;
        height: 36px;
    }

    .rtk9-gallery__arrow--previous {
        left: 10px;
    }

    .rtk9-gallery__arrow--next {
        right: 10px;
    }

    .rtk9-gallery__arrow svg {
        width: 18px;
        height: 18px;
    }

    .rtk9-gallery__thumbnails {
        display: flex;
        gap: var(--rtk9-dg-thumb-gap);
        margin-top: var(--rtk9-dg-thumb-gap);
        padding: 2px 2px 8px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .rtk9-gallery__thumbnail {
        flex: 0 0 72px;
        width: 72px;
        scroll-snap-align: start;
    }

    .rtk9-gallery__dots {
        display: flex;
    }

    .rtk9-gallery-lightbox__viewport {
        inset: 52px 10px 58px;
    }

    .rtk9-gallery-lightbox__arrow {
        width: 40px;
        height: 40px;
        background: rgba(0, 0, 0, 0.58);
    }

    .rtk9-gallery-lightbox__arrow--previous {
        left: 8px;
    }

    .rtk9-gallery-lightbox__arrow--next {
        right: 8px;
    }

    .rtk9-gallery-lightbox__counter {
        display: none;
    }

    .rtk9-gallery-lightbox__dots {
        display: flex;
    }
}

@media (max-width: 480px) {
    .rtk9-gallery__thumbnails {
        display: none;
    }

    .rtk9-gallery__stage {
        aspect-ratio: 4 / 3.4;
    }

    /* Intentionally keep arrows + dots together on phones. */
    .rtk9-gallery__arrow {
        display: grid;
        width: 34px;
        height: 34px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rtk9-gallery *,
    .rtk9-gallery-lightbox * {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
