/* ===========================================================================
   Base storefront theme.

   RTL RULE: logical properties only — margin-inline-start, padding-inline,
   inset-inline, text-align: start/end. No margin-left / right / float anywhere.
   Flipping <html dir> is the ONLY thing needed to support Farsi and Arabic;
   there is deliberately no rtl.css.

   A child theme overrides the tokens in :root and nothing else, in most cases.
   =========================================================================== */

@font-face {
    font-family: "IRANYekan";
    src: url("../fonts/iranyekanwebregular.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

:root {
    /* brand */
    --brand: #10b981;
    --brand-strong: #059669;
    --brand-soft: #ecfdf5;
    --brand-ink: #ffffff;

    /* Action colour: header search focus and account icon. The sign-in /
       sign-up cards (.auth) redefine it as blue further down.
       --action-rgb is the same colour as channels, for the tinted shadows. */
    --action: #10b981;
    --action-hover: #059669;
    --action-active: #047857;
    --action-rgb: 16 185 129;
    --action-ink: #ffffff;
    --action-disabled: #a7e3cb;
    --control-radius: 10px;

    /* neutrals */
    --ink: #111111;
    --ink-2: #333333;
    --muted: #6b7280;
    --muted-2: #9ca3af;
    --line: #e5e7eb;
    --line-2: #eeeff1;
    --bg: #ffffff;
    --bg-soft: #f3f4f6;
    --bg-soft-2: #f7f8f9;
    --dark: #151515;

    /* accents */
    --star: #f5a623;
    --sale: #dc2626;
    --new: #2563eb;

    --radius: 6px;
    --wrap: 1240px;
    --gutter: 32px;

    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --line-height: 1.5;
    --tracking-wide: 0.2em;
}

/* Locale-specific typography — set here, never inline in the layout.
   Letter-spacing and uppercase break joined scripts, so both are switched off. */
html[lang="fa"] {
    --font-body: "IRANYekan", Tahoma, Arial, sans-serif;
    --line-height: 1.7;
    --tracking-wide: 0;
}

html[lang="ar"] {
    --font-body: "Cairo", "Noto Naskh Arabic", Tahoma, Arial, sans-serif;
    --line-height: 1.7;
    --tracking-wide: 0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: var(--line-height);
    -webkit-font-smoothing: antialiased;
}

button,
input,
select {
    font: inherit;
    color: inherit;
    border: 0;
    background: none;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
h3,
h4,
p {
    margin: 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

svg {
    display: block;
    flex: none;
}

.wrap {
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* Inner pages end in a .wrap; home ends in the benefits band, which sits flush on the footer. */
.site-main > .wrap:last-child {
    padding-block-end: 48px;
}

.sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    inset-block-start: -3rem;
    inset-inline-start: 1rem;
    z-index: 100;
    padding: 0.5rem 0.75rem;
    background: var(--brand);
    color: var(--brand-ink);
    border-radius: var(--radius);
}

.skip-link:focus {
    inset-block-start: 1rem;
}

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Arrows drawn for LTR point the other way in RTL. */
[dir="rtl"] .icon--flip {
    transform: scaleX(-1);
}

.eyebrow {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

html:is([lang="fa"], [lang="ar"]) .eyebrow {
    text-transform: none;
}

/* --- buttons ------------------------------------------------------------ */

.btn,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.15s, border-color 0.15s;
}

.btn--brand,
.button {
    background: var(--brand);
    color: var(--brand-ink);
}

.btn--brand:hover,
.button:hover {
    background: var(--brand-strong);
}

.btn--light {
    background: #fff;
    color: var(--ink);
}

.btn--light:hover {
    background: #eee;
}

.btn--dark {
    background: var(--ink);
    color: #fff;
}

.btn--dark:hover {
    background: #000;
}

.btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.icon-button {
    position: relative;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.icon-button:hover {
    background: var(--bg-soft);
}

.icon-button--boxed {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.count-badge {
    position: absolute;
    inset-block-start: 2px;
    inset-inline-end: 1px;
    display: grid;
    place-items: center;
    min-width: 16px;
    height: 16px;
    padding-inline: 4px;
    border-radius: 100px;
    background: var(--brand);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    box-shadow: 0 0 0 2px #fff;
}

/* --- top bar ------------------------------------------------------------ */

.topbar {
    background: var(--dark);
    color: #d1d5db;
    font-size: 11.5px;
}

.topbar__inner {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 30px;
}

.topbar__offer {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 500;
}

.topbar__note {
    margin-inline: auto;
    color: var(--muted-2);
}

.topbar__links {
    display: flex;
    align-items: center;
    margin-inline-start: auto;
}

.topbar__note + .topbar__links {
    margin-inline-start: 0;
}

.topbar__links a {
    padding-inline: 12px;
    border-inline-start: 1px solid #333;
}

.topbar__links a:first-child {
    border: 0;
}

.topbar__links a:hover {
    color: #fff;
}

/* Product search inside the black top bar (header variant "split"). */
.topbar--search .topbar__inner {
    min-height: 40px;
}

.topbar__search {
    flex: 0 1 320px;
    margin-inline: auto;
}

.topbar .site-search {
    width: 100%;
    margin-inline-start: 0;
}

.topbar .site-search input {
    padding-block: 6px;
    border: 1px solid #333;
    background: #262626;
    color: #fff;
    font-size: 12px;
}

.topbar .site-search input::placeholder {
    color: #8b9099;
}

.topbar .site-search input:focus {
    border-color: var(--action);
    box-shadow: 0 0 0 2px rgb(var(--action-rgb) / 0.35);
}

.topbar .site-search__icon {
    color: #8b9099;
}

/* --- header ------------------------------------------------------------- */

.site-header {
    position: sticky;
    inset-block-start: 0;
    z-index: 40;
    background: #fff;
    border-block-end: 1px solid var(--line-2);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 28px;
    min-height: 64px;
    padding-block: 8px;
}

.site-header__toggle {
    display: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

.logo__mark {
    color: var(--ink);
}

/* Uploaded logo: fixed height, natural width, never wider than a sensible band. */
.logo__image {
    block-size: 56px;
    inline-size: auto;
    max-inline-size: 240px;
    object-fit: contain;
}

@media (max-width: 600px) {
    .logo__image {
        block-size: 44px;
        max-inline-size: 170px;
    }
}

.logo__text {
    line-height: 1;
}

.logo__text b {
    display: block;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.logo__text span {
    display: block;
    margin-block-start: 3px;
    color: var(--muted);
    font-size: 8.5px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

html:is([lang="fa"], [lang="ar"]) .logo__text :is(b, span) {
    letter-spacing: 0;
}

html:is([lang="fa"], [lang="ar"]) .logo__text span {
    font-size: 10px;
}

.site-header__panel {
    display: flex;
    align-items: center;
    gap: 28px;
    flex: 1;
    min-width: 0;
}

.site-nav {
    display: flex;
    gap: 26px;
    margin-inline-start: 24px;
}

.nav-item {
    position: relative;
}

.nav-item__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding-block: 4px;
    color: var(--ink-2);
    font-weight: 500;
    white-space: nowrap;
}

.nav-item__link:hover,
.nav-item__link.is-active,
.nav-item--menu:hover > .nav-item__link,
.nav-item--menu:focus-within > .nav-item__link {
    color: var(--ink);
}

.nav-item__chevron {
    color: var(--muted);
    transition: transform 0.18s ease;
}

.nav-item--menu:hover .nav-item__chevron,
.nav-item--menu:focus-within .nav-item__chevron {
    transform: rotate(180deg);
}

/* Category dropdown: opens on hover and on keyboard focus; the invisible
   padding-top bridges the gap so the pointer can travel into it. */
.nav-menu {
    position: absolute;
    inset-block-start: 100%;
    inset-inline-start: -14px;
    z-index: 50;
    padding-block-start: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}

.nav-item--menu:hover > .nav-menu,
.nav-item--menu:focus-within > .nav-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu > .nav-tree {
    min-inline-size: 220px;
    max-block-size: 70vh;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 28px -12px rgb(17 17 17 / 0.22);
}

.nav-tree {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Deeper levels indent under their parent. */
.nav-tree .nav-tree {
    margin-inline-start: 12px;
    padding-inline-start: 10px;
    border-inline-start: 1px solid var(--line-2);
}

.nav-tree__link {
    display: block;
    padding: 7px 10px;
    border-radius: 6px;
    color: var(--ink-2);
    font-size: 13px;
    white-space: nowrap;
}

.nav-tree__link:hover {
    background: var(--bg-soft);
    color: var(--ink);
}

.nav-tree__link--parent {
    font-weight: 600;
}

.nav-item__link.is-active::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: -2px;
    height: 2px;
    background: var(--ink);
}

.site-search {
    position: relative;
    width: 250px;
    margin-inline-start: auto;
}

.site-search input {
    width: 100%;
    padding-block: 9px;
    padding-inline: 40px 14px;
    border-radius: 100px;
    background: var(--bg-soft);
    font-size: 12.5px;
}

.site-search input::placeholder {
    color: var(--muted-2);
}

.site-search input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--brand);
}

.site-search__icon {
    position: absolute;
    inset-inline-start: 14px;
    inset-block-start: 50%;
    transform: translateY(-50%);
    color: var(--muted);
}

/* Waiting for suggestions (theme.js initSearchSuggest): the icon breathes. */
.site-search.is-searching .site-search__icon {
    animation: suggest-wait 0.9s ease-in-out infinite alternate;
}

@keyframes suggest-wait {
    to {
        opacity: 0.35;
    }
}

/* --- search suggestions -------------------------------------------------- */

/* Wider than the field when the field is narrow; anchored to the field's
   inline-end edge, so in the header it opens toward the middle of the page. */
.suggest {
    position: absolute;
    inset-block-start: calc(100% + 8px);
    inset-inline-end: 0;
    z-index: 60;
    inline-size: max(100%, 400px);
    max-inline-size: calc(100vw - 32px);
    max-block-size: min(70vh, 560px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-block: 6px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 12px 32px rgb(17 17 17 / 0.12), 0 2px 6px rgb(17 17 17 / 0.06);
    font-size: 13px;
    text-align: start;
}

.suggest__group + .suggest__group {
    margin-block-start: 4px;
    padding-block-start: 4px;
    border-block-start: 1px solid var(--line-2);
}

.suggest__heading {
    padding: 8px 16px 4px;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
}

.suggest__option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    color: inherit;
    text-decoration: none;
}

.suggest__option[aria-selected="true"] {
    background: var(--bg-soft);
}

.suggest__option mark {
    background: none;
    color: inherit;
    font-weight: 700;
}

.suggest__option--plain {
    padding-block: 7px;
}

.suggest__thumb {
    display: grid;
    place-items: center;
    flex: none;
    inline-size: 44px;
    block-size: 44px;
    overflow: hidden;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    background: var(--bg-soft);
}

/* No picture: the same stripes as a product card without one. */
.suggest__thumb:empty {
    background: repeating-linear-gradient(45deg, var(--bg-soft), var(--bg-soft) 6px, var(--line) 6px, var(--line) 12px);
}

.suggest__thumb img {
    inline-size: 100%;
    block-size: 100%;
    object-fit: contain;
}

.suggest__body {
    display: grid;
    gap: 2px;
    flex: 1;
    min-inline-size: 0;
}

.suggest__name {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.5;
}

.suggest__meta {
    color: var(--muted);
    font-size: 11.5px;
}

.suggest__price {
    display: grid;
    flex: none;
    justify-items: end;
    gap: 1px;
    font-weight: 600;
    white-space: nowrap;
}

.suggest__price s {
    color: var(--muted-2);
    font-size: 11px;
    font-weight: 400;
}

.suggest__out {
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 500;
}

.suggest__note {
    margin: 0;
    padding: 14px 16px;
    color: var(--muted);
}

.suggest__all {
    margin-block-start: 4px;
    padding-block: 11px;
    border-block-start: 1px solid var(--line-2);
    color: var(--brand-strong);
    font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
    .site-search.is-searching .site-search__icon {
        animation: none;
    }
}

.site-header__actions {
    display: flex;
    gap: 4px;
    flex: none;
}

/* Header variant "classic" with logoSide "end": the whole row mirrors. */
.site-header--logo-end:not(.site-header--split) .site-header__inner {
    flex-direction: row-reverse;
}

/* --- header variant "split": logo | centred menu | search + sign-in + cart -- */

.site-header--split .site-header__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas: "brand menu end";
    align-items: center;
    gap: 24px;
}

.site-header--split.site-header--logo-end .site-header__inner {
    grid-template-areas: "end menu brand";
}

.site-header--split .site-header__brand {
    grid-area: brand;
    justify-self: start;
}

.site-header--split.site-header--logo-end .site-header__brand {
    justify-self: end;
}

.site-header--split .site-header__menu {
    grid-area: menu;
}

.site-header--split .site-nav {
    gap: 30px;
    margin-inline-start: 0;
}

.site-header--split .site-header__end {
    grid-area: end;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-self: end;
}

.site-header--split.site-header--logo-end .site-header__end {
    justify-self: start;
    /* The group then sits at the opposite page edge, so its order flips with it: cart stays toward the menu. */
    flex-direction: row-reverse;
}

/* Medium screens: there is no room for equal side columns, so the menu
   centres in the space between logo and actions instead of on the page. */
@media (max-width: 1180px) and (min-width: 901px) {
    .site-header--split .site-header__inner {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 20px;
    }

    .site-header--split .site-header__menu {
        justify-self: center;
    }

    .site-header--split .site-nav {
        gap: 20px;
    }

}

.account-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-block-size: 40px;
    padding-inline: 14px;
    border: 1px solid var(--line);
    border-radius: var(--control-radius);
    background: #fff;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.account-button:hover {
    border-color: #cfd4da;
    background: var(--bg-soft-2);
    box-shadow: 0 4px 12px -6px rgb(17 17 17 / 0.18);
}

.account-button .icon {
    color: var(--action);
}

/* --- hero --------------------------------------------------------------- */

.hero {
    position: relative;
    height: 360px;
    overflow: hidden;
    background: #222;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s, visibility 0.6s;
}

.slide.is-active {
    opacity: 1;
    visibility: visible;
}

.scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Built-in art mirrors in RTL so its subject stays opposite the text.
   Uploaded <img> banners are never flipped — text in a photo would read backwards. */
[dir="rtl"] svg.scene {
    transform: scaleX(-1);
}

/* Dark wash only where text sits on the image; an image-only banner stays untouched. */
.slide--text::after,
.promo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.35) 40%, rgba(0, 0, 0, 0.05) 70%);
}

[dir="rtl"] .slide--text::after {
    background: linear-gradient(to left, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.35) 40%, rgba(0, 0, 0, 0.05) 70%);
}

