.zcs-wc-gallery {
    --zcs-gallery-gap: 16px;
    --zcs-gallery-main-height: 360px;
    --zcs-gallery-thumb-size: 72px;
    --zcs-gallery-thumb-gap: 10px;
    --zcs-gallery-thumbs-spacing: 14px;
    --zcs-gallery-arrow-size: 44px;
    --zcs-gallery-arrow-icon-size: 18px;
    --zcs-gallery-arrow-offset: 12px;
    --zcs-gallery-arrow-top: 50%;
    --zcs-gallery-dot-size: 8px;
    --zcs-gallery-dot-gap: 8px;
    --zcs-thumb-inactive-opacity: 0.65;
    --zcs-thumb-active-scale: 1;
    position: relative;
    width: 100%;
    outline: none;
}

.zcs-wc-gallery *,
.zcs-wc-gallery *::before,
.zcs-wc-gallery *::after {
    box-sizing: border-box;
}

.zcs-wc-gallery:focus-visible {
    outline: 2px solid rgba(0, 0, 0, 0.18);
    outline-offset: 4px;
}

.zcs-wc-gallery__main {
    position: relative;
}

.zcs-wc-gallery__viewport {
    overflow: hidden;
    width: 100%;
    touch-action: pan-y;
}

.zcs-wc-gallery__track {
    display: flex;
    gap: var(--zcs-gallery-gap);
    transition: transform 0.35s ease;
    will-change: transform;
}

.zcs-wc-gallery__item {
    flex: 0 0 auto;
    min-width: 0;
}

.zcs-wc-gallery__image-box {
    position: relative;
    height: var(--zcs-gallery-main-height);
    overflow: hidden;
}

.zcs-wc-gallery__image-box img,
.zcs-wc-gallery__lightbox-trigger img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.zcs-wc-gallery__lightbox-trigger {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: zoom-in;
}

.zcs-wc-gallery__arrow {
    position: absolute;
    top: var(--zcs-gallery-arrow-top);
    transform: translateY(-50%);
    width: var(--zcs-gallery-arrow-size);
    height: var(--zcs-gallery-arrow-size);
    border-radius: 999px;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
}

.zcs-wc-gallery__arrow span {
    font-size: var(--zcs-gallery-arrow-icon-size);
    line-height: 1;
}

.zcs-wc-gallery__arrow--prev {
    left: var(--zcs-gallery-arrow-offset);
}

.zcs-wc-gallery__arrow--next {
    right: var(--zcs-gallery-arrow-offset);
}

.zcs-wc-gallery__arrow:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: translateY(-50%) scale(0.98);
}

.zcs-wc-gallery__thumbs {
    display: flex;
    gap: var(--zcs-gallery-thumb-gap);
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    margin-top: var(--zcs-gallery-thumbs-spacing);
    padding: 2px 0;
    scrollbar-width: thin;
    scroll-behavior: smooth;
}

.zcs-wc-gallery[data-thumbs-position="top"] .zcs-wc-gallery__thumbs {
    margin-top: 0;
    margin-bottom: var(--zcs-gallery-thumbs-spacing);
}

.zcs-wc-gallery[data-thumbs-wrap="wrap"] .zcs-wc-gallery__thumbs {
    flex-wrap: wrap;
    overflow: visible;
}

.zcs-wc-gallery__thumb {
    width: var(--zcs-gallery-thumb-size);
    height: var(--zcs-gallery-thumb-size);
    min-width: var(--zcs-gallery-thumb-size);
    padding: 0;
    border: 1px solid #d9d9d9;
    overflow: hidden;
    cursor: pointer;
    opacity: var(--zcs-thumb-inactive-opacity);
    transition: transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}

.zcs-wc-gallery__thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.zcs-wc-gallery__thumb.is-active {
    opacity: 1;
    transform: scale(var(--zcs-thumb-active-scale));
}

.zcs-wc-gallery__dots {
    display: flex;
    justify-content: center;
    gap: var(--zcs-gallery-dot-gap);
    margin-top: 14px;
}

.zcs-wc-gallery__dot {
    width: var(--zcs-gallery-dot-size);
    height: var(--zcs-gallery-dot-size);
    min-width: var(--zcs-gallery-dot-size);
    padding: 0;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    opacity: 0.9;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.zcs-wc-gallery__dot.is-active {
    transform: scale(1.2);
    opacity: 1;
}

.zcs-wc-gallery__notice {
    padding: 18px 20px;
    border: 1px dashed #d9d9d9;
    border-radius: 12px;
    color: #555;
    background: #fafafa;
}

.zcs-wc-gallery-lightbox-open {
    overflow: hidden;
}

.zcs-wc-gallery-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 30px;
}

.zcs-wc-gallery-lightbox.is-open {
    display: flex;
}

.zcs-wc-gallery-lightbox__image {
    max-width: min(90vw, 1200px);
    max-height: 88vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 12px;
}

.zcs-wc-gallery-lightbox__close,
.zcs-wc-gallery-lightbox__nav {
    position: absolute;
    border: 0;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.zcs-wc-gallery-lightbox__close:hover,
.zcs-wc-gallery-lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.24);
}

.zcs-wc-gallery-lightbox__close {
    top: 18px;
    right: 18px;
    width: 48px;
    height: 48px;
    font-size: 32px;
    line-height: 1;
}

.zcs-wc-gallery-lightbox__nav {
    top: 50%;
    width: 48px;
    height: 48px;
    transform: translateY(-50%);
    font-size: 20px;
}

.zcs-wc-gallery-lightbox__nav--prev {
    left: 22px;
}

.zcs-wc-gallery-lightbox__nav--next {
    right: 22px;
}

@media (max-width: 1024px) {
    .zcs-wc-gallery {
        --zcs-gallery-main-height: 320px;
        --zcs-gallery-thumb-size: 64px;
    }
}

@media (max-width: 767px) {
    .zcs-wc-gallery {
        --zcs-gallery-main-height: 260px;
        --zcs-gallery-thumb-size: 56px;
    }

    .zcs-wc-gallery__dots {
        margin-top: 12px;
    }

    .zcs-wc-gallery-lightbox {
        padding: 16px;
    }

    .zcs-wc-gallery-lightbox__nav--prev {
        left: 10px;
    }

    .zcs-wc-gallery-lightbox__nav--next {
        right: 10px;
    }
}
