/* ==========================================================================
   LmdfStore — La Crèmerie design system (docs/design/prototype-storefront.dc.html)
   Foundation-owned. Feature stylesheets (storefront.css, checkout.css, account.css)
   build on these tokens and components; they never redefine them.

   Rules
   - Logical properties only (margin-inline-start, inset-inline-end, text-align: start)
     so Arabic (dir="rtl") mirrors without extra rules.
   - Arabic never uses letter-spacing or uppercase: components read --track/--upper.
   - Aref Ruqaa only for .display headings in Arabic; product names, prices and
     controls use Noto Naskh Arabic.
   - No inline styles or scripts (CSP): use classes from this file.
   - Breakpoints: 760px (tablet) and 1100px (desktop). Mobile first.
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */

:root {
    --cream: #F4EEE3;          /* page ground */
    --paper: #FBF8F2;          /* panels, summaries */
    --mat: #FFFDF9;            /* photo mats, inputs */
    --ink: #2A211C;            /* text, dark controls */
    --body: #4A3F37;           /* long-form text */
    --taupe: #6B5F56;          /* secondary text (>= 4.5:1 on cream) */
    --line: #E2D5BE;           /* hairlines */
    --field: #8C7F72;          /* input borders (>= 3:1) */
    --bordeaux: #6B1E2B;       /* primary action, accents */
    --bordeaux-dark: #4E1520;  /* hover */
    --gilt: #A07A3A;           /* decorative rules and arcs only, never body text */
    --alert-bg: #F3E6E4;       /* inline error panels (bordeaux text) */
    --photo-ground: #E9DFCF;   /* behind photos while they load */
    --muted-mark: #D6C8B0;     /* inactive markers */
    --disabled: #B8AC9C;       /* disabled control glyphs */
    --on-dark: #F4EEE3;        /* text on bordeaux and ink */

    --font-latin-display: 'Bodoni Moda', Didot, 'Bodoni 72', 'Times New Roman', serif;
    --font-latin-ui: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
    --font-arabic-display: 'Aref Ruqaa', 'Traditional Arabic', 'Times New Roman', serif;
    --font-arabic-ui: 'Noto Naskh Arabic', 'Traditional Arabic', Tahoma, serif;

    --font-ui: var(--font-latin-ui);
    --font-display: var(--font-latin-display);
    --font-heading: var(--font-latin-display);
    --font-name: var(--font-latin-display);
    --weight-heading: 400;
    --weight-name: 400;
    --font-other-language: var(--font-arabic-ui);

    --track: 0.2em;            /* tracked uppercase labels */
    --track-s: 0.08em;
    --upper: uppercase;
    --italic: italic;

    --fs-label: 12px;
    --fs-nav: 13px;
    --fs-small: 15px;
    --fs-body: 17px;
    --fs-lead: 17px;
    --fs-meta: 11px;
    --fs-tag: 10px;
    --fs-price: 16px;
    --fs-btn: 13px;
    --fs-btn-s: 12px;
    --fs-strip: 12px;
    --fs-h1: 40px;
    --fs-h2: 36px;
    --fs-display: 56px;
    --fs-card-name: 18px;
    --lh: 1.65;
    --lh-heading: 1.05;

    --gutter: 20px;
    --section-space: 56px;
    --grid-gap: 14px;
    --grid-row-gap: 32px;
    --mat-pad: 7px;
    --control-h: 52px;
    --button-h: 56px;
    --card-button-h: 44px;
    --target: 44px;
    --focus-ring: 2px solid var(--bordeaux);
    --header-logo: 132px;
    --max-width: 1440px;
    --sticky-h: 124px;         /* strip + header (.site-top); site.js replaces it with the measured height */

    color-scheme: light;
}

:root:lang(ar) {
    --font-ui: var(--font-arabic-ui);
    --font-display: var(--font-arabic-display);
    --font-heading: var(--font-arabic-ui);
    --font-name: var(--font-arabic-ui);
    --weight-heading: 700;
    --weight-name: 600;
    --font-other-language: var(--font-latin-ui);

    --track: 0;
    --track-s: 0;
    --upper: none;
    --italic: normal;

    --fs-label: 15px;
    --fs-nav: 16px;
    --fs-small: 16px;
    --fs-body: 18px;
    --fs-lead: 18px;
    --fs-meta: 13px;
    --fs-tag: 12px;
    --fs-price: 17px;
    --fs-btn: 17px;
    --fs-btn-s: 15px;
    --fs-strip: 14px;
    --fs-card-name: 16px;
    --fs-display: 60px;
    --lh: 1.95;
    --lh-heading: 1.45;
}

