/* Base, layout and shared components. Uses logical properties throughout so RTL and LTR
   share one stylesheet. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  font-weight: 400;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: var(--lh-tight); margin: 0; color: var(--text); text-wrap: balance; }
h1 { font-size: var(--fs-h1); font-weight: 700; }
h2 { font-size: var(--fs-h2); font-weight: 700; }
h3 { font-size: var(--fs-h3); font-weight: 600; }
:root[lang="en"] h1, :root[lang="en"] h2 { letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[lang="en"] { font-family: var(--font-en); }
:root[lang="fa"] [lang="en"] { line-height: 1.6; }
.num, .price { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.price { white-space: nowrap; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: absolute; inset-inline-start: 12px; top: -80px; z-index: 50; padding: 10px 16px; background: var(--primary); color: var(--on-primary); border-radius: var(--r-sm); }
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(56px, 8vw, 112px); }
.section--tight { padding-block: clamp(40px, 5vw, 72px); }
.section--sunk { background: var(--surface-sunk); }
.section--dark { background: var(--c-espresso); color: var(--text-on-dark); }
.section--dark h2, .section--dark h3 { color: var(--text-on-dark); }
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.kicker { font-size: var(--fs-sm); font-weight: 600; color: var(--c-caramel-text); }
:root[lang="en"] .kicker { text-transform: uppercase; letter-spacing: 0.12em; font-size: var(--fs-xs); }
.section--dark .kicker { color: var(--c-saffron); }
.lede { font-size: var(--fs-lg); color: var(--text-muted); max-width: 60ch; }
.section--dark .lede { color: var(--text-on-dark-muted); }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-sm); }
.page-head { padding-block: clamp(32px, 5vw, 64px) clamp(20px, 3vw, 32px); display: flex; flex-direction: column; gap: var(--sp-3); }
.page-head .lede { font-size: var(--fs-md); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgb(247 241 232 / 0.92); backdrop-filter: saturate(1.4) blur(10px);
  border-block-end: 1px solid var(--border);
}
.site-header__bar { display: flex; align-items: center; gap: var(--sp-5); min-height: 68px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--c-espresso); }
.wordmark svg { width: 34px; height: 34px; flex: none; }
.wordmark__text { font-family: var(--font-fa); font-weight: 800; font-size: 26px; line-height: 1; letter-spacing: 0; }
.wordmark__sub { font-family: var(--font-en-display); font-weight: 700; font-size: 10px; letter-spacing: 0.32em; display: block; margin-block-start: 4px; opacity: 0.8; white-space: nowrap; }
@media (max-width: 560px) { .site-header .wordmark__sub { display: none; } }
.site-nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 28px); margin-inline-start: auto; }
.site-nav a { text-decoration: none; font-size: var(--fs-sm); font-weight: 500; padding-block: 8px; position: relative; white-space: nowrap; }
.site-nav a[aria-current="page"]::after, .site-nav a:hover::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 2px; background: var(--c-saffron); border-radius: 2px; }
.site-nav .nav-barista { color: var(--c-caramel-text); font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: var(--sp-2); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: var(--tap); height: var(--tap); padding-inline: 10px; border-radius: var(--r-pill); border: 1px solid transparent; background: transparent; text-decoration: none; cursor: pointer; font-size: var(--fs-sm); font-weight: 500; }
.icon-btn:hover { background: rgb(59 35 26 / 0.07); }
.icon-btn svg { width: 22px; height: 22px; }
.lang-btn { border-color: var(--border-strong); padding-inline: 14px; }
.cart-count { min-width: 20px; height: 20px; padding-inline: 5px; border-radius: 10px; background: var(--c-saffron); color: var(--c-ink); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.cart-count[data-count="0"] { display: none; }
.nav-toggle { display: none; }

/* header over the hero */
.is-home .site-header { position: absolute; inset-inline: 0; background: transparent; border: 0; backdrop-filter: none; color: var(--text-on-dark); }
.is-home .site-header .wordmark { color: var(--c-cream); }
.is-home .site-header .site-nav .nav-barista { color: var(--c-saffron); }
.is-home .site-header .icon-btn:hover { background: rgb(247 241 232 / 0.12); }
.is-home .site-header .lang-btn { border-color: rgb(247 241 232 / 0.45); }

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: fixed; inset: 0; z-index: 40; margin: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--c-cream); color: var(--text); padding: 88px var(--gutter) var(--sp-6); overflow-y: auto;
    display: none; /* closed: out of layout, so it cannot create horizontal overflow */
  }
  .site-nav.is-open { display: flex; animation: nav-in var(--t-med) var(--ease); }
  @keyframes nav-in { from { opacity: 0; transform: translateY(-8px); } }
  .site-nav a { font-size: var(--fs-lg); font-weight: 600; padding-block: 14px; border-block-end: 1px solid var(--border); }
  .site-nav a::after { display: none; }
  .is-home .site-nav .nav-barista { color: var(--c-caramel-text); }
  .nav-close { position: absolute; top: 14px; inset-inline-end: var(--gutter); }
  .header-actions { margin-inline-start: auto; }
}
@media (min-width: 961px) { .nav-close { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding-inline: 24px; border-radius: var(--r-pill); border: 1px solid transparent;
  font-family: var(--font-body); font-size: var(--fs-base); font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--c-saffron); color: var(--on-accent); }
