/* ============================================================
   کافه لاین — Design System (shared tokens, fonts, primitives)
   Local fonts only. No external CDN. Mobile-first. RTL.
   ============================================================ */

/* ---------- Local Persian font: Vazirmatn (OFL) ---------- */
@font-face{
  font-family:"Vazirmatn";font-style:normal;font-weight:400;font-display:swap;
  src:url("fonts/vazirmatn-400.woff2") format("woff2");
}
@font-face{
  font-family:"Vazirmatn";font-style:normal;font-weight:500;font-display:swap;
  src:url("fonts/vazirmatn-500.woff2") format("woff2");
}
@font-face{
  font-family:"Vazirmatn";font-style:normal;font-weight:700;font-display:swap;
  src:url("fonts/vazirmatn-700.woff2") format("woff2");
}
@font-face{
  font-family:"Vazirmatn";font-style:normal;font-weight:800;font-display:swap;
  src:url("fonts/vazirmatn-800.woff2") format("woff2");
}

/* ---------- Design tokens ---------- */
:root{
  /* surfaces */
  --bg:#f6f1e9;
  --surface:#fffcf7;
  --surface-2:#f1eae0;
  --surface-3:#ece3d7;

  /* ink / text */
  --ink:#1c1712;
  --ink-2:#6d645b;      /* readable muted */
  --ink-3:#948a80;      /* soft, non-essential */

  /* lines */
  --line:rgba(28,23,18,.10);
  --line-2:rgba(28,23,18,.16);

  /* brand */
  --brand:#95633f;      /* coffee */
  --brand-deep:#6e4327;
  --gold:#b98b4e;       /* limited caramel accent */
  --accent:var(--brand);/* per-category override target */

  /* semantic */
  --success:#3f7d5a;
  --success-soft:#e7f1ea;
  --danger:#b1463c;
  --danger-soft:#faece9;

  /* radii */
  --r-xs:10px; --r-sm:13px; --r:16px; --r-lg:20px; --r-xl:26px; --r-pill:999px;

  /* shadows (soft, natural) */
  --shadow-xs:0 1px 3px rgba(43,30,18,.05);
  --shadow-sm:0 4px 14px rgba(43,30,18,.06);
  --shadow:0 12px 30px rgba(43,30,18,.09);
  --shadow-lg:0 22px 54px rgba(43,30,18,.14);

  /* motion */
  --ease:cubic-bezier(.2,.7,.2,1);
}

/* ---------- Reset ---------- */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-behavior:smooth;color-scheme:light}
body{
  margin:0;min-height:100vh;background:var(--bg);color:var(--ink);
  font-family:"Vazirmatn","Tahoma","Segoe UI",Arial,sans-serif;
  font-size:15px;line-height:1.75;font-weight:400;
  -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;
  overflow-x:hidden;
}
a{color:inherit;text-decoration:none}
img{display:block;max-width:100%}
button,input,textarea,select{font:inherit;color:inherit}
button{cursor:pointer}
b,strong{font-weight:700}
h1,h2,h3{margin:0;line-height:1.3;font-weight:800;letter-spacing:-.01em}
::selection{background:rgba(149,99,63,.18)}

/* Accessible focus ring everywhere */
:focus-visible{outline:2.5px solid var(--brand);outline-offset:2px;border-radius:6px}

/* ---------- Shared: eyebrow / labels ---------- */
.eyebrow{display:inline-flex;align-items:center;gap:8px;color:var(--brand);
  font-size:11px;font-weight:800;letter-spacing:.02em}
.eyebrow i{width:20px;height:2px;border-radius:2px;background:currentColor;opacity:.7}

/* ---------- Shared: brand cup mark ---------- */
.cupmark{position:relative;flex:0 0 auto;border-radius:13px;background:var(--surface);
  border:1px solid var(--line);width:40px;height:40px;box-shadow:var(--shadow-xs)}
.cupmark::before{content:"";position:absolute;width:16px;height:12px;border:2px solid var(--ink);
  border-top-width:1.6px;border-radius:3px 3px 8px 8px;right:9px;top:12px}
.cupmark::after{content:"";position:absolute;width:6px;height:8px;border:2px solid var(--ink);
  border-right:0;border-radius:6px 0 0 6px;right:4px;top:15px}
