/* Tamar Madinah storefront preview, business v2.
   A conventional retail layout built with tasteskill v2's craft rules (tokens, few type sizes,
   tone steps instead of hairlines, no shadows at rest, square controls). Colours from the brand. */

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/onest-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/literata-latin.woff2") format("woff2");
}

/* ---------- tokens ---------- */
:root {
  --canvas: #faf8f3;      /* near-white shopping canvas */
  --white: #ffffff;       /* product photographs sit on white */
  --surface: #f1ecdd;     /* one tone step: controls, panels */
  --surface-2: #e7dfc8;   /* pressed / hover step */
  --cream: #f5eed6;       /* brand cream, for the hero and gifts fields */
  --green: #173a24;       /* brand green: actions, footer, hero field */
  --green-2: #0f2a19;     /* hover */
  --on-green: #f7ecbe;    /* the logo's cream on green */
  --gold: #c99a2e;        /* the gold box: cart count and the hero price only */
  --ink: #1b2119;
  --muted: #474d43;
  --in: #1f6b3a;          /* stock: in */
  --some: #7a5410;        /* stock: some sizes sold out */
  --out: #6b6b66;         /* stock: sold out */

  --sans: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Literata", Georgia, "Times New Roman", serif;

  --step-small: 0.875rem;                                     /* 14px */
  --step-body: clamp(1rem, 0.96rem + 0.15vw, 1.0625rem);       /* 16–17px */
  --step-lead: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);      /* 18–20px */
  --step-head: clamp(1.625rem, 1.3rem + 1.2vw, 2.25rem);       /* 26–36px */
  --step-display: clamp(2.25rem, 1.5rem + 2.6vw, 3.5rem);      /* 36–56px */

  --wrap: 1320px;
  --margin: clamp(16px, 3vw, 40px);
  --gap: clamp(12px, 1.8vw, 24px);
  --section: clamp(48px, 7vw, 96px);
  --header-h: 72px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font-family: var(--sans); font-size: var(--step-body); line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
h1, h2, h3, p, ul, dl, dd, figure, fieldset { margin: 0; }
ul { padding: 0; list-style: none; }
fieldset { border: 0; padding: 0; min-width: 0; }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 0.07em; }
p { text-wrap: pretty; max-width: 65ch; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
::selection { background: var(--green); color: var(--on-green); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -100px; z-index: 50; background: var(--white); padding: 12px 16px; }
.skip:focus { top: 8px; }

/* ---------- type ---------- */
.h1, .hero__title, .buy__name { font-family: var(--serif); font-weight: 500; letter-spacing: -0.015em; line-height: 1.1; text-wrap: balance; }
.h1 { font-size: var(--step-display); }
.h2 { font-family: var(--serif); font-weight: 500; font-size: var(--step-head); line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; }
.h3, .footer-h { font-size: var(--step-lead); font-weight: 600; line-height: 1.3; }
.note, .crumbs, .card__meta, .stock, .result-count { font-size: var(--step-small); }
.note { color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  min-height: 48px; padding: 0 24px; border-radius: 0;
  font-weight: 500; text-decoration: none; text-align: center; line-height: 1.2;
  background: var(--surface); color: var(--ink);
  transition: background-color 160ms ease, color 160ms ease, transform 120ms var(--ease);
}
.btn:active:not([disabled]) { transform: translateY(1px); }
.btn--primary { background: var(--green); color: var(--white); }
.btn--secondary { background: var(--surface); color: var(--green); }
.btn--small { min-height: 44px; padding: 0 16px; font-size: var(--step-small); width: 100%; }
.btn--block { width: 100%; }
.btn--grow { flex: 1; }
.btn[disabled] { background: var(--surface); color: var(--out); cursor: not-allowed; }
@media (hover: hover) {
  .btn--primary:not([disabled]):hover { background: var(--green-2); }
  .btn--secondary:hover { background: var(--surface-2); }
}
.text-btn { min-height: 44px; padding: 0 4px; text-decoration: underline; }
.link-more { font-weight: 500; color: var(--green); }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--white); }
.site-header__inner {
  display: flex; align-items: center; gap: 32px;
  max-width: var(--wrap); margin: 0 auto; padding: 0 var(--margin); height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 48px; height: 48px; }
