/*
 * A pet world on the home (resources/views/website/home/pet-world.blade.php): banner + picture tiles, as the
 * 2026 mockup (Web.dc.html) draws Dog World. Its colours come from the dashboard as --pw-bg, --pw-ink and
 * --pw-tint on the section. Logical properties throughout, so /ar (dir="rtl") is mirrored. Plain CSS, not in
 * the Vite build (the storefront never is).
 */
.pw {
    --pw-bg: #6633cc;
    --pw-ink: #ffffff;
    --pw-tint: #f6f2ff;
    --pw-pad: 16px;
    --pw-gutter: var(--pw-pad); /* the section's inline padding, which the phone's tile row runs into */
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 1280px;
    margin: 28px auto 0;
    padding-inline: var(--pw-pad);
    box-sizing: border-box;
    color: #1a1033;
}

/* On the app-style home <main class="ah"> is a flex column: without the width above the section shrank to
   its tiles. There it lines up with the collection panels (same inline padding). */
.ah .pw { --pw-gutter: var(--ah-pad); padding-inline: var(--ah-pad); }

/* ── Banner: title and subtitle at the start, the photo at the end, "Shop all" under the text ── */
.pw__banner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    grid-template-rows: auto 1fr;
    column-gap: 12px;
    min-height: 132px;
    padding: 18px 0 14px 18px;
    padding-inline: 18px 0;
    border-radius: 24px;
    overflow: hidden;
    background: var(--pw-bg);
    color: var(--pw-ink);
    box-sizing: border-box;
}
.pw__photo {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0;
    width: 150px;
    height: 100%;
    object-fit: cover;
    object-position: 50% 18%;
}
.pw__title {
    grid-column: 1;
    margin: 0;
    font-family: Chapeau, "IBM Plex Sans Arabic", system-ui, sans-serif;
    font-weight: 900;
    font-size: 26px;
    line-height: 1.05;
    color: inherit;
}
.pw__side {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-block-start: 4px;
}
.pw__sub { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.35; color: inherit; }
.pw__cta {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--pw-ink);
    color: var(--pw-bg);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}
.pw__cta:hover, .pw__cta:focus-visible { color: var(--pw-bg); text-decoration: underline; }

/* ── Tiles: one swipeable row on a phone (as the app's rails: no half-empty second row, the next
   tile peeking at the edge), as many 140px+ tiles as fit on wider screens ── */
.pw__tiles {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 96px;
    gap: 8px;
    margin: 0 calc(-1 * var(--pw-gutter));
    padding: 0 var(--pw-gutter) 2px;
    list-style: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--pw-gutter);
    scrollbar-width: none;
}
.pw__tiles::-webkit-scrollbar { display: none; }
.pw__tiles > li { scroll-snap-align: start; }
.pw__tile {
    position: relative;
    display: block;
    height: 104px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--pw-tint);
    color: #1a1033;
    text-decoration: none;
    transition: transform 160ms cubic-bezier(.2, .8, .2, 1);
}
.pw__tile:hover { transform: translateY(-3px); color: #1a1033; }
.pw__tile:focus-visible { outline: 3px solid var(--pw-bg); outline-offset: 2px; }
.pw__label {
    position: absolute;
    inset-block-start: 8px;
    inset-inline: 8px 6px;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.2;
}
.pw__img {
    position: absolute;
    inset-block-end: 0;
    inset-inline-end: 0;
    width: 100%;
    height: 62%;
    object-fit: contain;
    object-position: 100% 100%;
}
[dir="rtl"] .pw__img { object-position: 0 100%; }
/* A product photo on white: multiplied onto the tint, so its white box disappears. */
.pw__tile--packshot .pw__img { mix-blend-mode: multiply; inset-block-end: 4px; inset-inline-end: 4px; width: calc(100% - 8px); }

@media (prefers-reduced-motion: reduce) {
    .pw__tile { transition: none; }
    .pw__tile:hover { transform: none; }
}

@media (min-width: 768px) {
    .pw { --pw-pad: 24px; gap: 18px; margin-block-start: 40px; }
    /* Title at the start, the photo in the middle, subtitle and "Shop all" at the end. */
    .pw__banner {
        grid-template-columns: minmax(0, 34%) minmax(0, 1fr) minmax(0, 30%);
        grid-template-rows: auto;
        align-items: center;
        min-height: 220px;
        padding: 36px 40px;
        border-radius: 32px;
    }
    .pw__photo { inset-inline: 34% auto; width: 28%; object-position: 50% 15%; }
    .pw__title { font-size: 56px; line-height: .95; }
    .pw__side { grid-column: 3; position: relative; gap: 14px; margin: 0; justify-content: center; }
    .pw__sub { font-family: Chapeau, "IBM Plex Sans Arabic", system-ui, sans-serif; font-weight: 700; font-size: 24px; line-height: 1.15; }
    .pw__cta { min-height: 44px; padding: 0 22px; font-size: 15px; }
    .pw__tiles {
        grid-auto-flow: row;
        grid-auto-columns: auto;
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 14px;
        margin: 0;
        padding: 0;
        overflow: visible;
        scroll-snap-type: none;
    }
    .pw__tile { height: auto; aspect-ratio: 1 / 1.05; border-radius: 22px; }
    .pw__label { inset-block-start: 14px; inset-inline: 14px 10px; font-family: Chapeau, "IBM Plex Sans Arabic", system-ui, sans-serif; font-size: 17px; line-height: 1.15; }
    .pw__tile--packshot .pw__img { inset-block-end: 8px; inset-inline-end: 8px; width: calc(100% - 16px); }
}
@media (min-width: 1024px) {
    .pw { --pw-pad: 32px; }
    /* Every tile on one row (up to 8, from --pw-count on the section), as Web.dc.html draws it. */
    .pw__tiles { grid-template-columns: repeat(var(--pw-count, 8), minmax(0, 1fr)); }
}