.btn--primary:hover { background: #EFB459; box-shadow: 0 6px 18px rgb(232 163 61 / 0.35); }
.btn--dark { background: var(--primary); color: var(--on-primary); }
.btn--dark:hover { background: #4A2E22; }
.btn--outline { border-color: var(--border-strong); background: transparent; color: var(--text); }
.btn--outline:hover { border-color: var(--c-espresso); background: rgb(59 35 26 / 0.04); }
.btn--ghost-light { border-color: rgb(247 241 232 / 0.55); color: var(--c-cream); }
.btn--ghost-light:hover { background: rgb(247 241 232 / 0.1); border-color: var(--c-cream); }
.btn--sm { min-height: var(--tap); padding-inline: 16px; font-size: var(--fs-sm); }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.link { color: var(--c-caramel-text); font-weight: 600; text-underline-offset: 4px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; line-height: 1.8; white-space: nowrap; }
.badge--signature { background: var(--c-saffron); color: var(--c-ink); }
.badge--pending { background: #F3E3C7; color: #7A4A0A; }
.badge--matcha { background: #E3E8D6; color: var(--c-matcha-text); }
.badge--muted { background: var(--surface-sunk); color: var(--text-muted); }
.badge--error { background: #F6DCD8; color: var(--c-brick-text); }

/* ---------- cards & product art ---------- */
.grid { display: grid; gap: clamp(16px, 2.2vw, 28px); }
.grid--products { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow var(--t-med) var(--ease), transform var(--t-med) var(--ease); }
.card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.card__body { padding: var(--sp-4) var(--sp-5) var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; }
.card__title { font-size: var(--fs-md); font-weight: 600; line-height: 1.5; }
.card__title a { text-decoration: none; }
.card__title a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }
.card__meta { font-size: var(--fs-sm); color: var(--text-muted); }
.card__foot { margin-block-start: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding-block-start: var(--sp-3); }
.card .price { font-weight: 700; font-size: var(--fs-md); }
.price small { font-weight: 500; font-size: var(--fs-xs); color: var(--text-muted); }

.art { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; background: var(--art-bg, #EADCC7); }
.art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 110%, rgb(255 253 249 / 0.55), transparent 60%); }
.art svg { position: relative; width: 46%; height: auto; color: var(--art-fg, var(--c-espresso)); }
.art--coffee { --art-bg: #E7D3BC; --art-fg: #5B3A29; }
.art--lamizpresso { --art-bg: #3B231A; --art-fg: #E8A33D; }
.art--tea { --art-bg: #DDE3CE; --art-fg: #55623D; }
.art--hot { --art-bg: #EAD8C2; --art-fg: #3B231A; }
.art--cold { --art-bg: #DCE5E4; --art-fg: #2E4A4D; }
.art--matcha { --art-bg: #DCE4CC; --art-fg: #55623D; }
.art--smoothie { --art-bg: #F0DCD4; --art-fg: #8A3B3B; }
.art--bakery { --art-bg: #F2DFC2; --art-fg: #8A5230; }
.art--toast { --art-bg: #EFDCC4; --art-fg: #6A4128; }
.art--popsicle { --art-bg: #F5E1CF; --art-fg: #A9502E; }
.art__note { position: absolute; inset-block-end: 10px; inset-inline-start: 12px; font-size: 11px; color: rgb(36 22 17 / 0.66); background: rgb(255 253 249 / 0.75); padding: 1px 8px; border-radius: var(--r-pill); }
.art--lamizpresso .art__note { color: var(--c-cream); background: rgb(0 0 0 / 0.25); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-size: var(--fs-sm); font-weight: 600; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface);
  font-size: var(--fs-base); line-height: 1.6; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.textarea { min-height: 120px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--c-espresso); box-shadow: 0 0 0 3px rgb(232 163 61 / 0.35); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--error); }
.field__hint { font-size: var(--fs-xs); color: var(--text-muted); }
.field__error { font-size: var(--fs-sm); color: var(--error); font-weight: 500; }
.input[dir="ltr"] { text-align: start; }
[dir="rtl"] .input[dir="ltr"] { text-align: end; }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: clamp(20px, 4vw, 40px); }
.alert { padding: 14px 18px; border-radius: var(--r-md); font-size: var(--fs-sm); border: 1px solid; }
.alert--info { background: #FBF3E3; border-color: #EBD3A5; color: #6B4510; }
.alert--success { background: #EEF2E6; border-color: #C9D3B4; color: var(--c-matcha-text); }
.alert--error { background: #FBEAE7; border-color: #EBC0B9; color: var(--c-brick-text); }
.toast { position: fixed; inset-block-end: 20px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 60; background: var(--c-espresso); color: var(--c-cream); padding: 12px 20px; border-radius: var(--r-pill); box-shadow: var(--shadow-2); font-size: var(--fs-sm); font-weight: 500; }
[dir="rtl"] .toast { transform: translateX(50%); }

/* chips (filters, choices) */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding-inline: 14px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface); font-size: var(--fs-sm); font-weight: 500; cursor: pointer; text-decoration: none; user-select: none; }
.chip:hover { border-color: var(--c-espresso); }
.chip[aria-current="true"], .chip:has(input:checked) { background: var(--c-espresso); color: var(--c-cream); border-color: var(--c-espresso); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.chip[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.chip .count { font-size: var(--fs-xs); opacity: 0.75; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { padding: 10px 14px; text-align: start; border-block-end: 1px solid var(--border); vertical-align: middle; }
.table th { font-weight: 600; background: var(--surface-sunk); white-space: nowrap; }
.table tr:last-child td { border-block-end: 0; }

/* qty stepper */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--r-pill); background: var(--surface); }
.stepper button { width: 40px; height: 40px; border: 0; background: transparent; border-radius: 50%; cursor: pointer; font-size: 20px; line-height: 1; display: grid; place-items: center; }
.stepper button:hover:not([disabled]) { background: var(--surface-sunk); }
.stepper button[disabled] { opacity: 0.35; cursor: not-allowed; }
.stepper output, .stepper input { min-width: 28px; text-align: center; font-weight: 700; border: 0; background: transparent; width: 40px; }

/* ---------- footer ---------- */
.site-footer { background: var(--c-espresso); color: var(--text-on-dark); padding-block: var(--sp-8) var(--sp-6); margin-block-start: var(--sp-8); }
.site-footer a { color: var(--text-on-dark); text-decoration: none; }
.site-footer a:hover { color: var(--c-saffron); }
.footer-grid { display: grid; gap: var(--sp-6); grid-template-columns: 1.4fr repeat(2, 1fr); }
.footer-grid h2 { font-size: var(--fs-base); color: var(--c-saffron); margin-block-end: var(--sp-3); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-sm); }
.site-footer .wordmark { color: var(--c-cream); }
.footer-tagline { color: var(--text-on-dark-muted); margin-block-start: var(--sp-3); max-width: 36ch; }
.footer-bottom { margin-block-start: var(--sp-7); padding-block-start: var(--sp-5); border-block-start: 1px solid rgb(247 241 232 / 0.15); font-size: var(--fs-xs); color: var(--text-on-dark-muted); display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-6); justify-content: space-between; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* breadcrumbs */
.crumbs { font-size: var(--fs-sm); color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--text-muted); }
.crumbs span[aria-hidden] { opacity: 0.5; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}
.badge--featured { background: var(--c-espresso); color: var(--c-cream); }