.cupmark.solid{background:var(--ink);border-color:var(--ink)}
.cupmark.solid::before{border-color:#fff}
.cupmark.solid::after{border-color:#fff}

/* ---------- Shared: quantity stepper ---------- */
.qty-control{display:inline-grid;grid-template-columns:36px 30px 36px;align-items:center;
  height:40px;border:1px solid var(--line-2);border-radius:var(--r-sm);overflow:hidden;
  background:var(--surface);box-shadow:var(--shadow-xs)}
.qty-control button{height:100%;border:0;background:transparent;font-size:20px;line-height:1;
  color:var(--ink);display:grid;place-items:center;transition:background .15s}
.qty-control button:hover{background:var(--surface-2)}
.qty-control button:active{background:var(--surface-3)}
.qty-control b{text-align:center;font-size:14px;font-weight:700;font-variant-numeric:tabular-nums}

/* ---------- Shared: toast ---------- */
.toast{position:fixed;z-index:120;left:50%;transform:translate(-50%,14px);
  background:var(--ink);color:#fff;border-radius:var(--r-sm);padding:11px 16px;
  font-size:13px;font-weight:500;white-space:nowrap;max-width:88vw;overflow:hidden;
  text-overflow:ellipsis;box-shadow:var(--shadow-lg);opacity:0;pointer-events:none;
  transition:opacity .2s,transform .2s}
.toast.show{opacity:1;transform:translate(-50%,0)}

/* ---------- Shared: form fields ---------- */
.form-error{display:block;min-height:15px;color:var(--danger);font-size:12px;
  font-weight:500;margin-top:5px}

/* ============================================================
   پروندهٔ مشتری — خوش‌آمد، «همیشگی» و صفحهٔ پروفایل
   (روی هر سه صفحهٔ مشتری بارگذاری می‌شود، پس اینجا می‌ماند)
   ============================================================ */

/* ---------- نوار خوش‌آمد ---------- */
.hello-strip{display:flex;align-items:center;justify-content:space-between;gap:10px;
  flex-wrap:wrap;margin:2px 0 0;padding:10px 13px;border:1px solid var(--line);
  border-radius:var(--r);background:var(--surface);box-shadow:var(--shadow-xs);
  animation:helloIn .45s var(--ease) both}
.hello-strip[hidden]{display:none}
.hello-strip p{margin:0;display:flex;align-items:center;gap:8px;min-width:0;
  font-size:14px;color:var(--ink-2)}
.hello-strip p i{width:7px;height:7px;flex:0 0 7px;border-radius:50%;background:var(--brand);
  box-shadow:0 0 0 4px rgba(149,99,63,.13)}
.hello-strip p b{color:var(--ink);font-weight:800;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;max-width:14ch}
.hello-actions{display:flex;align-items:center;gap:2px;margin-inline-start:auto}
.hello-link{border:0;background:transparent;padding:6px 9px;border-radius:var(--r-xs);
  font-size:12px;font-weight:600;color:var(--brand);white-space:nowrap;line-height:1}
.hello-link.ghost{color:var(--ink-3);font-weight:500}
.hello-link:active{background:var(--surface-2)}
@keyframes helloIn{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}

/* ---------- کارت «همیشگی» ---------- */
.usual-card{display:grid;gap:11px;margin:10px 0 0;padding:12px;
  border:1px solid var(--line);border-radius:var(--r-lg);
  background:linear-gradient(180deg,var(--surface) 0%,var(--surface-2) 100%);
  box-shadow:var(--shadow-sm);animation:helloIn .5s .06s var(--ease) both}
.usual-card[hidden]{display:none}
.usual-top{display:flex;align-items:center;gap:11px;min-width:0}
.usual-copy{flex:1;min-width:0}
.usual-copy b{display:block;font-size:15px;font-weight:800;line-height:1.4}
.usual-copy small{display:block;margin-top:2px;font-size:12px;color:var(--ink-2);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.usual-thumbs{display:flex;gap:6px;flex:0 0 auto}
.usual-thumb{position:relative;display:grid;place-items:center;width:42px;height:42px;flex:0 0 42px;
  border-radius:13px;overflow:hidden;border:1px solid var(--line);background:var(--surface-3)}
.usual-thumb img{width:100%;height:100%;object-fit:cover}
.usual-thumb.more{background:var(--surface);color:var(--ink-3);font-size:12px;font-weight:800}
.usual-go{display:flex;align-items:center;gap:10px;width:100%;padding:13px 15px;border:0;
  border-radius:var(--r);background:var(--ink);color:#fff;box-shadow:var(--shadow-sm);
  transition:transform .15s var(--ease)}
.usual-go b{font-size:14px;font-weight:800}
.usual-go strong{margin-inline-start:auto;font-size:13px;font-weight:700;opacity:.92;
  font-variant-numeric:tabular-nums}
.usual-go i{font-style:normal;font-size:16px;opacity:.75}
.usual-go:active{transform:scale(.99)}

/* ---------- ردیف «شما را می‌شناسیم» در سبد ---------- */
.known-row{display:flex;align-items:center;gap:11px;padding:11px 12px;
  border:1px solid var(--line);border-radius:var(--r);background:var(--surface-2)}
.known-row[hidden]{display:none}
.known-avatar{display:grid;place-items:center;width:38px;height:38px;flex:0 0 38px;
  border-radius:50%;background:var(--brand);color:#fff;font-size:15px;font-weight:800}
.known-copy{flex:1;min-width:0}
.known-copy b{display:block;font-size:14px;font-weight:800;overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap}
.known-copy small{display:block;margin-top:1px;font-size:12px;color:var(--ink-2);
  direction:ltr;text-align:right;font-variant-numeric:tabular-nums}
.known-switch{border:1px solid var(--line-2);background:var(--surface);
  border-radius:var(--r-pill);padding:7px 12px;font-size:12px;font-weight:600;
  color:var(--ink-2);white-space:nowrap;flex:0 0 auto}
.known-switch:active{background:var(--surface-2)}

/* ---------- صفحهٔ پروندهٔ من ---------- */
.plain-topbar{position:sticky;top:0;z-index:40;border-bottom:1px solid var(--line);
  background:color-mix(in srgb,var(--bg) 88%,transparent);
  backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.plain-topbar-inner{max-width:640px;height:62px;margin:auto;padding:0 16px;
  display:flex;align-items:center;gap:11px}
.plain-back{width:40px;height:40px;flex:0 0 40px;border:1px solid var(--line);
  border-radius:13px;background:var(--surface);display:grid;place-items:center;
  font-size:21px;line-height:1;box-shadow:var(--shadow-xs)}
.plain-logo-mark{position:relative;width:40px;height:40px;flex:0 0 40px;border-radius:13px;
  background:#050505;overflow:hidden;border:1px solid rgba(255,255,255,.1);box-shadow:var(--shadow-xs)}
.plain-logo-mark img{position:absolute;left:50%;top:50%;width:235%;height:auto;max-width:none;
  transform:translate(-50%,-51.6%)}
.plain-title{display:flex;flex-direction:column;gap:1px;min-width:0}
.plain-title b{font-size:15px;font-weight:800}
.plain-title small{font-size:11px;color:var(--ink-3)}

.profile-shell{max-width:640px;margin:auto;padding:18px 16px 48px;display:grid;gap:14px}
.profile-hero{display:grid;gap:4px;padding:2px}
.profile-hero h1{font-size:clamp(22px,6vw,30px)}
.profile-hero p{margin:0;color:var(--ink-2);font-size:13px}
.profile-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.profile-stat{padding:12px 10px;border:1px solid var(--line);border-radius:var(--r);
  background:var(--surface);box-shadow:var(--shadow-xs);text-align:center}
.profile-stat b{display:block;font-size:16px;font-weight:800;font-variant-numeric:tabular-nums;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.profile-stat small{display:block;margin-top:3px;font-size:11px;color:var(--ink-3)}

.profile-card{padding:15px;border:1px solid var(--line);border-radius:var(--r-lg);
  background:var(--surface);box-shadow:var(--shadow-xs);display:grid;gap:11px}
.profile-card>header{display:grid;gap:3px}
.profile-card>header b{font-size:14px;font-weight:800}
.profile-card>header small{font-size:12px;color:var(--ink-2)}
.bd-selects{display:flex;gap:9px}
.bd-selects select{flex:1;min-width:0;height:46px;padding:0 12px;border:1px solid var(--line-2);
  border-radius:var(--r-sm);background:var(--surface);font-size:14px;appearance:none;
  background-image:linear-gradient(45deg,transparent 49%,var(--ink-3) 50%,transparent 52%),
    linear-gradient(-45deg,transparent 49%,var(--ink-3) 50%,transparent 52%);
  background-size:7px 7px,7px 7px;background-position:left 15px top 21px,left 20px top 21px;
  background-repeat:no-repeat}
.chip-grid{display:flex;flex-wrap:wrap;gap:8px}
.chip{border:1px solid var(--line-2);background:var(--surface);border-radius:var(--r-pill);
  padding:9px 14px;font-size:13px;font-weight:600;color:var(--ink-2);
  transition:background .15s,color .15s,border-color .15s}
.chip[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:#fff}
.chip:active{transform:scale(.97)}
.profile-save{width:100%;padding:14px;border:0;border-radius:var(--r);background:var(--brand);
  color:#fff;font-size:14px;font-weight:800;box-shadow:var(--shadow-sm);
  transition:transform .15s var(--ease)}
.profile-save:active{transform:scale(.99)}
.profile-save:disabled{opacity:.6}
.profile-signout{justify-self:center;border:0;background:transparent;color:var(--ink-3);
  font-size:12px;padding:8px 10px;text-decoration:underline;text-underline-offset:3px}

.profile-empty{display:grid;gap:9px;justify-items:center;text-align:center;padding:38px 16px;
  border:1px dashed var(--line-2);border-radius:var(--r-lg);background:var(--surface)}
.profile-body{display:grid;gap:14px}
.profile-form{display:grid;gap:14px}
.profile-shell>[hidden],.profile-body[hidden]{display:none}
.profile-toast{bottom:26px}
.profile-empty b{font-size:15px;font-weight:800}
.profile-empty p{margin:0;max-width:340px;color:var(--ink-2);font-size:13px;line-height:1.9}
.profile-empty a{margin-top:4px;padding:11px 20px;border-radius:var(--r-pill);
  background:var(--ink);color:#fff;font-size:13px;font-weight:700}

@media(min-width:700px){
  .profile-shell{padding:26px 24px 60px}
  .plain-topbar-inner{height:70px;padding:0 24px}
}
@media(max-width:359px){
  .hello-strip{padding:9px 11px}
  .hello-link{padding:5px 6px;font-size:11px}
  .usual-thumb{width:48px;height:48px;flex-basis:48px}
  .profile-stats{gap:7px}
  .profile-stat{padding:10px 6px}
}

@media(prefers-reduced-motion:reduce){
  *{transition:none!important;animation:none!important;scroll-behavior:auto!important}
}

/* ---------- امضای سازنده — فیل طور ---------- */
.filtor-credit{display:flex;align-items:center;justify-content:center;gap:5px;flex-wrap:wrap;
  font-size:12px;font-weight:500;line-height:2;text-align:center}
.filtor-credit .filtor-heart{width:16px;height:16px;flex:0 0 auto;display:inline-block;
  filter:drop-shadow(0 1px 2px rgba(239,36,64,.35))}
.filtor-credit a{color:inherit;font-weight:800;text-decoration:none;
  border-bottom:1px dashed currentColor;padding-bottom:1px;transition:opacity .2s}
.filtor-credit a:hover{opacity:.72}
@media(prefers-reduced-motion:reduce){.filtor-credit a{transition:none}}
/* فوتر امضا در صفحه‌های سفارش */
.credit-footer{max-width:1180px;margin:22px auto 0;padding:18px 16px 26px;
  border-top:1px solid var(--line);color:var(--ink-3)}
/* در صفحه‌های کوتاه، فوتر به کف پنجره می‌چسبد و وسط صفحه معلق نمی‌ماند.
   نکته: در ستون فلکس، عنصری که margin افقی auto دارد کشیده نمی‌شود؛
   برای همین به همهٔ فرزندها width:100% داده شده تا چیدمان قبلی دست‌نخورده بماند. */
body:has(>.credit-footer){box-sizing:border-box;min-height:100svh;display:flex;flex-direction:column}
body:has(>.credit-footer)>*{width:100%;min-width:0}
body:has(>.credit-footer)>.credit-footer{margin-top:auto}