.slide__body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    color: #fff;
}

.slide__title {
    max-width: 12ch;
    font-size: 46px;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.02em;
}

html:is([lang="fa"], [lang="ar"]) .slide__title {
    max-width: 16ch;
    line-height: 1.35;
    letter-spacing: 0;
}

.slide__text {
    max-width: 40ch;
    margin-block: 14px 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 15px;
    line-height: 1.55;
}

/* Whole-slide link: covers image and text, sits under the arrows and dots (z-index 3). */
.slide__link {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.slide__link:focus-visible {
    outline-offset: -4px;
}

.hero__arrow {
    position: absolute;
    inset-block-start: 50%;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    transform: translateY(-50%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.15);
    color: #fff;
}

.hero__arrow:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hero__arrow--prev {
    inset-inline-start: 16px;
}

.hero__arrow--next {
    inset-inline-end: 16px;
}

.hero__dots {
    position: absolute;
    inset-inline: 0;
    inset-block-end: 20px;
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: 7px;
    pointer-events: none;
}

.hero__dots button {
    width: 7px;
    height: 7px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    pointer-events: auto;
}

.hero__dots button.is-active {
    background: #fff;
}

.hero__counter {
    position: absolute;
    inset-inline-end: 32px;
    inset-block-end: 22px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 11px;
    letter-spacing: 0.1em;
}

.hero__bar {
    position: relative;
    display: block;
    width: 44px;
    height: 1px;
    background: rgba(255, 255, 255, 0.5);
}

.hero__bar::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    inset-block-start: -1px;
    width: 100%;
    height: 3px;
    background: #fff;
    transform: scaleX(var(--progress, 0.33));
    transform-origin: left center;
    transition: transform 0.4s;
}