@media (min-width: 760px) {
    :root {
        --gutter: 40px;
        --section-space: 80px;
        --grid-gap: 24px;
        --grid-row-gap: 44px;
        --mat-pad: 10px;
        --fs-h1: 52px;
        --fs-h2: 44px;
        --fs-display: 80px;
        --fs-card-name: 21px;
        --card-button-h: 48px;
    }

    :root:lang(ar) {
        --fs-h1: 46px;
        --fs-h2: 42px;
        --fs-display: 76px;
        --fs-card-name: 18px;
    }
}

@media (min-width: 1100px) {
    :root {
        --gutter: 64px;
        --section-space: 104px;
        --grid-gap: 36px;
        --grid-row-gap: 56px;
        --mat-pad: 14px;
        --fs-lead: 19px;
        --fs-h1: 64px;
        --fs-h2: 56px;
        --fs-display: 104px;
        --fs-card-name: 24px;
        --header-logo: 190px;
        --sticky-h: 164px;
    }

    :root:lang(ar) {
        --fs-lead: 20px;
        --fs-h1: 56px;
        --fs-h2: 54px;
        --fs-display: 96px;
        --fs-card-name: 20px;
    }
}

/* 2. Base ------------------------------------------------------------------ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* In-page targets (header search, skip link, error-summary links, focus) land below the sticky header. */
html:has(.site-top) {
    scroll-padding-top: calc(var(--sticky-h) + 16px);
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--cream);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: var(--fs-body);
    line-height: var(--lh);
    -webkit-font-smoothing: antialiased;
}

img,
svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: var(--weight-heading);
    line-height: var(--lh-heading);
    text-wrap: balance;
}

h1 {
    font-size: var(--fs-h1);
}

h2 {
    font-size: var(--fs-h2);
}

p,
ul,
ol,
dl,
figure,
blockquote,
address {
    margin: 0;
}

address {
    font-style: normal;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

bdi {
    unicode-bidi: isolate;
}

/* 3. Accessibility --------------------------------------------------------- */

:focus-visible {
    outline: var(--focus-ring);
    outline-offset: 2px;
}

.strip :focus-visible,
.site-footer :focus-visible,
.flash :focus-visible {
    outline-color: var(--on-dark);
}

main:focus {
    outline: none;
}

.visually-hidden,
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    inset-inline-start: 16px;
    top: -100px;
    z-index: 100;
    padding: 12px 18px;
    background: var(--ink);
    color: var(--on-dark);
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 16px;
}

/* 4. Layout primitives ----------------------------------------------------- */

.site-main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

.page {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding: 24px var(--gutter) var(--section-space);
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.section {
    padding: var(--section-space) var(--gutter);
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.section--paper {
    background: var(--paper);
    border-block: 1px solid var(--line);
}

.section--ruled {
    border-top: 1px solid var(--line);
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
}

.split {
    display: grid;
    gap: 32px;
    align-items: start;
}

@media (min-width: 1100px) {
    .split {
        grid-template-columns: minmax(0, 1fr) 400px;
        gap: 64px;
    }
}

/* 5. Typography ------------------------------------------------------------ */

.display {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--fs-display);
    line-height: var(--lh-heading);
    letter-spacing: -0.02em;
}

:root:lang(ar) .display {
    letter-spacing: 0;
}

.display em,
.display .accent {
    font-style: var(--italic);
    color: var(--bordeaux);
}

.title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--fs-h1);
    line-height: var(--lh-heading);
}

.eyebrow {
    font-size: var(--fs-label);
    letter-spacing: var(--track);
    text-transform: var(--upper);
    font-weight: 600;
    color: var(--bordeaux);
}

.lead {
    max-width: 52ch;
    font-size: var(--fs-lead);
    line-height: var(--lh);
    color: var(--body);
}

.prose {
    max-width: 68ch;
    color: var(--body);
}

.prose > * + * {
    margin-top: 1em;
}

.muted {
    color: var(--taupe);
}

.small {
    font-size: var(--fs-small);
}

.name {
    font-family: var(--font-name);
    font-weight: var(--weight-name);
}