.brand__name { font-family: var(--serif); font-size: 1.375rem; font-weight: 500; letter-spacing: -0.01em; color: var(--green); white-space: nowrap; }
.main-nav { display: flex; gap: 28px; margin-left: auto; }
.main-nav a { text-decoration: none; font-weight: 500; padding: 10px 0; }
.main-nav a[aria-current="page"] { color: var(--green); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }
@media (hover: hover) { .main-nav a:hover { color: var(--green); text-decoration: underline; text-underline-offset: 8px; } }
.cart-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; background: var(--green); color: var(--white); text-decoration: none; font-weight: 500; }
.cart-link__count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: var(--green-2); font-size: var(--step-small); font-variant-numeric: tabular-nums; font-weight: 600; }
.menu-btn { display: none; min-height: 44px; padding: 0 12px 0 0; font-weight: 500; }

/* ---------- layout ---------- */
.section, .page-head, .hero, .promo { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--margin); }
.section { padding-block: var(--section) 0; }
.section--tight { padding-top: clamp(32px, 4vw, 48px); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
main { padding-bottom: var(--section); }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; padding-top: clamp(16px, 2vw, 24px); }
.hero__text { background: var(--cream); padding: clamp(28px, 4vw, 56px); display: flex; flex-direction: column; justify-content: center; gap: 20px; }
.hero__title { font-size: var(--step-display); color: var(--green); max-width: 14ch; }
.hero__lead { font-size: var(--step-lead); max-width: 40ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.hero__product { background: var(--green); color: var(--on-green); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: clamp(24px, 3vw, 40px); text-decoration: none; }
.hero__tile { display: block; width: min(100%, 360px); aspect-ratio: 1; background: var(--white); overflow: hidden; }
.hero__tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--ease); }
@media (hover: hover) { .hero__product:hover .hero__tile img { transform: scale(1.03); } }
.hero__caption { font-size: var(--step-body); }
.hero__caption strong { color: var(--gold); font-weight: 600; margin-left: 6px; }

/* ---------- categories ---------- */
.cats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gap); }
.cat { display: grid; grid-template-rows: auto auto auto; gap: 4px; text-decoration: none; background: var(--white); padding-bottom: 14px; }
.cat__img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--white); margin-bottom: 8px; }
.cat__name, .cat__meta { padding-inline: 14px; }
.cat__name { font-weight: 600; }
.cat__meta { font-size: var(--step-small); color: var(--muted); }
@media (hover: hover) { .cat:hover .cat__name { color: var(--green); text-decoration: underline; } }