[dir="rtl"] .hero__bar::after {
    transform-origin: right center;
}

/* --- category tiles ----------------------------------------------------- */

.cat-tiles {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 12px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
}

/* Same box as before; the icon row is gone, so a fixed height keeps the shape. */
.cat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 100%;
    min-height: 118px;
    padding: 14px 8px 12px;
    border-radius: var(--radius);
    background: var(--bg-soft);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    transition: background-color 0.15s;
}

.cat-tile:hover {
    background: #e9ebee;
}

/* --- sections ----------------------------------------------------------- */

.section {
    padding-block: 40px 0;
}

.section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-block-end: 18px;
}

.section__title,
.page-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-title {
    margin-block-end: 18px;
}

.view-all {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-2);
    font-size: 12.5px;
}

.view-all:hover {
    color: var(--brand);
}

.breadcrumb {
    display: flex;
    gap: 0.5rem;
    padding-block: 18px;
    color: var(--muted);
    font-size: 12.5px;
}

/* --- product grid & card ------------------------------------------------ */

.grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}

.card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    transition: box-shadow 0.18s;
}

.card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.card__media {
    position: relative;
    overflow: hidden;
    height: 130px;
    background: var(--bg-soft);
}

.card__art {
    position: relative;
    display: grid;
    place-items: center;
    height: 100%;
}

/* Pinned to the frame: inside the grid, height:100% resolved against a row that
   grows with the photo, so a tall photo spilled out and covered the name and
   price. contain shows the whole part instead of cropping its top and bottom. */
.card__art img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;   /* product photos are shot on white: no grey bands beside a fitted photo */
}

.card__icon {
    color: var(--ink);
    transition: transform 0.25s;
}

.card:hover .card__icon {
    transform: scale(1.06);
}

.card__placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(45deg, var(--bg-soft), var(--bg-soft) 10px, var(--line) 10px, var(--line) 20px);
}

.card__wish {
    position: absolute;
    inset-block-start: 8px;
    inset-inline-end: 8px;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: var(--ink);
}

.tag {
    position: absolute;
    inset-block-start: 8px;
    inset-inline-start: 8px;
    z-index: 1;
    padding: 3px 8px;
    border-radius: 3px;
    background: var(--brand);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

.tag--sale {
    background: var(--sale);
}

.tag--new {
    background: var(--new);
}

.card__body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    padding: 12px;
}

.card__category {
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 0.12em;
}

html:is([lang="fa"], [lang="ar"]) .card__category {
    font-size: 11px;
    letter-spacing: 0;
}

.card__title {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
}

.card__title a:hover {
    color: var(--brand);
}

.stars {
    display: flex;
    align-items: center;
    gap: 1px;
    margin-block: 2px 4px;
    color: var(--line);
    font-size: 10px;
}

.stars .is-on {
    color: var(--star);
}

.stars span {
    margin-inline-start: 4px;
    color: var(--muted);
}

.price {
    font-size: 15px;
    font-weight: 700;
}

.price s {
    margin-inline-start: 6px;
    color: var(--muted-2);
    font-size: 12px;
    font-weight: 400;
}

.card__options {
    color: var(--muted);
    font-size: 12px;
}

.card__stock {
    color: var(--sale);
    font-size: 12px;
    font-weight: 600;
}

.empty-state {
    padding: 50px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    text-align: center;
}

/* --- promos ------------------------------------------------------------- */

.promos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-block-start: 22px;
}

.promo {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 200px;
    padding: 32px;
    overflow: hidden;
    border-radius: var(--radius);
    color: #fff;
}

.promo::after {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.15));
}

[dir="rtl"] .promo::after {
    background: linear-gradient(to left, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.15));
}

.promo__body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.promo__body .eyebrow {
    margin-block-end: 10px;
    color: rgba(255, 255, 255, 0.8);
}