/* English data on Arabic pages (a name without an Arabic version, rendered as <bdi lang="en" dir="ltr">):
   Latin faces, never Aref Ruqaa or the Arabic UI face (section 4). Names and headings keep the Latin
   display face that English product names use. */
:root:lang(ar) bdi:lang(en) {
    font-family: var(--font-latin-ui);
}

:root:lang(ar) :is(h1, h2, h3, legend, .name) bdi:lang(en) {
    font-family: var(--font-latin-display);
}

.price {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.rule {
    width: 72px;
    height: 1px;
    border: 0;
    margin: 0;
    background: var(--gilt);
}

.label {
    font-size: var(--fs-label);
    letter-spacing: var(--track);
    text-transform: var(--upper);
    font-weight: 600;
}

/* 6. Site chrome ----------------------------------------------------------- */

.site-top {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--cream);
}

/* Without JavaScript the mobile menu is always open: a sticky block that tall would cover the page. */
html:not(.js) .site-top {
    position: relative;
}

@media (min-width: 1100px) {
    html:not(.js) .site-top {
        position: sticky;
    }
}

.strip {
    min-height: 40px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--bordeaux);
    color: var(--on-dark);
    font-size: var(--fs-strip);
    letter-spacing: var(--track-s);
    text-transform: var(--upper);
}

.strip__full {
    display: none;
}

@media (min-width: 760px) {
    .strip__full {
        display: inline;
    }

    .strip__short {
        display: none;
    }
}

.site-header {
    border-bottom: 1px solid var(--line);
}

.site-header__desktop {
    display: none;
}

.site-header__mobile {
    display: grid;
    grid-template-columns: var(--target) minmax(0, 1fr) var(--target);
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
}

@media (min-width: 1100px) {
    .site-header__desktop {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: center;
        gap: 24px;
        padding: 14px var(--gutter);
    }

    .site-header__mobile {
        display: none;
    }
}

.site-header__end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 4px;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.site-nav__link {
    display: inline-flex;
    align-items: center;
    min-height: var(--target);
    padding: 0 12px;
    border-bottom: 1px solid transparent;
    color: var(--ink);
    font-size: var(--fs-nav);
    letter-spacing: var(--track-s);
    text-transform: var(--upper);
    text-decoration: none;
}

.site-nav__link:hover {
    border-bottom-color: var(--line);
}

.site-nav__link[aria-current="page"] {
    border-bottom-color: var(--bordeaux);
}

.site-logo {
    display: block;
    justify-self: center;
}

.site-logo img {
    width: var(--header-logo);
}

.icon-button {
    position: relative;
    width: var(--target);
    height: var(--target);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: none;
    border: 0;
    color: var(--ink);
}

.basket-badge {
    position: absolute;
    top: 3px;
    inset-inline-end: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bordeaux);
    color: var(--on-dark);
    font-family: var(--font-latin-ui);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    min-height: var(--target);
    padding: 0 12px;
    color: var(--ink);
    font-family: var(--font-other-language);
    font-size: 16px;
    text-decoration: none;
}

