/* Product gallery carousel [store_gallery] */

.store-gallery-carousel {
    position: relative;
    width: 100%;
    margin: 0 0 var(--store-space-8);
    --store-gallery-carousel-columns: 4;
}

.store-gallery-carousel__shell {
    position: relative;
}

.store-gallery-carousel__shell::before,
.store-gallery-carousel__shell::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 2;
    width: 72px;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
    transition:
        opacity var(--store-transition-base),
        visibility var(--store-transition-base);
}

.store-gallery-carousel.is-at-start .store-gallery-carousel__shell::before {
    opacity: 0;
    visibility: hidden;
}

.store-gallery-carousel.is-at-end .store-gallery-carousel__shell::after {
    opacity: 0;
    visibility: hidden;
}

.store-gallery-carousel__shell::before {
    left: 0;
    background: linear-gradient(
        90deg,
        var(--store-color-white) 0%,
        rgba(255, 255, 255, 0.92) 34%,
        rgba(255, 255, 255, 0) 100%
    );
}

.store-gallery-carousel__shell::after {
    right: 0;
    background: linear-gradient(
        270deg,
        var(--store-color-white) 0%,
        rgba(255, 255, 255, 0.92) 34%,
        rgba(255, 255, 255, 0) 100%
    );
}

.store-gallery-carousel__nav--edge {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 48px;
    height: 64px;
    border: 0 !important;
    border-radius: 16px !important;
    box-shadow: var(--store-shadow-button) !important;
    color: transparent !important;
    font-size: 0;
    line-height: 0;
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%);
    transition:
        transform var(--store-transition-fast),
        box-shadow var(--store-transition-fast),
        opacity var(--store-transition-base),
        visibility var(--store-transition-base);
}

.store-gallery-carousel.is-at-start .store-gallery-carousel__nav--edge-prev,
.store-gallery-carousel.is-at-end .store-gallery-carousel__nav--edge-next,
.store-gallery-carousel__nav--edge[aria-disabled="true"] {
    opacity: 0.38;
    box-shadow: none !important;
    cursor: not-allowed;
    pointer-events: auto;
}

.store-gallery-carousel__nav--edge::before {
    content: "";
    display: block;
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    border-right: 3px solid #ffffff;
    border-bottom: 3px solid #ffffff;
}

.store-gallery-carousel__nav--edge-prev {
    left: var(--store-space-3);
}

.store-gallery-carousel__nav--edge-prev::before {
    transform: rotate(135deg) translateX(2px);
}

.store-gallery-carousel__nav--edge-next {
    right: var(--store-space-3);
}

.store-gallery-carousel__nav--edge-next::before {
    transform: rotate(-45deg) translateX(-2px);
}

.store-gallery-carousel__nav--edge:hover,
.store-gallery-carousel__nav--edge:focus,
.store-gallery-carousel__nav--edge:focus-visible {
    transform: translateY(-50%) scale(1.04);
    box-shadow: var(--store-shadow-button-hover) !important;
    outline: none !important;
}

.store-gallery-carousel__nav--edge[aria-disabled="true"]:hover,
.store-gallery-carousel__nav--edge[aria-disabled="true"]:focus,
.store-gallery-carousel__nav--edge[aria-disabled="true"]:focus-visible {
    transform: translateY(-50%);
    box-shadow: none !important;
}

.store-gallery-carousel.is-revealed .store-gallery-carousel__nav--edge,
.store-gallery-carousel.is-revealed .store-gallery-carousel__shell::before,
.store-gallery-carousel.is-revealed .store-gallery-carousel__shell::after {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.store-gallery-carousel__viewport {
    position: relative;
    overflow: hidden;
}

.store-gallery-carousel__track.store-products-grid,
.store-gallery-carousel__track {
    display: flex;
    grid-template-columns: none;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: var(--store-grid-gap);
    margin: 0;
    padding: 0;
    list-style: none;
    transition: transform var(--store-transition-base);
    will-change: transform;
}

.store-gallery-carousel__track > .product-card {
    flex: 0 0 calc(
        (100% - ((var(--store-gallery-carousel-columns) - 1) * var(--store-grid-gap)))
        / var(--store-gallery-carousel-columns)
    );
    min-width: 0;
    height: auto;
}

.store-gallery-carousel.is-revealed .store-gallery-carousel__track {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
}

.store-gallery-carousel__overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--store-space-6);
    background: rgba(255, 255, 255, 0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity var(--store-transition-base),
        visibility var(--store-transition-base);
}

