/*
 * The app-style home (resources/views/website/home/*, switch storefront_home.app_home).
 * Everything is under .ah, so no other page is touched. Logical properties throughout (RTL: dir="rtl" on <html>).
 * Tokens follow the app's 2026 palette: ink, muted, line, surface, purple, mint, sun, coral, sky.
 */
.ah {
    --ah-ink: #1d1537;
    --ah-muted: #6b6486;
    --ah-line: #ece8f7;
    --ah-surface: #fff;
    --ah-bg: #f7f4fd;
    --ah-purple: #6d3ed6;
    --ah-purple-soft: #ece4fb;
    --ah-mint: #d9f4ea;
    --ah-sun: #fdf0c8;
    --ah-coral: #fde0da;
    --ah-sky: #dcecfb;
    --ah-gap: 16px;
    --ah-pad: 16px;
    max-width: 1280px;
    margin-inline: auto;
    padding-block: 8px 40px;
    /* The site's <main> is a flex column with a 25px gap (main.css); here the sections' own margins are
       the only space between them, as in the app. */
    gap: 0;
    color: var(--ah-ink);
}
.ah [hidden] { display: none !important; }
.ah img { max-width: 100%; }

/* ── Section frame ─────────────────────────────────────────────────────── */
/* 20px between sections, as the app's home column. */
.ah-sec { margin-block: 20px 0; padding-inline: var(--ah-pad); }
.ah-sec__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-block-end: 12px; }
.ah-sec__title { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 800; color: inherit; }
.ah-sec__more { flex: none; font-size: 14px; font-weight: 700; color: var(--ah-purple); text-decoration: none; padding: 6px 2px; }
.ah-sec__more:hover { text-decoration: underline; }
.ah-sec__sub { margin: -4px 0 12px; font-size: 14px; line-height: 1.5; color: var(--ah-muted); }

/* ── Banner carousel ───────────────────────────────────────────────────── */
.ah-hero { position: relative; margin-block-start: 12px; }
.ah-hero__track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--ah-pad);
    padding-inline: var(--ah-pad);
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}
.ah-hero__track::-webkit-scrollbar { display: none; }
.ah-hero__slide { flex: 0 0 88%; scroll-snap-align: start; aspect-ratio: 2 / 1; border-radius: 20px; overflow: hidden; background: var(--ah-bg); }
.ah-hero__link { display: block; width: 100%; height: 100%; }
.ah-hero__link picture, .ah-hero__link img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ah-hero__arrow {
    display: none;
    position: absolute;
    inset-block-start: calc(50% - 22px);
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: var(--ah-ink);
    box-shadow: 0 2px 10px rgba(29, 21, 55, .25);
    cursor: pointer;
    place-items: center;
}
.ah-hero__arrow:disabled { opacity: .35; cursor: default; }
.ah-hero__arrow--prev { inset-inline-start: 24px; }
.ah-hero__arrow--next { inset-inline-end: 24px; }
[dir="rtl"] .ah-hero__arrow svg { transform: scaleX(-1); }
.ah-hero__bar { display: flex; align-items: center; justify-content: center; gap: 10px; margin-block-start: 12px; }
.ah-hero__dots { display: flex; gap: 8px; }
.ah-hero__dot {
    position: relative;
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #cfc4ec;
    cursor: pointer;
    transition: width .2s ease, background-color .2s ease;
}
/* A 24px touch target around the 8px dot. */
.ah-hero__dot::after { content: ""; position: absolute; inset: -8px -4px; }
.ah-hero__dot.is-active { width: 26px; background: var(--ah-purple); }
.ah-hero__pause {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--ah-line);
    border-radius: 50%;
    background: var(--ah-surface);
    color: var(--ah-muted);
    cursor: pointer;
}
.ah-hero__pause[aria-pressed="true"] { color: var(--ah-purple); }
.ah-hero__arrow:focus-visible, .ah-hero__dot:focus-visible, .ah-hero__pause:focus-visible,
.ah-tile__link:focus-visible, .ah-brand__link:focus-visible, .ah-care:focus-visible, .ah-deal:focus-visible,
.ah-sec__more:focus-visible, .ah-hero__link:focus-visible, .ah-feature__link:focus-visible {
    outline: 3px solid var(--ah-purple);
    outline-offset: 2px;
}

