/**
 * ProductsPeruvian Atom hero slider.
 *
 * Elementor structure:
 * .productsperuvian-hero-slider
 *   > .productsperuvian-hero-slide
 *   > .productsperuvian-hero-slide
 *
 * The JS wraps the slides in a stage only on the public frontend. In the
 * Elementor editor the original containers remain untouched for easy editing.
 */

.productsperuvian-hero-slider {
    --pp-hero-transition: 650ms;
    --pp-hero-nav-bg: #f7f6f1;
    --pp-hero-dot: rgba(17, 17, 17, 0.16);
    --pp-hero-dot-active: #111;
    position: relative;
    width: 100%;
}

.productsperuvian-hero-slider__stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    overflow: hidden;
}

.productsperuvian-hero-slider__stage > .productsperuvian-hero-slide {
    grid-area: 1 / 1;
    width: 100%;
    min-width: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(1.006);
    transition:
        opacity var(--pp-hero-transition) ease,
        transform var(--pp-hero-transition) ease,
        visibility 0s linear var(--pp-hero-transition);
    z-index: 1;
}

.productsperuvian-hero-slider__stage > .productsperuvian-hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: scale(1);
    transition:
        opacity var(--pp-hero-transition) ease,
        transform var(--pp-hero-transition) ease,
        visibility 0s linear 0s;
    z-index: 2;
}

.productsperuvian-hero-slider__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 30px;
    padding: 8px 16px;
    background: var(--pp-hero-nav-bg);
}

.productsperuvian-hero-slider__dot {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    width: 20px;
    height: 4px;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--pp-hero-dot);
    cursor: pointer;
    transition:
        width 280ms ease,
        background-color 280ms ease,
        opacity 280ms ease;
}

.productsperuvian-hero-slider__dot:hover,
.productsperuvian-hero-slider__dot:focus-visible {
    background: rgba(17, 17, 17, 0.34);
}

.productsperuvian-hero-slider__dot:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

.productsperuvian-hero-slider__dot.is-active,
.productsperuvian-hero-slider__dot[aria-current="true"] {
    width: 70px;
    background: var(--pp-hero-dot-active);
}

/* Elementor editor: keep each Atom/container visible and editable. */
.elementor-editor-active .productsperuvian-hero-slider > .productsperuvian-hero-slide,
.elementor-editor-preview .productsperuvian-hero-slider > .productsperuvian-hero-slide {
    position: relative;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
}

@media (max-width: 767px) {
    .productsperuvian-hero-slider__nav {
        min-height: 28px;
        gap: 7px;
        padding: 7px 12px;
    }

    .productsperuvian-hero-slider__dot {
        width: 16px;
        height: 3px;
    }

    .productsperuvian-hero-slider__dot.is-active,
    .productsperuvian-hero-slider__dot[aria-current="true"] {
        width: 52px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .productsperuvian-hero-slider__stage > .productsperuvian-hero-slide,
    .productsperuvian-hero-slider__dot {
        transition: none !important;
    }
}