.lang-switch:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Mobile menu: a disclosure toggled by site.js. Without JavaScript the list is simply shown. */
.menu-toggle__close {
    display: none;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__open {
    display: none;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__close {
    display: block;
}

html:not(.js) .menu-toggle {
    visibility: hidden;
}

.mobile-nav {
    padding: 4px 20px 16px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.js .mobile-nav:not(.is-open) {
    display: none;
}

/* The open menu stays inside the viewport below the sticky header and scrolls on short or landscape screens. */
.js .mobile-nav.is-open {
    max-height: calc(100vh - var(--sticky-h));
    max-height: calc(100dvh - var(--sticky-h));
    overflow-y: auto;
    overscroll-behavior: contain;
}

@media (min-width: 1100px) {
    .mobile-nav,
    .js .mobile-nav.is-open {
        display: none;
    }
}

.mobile-nav__list {
    list-style: none;
    padding: 0;
}

.mobile-nav__link {
    display: flex;
    align-items: center;
    min-height: 54px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 21px;
    text-decoration: none;
}

.mobile-nav__link[aria-current="page"] {
    color: var(--bordeaux);
}

.mobile-nav__lang {
    display: flex;
    align-items: center;
    min-height: 54px;
    color: var(--bordeaux);
    font-family: var(--font-other-language);
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
}

.flash {
    padding: 12px var(--gutter);
    background: var(--ink);
    color: var(--on-dark);
    font-size: 15px;
}

.flash a {
    color: var(--on-dark);
    font-weight: 600;
}

/* 7. Footer ---------------------------------------------------------------- */

.site-footer {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 48px var(--gutter) 28px;
    background: var(--bordeaux);
    color: var(--on-dark);
}

.site-footer a {
    color: var(--on-dark);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.site-footer__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px;
}

.site-footer__brand {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 15px;
    line-height: 1.6;
}

.site-footer__brand img {
    width: 150px;
}

.site-footer__contact {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.site-footer__contact a {
    display: inline-flex;
    align-items: center;
    min-height: var(--target);
}

.site-footer__col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 15px;
    line-height: 1.6;
}

.site-footer__col ul {
    list-style: none;
    padding: 0;
}

.site-footer__col li a {
    display: inline-flex;
    align-items: center;
    min-height: var(--target);
}

.site-footer__heading {
    font-family: var(--font-ui);
    font-size: var(--fs-label);
    font-weight: 600;
    letter-spacing: var(--track);
    text-transform: var(--upper);
    line-height: 1.4;
}

.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid rgb(244 238 227 / 0.3);
    font-size: 13px;
}

@media (min-width: 1100px) {
    .site-footer {
        padding: 72px var(--gutter) 40px;
    }

    .site-footer__grid {
        grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
    }

    .site-footer__brand {
        grid-column: auto;
    }

    .site-footer__brand img {
        width: 190px;
    }
}

/* 8. Buttons and links ----------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: var(--target);
    padding: 0 24px;
    border: 1px solid transparent;
    border-radius: 0;
    background: none;
    font-family: var(--font-ui);
    font-size: var(--fs-btn);
    font-weight: 600;
    letter-spacing: var(--track);
    text-transform: var(--upper);
    text-decoration: none;
    text-align: center;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.btn--primary {
    min-height: var(--button-h);
    padding: 0 32px;
    background: var(--bordeaux);
    color: var(--on-dark);
}

.btn--primary:hover {
    background: var(--bordeaux-dark);
}

.btn--outline {
    border-color: var(--bordeaux);
    color: var(--bordeaux);
    font-size: var(--fs-btn-s);
    letter-spacing: var(--track-s);
}

.btn--outline:hover {
    background: var(--bordeaux);
    color: var(--on-dark);
}

.btn--ink {
    min-height: 52px;
    padding: 0 40px;
    border-color: var(--ink);
    color: var(--ink);
    font-size: var(--fs-btn-s);
    letter-spacing: var(--track-s);
}

.btn--ink:hover {
    background: var(--ink);
    color: var(--on-dark);
}

.btn--on-dark {
    padding: 0 18px;
    border-color: rgb(244 238 227 / 0.6);
    color: var(--on-dark);
    font-family: var(--font-other-language);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

.site-footer .btn--on-dark:hover {
    background: var(--on-dark);
    color: var(--bordeaux);
    text-decoration: none;
}

.btn--block {
    width: 100%;
}

.btn--small {
    min-height: var(--target);
    padding: 0 16px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Underlined uppercase text link (prototype "Build a platter", "All cheeses"). */
.link {
    display: inline-flex;
    align-items: center;
    min-height: var(--target);
    padding: 0;
    background: none;
    border: 0;
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: var(--fs-btn);
    font-weight: 600;
    letter-spacing: var(--track);
    text-transform: var(--upper);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 8px;
}

.link:hover {
    color: var(--bordeaux);
}

/* Plain inline link (small text, breadcrumbs, "Remove"). */
.text-link {
    padding: 0;
    background: none;
    border: 0;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.text-link:hover {
    color: var(--bordeaux);
}

/* 9. Forms ----------------------------------------------------------------- */

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-grid {
    display: grid;
    gap: 16px;
}

@media (min-width: 760px) {
    .form-grid--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1100px) {
    .form-grid--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.fieldset > legend {
    padding: 0;
    margin-bottom: 20px;
    font-family: var(--font-display);
    font-size: 30px;
    line-height: 1.3;
}

.field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field__label,
.field > label {
    font-size: 14px;
    font-weight: 600;
}

:root:lang(ar) .field__label,
:root:lang(ar) .field > label {
    font-size: 16px;
}

.field__optional {
    font-weight: 400;
    color: var(--taupe);
}

.input,
.select,
.textarea {
    width: 100%;
    min-height: var(--control-h);
    padding: 0 14px;
    background: var(--mat);
    border: 1px solid var(--field);
    border-radius: 0;
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.4;
    scroll-margin-top: 48px;   /* keep the label above in view when focus or a link scrolls to the control */
}

.select {
    padding-inline: 12px;
}

.textarea {
    min-height: 96px;
    padding-block: 12px;
    line-height: 1.5;
    resize: vertical;
}

.input[type="tel"],
.input[type="email"],
.input[dir="ltr"] {
    font-family: var(--font-latin-ui);
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
    outline: var(--focus-ring);
    outline-offset: 0;
    border-color: var(--bordeaux);
}

.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"],
.input.input-validation-error,
.select.input-validation-error,
.textarea.input-validation-error {
    border: 2px solid var(--bordeaux);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
    background: var(--paper);
    color: var(--taupe);
}

.field__hint {
    font-size: 14px;
    color: var(--taupe);
}

.field-error {
    font-size: 14px;
    font-weight: 600;
    color: var(--bordeaux);
}

.field-error:empty,
.field-error.field-validation-valid {
    display: none;
}

/* Searchable select (search-select.js): an editable combobox in place of a long <select>, which stays in the
   form, hidden, and is what posts. Without the script the plain select shows. */
.combo {
    position: relative;
}

.combo__control {
    position: relative;
}

.combo__input {
    padding-inline-end: calc(var(--target) * 2 + 4px);
    text-overflow: ellipsis;
    unicode-bidi: plaintext;   /* an English name on an Arabic page reads left to right ("Faiha'"); padding keeps the page side */
}

:root:lang(ar) .combo__input:lang(en) {
    font-family: var(--font-latin-ui);
}

.combo__input::placeholder {
    color: var(--taupe);
    opacity: 1;
}

.combo__button {
    position: absolute;
    top: 50%;
    width: var(--target);
    height: var(--target);
    margin-top: calc(var(--target) / -2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: none;
    border: 0;
    color: var(--taupe);
    cursor: pointer;
}

.combo__button:hover {
    color: var(--ink);
}

.combo__button[hidden] {
    display: none;
}

.combo__toggle {
    inset-inline-end: 4px;
}

.combo__clear {
    inset-inline-end: calc(var(--target) + 4px);
}

.combo__toggle svg {
    transition: transform 160ms ease;
}

.combo.is-open .combo__toggle svg {
    transform: rotate(180deg);
}

.combo__popup {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 4px);
    z-index: 20;   /* under the sticky site header (30) */
    background: var(--mat);
    border: 1px solid var(--field);
    box-shadow: 0 14px 32px rgba(42, 33, 28, 0.14), 0 2px 6px rgba(42, 33, 28, 0.08);
    transform-origin: top center;
    transition: opacity 140ms ease-out, transform 140ms ease-out;
}

.combo__popup.is-entering {
    opacity: 0;
    transform: translateY(-4px);
}

.combo.is-above .combo__popup {
    top: auto;
    bottom: calc(100% + 4px);
    transform-origin: bottom center;
}

.combo.is-above .combo__popup.is-entering {
    transform: translateY(4px);
}

.combo__list {
    max-height: var(--combo-room, 320px);
    margin: 0;
    padding: 4px 0;
    list-style: none;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.combo__list[hidden] {
    display: none;
}

.combo__option {
    position: relative;
    min-height: var(--target);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding-block: 9px;
    padding-inline: 13px 44px;
    border-inline-start: 3px solid transparent;
    cursor: pointer;
}

.combo__option.is-active {
    background: var(--cream);
    border-inline-start-color: var(--bordeaux);
}

/* The area already chosen: a tick at the end of the row (a tick does not mirror in Arabic). */
.combo__option.is-chosen::after {
    content: "";
    position: absolute;
    inset-inline-end: 18px;
    top: 50%;
    width: 11px;
    height: 6px;
    border-left: 2px solid var(--bordeaux);
    border-bottom: 2px solid var(--bordeaux);
    transform: translateY(-75%) rotate(-45deg);
}

.combo__name {
    align-self: flex-start;    /* at the row's start in Arabic too, even when the name itself is English */
    color: var(--ink);
    font-size: 16px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.combo__option.is-chosen .combo__name {
    font-weight: 600;
}

.combo__name mark {
    background: none;
    color: var(--bordeaux);
    font-weight: 700;
}

.combo__meta {
    color: var(--taupe);
    font-size: 13px;
    line-height: 1.35;
}

:root:lang(ar) .combo__meta {
    font-size: 14px;
}

.combo__empty {
    margin: 0;
    padding: 14px 16px;
    color: var(--taupe);
    font-size: 14px;
    overflow-wrap: anywhere;   /* a long pasted search must not widen the page */
}

@media (prefers-reduced-motion: reduce) {
    .combo__popup,
    .combo__toggle svg {
        transition: none;
    }
}

@media (forced-colors: active) {
    .combo__option.is-active {
        outline: 2px solid Highlight;
        outline-offset: -2px;
    }

    .combo__option.is-chosen::after {
        border-color: CanvasText;
    }
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: var(--target);
}

.checkbox input,
.radio-card input {
    width: 20px;
    height: 20px;
    margin: 3px 0 0;
    flex: none;
    accent-color: var(--bordeaux);
}

/* Radio cards (payment method, delivery time). */
.radio-cards {
    display: grid;
    gap: 14px;
}

@media (min-width: 760px) {
    .radio-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.radio-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    background: var(--mat);
    border: 1px solid var(--field);
    cursor: pointer;
}

.radio-card:has(input:checked) {
    border: 2px solid var(--bordeaux);
    padding: 17px;
}

.radio-card:has(input:focus-visible) {
    outline: var(--focus-ring);
    outline-offset: 2px;
}

.radio-card__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.radio-card__title {
    font-size: 17px;
    font-weight: 600;
}

.radio-card__text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--taupe);
}

/* 10. Alert panel ---------------------------------------------------------- */

.alert {
    padding: 12px 14px;
    background: var(--alert-bg);
    color: var(--bordeaux);
    font-size: 14px;
    line-height: 1.6;
}

:root:lang(ar) .alert {
    font-size: 16px;
}

.alert:focus {
    outline: var(--focus-ring);
    outline-offset: 2px;
}

.alert ul,
.alert__list ul {
    margin: 0;
    padding-inline-start: 18px;
}

.alert__list.validation-summary-valid {
    display: none;
}

.notice {
    padding: 16px 18px;
    background: var(--paper);
    border: 1px dashed var(--gilt);
}

/* 11. Product cards -------------------------------------------------------- */

.product-grid {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--grid-gap);
    row-gap: var(--grid-row-gap);
}

@media (min-width: 760px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1100px) {
    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .product-grid--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.product-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

/* Passe-partout mat around photos. */
.mat {
    position: relative;
    display: block;
    width: 100%;
    padding: var(--mat-pad);
    background: var(--mat);
    border: 1px solid var(--line);
}

.mat img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--photo-ground);
    filter: saturate(1.02) sepia(0.06);
}

.mat--wide img {
    aspect-ratio: 4 / 3;
}

a.mat:hover {
    border-color: var(--gilt);
}

.tag {
    position: absolute;
    top: calc(var(--mat-pad) + 8px);
    inset-inline-start: calc(var(--mat-pad) + 8px);
    padding: 4px 10px;
    background: rgb(251 248 242 / 0.94);
    color: var(--ink);
    font-size: var(--fs-tag);
    font-weight: 600;
    letter-spacing: var(--track-s);
    text-transform: var(--upper);
}

.product-card__meta {
    margin-top: 6px;
    font-size: var(--fs-meta);
    letter-spacing: var(--track-s);
    text-transform: var(--upper);
    color: var(--taupe);
}

.product-card__name {
    font-family: var(--font-name);
    font-weight: var(--weight-name);
    font-size: var(--fs-card-name);
    line-height: 1.25;
}

.product-card__name a {
    color: var(--ink);
    text-decoration: none;
}

.product-card__name a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.product-card__price {
    font-size: var(--fs-price);
    font-weight: 600;
}

.product-card__unit {
    font-weight: 400;
    color: var(--taupe);
}

.product-card__action {
    width: 100%;
    margin-top: auto;
    min-height: var(--card-button-h);
}

/* 12. Quantity stepper ----------------------------------------------------- */

.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--ink);
    background: var(--mat);
}