.store-gallery-carousel__overlay-close {
    position: absolute;
    top: var(--store-space-4);
    right: var(--store-space-4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0 !important;
    margin: 0;
    border: 1px solid var(--store-color-border) !important;
    border-radius: 999px !important;
    background: var(--store-color-white) !important;
    box-shadow: var(--store-shadow-control) !important;
    color: transparent;
    font-size: 0;
    line-height: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.store-gallery-carousel__overlay-close::before {
    content: "";
    display: block;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    background-color: var(--store-color-text-muted);
    -webkit-mask-image: var(--store-icon-mask-close);
    mask-image: var(--store-icon-mask-close);
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
    pointer-events: none;
}

.store-gallery-carousel__overlay-close:hover,
.store-gallery-carousel__overlay-close:focus,
.store-gallery-carousel__overlay-close:focus-visible {
    border-color: var(--store-color-primary-pale) !important;
    background: var(--store-color-surface-soft) !important;
    box-shadow: var(--store-shadow-control) !important;
    outline: none !important;
}

.store-gallery-carousel__overlay-close:hover::before,
.store-gallery-carousel__overlay-close:focus::before,
.store-gallery-carousel__overlay-close:focus-visible::before {
    background-color: var(--store-color-primary);
}

.store-gallery-carousel.is-revealed .store-gallery-carousel__overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.store-gallery-carousel__view-all,
.store-gallery-carousel__controls-view-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    border-radius: 12px !important;
    text-decoration: none;
    white-space: nowrap;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0;
    transform: none;
}

.store-gallery-carousel__controls-view-all {
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    padding: 0 var(--store-space-5) !important;
    font-size: 0.8rem;
}

.store-gallery-carousel__view-all {
    height: 53px;
    min-height: 53px;
    max-height: 53px;
    padding: 0 calc(var(--store-space-5) * 1.3) !important;
    font-size: 0.8rem;
}

.store-gallery-carousel__view-all:hover,
.store-gallery-carousel__view-all:focus,
.store-gallery-carousel__view-all:focus-visible,
.store-gallery-carousel__controls-view-all:hover,
.store-gallery-carousel__controls-view-all:focus,
.store-gallery-carousel__controls-view-all:focus-visible {
    transform: none;
}

.store-gallery-carousel__controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--store-space-3);
    margin-bottom: var(--store-space-4);
}

.store-gallery-carousel__nav:not(.store-gallery-carousel__nav--edge) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--store-color-border) !important;
    border-radius: 12px !important;
    background: var(--store-color-white) !important;
    box-shadow: var(--store-shadow-control) !important;
    color: var(--store-color-primary);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.store-gallery-carousel__nav:not(.store-gallery-carousel__nav--edge):hover,
.store-gallery-carousel__nav:not(.store-gallery-carousel__nav--edge):focus,
.store-gallery-carousel__nav:not(.store-gallery-carousel__nav--edge):focus-visible {
    border-color: var(--store-color-primary-pale) !important;
    background: var(--store-color-surface-soft) !important;
    box-shadow: var(--store-shadow-control) !important;
    color: var(--store-color-primary);
    outline: none !important;
}