.promo__title {
    max-width: 14ch;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

html:is([lang="fa"], [lang="ar"]) .promo__title {
    max-width: 18ch;
    line-height: 1.4;
    letter-spacing: 0;
}

.promo__text {
    margin-block: 8px 18px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
}

/* --- benefits ----------------------------------------------------------- */

.benefits {
    margin-block-start: 32px;
    padding-block: 28px;
    border-block-start: 1px solid var(--line-2);
    background: var(--bg-soft-2);
}

.benefits__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.benefit {
    display: flex;
    align-items: center;
    gap: 14px;
}

.benefit b {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.benefit span {
    color: var(--muted);
    font-size: 11.5px;
}

/* --- forms & sign-in ---------------------------------------------------- */

.btn--outline {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}

.btn--outline:hover {
    border-color: var(--muted);
}

.btn--block {
    width: 100%;
    padding-block: 12px;
    font-size: 14px;
}

/* --- action buttons: TRIAL on the sign-in / sign-up cards -----------------
   Once approved, these rules move from ".auth .btn" to ".btn" sitewide.
   Motion is transform + box-shadow only; the label never moves, the arrow
   nudges toward the inline end. */

.auth .btn {
    position: relative;
    min-block-size: 48px;
    padding-block: 12px;
    padding-inline: 22px;
    gap: 10px;
    border-radius: var(--control-radius);
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -0.005em;
    -webkit-tap-highlight-color: transparent;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

html:is([lang="fa"], [lang="ar"]) .auth .btn {
    letter-spacing: 0;
}

.auth .btn--brand {
    background: var(--action);
    color: var(--action-ink);
    /* Flat: a hairline shadow for edge definition only, no glow. */
    box-shadow: 0 1px 2px rgb(17 17 17 / 0.08);
}

.auth .btn--brand:hover {
    background: var(--action-hover);
}

.auth .btn--brand:active {
    background: var(--action-active);
    box-shadow: none;
    transition-duration: 0.06s;
}

.auth .btn:focus-visible {
    outline: 2px solid var(--action);
    outline-offset: 3px;
    border-radius: var(--control-radius);
}

.btn__icon {
    transition: translate 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.auth .btn--brand:hover .btn__icon {
    translate: 3px 0;
}

[dir="rtl"] .auth .btn--brand:hover .btn__icon {
    translate: -3px 0;
}

/* Disabled: flat and quiet, clearly not pressable. */
.auth .btn--brand:disabled:not(.is-loading) {
    background: var(--action-disabled);
    color: #fff;
    box-shadow: none;
    transform: none;
    opacity: 1;
}

/* Submitting (theme.js initSubmitLock, every POST form): the button keeps
   its colour, swaps its icon for a spinner in its own text colour, and the
   form ignores a second click — an order, an address or a code is sent once.
   Small controls without a label (basket quantity, remove) just dim. */
.btn.is-loading {
    cursor: progress;
    opacity: 1;
    transform: none;
}

.btn.is-loading .btn__icon {
    display: none;
}

.btn.is-loading::after {
    content: "";
    flex: none;
    inline-size: 16px;
    block-size: 16px;
    border: 2px solid color-mix(in srgb, currentColor 35%, transparent);
    border-block-start-color: currentColor;
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
}

.is-loading:not(.btn) {
    cursor: progress;
    opacity: 0.55;
}

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}

.auth .btn--outline {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    box-shadow: 0 1px 2px rgb(17 17 17 / 0.05);
}

.auth .btn--outline:hover {
    border-color: #cfd4da;
    background: var(--bg-soft-2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -6px rgb(17 17 17 / 0.18);
}

.auth .btn--outline:active {
    background: var(--bg-soft);
    transform: translateY(0);
    box-shadow: inset 0 1px 3px rgb(17 17 17 / 0.10);
    transition-duration: 0.06s;
}

/* Inputs share the button's corner radius and focus colour on these cards. */
/* Sign-in / sign-up forms are blue: the action tokens are redefined for
   .auth only, so the rest of the site keeps its colours. White on #2563eb
   is 5.2:1. */
.auth {
    --action: #2563eb;
    --action-hover: #1d4ed8;
    --action-active: #1e40af;
    --action-rgb: 37 99 235;
    --action-disabled: #bfd0f5;
}

.auth .field__input {
    min-block-size: 48px;
    border-radius: var(--control-radius);
}

/* Label row: label at the start, an optional link (forgot password) at the end. */
.field__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.field__aside {
    color: var(--action);
    font-size: 12.5px;
    font-weight: 600;
}

.field__aside:hover {
    text-decoration: underline;
}

/* Input with an icon at its start and, for passwords, a show/hide button at its end. */
.field__control {
    position: relative;
    display: flex;
    align-items: center;
}

.field__control .field__input {
    flex: 1;
}

.field__icon {
    position: absolute;
    inset-inline-start: 14px;
    color: var(--muted-2);
    pointer-events: none;
    transition: color 0.15s;
}

.field__control:focus-within .field__icon {
    color: var(--action);
}

.field__control--icon .field__input {
    padding-inline-start: 44px;
}

/* An LTR input (mobile, codes) inside an RTL form: its own "start" is the
   left, but the icon sits on the right, so the padding swaps sides. */
[dir="rtl"] .field__control--icon .field__input--ltr {
    padding-inline-start: 14px;
    padding-inline-end: 44px;
}

.field__control--toggle .field__input {
    padding-inline-end: 48px;
}

.field__toggle {
    position: absolute;
    inset-inline-end: 6px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--muted);
    transition: color 0.15s, background-color 0.15s;
}

.field__toggle:hover {
    background: var(--bg-soft);
    color: var(--ink);
}

.field__toggle:not([aria-pressed="true"]) .icon--eye-off,
.field__toggle[aria-pressed="true"] .icon--eye {
    display: none;
}

.auth .field__input:focus {
    border-color: var(--action);
    box-shadow: 0 0 0 4px rgb(var(--action-rgb) / 0.14);
}

.auth .field__input {
    caret-color: var(--action);
}

.auth ::selection {
    background: rgb(var(--action-rgb) / 0.18);
}

/* Captcha row matches the 48px controls; the image keeps its 3:1 shape. */
.auth .captcha__image {
    inline-size: 144px;
    block-size: 48px;
    border-radius: var(--control-radius);
}

.auth .captcha .icon-button {
    inline-size: 48px;
    block-size: 48px;
    border-radius: var(--control-radius);
}

@media (prefers-reduced-motion: reduce) {
    .btn.is-loading::after {
        animation-duration: 2s;
    }
}

.auth {
    display: grid;
    place-items: center;
    padding-block: 56px 8px;
}

.auth__card {
    width: 100%;
    max-width: 420px;
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
}

.auth__title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.auth__lead {
    margin-block: 6px 22px;
    color: var(--muted);
    font-size: 13px;
}

.auth__form {
    display: grid;
    gap: 16px;
}

.auth__form .btn--block {
    margin-block-start: 4px;
}

.auth__links {
    display: grid;
    gap: 8px;
    margin-block-start: 20px;
    padding-block-start: 18px;
    border-block-start: 1px solid var(--line-2);
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.auth__links a {
    color: var(--action);
    font-weight: 600;
}

.auth__links a:hover {
    text-decoration: underline;
}

.auth__step {
    margin-block-end: 8px;
    color: var(--action);
    font-size: 11.5px;
    font-weight: 600;
}

/* A phone number inside a sentence keeps its own (LTR) direction. */
.auth__number {
    color: var(--ink);
    font-weight: 600;
    unicode-bidi: isolate;
    direction: ltr;
}

.link-button {
    padding: 0;
    color: var(--action);
    font-size: 13px;
    font-weight: 600;
}

.link-button:hover {
    text-decoration: underline;
}

.alert a {
    margin-inline-start: 4px;
    font-weight: 600;
    text-decoration: underline;
}

.auth__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.field {
    display: grid;
    gap: 6px;
}

.field__label {
    font-size: 12.5px;
    font-weight: 600;
}

.field__input {
    width: 100%;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.field__hint {
    color: var(--muted);
    font-size: 11.5px;
}

.field__input--code {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5em;
    text-align: center;
}

/* Outranks the RTL end-alignment of LTR inputs below. */
[dir="rtl"] .field__input.field__input--code {
    text-align: center;
}

.field__input::placeholder {
    color: var(--muted-2);
}

.field__input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

/* Phone numbers and codes read left to right in every locale. */
.field__input--ltr {
    direction: ltr;
}

/* ...but stay aligned with the other fields of an RTL form ("end" of an LTR box). */
[dir="rtl"] .field__input--ltr {
    text-align: end;
}

.captcha {
    display: flex;
    align-items: center;
    gap: 8px;
}

.captcha .field__control {
    flex: 1;
}

.captcha .field__input {
    letter-spacing: 0.3em;
}

.captcha__image {
    flex: none;
    width: 132px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.captcha .icon-button {
    flex: none;
    width: 44px;
    height: 44px;
}

/* Compact auth card: each label sits beside its control instead of above it.
   The card is wider on desktop so the captcha input has room beside the image.
   A label-row link (forgot password) drops under the control, at its end. */
.auth__card--inline {
    max-width: 520px;
}

.auth__card--inline .field {
    grid-template-columns: 84px minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 6px;
}

.auth__card--inline .field__head {
    display: contents;
}

/* Centred on the first control row, also when the captcha wraps on phones. */
.auth__card--inline .field__label {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    min-block-size: 48px;
}

.auth__card--inline .field > .field__control,
.auth__card--inline .field > .captcha {
    grid-column: 2;
    grid-row: 1;
}

.auth__card--inline .field__aside,
.auth__card--inline .field__hint {
    grid-column: 2;
}

.auth__card--inline .field__aside {
    grid-row: 2;
    justify-self: end;
}

.alert {
    margin-block-end: 18px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
}

.alert--error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

/* --- catalogue: search / category / brand listing ------------------------ */

.catalog {
    padding-block-start: 8px;
}

.catalog__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 16px;
    margin-block: 18px 18px;
}

.catalog__head .page-title {
    margin-block-end: 0;
}

.catalog__count {
    color: var(--muted);
    font-size: 13px;
}

.catalog__layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
    gap: 24px;
}

.filters {
    position: sticky;
    inset-block-start: 88px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

/* On wide screens the panel is always open; the toggle only matters on phones. */
.filters__toggle {
    display: none;
}

.filters__form {
    display: grid;
    gap: 4px;
    padding: 6px 16px 16px;
}

.filters__group {
    margin: 0;
    padding-block: 14px;
    padding-inline: 0;
    border: 0;
    border-block-end: 1px solid var(--line-2);
}

.filters__title {
    margin-block-end: 10px;
    padding: 0;
    font-size: 13px;
    font-weight: 700;
}

.filters__checks {
    display: grid;
    gap: 8px;
    max-block-size: 240px;
    overflow-y: auto;
}

.check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-2);
    font-size: 13px;
    cursor: pointer;
}

.check input {
    inline-size: 16px;
    block-size: 16px;
    margin: 0;
    accent-color: var(--brand);
}

.filters__range {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.filters__range .field__input {
    min-block-size: 38px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
}

.filters__actions {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-block-start: 14px;
}

.filters__actions .btn {
    flex: 1;
}

.filters__clear {
    color: var(--muted);
    font-size: 12.5px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.filters__clear:hover {
    color: var(--ink);
}

.facet-tree {
    margin: 0;
    padding: 0;
    list-style: none;
}

.facet-tree .facet-tree {
    margin-inline-start: 10px;
    padding-inline-start: 8px;
    border-inline-start: 1px solid var(--line-2);
}

.facet-tree__link {
    display: block;
    padding: 5px 8px;
    border-radius: 6px;
    color: var(--ink-2);
    font-size: 13px;
}

.facet-tree__link:hover {
    background: var(--bg-soft);
    color: var(--ink);
}

.facet-tree__link.is-active {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 600;
}

/* Level 1, and level 2 when it has children, read as group headings; a level-2
   leaf stays regular like the deeper leaves. */
.filters__group > .facet-tree > li + li {
    margin-block-start: 6px;
}

/* IRANYekan ships a regular file only, declared as 100-900, so the browser never
   synthesises bold for it and font-weight alone shows no change. The stroke
   thickens the glyphs itself. */
.filters__group > .facet-tree > li > .facet-tree__link,
.filters__group > .facet-tree > li > .facet-tree > li > .facet-tree__link.has-children {
    font-weight: 700;
    -webkit-text-stroke: 0.5px currentColor;
}

.filters__group > .facet-tree > li > .facet-tree__link:not(.is-active),
.filters__group > .facet-tree > li > .facet-tree > li > .facet-tree__link.has-children:not(.is-active) {
    color: var(--ink);
}

.catalog__toolbar {
    display: flex;
    justify-content: flex-end;
    margin-block-end: 14px;
}

.catalog__sort {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12.5px;
}

.catalog__sort select {
    min-block-size: 36px;
    padding-inline: 12px 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
    cursor: pointer;
}

/* Beside the filters there is room for four cards, not six. */
.catalog__results .grid {
    grid-template-columns: repeat(4, 1fr);
}

/* --- brands page ------------------------------------------------------------ */

.brands-title {
    margin-block-start: 28px;
}

.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.brand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-block-size: 110px;
    padding: 16px 10px;
    border-radius: var(--radius);
    background: var(--bg-soft);
    text-align: center;
    transition: background-color 0.15s;
}

.brand-card:hover {
    background: #e9ebee;
}

.brand-card__en {
    font-size: 15px;
    font-weight: 700;
}

.brand-card__fa {
    color: var(--muted);
    font-size: 12.5px;
}

/* --- product page --------------------------------------------------------- */

.pdp {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: clamp(20px, 4vw, 48px);
    padding-block-end: 8px;
}

/* The image and its thumbnails stick together while the details column scrolls. */
.pdp__gallery {
    position: sticky;
    inset-block-start: 88px;
    display: grid;
    gap: 10px;
    min-width: 0;
}

.pdp__media {
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: #fff;
}

.pdp__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* One row that scrolls sideways when there are more thumbnails than fit. */
.pdp-thumbs {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 2px 2px 4px;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: thin;
}

.pdp-thumbs__item {
    display: block;
    flex: none;
    width: 64px;
    height: 64px;
    overflow: hidden;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    background: #fff;
    transition: border-color .15s ease;
}

.pdp-thumbs__item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pdp-thumbs__item:hover {
    border-color: var(--ink-2);
}

.pdp-thumbs__item.is-active {
    border-color: var(--brand);
    box-shadow: 0 0 0 1px var(--brand);
}

.pdp-thumbs__item:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.pdp__zoom {
    display: block;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
}

/* Product image viewer: a native <dialog>, so focus stays inside and Esc
   closes it. display is set on [open] only — a bare display rule would
   override the browser's hidden state of a closed dialog. */
.lightbox {
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 56px 64px 44px;
    border: 0;
    background: rgba(12, 12, 12, .94);
    color: #fff;
}

.lightbox[open] {
    display: grid;
    place-items: center;
}

.lightbox::backdrop {
    background: transparent;
}

html:has(.lightbox[open]) {
    overflow: hidden;
}

/* Sized against the viewport minus the dialog's block padding (56 + 44): a
   percentage max-height does not resolve inside the dialog's grid. */
.lightbox__image {
    max-width: 100%;
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
    object-fit: contain;
    user-select: none;
}

.lightbox__close,
.lightbox__step {
    position: absolute;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
    transition: background .15s ease;
}

.lightbox__close:hover,
.lightbox__step:hover {
    background: rgba(255, 255, 255, .24);
}

.lightbox__close:focus-visible,
.lightbox__step:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.lightbox__close {
    inset-block-start: 12px;
    inset-inline-end: 12px;
}

.lightbox__step {
    inset-block-start: 50%;
    transform: translateY(-50%);
}

.lightbox__step--prev {
    inset-inline-start: 12px;
}

.lightbox__step--next {
    inset-inline-end: 12px;
}

.lightbox__step[hidden],
.lightbox__count[hidden] {
    display: none;
}

.lightbox__count {
    position: absolute;
    inset-block-end: 14px;
    inset-inline: 0;
    margin: 0;
    font-size: 13px;
    text-align: center;
    opacity: .8;
}

@media (max-width: 640px) {
    .lightbox {
        padding: 56px 8px 44px;
    }

    .lightbox__step {
        inset-block-start: auto;
        inset-block-end: 6px;
        transform: none;
    }
}

/* "Added to basket" confirmation: a native <dialog>, so focus stays inside and
   Esc closes it. display is set on [open] only, as for .lightbox. */
.added {
    width: min(420px, calc(100vw - 32px));
    padding: 28px 24px 24px;
    border: 0;
    border-radius: 16px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    text-align: center;
}

.added[open] {
    display: grid;
    justify-items: center;
    gap: 16px;
}

.added::backdrop {
    background: rgba(12, 12, 12, .5);
}

html:has(.added[open]) {
    overflow: hidden;
}

.added__icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--brand);
    color: var(--brand-ink);
}

.added__title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.6;
}

.added__item {
    display: flex;
    align-items: center;
    gap: 12px;
    inline-size: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    text-align: start;
}

.added__item img {
    flex: none;
    inline-size: 64px;
    block-size: 64px;
    border-radius: 8px;
    object-fit: cover;
}

.added__name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.6;
}

