/* Advanced Home Slider — frontend styles */
.ahs-wrapper {
    position: relative;
    width: 100%;
    background: var(--ahs-bg, #f5f5f5);
    color: var(--ahs-primary, #ffffff);
    user-select: none;
    overflow: hidden;
}
.ahs-wrapper *,
.ahs-wrapper *::before,
.ahs-wrapper *::after { box-sizing: border-box; }

.ahs-viewport {
    position: relative;
    width: 100%;
    overflow: hidden;
}
.ahs-track {
    display: flex;
    width: 100%;
    transition: transform 500ms cubic-bezier(.22, .61, .36, 1);
    will-change: transform;
    touch-action: pan-y;
}
.ahs--dragging .ahs-track { transition: none !important; cursor: grabbing; }

.ahs-slide {
    position: relative;
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    aspect-ratio: var(--ahs-desktop-ratio, auto);
}
@media (max-width: 767px) {
    .ahs-slide { aspect-ratio: var(--ahs-mobile-ratio, var(--ahs-desktop-ratio, auto)); }
}

.ahs-link {
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
    /* Prevent the browser from initiating its native link-drag gesture,
       which was blocking mouse-wheel and pointer scrolling over the slide. */
    -webkit-user-drag: none;
    user-drag: none;
    user-select: none;
}
.ahs-picture,
.ahs-picture img { display: block; width: 100%; height: 100%; }
.ahs-img {
    object-fit: cover;
    object-position: center;
    max-width: 100%;
}

/* Overlays */
.ahs-slide--overlay-light::after,
.ahs-slide--overlay-dark::after {
    content: "";
    position: absolute; inset: 0;
    pointer-events: none;
}
.ahs-slide--overlay-light::after { background: linear-gradient(180deg, rgba(255,255,255,0) 40%, rgba(255,255,255,.45) 100%); }
.ahs-slide--overlay-dark::after  { background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.45) 100%); }

/* Overlay content — positioned via per-slide CSS custom properties written
   inline by the smarty template. (var(--ahs-ox-d), var(--ahs-oy-d)) is the
   anchor point on the image; (var(--ahs-tx-d), var(--ahs-ty-d)) shifts the
   overlay so its own start/center/end aligns with that anchor. This is
   what keeps "centered" overlays actually centered when the viewport
   width — and therefore the overlay's relative width against the image —
   changes between admin preview and the real storefront. */
.ahs-content {
    position: absolute;
    inset: auto;
    left: var(--ahs-ox-d, 5%);
    top:  var(--ahs-oy-d, 60%);
    transform: translate(var(--ahs-tx-d, 0%), var(--ahs-ty-d, 0%));
    max-width: 60%;
    padding: 0;
    pointer-events: none;
    z-index: 2;
}
@media (max-width: 767px) {
    .ahs-content {
        left: var(--ahs-ox-m, 5%);
        top:  var(--ahs-oy-m, 70%);
        transform: translate(var(--ahs-tx-m, 0%), var(--ahs-ty-m, 0%));
        max-width: 80%;
    }
}
.ahs-slide--content-left   .ahs-content { text-align: left; }
.ahs-slide--content-center .ahs-content { text-align: center; }
.ahs-slide--content-right  .ahs-content { text-align: right; }
.ahs-content__inner {
    max-width: 560px;
    color: var(--ahs-primary, #fff);
    pointer-events: auto;
}
/* Every overlay element reads its dimensions from CSS custom properties
   emitted by the module (see getOverlayLayoutVars()). Same values are
   applied in the admin editor, so what the merchant drags is exactly
   what visitors see. Defaults kick in only if the vars are missing. */
.ahs-eyebrow {
    display: inline-block;
    font-size: var(--ahs-eb-size, 12px);
    text-transform: uppercase;
    letter-spacing: .12em;
    margin-bottom: var(--ahs-eb-mb, 8px);
    text-align: var(--ahs-eb-align, inherit);
    opacity: .85;
}
.ahs-headline {
    font-size: var(--ahs-hl-size, 44px);
    line-height: 1.15;
    margin: 0 0 var(--ahs-hl-mb, 8px);
    text-align: var(--ahs-hl-align, inherit);
}
.ahs-description {
    font-size: var(--ahs-ds-size, 16px);
    line-height: 1.4;
    margin: 0 0 var(--ahs-ds-mb, 16px);
    text-align: var(--ahs-ds-align, inherit);
    opacity: .95;
}
.ahs-cta {
    display: inline-block;
    padding: var(--ahs-ct-pad-y, 10px) var(--ahs-ct-pad-x, 20px);
    background: var(--ahs-accent, #2d2d2d);
    color: var(--ahs-primary, #fff);
    border-radius: 999px;
    font-weight: 600;
    font-size: var(--ahs-ct-size, 15px);
    text-align: var(--ahs-ct-align, inherit);
}
/* Wrapping around the CTA needs the parent to honor its alignment override
   because inline-block CTA sits in the text flow of the overlay. */
.ahs-content__inner { line-height: 1; }
.ahs-content__inner > * { line-height: 1.15; }

@media (max-width: 767px) {
    .ahs-eyebrow    { font-size: var(--ahs-eb-size-m, var(--ahs-eb-size, 12px)); }
    .ahs-headline   { font-size: var(--ahs-hl-size-m, var(--ahs-hl-size, 28px)); }
    .ahs-description{ font-size: var(--ahs-ds-size-m, var(--ahs-ds-size, 14px)); }
    .ahs-cta        { font-size: var(--ahs-ct-size-m, var(--ahs-ct-size, 14px)); }
}
.ahs--btn-square .ahs-cta { border-radius: 4px; }
.ahs--btn-rounded .ahs-cta { border-radius: 999px; }

/* Arrows */
.ahs-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 44px; height: 44px;
    display: inline-flex;
    align-items: center; justify-content: center;
    background: rgba(255,255,255,.85);
    color: #111;
    border: 0;
    cursor: pointer;
    transition: background 150ms;
}
.ahs-btn:hover { background: #fff; }
.ahs--btn-rounded .ahs-btn { border-radius: 999px; }
.ahs--btn-square  .ahs-btn { border-radius: 4px; }
.ahs--btn-circle  .ahs-btn { border-radius: 999px; }
.ahs-btn--prev { left: 12px; }
.ahs-btn--next { right: 12px; }

/* Pagination */
.ahs-pagination {
    display: flex; justify-content: center;
    gap: .5rem;
    padding: .75rem 0;
}
.ahs--nav-overlay .ahs-pagination {
    position: absolute;
    left: 0; right: 0; bottom: 8px;
    padding: 0;
    z-index: 3;
}
.ahs-dot {
    width: 10px; height: 10px;
    border: 0;
    background: var(--ahs-dot, #fff);
    opacity: .55;
    border-radius: 999px;
    cursor: pointer;
    transition: opacity 150ms, transform 150ms;
    padding: 0;
}
.ahs-dot:hover { opacity: .8; }
.ahs-dot--active {
    opacity: 1;
    background: var(--ahs-dot-active, #fff);
    transform: scale(1.15);
}

/* SR live region */
.ahs-sr-live {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .ahs-track { transition: none !important; }
    .ahs-dot   { transition: none !important; }
}