.store-gallery-carousel__nav:not(.store-gallery-carousel__nav--edge):disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.store-gallery-carousel__nav.store-gallery-carousel__nav--edge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    background-color: #1d4ed8 !important;
    background-image: linear-gradient(
        135deg,
        var(--store-action-button-bg-start, #1d4ed8) 0%,
        var(--store-action-button-bg-end, #2563eb) 100%
    ) !important;
}

.store-gallery-carousel__nav.store-gallery-carousel__nav--edge:hover,
.store-gallery-carousel__nav.store-gallery-carousel__nav--edge:focus,
.store-gallery-carousel__nav.store-gallery-carousel__nav--edge:focus-visible {
    border: 0 !important;
    background-color: #1d4ed8 !important;
    background-image: linear-gradient(
        135deg,
        var(--store-action-button-bg-start, #1d4ed8) 0%,
        var(--store-action-button-bg-end, #2563eb) 100%
    ) !important;
    color: transparent !important;
}

:is(html[data-wp-dark-mode-active], html.wp-dark-mode-active, html[data-wp-dark-mode-loading]) .store-gallery-carousel__overlay {
    background: rgba(15, 23, 42, 0.28);
}

:is(html[data-wp-dark-mode-active], html.wp-dark-mode-active, html[data-wp-dark-mode-loading]) .store-gallery-carousel__shell::before {
    background: linear-gradient(
        90deg,
        var(--store-color-white) 0%,
        rgba(30, 41, 59, 0.9) 34%,
        rgba(30, 41, 59, 0) 100%
    );
}

:is(html[data-wp-dark-mode-active], html.wp-dark-mode-active, html[data-wp-dark-mode-loading]) .store-gallery-carousel__shell::after {
    background: linear-gradient(
        270deg,
        var(--store-color-white) 0%,
        rgba(30, 41, 59, 0.9) 34%,
        rgba(30, 41, 59, 0) 100%
    );
}

html[data-wp-dark-mode-active] .store-gallery-carousel__nav.store-gallery-carousel__nav--edge,
html.wp-dark-mode-active .store-gallery-carousel__nav.store-gallery-carousel__nav--edge,
html[data-wp-dark-mode-loading] .store-gallery-carousel__nav.store-gallery-carousel__nav--edge,
html[data-wp-dark-mode-active] .wp-dark-mode-ignore.store-gallery-carousel__nav--edge,
html.wp-dark-mode-active .wp-dark-mode-ignore.store-gallery-carousel__nav--edge {
    background-color: #2563eb !important;
    background-image: linear-gradient(
        135deg,
        var(--store-action-button-bg-start, #60a5fa) 0%,
        var(--store-action-button-bg-end, #3b82f6) 100%
    ) !important;
}

html[data-wp-dark-mode-active] .store-gallery-carousel__nav.store-gallery-carousel__nav--edge::before,
html.wp-dark-mode-active .store-gallery-carousel__nav.store-gallery-carousel__nav--edge::before,
html[data-wp-dark-mode-loading] .store-gallery-carousel__nav.store-gallery-carousel__nav--edge::before {
    border-right-color: #ffffff !important;
    border-bottom-color: #ffffff !important;
}

@media (max-width: 1080px) and (min-width: 641px) {
    .store-gallery-carousel {
        --store-gallery-carousel-columns: 3;
    }
}

@media (max-width: 640px) {
    .store-gallery-carousel {
        --store-gallery-carousel-columns: 2;
    }

    .store-gallery-carousel__controls {
        flex-wrap: wrap;
        margin-bottom: var(--store-space-3);
    }

    .store-gallery-carousel__shell::before,
    .store-gallery-carousel__shell::after {
        width: 52px;
    }

    .store-gallery-carousel__nav--edge {
        width: 42px;
        height: 54px;
        border-radius: 14px !important;
    }

    .store-gallery-carousel__nav--edge::before {
        width: 10px;
        height: 10px;
        border-width: 2.5px;
    }

    .store-gallery-carousel__nav--edge-prev {
        left: var(--store-space-2);
    }

    .store-gallery-carousel__nav--edge-next {
        right: var(--store-space-2);
    }

    .store-gallery-carousel__controls-view-all {
        height: 40px;
        min-height: 40px;
        max-height: 40px;
        padding: 0 var(--store-space-4) !important;
        font-size: 0.76rem;
    }

    .store-gallery-carousel__view-all {
        height: 48px;
        min-height: 48px;
        max-height: 48px;
        padding: 0 calc(var(--store-space-4) * 1.3) !important;
        font-size: 0.76rem;
    }
}