.added__variety {
    color: var(--muted);
    font-size: 12.5px;
}

.added__actions {
    display: grid;
    gap: 8px;
    inline-size: 100%;
}

.pdp__brand {
    display: inline-block;
    margin-block-end: 6px;
    color: var(--brand);
    font-size: 13px;
    font-weight: 600;
}

.pdp__brand:hover {
    text-decoration: underline;
}

.pdp__title {
    font-size: clamp(20px, 2.4vw, 26px);
    font-weight: 700;
    line-height: 1.45;
}

.pdp__name-en {
    margin-block-start: 4px;
    color: var(--muted);
    font-size: 13px;
}

.pdp__info .alert {
    margin-block: 16px 0;
}

.alert--success {
    border: 1px solid #bbe5cb;
    background: #f0faf4;
    color: #14532d;
}

.pdp__unavailable {
    margin-block-start: 20px;
    color: var(--muted);
}

.pdp__buy {
    display: grid;
    gap: 16px;
    margin-block-start: 22px;
}

.variants {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.variants__title {
    margin-block-end: 8px;
    padding: 0;
    font-size: 13px;
    font-weight: 700;
}

.variant {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.variant:hover {
    border-color: #cfd4da;
}

.variant input {
    inline-size: 16px;
    block-size: 16px;
    margin: 0;
    accent-color: var(--brand);
}

.variant:has(input:checked) {
    border-color: color-mix(in srgb, var(--brand) 45%, #fff);
    background: color-mix(in srgb, var(--brand-soft) 55%, #fff);
}

.variant:has(input:focus-visible) {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.variant__body {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 12px;
}

.variant__name {
    font-size: 13.5px;
    font-weight: 600;
}

.variant__price {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
}

.variant__off {
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--sale);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.variant__stock {
    flex-basis: 100%;
    color: var(--sale);
    font-size: 12px;
    font-weight: 600;
}

.variant--out .variant__name,
.variant--out .variant__price {
    color: var(--muted);
}

.pdp__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    padding-block-start: 4px;
    border-block-start: 1px solid var(--line-2);
}

.pdp__final {
    font-size: clamp(22px, 2.6vw, 28px);
    font-weight: 800;
}

.pdp__base {
    color: var(--muted-2);
    font-size: 15px;
}

.pdp__off {
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--sale);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.pdp__stock {
    color: var(--brand);
    font-size: 13px;
    font-weight: 600;
}

.pdp__stock.is-out {
    color: var(--sale);
}

.pdp__code {
    color: var(--muted);
    font-size: 12.5px;
}

.pdp__actions {
    display: flex;
    gap: 12px;
}

.qty {
    display: inline-flex;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.qty__step {
    inline-size: 42px;
    color: var(--ink-2);
    font-size: 18px;
    transition: background-color 0.15s;
}

.qty__step:hover {
    background: var(--bg-soft);
}

.qty__input {
    inline-size: 52px;
    border-inline: 1px solid var(--line-2);
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    -moz-appearance: textfield;
}

.qty__input::-webkit-outer-spin-button,
.qty__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pdp__add {
    flex: 1;
    min-block-size: 50px;
    border-radius: 10px;
    font-size: 15px;
}

.pdp-desc {
    max-width: 860px;
    margin-block-start: 40px;
}

.pdp-desc .section__title {
    margin-block-end: 14px;
}

.prose {
    color: var(--ink-2);
    font-size: 14.5px;
    line-height: 1.95;
}

.prose :is(p, ul, ol, table) {
    margin-block: 0 12px;
}

.prose img {
    border-radius: 8px;
}

.prose table {
    border-collapse: collapse;
}

.prose :is(th, td) {
    padding: 6px 10px;
    border: 1px solid var(--line);
}

.prose :is(h2, h3) {
    color: var(--ink);
}

/* --- basket ---------------------------------------------------------------- */

.basket-page {
    padding-block: 28px 48px;
}

.basket {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
    gap: 24px;
}

.basket-lines {
    margin: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    list-style: none;
}

.basket-line {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto minmax(110px, auto);
    align-items: center;
    gap: 16px;
    padding: 16px;
}

.basket-line + .basket-line {
    border-block-start: 1px solid var(--line-2);
}

.basket-line__media {
    display: block;
    overflow: hidden;
    aspect-ratio: 1;
    border-radius: 8px;
    background: var(--bg-soft-2);
}

.basket-line__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.basket-line__info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
}

.basket-line__brand {
    color: var(--muted);
    font-size: 12px;
}

.basket-line__name {
    font-size: 14.5px;
    font-weight: 700;
}

.basket-line__name:hover {
    color: var(--brand);
}

.basket-line__variety,
.basket-line__code {
    color: var(--muted);
    font-size: 12.5px;
}

.basket-line__unit {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-block-start: 4px;
    font-size: 13px;
    font-weight: 600;
}

.basket-line__unit s {
    color: var(--muted-2);
    font-weight: 400;
}

.basket-line__warning {
    margin: 4px 0 0;
    color: var(--sale);
    font-size: 12.5px;
    font-weight: 600;
}

.basket-line--out .basket-line__media img {
    opacity: 0.45;
}

.basket-line__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 10px;
}

.basket-line .qty__step {
    inline-size: 36px;
    block-size: 38px;
}

.basket-line .qty__step:disabled {
    color: var(--muted-2);
    cursor: not-allowed;
}

.basket-line .qty__step:disabled:hover {
    background: none;
}

.qty__value {
    display: grid;
    place-items: center;
    inline-size: 40px;
    border-inline: 1px solid var(--line-2);
    font-size: 14px;
    font-weight: 700;
}

.basket-line__remove {
    display: grid;
    place-items: center;
    inline-size: 38px;
    block-size: 38px;
    border-radius: 10px;
    color: var(--muted);
    transition: background-color 0.15s, color 0.15s;
}

.basket-line__remove:hover {
    background: #fef2f2;
    color: var(--sale);
}

.basket-line__max {
    flex-basis: 100%;
    color: var(--muted);
    font-size: 11.5px;
    text-align: center;
}

.basket-line__total {
    font-size: 15px;
    font-weight: 800;
    text-align: end;
}

.basket__back {
    margin-block-start: 16px;
}

.basket-summary {
    position: sticky;
    inset-block-start: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.basket-summary__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.basket-summary__rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
}

.basket-summary__rows > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13.5px;
}

.basket-summary__rows dt {
    color: var(--muted);
}

.basket-summary__rows dd {
    margin: 0;
    font-weight: 600;
}

.basket-summary__discount dd {
    color: var(--sale);
}

.basket-summary__payable {
    padding-block-start: 12px;
    border-block-start: 1px solid var(--line-2);
}

.basket-summary__payable dt {
    color: var(--ink);
    font-weight: 700;
}

.basket-summary__payable dd {
    font-size: 18px;
    font-weight: 800;
}

.basket-summary__note {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
}

.basket-summary .alert {
    margin: 0;
}

.basket-summary__register {
    color: var(--ink-2);
    font-size: 13px;
    text-align: center;
}

.basket-summary__register:hover {
    color: var(--brand);
}

.basket-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 48px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    text-align: center;
}

.basket-empty__icon {
    color: var(--muted-2);
}

.basket-empty .empty-state {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 15px;
}

/* --- account ----------------------------------------------------------------
   Carries .auth too, for the blue form controls and buttons; the centred
   single-card layout of .auth is replaced by a menu + content grid. */

.auth.account {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    /* Replaces .auth's centring: columns stretch across, rows keep their own height. */
    place-items: start stretch;
    gap: 24px;
    padding-block: 32px 48px;
}

.account__side {
    position: sticky;
    inset-block-start: 16px;
    display: grid;
    gap: 12px;
}

.account__card,
.account__nav,
.account__main {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.account__card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
}

.account__avatar {
    display: grid;
    flex: none;
    place-items: center;
    inline-size: 48px;
    block-size: 48px;
    border-radius: 50%;
    background: rgb(var(--action-rgb) / 0.1);
    color: var(--action);
    font-size: 20px;
    font-weight: 700;
}

.account__who {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.account__who strong {
    overflow: hidden;
    font-size: 14.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account__who bdi {
    color: var(--muted);
    font-size: 12.5px;
}

.account__nav {
    display: grid;
    padding: 6px;
}

.account__nav :is(a, button) {
    display: flex;
    align-items: center;
    gap: 10px;
    inline-size: 100%;
    padding: 11px 12px;
    border-radius: 8px;
    color: var(--ink-2);
    font-size: 13.5px;
    font-weight: 600;
    text-align: start;
    transition: background-color 0.15s, color 0.15s;
}

.account__nav :is(a, button):hover {
    background: var(--bg-soft-2);
    color: var(--ink);
}

.account__nav a.is-active {
    background: rgb(var(--action-rgb) / 0.08);
    color: var(--action);
}

.account__nav .icon {
    color: currentColor;
    opacity: 0.85;
}

.account__nav form {
    margin-block-start: 4px;
    padding-block-start: 4px;
    border-block-start: 1px solid var(--line-2);
}

.account__nav button:hover {
    background: #fef2f2;
    color: var(--sale);
}

.account__main {
    padding: clamp(18px, 3vw, 32px);
}

.account__main > .alert {
    margin-block: 0 18px;
}

.account__head {
    margin-block-end: 22px;
}

.account__head .auth__lead {
    margin-block-end: 0;
}

.account__head--row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.account__form {
    display: grid;
    gap: 18px;
    max-width: 720px;
}

.account__form--narrow {
    max-width: 420px;
}

.account__form fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

/* Side-by-side fields keep their own height: a hint under one never stretches the other. */
.account__form .field {
    align-content: start;
}

.account__form textarea.field__input {
    font: inherit;
    resize: vertical;
    min-block-size: 96px;
    line-height: 1.8;
}

.account__form select.field__input {
    padding-inline-end: 34px;
}

.account__postal {
    max-width: 260px;
}

.account__readonly {
    margin: 0;
    padding: 11px 14px;
    border: 1px dashed var(--line);
    border-radius: var(--control-radius);
    background: var(--bg-soft-2);
    color: var(--muted);
    font-size: 14px;
    text-align: end;
}

.account__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-block-start: 6px;
}

.field__optional {
    color: var(--muted-2);
    font-weight: 400;
}

.field__error {
    margin: 0;
    color: var(--sale);
    font-size: 12px;
}

.field__input[aria-invalid="true"] {
    border-color: var(--sale);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chip span {
    display: inline-block;
    padding: 9px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.chip:hover span {
    border-color: var(--muted-2);
}

.chip input:checked + span {
    border-color: var(--action);
    background: rgb(var(--action-rgb) / 0.08);
    color: var(--action);
    font-weight: 600;
}

.chip input:focus-visible + span {
    outline: 2px solid var(--action);
    outline-offset: 2px;
}

.birthdate {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1.2fr;
    gap: 10px;
    max-width: 420px;
}

.account__empty {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 40px 16px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    color: var(--muted);
    text-align: center;
}

.account__empty p {
    margin: 0;
}

.address-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.address {
    display: grid;
    align-content: start;
    gap: 6px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.address--default {
    border-color: rgb(var(--action-rgb) / 0.45);
    box-shadow: 0 0 0 1px rgb(var(--action-rgb) / 0.2);
}

.address__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 14.5px;
}

.address__badge {
    padding: 2px 9px;
    border-radius: 999px;
    background: rgb(var(--action-rgb) / 0.1);
    color: var(--action);
    font-size: 11.5px;
    font-weight: 600;
}

.address p {
    margin: 0;
}

.address__place {
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 600;
}

.address__text {
    color: var(--ink-2);
    font-size: 13px;
    line-height: 1.9;
}

.address__postal {
    color: var(--muted);
    font-size: 12.5px;
}

.address__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    margin-block-start: 6px;
    padding-block-start: 10px;
    border-block-start: 1px solid var(--line-2);
    font-size: 13px;
}

.address__actions a {
    color: var(--action);
    font-weight: 600;
}

.address__actions a:hover {
    text-decoration: underline;
}

.link-button--danger {
    color: var(--sale);
}

/* --- checkout ------------------------------------------------------------------ */

.checkout-page {
    padding-block: 24px 48px;
}

.steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    margin: 0 0 18px;
    padding: 0;
    color: var(--muted);
    font-size: 13px;
    list-style: none;
}

.steps li,
.steps a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.steps span {
    display: grid;
    place-items: center;
    inline-size: 26px;
    block-size: 26px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
}

.steps .is-done span {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand);
}

.steps .is-current {
    color: var(--ink);
    font-weight: 700;
}

.steps .is-current span {
    border-color: var(--brand);
    background: var(--brand);
    color: var(--brand-ink);
}

.checkout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
    gap: 24px;
}