.qty-stepper__button {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: none;
    border: 0;
    color: var(--ink);
    font-family: var(--font-latin-ui);
    font-size: 24px;
    line-height: 1;
}

.qty-stepper__button:disabled {
    color: var(--disabled);
    cursor: not-allowed;
}

.qty-stepper__value {
    min-width: 120px;
    padding: 0 8px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    border: 0;
    background: none;
}

.qty-stepper--compact {
    border-color: var(--field);
}

.qty-stepper--compact .qty-stepper__button {
    width: var(--target);
    height: var(--target);
    font-size: 20px;
}

.qty-stepper--compact .qty-stepper__value {
    min-width: 76px;
    font-size: 15px;
}

/* 13. Summary panel -------------------------------------------------------- */

.summary {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px;
    background: var(--paper);
    border: 1px solid var(--line);
}

@media (min-width: 1100px) {
    .summary {
        padding: 32px;
    }
}

.summary__title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 400;
    line-height: 1.3;
}

.summary__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 16px;
}

.summary__row > :last-child {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.summary__divider {
    padding-block: 14px;
    border-block: 1px solid var(--line);
}

.summary__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--ink);
    font-weight: 600;
}

.summary__total > :first-child {
    font-size: 17px;
}

.summary__total > :last-child {
    font-size: 22px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.summary__note {
    font-size: 13px;
    line-height: 1.6;
    color: var(--taupe);
}

/* Progress towards free delivery: <progress class="meter" max="20" value="12">. */
.meter {
    display: block;
    width: 100%;
    height: 4px;
    border: 0;
    background: var(--line);
    appearance: none;
}

.meter::-webkit-progress-bar {
    background: var(--line);
}

.meter::-webkit-progress-value {
    background: var(--gilt);
}

.meter::-moz-progress-bar {
    background: var(--gilt);
}

/* 14. Breadcrumbs ---------------------------------------------------------- */

.breadcrumbs ol {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-small);
    color: var(--taupe);
}

