/*
 * Advanced Slider — modern engine (Crema).
 * Markup: catalog/view/theme/base/template/extension/module/advslider/slider.twig
 * Loaded by the module controller only on pages that render a slider. Cache-bust: ASSET_VERSION in
 * catalog/controller/extension/module/advslider.php (not header.twig).
 *
 * The track is a native scroll-snap strip: it swipes and scrolls without JavaScript. Sizes follow the slider's own
 * width (container query units), so the same slider reads well in a 263 px side column and a 1170 px hero.
 */

.advs {
    --advs-pad: 12px;
    --advs-panel: rgba(248, 246, 242, 0.9);
    --advs-bar: 28px;
    position: relative;
    display: block;
    width: 100%;
    /* The slider's bottom edge usually falls on a fraction of a pixel (its height is a ratio of its width, the header
       above has a fractional height). Safari then leaves one device pixel of page background between the slider and
       the block below — a white hairline over a dark footer. One pixel of overlap closes it. */
    margin-bottom: -1px;
    color: var(--ink-900, #282729);
    container-type: inline-size;
}

@supports (width: 1cqi) {
    .advs {
        --advs-pad: clamp(8px, 2cqi, 24px);
    }
}

.advs [hidden] {
    display: none !important;
}

/* ── Track and slides ── */

.advs__track {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.advs__track::-webkit-scrollbar {
    display: none;
}

.advs--single .advs__track {
    overflow: hidden;
}

.advs__slide {
    position: relative;
    flex: 0 0 100%;
    min-width: 0;
    aspect-ratio: var(--advs-w) / var(--advs-h);
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* An image slide is exactly the module's ratio. min-height: 0 switches off the automatic minimum of aspect-ratio
   boxes, and the image is taken out of flow: otherwise its intrinsic height (the file's, which with a pixel `sizes`
   can be far more than the slot) stretches the slide in Safari — a tall white gap on iPhone. */
.advs__slide--image {
    min-height: 0;
    overflow: hidden;
}

/* Where container units exist the height is spelled out from the slider's width instead of left to aspect-ratio:
   Safari does not recompute the height of an aspect-ratio flex item when the slider gets narrower (rotating an
   iPhone, resizing the window) and keeps the old, taller box. */
@supports (width: 1cqi) {
    .advs__slide {
        aspect-ratio: auto;
        min-height: calc(100cqi * var(--advs-h) / var(--advs-w));
    }

    .advs__slide--image {
        height: calc(100cqi * var(--advs-h) / var(--advs-w));
        min-height: 0;
    }
}

.advs__link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.advs__link:hover,
.advs__link:focus {
    color: inherit;
    text-decoration: none;
}

.advs__slide--image picture {
    display: block;
    height: 100%;
}

.advs__img {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    /* Every candidate file is rendered on a canvas of the module's ratio, so cover never crops a picture — it only
       closes the sub-pixel strip that contain leaves when the box height is fractional (a white hairline under the
       banner, visible above a dark footer). */
    object-fit: cover;
}

/* ── Text over the image ── */

.advs__caption {
    position: absolute;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-sizing: border-box;
    max-width: calc(100% - 2 * var(--advs-pad));
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--advs-panel);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--ink-900, #282729);
    text-align: left;
}

@supports (width: 1cqi) {
    .advs__caption {
        max-width: min(calc(100% - 2 * var(--advs-pad)), max(62cqi, 240px));
        padding: clamp(8px, 1.5cqi, 16px) clamp(12px, 2.2cqi, 24px);
    }
}

.advs__caption--p1 { top: var(--advs-pad); left: var(--advs-pad); }
.advs__caption--p2 { top: var(--advs-pad); right: var(--advs-pad); }
.advs__caption--p3 { bottom: var(--advs-pad); left: var(--advs-pad); }
.advs__caption--p4 { bottom: var(--advs-pad); right: var(--advs-pad); }

/* Bottom captions clear the control bar once it is shown */
.advs.is-ready:not(.advs--single) .advs__caption--p3,
.advs.is-ready:not(.advs--single) .advs__caption--p4 {
    bottom: calc(var(--advs-pad) + var(--advs-bar) + 8px);
}

.advs__heading {
    display: block;
    margin: 0;
    font-size: 16px;
    font-size: clamp(15px, 2.6vw, 24px);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0;
    color: var(--ink-900, #282729);
}

.advs__text {
    display: block;
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--ink-800, #3a383b);
}

.advs__more {
    display: block;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--ink-muted-dark, #6f6862);
    transition: color 0.2s;
}

@supports (width: 1cqi) {
    .advs__heading {
        font-size: clamp(15px, 2.6cqi, 24px);
    }

    .advs__text {
        font-size: clamp(12px, 1.7cqi, 15px);
    }
}

.advs__link:hover .advs__more,
.advs__link:focus-visible .advs__more {
    color: var(--ink-900, #282729);
}

.advs__link:focus-visible {
    outline: 2px solid var(--ink-900, #282729);
    outline-offset: -4px;
}

/* ── Free HTML slides ── */

.advs__html {
    width: 100%;
}

.advs__html img,
.advs__html video,
.advs__html iframe {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ── Product / builder slides: text beside an image ── */

.advs__slide--content {
    display: flex;
    align-items: center;
    background: var(--background-light, #f8f6f2);
}

.advs__bg,
.advs__bg picture {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

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

.advs__split {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: center;
    gap: 24px;
    box-sizing: border-box;
    width: 100%;
    padding: 24px;
}

@supports (width: 1cqi) {
    .advs__split {
        gap: clamp(16px, 4cqi, 56px);
        padding: clamp(16px, 4cqi, 56px);
    }
}

.advs__slide--reverse .advs__media {
    order: 2;
}

.advs__media a,
.advs__media picture {
    display: block;
}

.advs__item {
    display: block;
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
}

/* A product render on white sits on the cream panel without its white box */
.advs__slide--content:not(.advs__slide--bg) .advs__item {
    mix-blend-mode: multiply;
}

.advs__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.advs__slide--bg .advs__body {
    padding: 16px 20px;
    border-radius: 8px;
    background: var(--advs-panel);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.advs__body .advs__heading {
    font-size: clamp(18px, 3.4vw, 28px);
}

@supports (width: 1cqi) {
    .advs__body .advs__heading {
        font-size: clamp(18px, 3.4cqi, 28px);
    }
}

.advs__body .advs__heading a {
    color: inherit;
    text-decoration: none;
}

.advs__price {
    margin: 0;
    font-size: 20px;
    font-size: clamp(16px, 2.6vw, 24px);
    font-weight: 600;
    line-height: 1.25;
}

.advs__price-word,
.advs__price-old {
    font-size: 0.7em;
    font-weight: 400;
    color: var(--ink-muted-dark, #6f6862);
}

.advs__countdown {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--ink-muted-dark, #6f6862);
}

.advs__time {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--ink-900, #282729);
}

.advs__button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 24px;
    border: 0;
    border-radius: 6px;
    background: var(--button-primary-bg, #282729) !important;
    color: var(--text-inverse, #fff);
    font-family: inherit;
    font-size: var(--font-md, 14px);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.advs__button:hover,
.advs__button:focus {
    background: var(--button-primary-hover, #3a383b) !important;
    color: var(--text-inverse, #fff);
    text-decoration: none;
}

.advs__badge {
    position: absolute;
    top: var(--advs-pad);
    left: var(--advs-pad);
    z-index: 2;
    padding: 4px 10px;
    border-radius: 4px;
    background: var(--ink-900, #282729);
    color: var(--text-inverse, #fff);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
}

@container (max-width: 560px) {
    .advs__split {
        grid-template-columns: minmax(0, 1fr);
    }

    .advs__media {
        max-width: 60%;
        margin: 0 auto;
    }

    .advs__slide--reverse .advs__media {
        order: 0;
    }
}

/* ── Controls (revealed by advslider.js) ── */

/* !important on the backgrounds of real <button>s: stylesheet.css makes every unclassed-as-.btn button transparent
   with a selector of six :not() — no plain class selector outweighs it. */
.advs__arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-top: -22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--advs-panel) !important;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--ink-900, #282729);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.advs__arrow--prev { left: 12px; }
.advs__arrow--next { right: 12px; }

.advs:hover .advs__arrow,
.advs:focus-within .advs__arrow {
    opacity: 1;
}

.advs__bar {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 2;
    display: flex;
    align-items: center;
    min-height: var(--advs-bar);
    padding: 0 4px;
    border-radius: 999px;
    background: var(--advs-panel);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    opacity: 0.8;
    transition: opacity 0.2s;
}

.advs:hover .advs__bar,
.advs:focus-within .advs__bar {
    opacity: 1;
}

.advs__bar--dots {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
}

.advs__dots {
    display: flex;
    align-items: center;
}

.advs__dot,
.advs__pause {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--advs-bar);
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink-900, #282729);
    cursor: pointer;
}

.advs__dot {
    width: 20px;
}

.advs__pause {
    width: var(--advs-bar);
    border-radius: 50%;
}

/* 44 px hit area around the small controls */
.advs__dot::after,
.advs__pause::after {
    content: "";
    position: absolute;
    top: -8px;
    bottom: -8px;
    left: 0;
    right: 0;
}

.advs__pause::after {
    left: -8px;
    right: -8px;
}

.advs__dot::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: var(--ink-muted, #8a827a);
    transition: width 0.2s, background-color 0.2s;
}

.advs__dot[aria-current="true"]::before {
    width: 16px;
    background: var(--ink-900, #282729);
}

.advs__icon-play,
.advs.is-paused .advs__icon-pause {
    display: none;
}

.advs.is-paused .advs__icon-play {
    display: block;
}

.advs__arrow:focus-visible,
.advs__dot:focus-visible,
.advs__pause:focus-visible,
.advs__button:focus-visible {
    outline: 2px solid var(--ink-900, #282729);
    outline-offset: 2px;
}

/* Touch screens swipe; the arrows would only cover the picture */
@media (hover: none) {
    .advs__arrow {
        display: none;
    }

    .advs__bar {
        opacity: 1;
    }
}

@container (max-width: 400px) {
    .advs__arrow {
        width: 32px;
        height: 32px;
        margin-top: -16px;
    }

    .advs__arrow--prev { left: 6px; }
    .advs__arrow--next { right: 6px; }

    .advs__bar {
        right: 6px;
        bottom: 6px;
    }
}

/* ── Layout 2: a slow zoom on the slide in view ── */

@media (prefers-reduced-motion: no-preference) {
    .advs--layout2 .advs__slide.is-active .advs__img {
        animation: advs-zoom 14s ease-out both;
    }
}

@keyframes advs-zoom {
    from { transform: scale(1); }
    to { transform: scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
    .advs__arrow,
    .advs__bar,
    .advs__more,
    .advs__dot::before {
        transition: none;
    }
}

@media print {
    .advs__arrow,
    .advs__bar {
        display: none !important;
    }

    .advs__track {
        overflow: hidden;
    }
}