.checkout__main {
    display: grid;
    gap: 16px;
}

.checkout-box {
    padding: 18px 20px 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.checkout-box__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-block-end: 14px;
}

.checkout-box__head h2 {
    margin: 0;
    font-size: 15.5px;
    font-weight: 700;
}

.checkout-box__head a {
    color: var(--brand);
    font-size: 13px;
    font-weight: 600;
}

.checkout-box__empty {
    margin: 0;
    color: var(--muted);
    font-size: 13.5px;
}

.choices {
    display: grid;
    gap: 10px;
}

.choices--row {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.choice {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.choice:hover {
    border-color: var(--muted-2);
}

.choice input {
    flex: none;
    margin-block-start: 3px;
    accent-color: var(--brand);
}

.choice:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-soft);
    box-shadow: 0 0 0 1px var(--brand);
}

.choice:has(input:focus-visible) {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.choice__body {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.choice__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
}

.choice__text {
    color: var(--ink-2);
    font-size: 13px;
    line-height: 1.8;
}

.choice__meta {
    color: var(--muted);
    font-size: 12.5px;
}

.checkout__comment {
    font: inherit;
    resize: vertical;
    min-block-size: 84px;
    line-height: 1.8;
}

.checkout-items {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0 0 14px;
    border-block-end: 1px solid var(--line-2);
    list-style: none;
}

.checkout-items li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: baseline;
    gap: 8px;
    font-size: 13px;
}