/* ── Round, pastel category tiles ──────────────────────────────────────── */
.ah-tiles { display: flex; gap: 14px; margin: 0; padding: 4px 2px 8px; list-style: none; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.ah-tiles::-webkit-scrollbar { display: none; }
.ah-tile { flex: 0 0 auto; width: 92px; scroll-snap-align: start; }
.ah-tile__link { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: inherit; border-radius: 16px; }
.ah-tile__img { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; overflow: hidden; background: var(--ah-purple-soft); }
.ah-tile__img img { width: 100%; height: 100%; object-fit: cover; }
/* A sub-category's tile art is the app's 3:4 card picture: the pack sits low and to the end, cut by the
   right and bottom edges. In a circle that left a sliver, so the picture is enlarged towards the pack. */
.ah-tile__img--art img { transform: scale(1.6); transform-origin: 72% 78%; }
.ah-tile--mint .ah-tile__img { background: var(--ah-mint); }
.ah-tile--sun .ah-tile__img { background: var(--ah-sun); }
.ah-tile--sky .ah-tile__img { background: var(--ah-sky); }
.ah-tile--coral .ah-tile__img { background: var(--ah-coral); }
.ah-tile__name { font-size: 14px; font-weight: 700; line-height: 1.3; text-align: center; overflow-wrap: anywhere; }
.ah-tiles--small .ah-tile { width: 78px; }
.ah-tiles--small .ah-tile__img { width: 68px; height: 68px; }
.ah-tiles--small .ah-tile__name { font-size: 13px; font-weight: 600; }

/* Pet categories, as the app's 2026 home draws them (PetsCategoryListView): rounded photo cards,
   125 x 135, radius 20, the name on a white pill at the top corner. */
.ah-pets { display: flex; gap: 12px; margin: 0; padding: 4px 2px 8px; list-style: none; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.ah-pets::-webkit-scrollbar { display: none; }
.ah-pet { flex: 0 0 auto; width: 125px; scroll-snap-align: start; }
.ah-pet__link { position: relative; display: block; height: 135px; border-radius: 20px; overflow: hidden; background: var(--ah-purple-soft); color: var(--ah-ink); text-decoration: none; }
.ah-pet__link img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ah-pet__name {
    position: absolute;
    top: 8px;
    inset-inline-start: 8px;
    max-width: calc(100% - 16px);
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff;
    color: var(--ah-ink);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Product rows ──────────────────────────────────────────────────────── */
.ah-rail {
    display: flex;
    gap: 12px;
    margin-inline: calc(var(--ah-pad) * -1);
    padding: 4px var(--ah-pad) 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-padding-inline: var(--ah-pad);
    scrollbar-width: none;
    align-items: stretch;
}
.ah-rail::-webkit-scrollbar { display: none; }
.ah-rail__item { flex: 0 0 auto; width: 172px; scroll-snap-align: start; display: flex; }
.ah-rail__item > .shop__card { width: 100%; }

/* ── Coloured panels (a collection with a look; Fetch it fast) ─────────── */
.ah-panel {
    --ah-panel: #1a1033;
    margin-inline: var(--ah-pad);
    padding: 18px var(--ah-pad) 12px;
    border-radius: 28px;
    background: var(--ah-panel);
    color: #fff;
}
.ah-panel.ah-sec { padding-inline: var(--ah-pad); }
.ah-panel .ah-sec__more { color: #ffd166; }
.ah-panel .ah-sec__sub { color: rgba(255, 255, 255, .78); }
.ah-panel--light { color: var(--ah-ink); }
.ah-panel--light .ah-sec__more { color: var(--ah-purple); }
.ah-panel--light .ah-sec__sub { color: rgba(29, 21, 55, .7); }
.ah-panel--flash { --ah-panel: #1a1033; }
.ah-panel__banner { display: block; margin-block-end: 14px; border-radius: 18px; overflow: hidden; aspect-ratio: 2 / 1; }
.ah-panel__banner img, .ah-panel__banner picture { display: block; width: 100%; height: 100%; object-fit: cover; }
.ah-clock { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-block-end: 14px; }
.ah-clock__label { font-weight: 700; margin-inline-end: 4px; }
.ah-clock__cell { display: grid; place-items: center; min-width: 56px; padding: 6px 8px; border-radius: 14px; background: #f5b83d; color: #1a1033; line-height: 1.1; }
.ah-clock__cell b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ah-clock__cell i { font-size: 11px; font-style: normal; font-weight: 600; }

/* ── Featured banner, Brands, Care, Deal of the week ───────────────────── */
.ah-feature__link { display: block; border-radius: 20px; overflow: hidden; aspect-ratio: 2 / 1; background: var(--ah-bg); }
.ah-feature__link picture, .ah-feature__link img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ah-brands { display: flex; gap: 10px; margin: 0; padding: 2px 2px 8px; list-style: none; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.ah-brands::-webkit-scrollbar { display: none; }
.ah-brand { flex: 0 0 auto; width: 120px; scroll-snap-align: start; }
.ah-brand__link { display: block; height: 72px; padding: 10px; border: 1px solid var(--ah-line); border-radius: 16px; background: var(--ah-surface); }
.ah-brand__link picture { display: block; width: 100%; height: 100%; }
.ah-brand__link img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ah-care { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px; border-radius: 22px; background: var(--ah-purple-soft); color: var(--ah-ink); text-decoration: none; }
.ah-care__text { display: grid; gap: 4px; min-width: 0; }
.ah-care__title { font-size: 18px; font-weight: 800; }
.ah-care__body { font-size: 14px; line-height: 1.45; color: var(--ah-muted); }
.ah-care__cta { flex: none; padding: 10px 16px; border-radius: 999px; background: var(--ah-purple); color: #fff; font-weight: 700; font-size: 14px; }
.ah-deal { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-radius: 22px; background: var(--ah-ink); color: #fff; text-decoration: none; }
.ah-deal__text { display: grid; gap: 4px; min-width: 0; }
.ah-deal__eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #ffd166; }
.ah-deal__title { font-size: 20px; line-height: 1.3; font-weight: 800; }
.ah-deal__ends { font-size: 13px; color: rgba(255, 255, 255, .75); }
.ah-deal__img { flex: none; display: grid; place-items: center; width: 84px; height: 84px; border-radius: 18px; background: #fff; overflow: hidden; padding: 8px; }
.ah-deal__img img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ── Tablet and desktop ────────────────────────────────────────────────── */
@media (min-width: 768px) {
    .ah { --ah-pad: 24px; }
    .ah-sec__title { font-size: 26px; }
    .ah-tile { width: 132px; }
    .ah-tile__img { width: 120px; height: 120px; }
    .ah-tile__name { font-size: 16px; }
    .ah-tiles--small .ah-tile { width: 108px; }
    .ah-tiles--small .ah-tile__img { width: 92px; height: 92px; }
    .ah-rail__item { width: 200px; }
    /* The deal of the week is one short line and a logo: across a desktop it was a long empty bar. */
    .ah-deal { max-width: 760px; margin-inline: auto; }
}
@media (min-width: 1024px) {
    .ah-pet { width: 160px; }
    .ah-pet__link { height: 172px; }
    .ah { --ah-pad: 32px; }
    .ah-hero__slide { flex-basis: 100%; aspect-ratio: 3 / 1; border-radius: 24px; }
    /* One banner across the content width: no neighbours peeking in. */
    .ah-hero { padding-inline: var(--ah-pad); }
    .ah-hero__track { padding-inline: 0; scroll-padding-inline: 0; }
    .ah-hero__arrow { display: grid; }
    .ah-hero__arrow--prev { inset-inline-start: calc(var(--ah-pad) + 16px); }
    .ah-hero__arrow--next { inset-inline-end: calc(var(--ah-pad) + 16px); }
    .ah-sec { margin-block-start: 32px; }
    .ah-tiles { justify-content: flex-start; gap: 28px; }
    /* Sub-categories: every tile in view, in rows (a pet can have ten), instead of a row cut at the edge. */
    .ah-tiles--small { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 20px 14px; overflow: visible; }
    .ah-tiles--small .ah-tile { width: auto; justify-self: center; }
    .ah-rail { gap: 16px; }
    /* Five cards across the content width, the rest a swipe or scroll away. */
    .ah-rail__item { width: calc((100% - 4 * 16px) / 5); min-width: 200px; }
    .ah-brands { display: grid; grid-template-columns: repeat(6, 1fr); overflow: visible; gap: 14px; }
    .ah-brand { width: auto; }
    .ah-brand__link { height: 88px; }
    .ah-feature__link { aspect-ratio: 4 / 1; }
    /* A collection's 2:1 picture across the panel was taller than its row of cards: at most 720px wide
       (360px tall), centred, the whole picture still shown. */
    .ah-panel__banner { max-width: 720px; margin-inline: auto; }
    .ah-care { padding: 24px 32px; }
    .ah-deal { padding: 24px 32px; }
    .ah-panel { padding: 24px var(--ah-pad) 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .ah-hero__track { scroll-behavior: auto; }
    .ah-hero__dot { transition: none; }
}