/* ---------- product cards ---------- */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.card { display: flex; flex-direction: column; background: var(--white); }
.card[hidden] { display: none; }
.card__media { display: block; aspect-ratio: 1; overflow: hidden; background: var(--white); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--ease); }
@media (hover: hover) { .card:hover .card__media img { transform: scale(1.03); } }
.card__body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; flex: 1; }
.card__name { font-size: var(--step-body); font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.card__name a { text-decoration: none; }
@media (hover: hover) { .card__name a:hover { text-decoration: underline; color: var(--green); } }
.card__meta { color: var(--muted); }
.card__price { font-size: var(--step-lead); font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 4px; }
.card__from { font-size: var(--step-small); font-weight: 400; color: var(--muted); }
.card .btn { margin-top: auto; }
.card .stock { margin-bottom: 12px; }
.stock { font-weight: 500; }
.stock--in { color: var(--in); }
.stock--some { color: var(--some); }
.stock--out { color: var(--out); }

/* ---------- gifts promo ---------- */
.promo { display: grid; grid-template-columns: 1fr 1.2fr; margin-top: var(--section); }
.promo__media { background: var(--white); }
.promo__media img { width: 100%; height: 100%; max-height: 520px; object-fit: cover; }
.promo__text { background: var(--cream); padding: clamp(28px, 4vw, 56px); display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.promo__text p { max-width: 52ch; }

/* ---------- about and visit ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.about__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.about__text { display: flex; flex-direction: column; gap: 16px; }
.about__text p { max-width: 56ch; }
.contact-list { display: grid; gap: 2px; margin-top: 8px; }
.contact-list div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 10px 14px; background: var(--white); }
.contact-list dt { color: var(--muted); }
.contact-list dd { overflow-wrap: anywhere; }

/* ---------- page head, crumbs ---------- */
.page-head { padding-top: clamp(20px, 3vw, 32px); display: grid; gap: 8px; }
.page-head__lead { color: var(--muted); }
.crumbs { color: var(--muted); }
.crumbs a { color: var(--ink); }
.page-head--product { padding-bottom: 16px; }

/* ---------- shop ---------- */
.section--shop { padding-top: 24px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--surface); font-weight: 500; transition: background-color 160ms ease; }
.chip[aria-pressed="true"] { background: var(--green); color: var(--white); }
@media (hover: hover) { .chip:not([aria-pressed="true"]):hover { background: var(--surface-2); } }
.result-count { color: var(--muted); margin: 16px 0; }

/* ---------- product page ---------- */
.pdp { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--margin); display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 4vw, 64px); align-items: start; }
.gallery__main { background: var(--white); }
.gallery__main img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: opacity 200ms ease; }
.gallery__main img.is-swapping { opacity: 0.3; }
.gallery__thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumb { width: 80px; height: 80px; background: var(--white); outline-offset: -2px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb[aria-current="true"] { outline: 2px solid var(--green); }
.pdp__info { display: grid; gap: 32px; }
.buy { display: grid; gap: 16px; }
.buy__name { font-size: var(--step-display); color: var(--green); }
.buy__price { font-size: var(--step-head); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.buy__currency { font-size: var(--step-small); font-weight: 500; color: var(--muted); }
.field { display: grid; gap: 8px; }
.field__label { font-weight: 600; padding: 0; }
.segmented { display: flex; gap: 4px; }
.segmented a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 18px; background: var(--surface); text-decoration: none; font-weight: 500; }
.segmented a[aria-current="page"] { background: var(--green); color: var(--white); }
@media (hover: hover) { .segmented a:not([aria-current]):hover { background: var(--surface-2); } }
.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.option { position: relative; display: grid; gap: 2px; padding: 10px 14px; min-height: 60px; background: var(--surface); cursor: pointer; transition: background-color 160ms ease; }
.option input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: inherit; }
.option__label { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; hyphens: manual; }
.option__meta { font-size: var(--step-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.option:has(input:checked) { background: var(--green); color: var(--white); }
.option:has(input:checked) .option__meta { color: var(--on-green); }
.option:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.option--out { cursor: not-allowed; background: var(--canvas); color: var(--out); }
.option--out .option__label { text-decoration: line-through; }
.option--out:has(input:checked) { background: var(--canvas); color: var(--out); }
@media (hover: hover) { .option:not(.option--out):not(:has(input:checked)):hover { background: var(--surface-2); } }
.buy__note { color: var(--muted); min-height: 0; }
.buy__note:empty { display: none; }
.buy__row { display: flex; gap: 8px; }
.buy__status { font-size: var(--step-small); color: var(--muted); min-height: 1.4em; }
.qty { display: grid; grid-template-columns: 44px 52px 44px; background: var(--surface); min-height: 48px; }
.qty__btn { font-size: 1.25rem; }
.qty__input { width: 100%; text-align: center; border: 0; background: transparent; font-variant-numeric: tabular-nums; appearance: textfield; -moz-appearance: textfield; }
.qty__input::-webkit-inner-spin-button, .qty__input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty__btn:focus-visible, .qty__input:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
@media (hover: hover) { .qty__btn:hover { background: var(--surface-2); } }
.details { display: grid; gap: 10px; padding: 20px; background: var(--white); }
.details ul { list-style: disc; padding-left: 1.2em; }
.details li + li { margin-top: 4px; }

/* ---------- cart, review ---------- */
.checkout-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: var(--gap); align-items: start; padding-top: 24px; }
.panel { background: var(--white); padding: 8px 24px; }
.summary { background: var(--white); padding: 24px; display: grid; gap: 12px; position: sticky; top: calc(var(--header-h) + 16px); }
.summary[hidden] { display: none; }
.total-row { display: flex; justify-content: space-between; font-size: var(--step-lead); font-variant-numeric: tabular-nums; }
.total-row strong { font-weight: 600; }
.line { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; gap: 6px 16px; padding: 16px 0; align-items: start; }
.line + .line { border-top: 2px solid var(--surface); }
.line__img { width: 80px; height: 80px; object-fit: cover; background: var(--white); }
.line__name { font-weight: 600; line-height: 1.3; }
.line__name a { text-decoration: none; }
.line__opt, .line__unit { font-size: var(--step-small); color: var(--muted); }
.line__price { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.line__ctl { grid-column: 2 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.line__remove { min-height: 44px; font-size: var(--step-small); text-decoration: underline; }
.line .qty { min-height: 44px; }
.empty { padding: 24px 0; display: grid; gap: 12px; justify-items: start; }

/* ---------- dialogs ---------- */
dialog { padding: 0; border: 0; color: var(--ink); background: var(--white); max-width: none; max-height: none; }
dialog::backdrop { background: rgb(0 0 0 / 0.45); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; background: var(--canvas); }
.dialog-title { font-family: var(--serif); font-size: var(--step-head); font-weight: 500; line-height: 1.2; }
.drawer { position: fixed; inset: 0 0 0 auto; width: min(440px, 100vw); height: 100dvh; margin: 0; box-shadow: -8px 0 32px rgb(0 0 0 / 0.2); } /* taste-skill-ignore: modal drawer floats */
.drawer[open] { display: flex; flex-direction: column; }
.drawer .dialog-title { font-size: var(--step-lead); font-family: var(--sans); font-weight: 600; }
.drawer__body { flex: 1; overflow-y: auto; padding: 0 24px; }
.drawer__foot { padding: 16px 24px 24px; background: var(--canvas); display: grid; gap: 10px; }
.drawer__foot[hidden] { display: none; }
.menu { position: fixed; inset: 0 auto 0 0; width: min(360px, 88vw); height: 100dvh; margin: 0; }
.menu[open] { display: flex; flex-direction: column; }
.menu .dialog-title { font-size: var(--step-lead); font-family: var(--sans); font-weight: 600; }
.menu__nav, .menu__cats { display: grid; padding: 8px 24px; }
.menu__nav a { font-size: var(--step-lead); font-weight: 500; padding: 10px 0; text-decoration: none; }
.menu__cats a { padding: 8px 0; text-decoration: none; color: var(--muted); }
.menu__sub { padding: 16px 24px 0; font-weight: 600; }
.notice { width: min(520px, calc(100vw - 32px)); padding: 32px; box-shadow: 0 16px 48px rgb(0 0 0 / 0.3); } /* taste-skill-ignore: modal dialog */
.notice p { margin-top: 12px; }
.notice .btn { margin-top: 24px; }
@media (prefers-reduced-motion: no-preference) {
  .drawer[open] { animation: slide-in 280ms var(--ease); }
  .menu[open] { animation: slide-in-left 240ms var(--ease); }
}
@keyframes slide-in { from { transform: translateX(32px); opacity: 0; } }
@keyframes slide-in-left { from { transform: translateX(-32px); opacity: 0; } }

/* ---------- footer ---------- */
.site-footer { background: var(--green); color: var(--on-green); }
.site-footer__grid { max-width: var(--wrap); margin: 0 auto; padding: 56px var(--margin) 32px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.site-footer a { text-decoration: none; }
@media (hover: hover) { .site-footer a:hover { text-decoration: underline; } }
.site-footer li + li { margin-top: 8px; }
.footer-h { margin-bottom: 12px; color: var(--white); }
.brand--footer .brand__name { color: var(--on-green); }
.site-footer__brand p { margin-top: 12px; max-width: 30ch; }
.site-footer__legal { padding: 20px max(var(--margin), calc((100% - var(--wrap)) / 2 + var(--margin))) 28px; font-size: var(--step-small); display: grid; gap: 6px; background: var(--green-2); }
.site-footer__legal a { text-decoration: underline; }

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .main-nav { display: none; }
  .menu-btn { display: inline-flex; align-items: center; }
  .site-header__inner { gap: 12px; }
  .brand { margin-right: auto; }
  .pdp, .about { grid-template-columns: 1fr; }
  .checkout-grid { grid-template-columns: 1fr; }
  .summary { position: static; }
}

/* ---------- phone ---------- */
@media (max-width: 640px) {
  :root { --header-h: 60px; }
  .brand img { width: 36px; height: 36px; }
  .brand__name { font-size: 1.125rem; }
  .brand { gap: 8px; }
  .cart-link { padding: 0 12px; }
  .hero { grid-template-columns: 1fr; padding-inline: 0; padding-top: 0; }
  .hero__text { padding: 24px var(--margin) 28px; gap: 14px; }
  .hero__actions .btn { flex: 1 1 140px; }
  .hero__product { flex-direction: row; justify-content: flex-start; padding: 16px var(--margin); }
  .hero__tile { width: 112px; flex: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cats .cat:last-child { grid-column: 1 / -1; }
  .card__body { padding: 12px; }
  .promo { grid-template-columns: 1fr; padding-inline: 0; }
  .promo__media img { max-height: 300px; }
  .promo__text { padding: 28px var(--margin); }
  .contact-list div { grid-template-columns: 1fr; gap: 0; }
  .site-footer__grid { grid-template-columns: 1fr; }
  .panel { padding: 4px 16px; }
  .line { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .line__img { width: 64px; height: 64px; }
  .section__head { flex-wrap: wrap; }
}