.checkout-items__name small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.checkout-items__qty {
    color: var(--muted);
}

.checkout-items__total {
    font-weight: 600;
}


/* --- orders & invoice (account) ---------------------------------------------------- */

.table-scroll {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.orders-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 13.5px;
}

.orders-table :is(th, td) {
    padding: 12px 14px;
    text-align: start;
    white-space: nowrap;
}

.orders-table th {
    background: var(--bg-soft-2);
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
}

.orders-table tbody tr + tr td {
    border-block-start: 1px solid var(--line-2);
}

.orders-table a {
    color: var(--action);
    font-weight: 600;
}

.orders-table a:hover {
    text-decoration: underline;
}

.invoice-table td:first-child {
    white-space: normal;
}

.status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 600;
}

.status--lg {
    padding: 6px 14px;
    font-size: 13px;
}

.status--pending {
    background: #fef3c7;
    color: #92400e;
}

.status--new,
.status--ongoing,
.status--store,
.status--readytoship {
    background: #dbeafe;
    color: #1e40af;
}

.status--sent,
.status--resend {
    background: #e0e7ff;
    color: #3730a3;
}

.status--delivered {
    background: #dcfce7;
    color: #166534;
}

.status--cancel {
    background: #fee2e2;
    color: #991b1b;
}

.order-pay {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-block-end: 18px;
    padding: 14px 16px;
    border: 1px solid #fde68a;
    border-radius: 12px;
    background: #fffbeb;
    color: #92400e;
    font-size: 13.5px;
}

.order-pay p {
    margin: 0;
}

.invoice-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: start;
    gap: 16px;
    margin-block-start: 18px;
}

.invoice-box {
    display: grid;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.invoice-box h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.invoice-facts {
    display: grid;
    gap: 10px;
    margin: 0;
    font-size: 13.5px;
}

.invoice-facts > div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 10px;
}

.invoice-facts dt {
    color: var(--muted);
}

.invoice-facts dd {
    margin: 0;
    line-height: 1.8;
}

.account__back {
    margin-block-start: 18px;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding-block: 1.5rem;
}

.pagination__page,
.pagination__step {
    display: inline-grid;
    place-items: center;
    min-inline-size: 38px;
    block-size: 38px;
    padding-inline: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink-2);
    font-size: 13.5px;
    font-weight: 600;
    transition: border-color 0.15s, color 0.15s;
}

.pagination__page:hover,
.pagination__step:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.pagination__page.is-current {
    border-color: var(--brand);
    background: var(--brand);
    color: var(--brand-ink);
}

.pagination__step {
    padding-inline: 14px;
}

.notfound {
    padding-block: clamp(2rem, 8vw, 5rem);
}