.breadcrumbs li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.breadcrumbs li + li::before {
    content: "/";
    color: var(--taupe);
}

.breadcrumbs a {
    display: inline-flex;
    align-items: center;
    min-height: var(--target);
    color: var(--taupe);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.breadcrumbs [aria-current="page"] {
    color: var(--ink);
}

/* 15. Pagination ----------------------------------------------------------- */

.pagination ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}

.pagination a,
.pagination span[aria-current] {
    min-width: var(--target);
    min-height: var(--target);
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid transparent;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    text-decoration: none;
}

.pagination a:hover {
    border-bottom-color: var(--line);
}

.pagination [aria-current="page"] {
    border-bottom-color: var(--bordeaux);
    font-weight: 600;
}

/* Arrows point the reading direction. */
:root:lang(ar) .pagination__arrow {
    transform: scaleX(-1);
}

/* 16. Chips and toggles ---------------------------------------------------- */

.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
}

.chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: var(--target);
    padding: 0 16px;
    background: var(--mat);
    border: 1px solid var(--field);
    color: var(--ink);
    font-size: 14px;
    white-space: nowrap;
    text-decoration: none;
}

.chip[aria-current="page"],
.chip[aria-pressed="true"] {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--on-dark);
}

.toggle {
    display: inline-flex;
    align-items: center;
    min-height: var(--target);
    padding: 0 10px;
    background: none;
    border: 0;
    border-bottom: 1px solid transparent;
    color: var(--taupe);
    font-size: var(--fs-small);
    text-decoration: none;
}