.notfound p {
    margin-block-start: 12px;
}

/* --- footer ------------------------------------------------------------- */

.site-footer {
    padding-block: 44px 22px;
    background: var(--dark);
    color: #d1d5db;
    font-size: 12.5px;
}

.site-footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr 1.3fr;
    gap: 30px;
}

.site-footer .logo__mark,
.site-footer .logo__text b {
    color: #fff;
}

.site-footer .logo__text span {
    color: var(--muted-2);
}

.site-footer h4 {
    margin-block-end: 12px;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
}

.site-footer__col a {
    display: block;
    padding-block: 3px;
    color: #b8bec7;
}

.site-footer__col a:hover,
.social a:hover {
    color: #fff;
}

.site-footer__about {
    max-width: 30ch;
    margin-block-start: 12px;
    color: var(--muted-2);
}

.social {
    display: flex;
    gap: 16px;
    margin-block-start: 18px;
}

.social a {
    color: #d1d5db;
}

.site-footer__contact :is(a, address) {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-block: 5px;
    color: #b8bec7;
    font-style: normal;
    line-height: 1.7;
}

.site-footer__contact .icon {
    flex: none;
    margin-block-start: 0.2em;
    color: var(--muted-2);
}

.site-footer__contact address {
    max-width: 32ch;
}

/* Pinned to the last column (the left in RTL): fills the gap the link
   columns leave on their row, or sits under the contact column when that
   row is full. */
.site-footer__trust {
    grid-column: -2;
}

.site-footer__trust a {
    display: inline-block;
    padding: 6px;
    border-radius: var(--radius);
    background: #fff;
}

.site-footer__trust img {
    display: block;
    width: auto;
    height: 96px;
}

.site-footer__base {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    margin-block-start: 34px;
    padding-block-start: 16px;
    border-block-start: 1px solid #2a2a2a;
    color: #8b9099;
    font-size: 11.5px;
}

.site-footer__legal a {
    padding-inline-start: 12px;
}

/* --- responsive --------------------------------------------------------- */

@media (max-width: 1180px) {
    .catalog__results .grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .cat-tiles {
        grid-template-columns: repeat(5, 1fr);
    }

    .site-footer__grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .pdp {
        grid-template-columns: 1fr;
    }

    .basket {
        grid-template-columns: 1fr;
    }

    .basket-summary {
        position: static;
    }

    /* minmax(0, 1fr), not 1fr: a wide table scrolls in its own box instead of widening the page. */
    .auth.account {
        grid-template-columns: minmax(0, 1fr);
        padding-block-start: 20px;
    }

    .checkout,
    .invoice-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .account__side {
        position: static;
    }

    /* The menu becomes a row of tabs above the content. */
    .account__nav {
        grid-auto-flow: column;
        grid-auto-columns: max-content;
        overflow-x: auto;
    }

    .account__nav form {
        margin: 0;
        padding: 0;
        border: 0;
    }

    .pdp__gallery {
        position: static;
    }

    /* Phones and tablets: filters stack above the results behind a toggle. */
    .catalog__layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .filters {
        position: static;
    }

    .filters__toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 16px;
        font-size: 13.5px;
        font-weight: 600;
        list-style: none;
        cursor: pointer;
    }

    .filters__toggle::-webkit-details-marker {
        display: none;
    }

    .catalog__results .grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .topbar__note {
        display: none;
    }

    .site-header__inner {
        flex-wrap: wrap;
        gap: 12px;
    }

    .site-header__toggle {
        display: grid;
    }

    .site-header__actions {
        margin-inline-start: auto;
    }

    /* Collapsed menu + search, opened by the toggle (theme.js). */
    .site-header__panel {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding-block-end: 14px;
    }

    .site-header__panel.is-open {
        display: flex;
    }

    .site-nav {
        flex-direction: column;
        gap: 4px;
        margin-inline-start: 0;
    }

    .nav-item__link.is-active::after {
        display: none;
    }

    /* The split header's 30px desktop spacing would otherwise leave big gaps in the stacked menu. */
    .site-header--split .site-nav {
        gap: 4px;
    }

    /* Inside the opened phone menu the category tree is simply shown,
       expanded and indented — no hover dropdown on touch screens. */
    .nav-item__chevron {
        display: none;
    }

    .nav-menu,
    .nav-item--menu:hover > .nav-menu,
    .nav-item--menu:focus-within > .nav-menu {
        position: static;
        padding-block-start: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .nav-menu > .nav-tree {
        min-inline-size: 0;
        max-block-size: none;
        margin-inline-start: 12px;
        padding-block: 0 6px;
        padding-inline: 10px 0;
        border: 0;
        border-inline-start: 1px solid var(--line-2);
        border-radius: 0;
        box-shadow: none;
    }

    /* split: menu button, logo, sign-in and cart on one row; the menu opens
       below. The end group dissolves so its items can be placed on the grid
       individually. (Search lives in the top bar.) */
    .site-header--split .site-header__inner {
        grid-template-columns: auto minmax(0, 1fr) auto auto;
        grid-template-areas:
            "toggle brand account cart"
            "menu menu menu menu";
        gap: 10px 8px;
        padding-block: 10px;
    }

    .site-header--split.site-header--logo-end .site-header__inner {
        grid-template-columns: auto auto auto minmax(0, 1fr);
        grid-template-areas:
            "toggle account cart brand"
            "menu menu menu menu";
    }

    .site-header--split .site-header__toggle {
        grid-area: toggle;
    }

    .site-header--split .site-header__end {
        display: contents;
    }

    .site-header--split .account-button {
        grid-area: account;
    }

    .site-header--split .site-header__end > .icon-button {
        grid-area: cart;
    }

    .site-header--split .site-header__menu {
        display: none;
    }

    .site-header--split .site-header__menu.is-open {
        display: block;
        padding-block-end: 6px;
    }

    .site-search {
        width: 100%;
        margin-inline-start: 0;
    }

    .slide__title {
        font-size: 36px;
    }

    .promos {
        grid-template-columns: 1fr;
    }

    .benefits__grid {
        grid-template-columns: 1fr 1fr;
    }

    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .catalog__results .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Basket line: image and details on top, quantity and total below. */
    .basket-line {
        grid-template-columns: 72px minmax(0, 1fr) auto;
        grid-template-areas:
            "media info info"
            "media actions total";
        gap: 10px 12px;
        padding: 14px;
    }

    .basket-line__media {
        grid-area: media;
        align-self: start;
    }

    .basket-line__info {
        grid-area: info;
    }

    .basket-line__actions {
        grid-area: actions;
        justify-content: flex-start;
    }

    .basket-line__total {
        grid-area: total;
    }

    :root {
        --gutter: 16px;
    }

    /* Phones: the sign-in button keeps its icon and drops the label. */
    .account-button {
        padding-inline: 11px;
    }

    .account-button span {
        display: none;
    }

    /* Phones: the top-bar search gets its own line under the shipping offer. */
    .topbar--search .topbar__inner {
        flex-wrap: wrap;
        gap: 6px 20px;
        padding-block: 6px;
    }

    .topbar__search {
        flex: 1 1 100%;
    }

    /* Arrows would sit on top of the slide text; the dots stay for navigation. */
    .topbar__links,
    .hero__counter,
    .hero__arrow {
        display: none;
    }

    .hero {
        height: 320px;
    }

    .slide__title {
        font-size: 30px;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cat-tiles {
        grid-template-columns: repeat(3, 1fr);
    }

    .benefits__grid,
    .site-footer__grid {
        grid-template-columns: 1fr;
    }

    .auth {
        padding-block-start: 28px;
    }

    .auth__card {
        padding: 22px;
    }

    .captcha {
        flex-wrap: wrap;
    }

    .field-row {
        grid-template-columns: 1fr;
    }

    .captcha .field__control {
        flex-basis: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.001ms !important;
    }
}