.toggle[aria-pressed="true"],
.toggle[aria-current="page"] {
    border-bottom-color: var(--ink);
    color: var(--ink);
    font-weight: 600;
}

/* 17. Empty and status pages ----------------------------------------------- */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 72px 20px;
    text-align: center;
    background: var(--paper);
    border: 1px solid var(--line);
}

.empty-state img {
    width: 96px;
}

.status-page {
    align-items: center;
    justify-content: center;
    flex: 1 0 auto;
}

.status-page__panel {
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    padding: 48px 20px;
    text-align: center;
    background: var(--paper);
    border: 1px solid var(--line);
}

@media (min-width: 760px) {
    .status-page__panel {
        padding: 56px 48px;
    }
}

.status-page__mark {
    width: 96px;
}

.status-page__title {
    font-size: var(--fs-h2);
}

.status-page__panel .lead {
    max-width: 44ch;
}

.status-page__reference {
    font-family: var(--font-latin-ui);
    font-size: 13px;
    color: var(--taupe);
    overflow-wrap: anywhere;
}

.status-page__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px 28px;
}

/* 18. Motion --------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 19. Print ---------------------------------------------------------------- */

@media print {
    .site-top,
    .site-footer,
    .skip-link,
    .flash {
        display: none;
    }

    body {
        background: #fff;
    }
}
