/* آی کیک — استایل فروشگاه */
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --milk: #FDF2F4;       /* زمینه: شیرِ صورتی */
  --frost: #FFFFFF;      /* کارت‌ها */
  --cocoa: #3A1F1D;      /* متن */
  --cocoa-2: #6E4E4A;    /* متن کم‌رنگ */
  --berry: #B02E5A;      /* اقدام اصلی */
  --berry-deep: #8C2047;
  --berry-soft: #F7DCE5;
  --pistachio: #6F9150;  /* امتیاز، موفقیت */
  --pistachio-soft: #E6F0DC;
  --butter: #F3C969;     /* برچسب وزن */
  --line: #EBD5DA;
  --danger: #B3261E;
  --radius-lg: 22px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 22px rgba(58, 31, 29, .08);
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  color: var(--cocoa);
  background: var(--milk);
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--berry); }
:focus-visible { outline: 3px solid var(--berry); outline-offset: 2px; border-radius: 6px; }
.num { font-feature-settings: "tnum"; }
.muted { color: var(--cocoa-2); }
.small { font-size: 13px; }
.hidden { display: none !important; }
[dir="ltr"], .ltr { direction: ltr; unicode-bidi: plaintext; text-align: left; }

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

/* ---------------------------------------------------- Top bar + frosting edge */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--berry);
  color: #fff;
  padding: 10px 16px 8px;
}
.topbar::after { /* لبه خامه‌ای */
  content: ""; position: absolute; inset-inline: 0; bottom: -11px; height: 12px;
  background: radial-gradient(circle at 12px -2px, var(--berry) 11px, transparent 12px) 0 0 / 24px 12px repeat-x;
}
.topbar-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.brand { font-weight: 900; font-size: 21px; letter-spacing: -.3px; color: #fff; text-decoration: none; }
.topbar .spacer { flex: 1; }
.top-link { color: #fff; text-decoration: none; font-size: 14px; opacity: .92; display: none; }
@media (min-width: 820px) { .top-link { display: inline; } }

/* ---------------------------------------------------- Layout */
main.page { max-width: 1100px; margin: 0 auto; padding: 26px 16px calc(var(--tab-h) + 28px + var(--safe-b)); }
@media (min-width: 820px) { main.page { padding-bottom: 48px; } }

.hero { padding: 6px 2px 18px; }
.hero h1 { font-size: clamp(28px, 7vw, 46px); font-weight: 900; line-height: 1.25; margin: 0 0 6px; letter-spacing: -.5px; max-width: 16ch; }
.hero p { margin: 0; color: var(--cocoa-2); max-width: 46ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.banner {
  display: flex; gap: 10px; align-items: center;
  background: var(--butter); color: var(--cocoa);
  border-radius: var(--radius); padding: 10px 14px; margin: 0 0 16px; font-weight: 600;
}
.banner.stop { background: var(--berry-soft); color: var(--berry-deep); }

h2.section { font-size: 20px; font-weight: 800; margin: 26px 0 12px; }

/* ---------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 11px 22px; min-height: 46px;
  background: var(--berry); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--berry-deep); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--berry); box-shadow: inset 0 0 0 2px var(--berry); }
.btn.ghost:hover { background: var(--berry-soft); }
.btn.soft { background: var(--berry-soft); color: var(--berry-deep); }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn.danger { background: var(--danger); }
.link-btn { background: none; border: 0; color: var(--berry); cursor: pointer; padding: 4px; font-weight: 600; }

/* ---------------------------------------------------- Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; border: 1.5px solid var(--line); background: var(--frost);
  border-radius: 999px; padding: 7px 15px; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--cocoa); color: #fff; border-color: var(--cocoa); }
.chip small { font-weight: 400; opacity: .75; margin-inline-start: 4px; }

/* ---------------------------------------------------- Product grid */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 980px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; } }
.card {
  background: var(--frost); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow);
  text-decoration: none; color: inherit; display: flex; flex-direction: column; position: relative;
}
.card .ph { aspect-ratio: 1 / 1; background: var(--berry-soft); overflow: hidden; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; }
.card .tag { /* برچسب وزن آویزان */
  position: absolute; top: 10px; inset-inline-start: 10px;
  background: var(--butter); color: var(--cocoa); font-weight: 800; font-size: 13px;
  padding: 3px 10px 3px 12px; border-radius: 6px 999px 999px 6px;
}
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.card .title { font-size: 14px; font-weight: 600; line-height: 1.5; }
.card .price { font-size: 17px; font-weight: 900; color: var(--berry-deep); margin-top: auto; }
.card .price small { font-size: 12px; font-weight: 500; color: var(--cocoa-2); }
.card .feat { position: absolute; top: 10px; inset-inline-end: 10px; background: var(--cocoa); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 99px; }

.empty { text-align: center; padding: 40px 16px; color: var(--cocoa-2); }
.empty .btn { margin-top: 12px; }

/* ---------------------------------------------------- Bottom tabs (mobile) */
.tabs {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--frost); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  text-decoration: none; color: var(--cocoa-2); font-size: 11.5px; font-weight: 600; position: relative;
}
.tabs a svg { width: 24px; height: 24px; }
.tabs a[aria-current="page"] { color: var(--berry); }
.tabs .dot { position: absolute; top: 9px; inset-inline-end: calc(50% - 18px); min-width: 17px; height: 17px; border-radius: 9px; background: var(--berry); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }
@media (min-width: 820px) { .tabs { position: sticky; top: 58px; height: auto; border: 0; background: transparent; max-width: 1100px; margin: 12px auto 0; display: flex; gap: 6px; padding: 0 16px; } .tabs a { flex-direction: row; gap: 6px; font-size: 14px; padding: 6px 12px; border-radius: 99px; } .tabs a[aria-current="page"] { background: var(--frost); } .tabs a svg { width: 18px; height: 18px; } .tabs .dot { position: static; } }

/* ---------------------------------------------------- Forms */
.panel { background: var(--frost); border-radius: var(--radius-lg); padding: 18px 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.panel h3 { margin: 0 0 12px; font-size: 17px; font-weight: 800; }
.panel h3 .step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--berry-soft); color: var(--berry-deep); font-size: 14px; margin-inline-end: 6px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .row2 { grid-template-columns: 1fr 1fr; } }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 14px; }
label .hint { font-weight: 400; color: var(--cocoa-2); font-size: 12.5px; }
input[type="text"], input[type="tel"], input[type="password"], input[type="email"], input[type="number"], input:not([type]), select, textarea {
  width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: var(--radius-sm);
  padding: 10px 12px; min-height: 46px; font-size: 16px; /* جلوگیری از زوم iOS */
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--berry); outline: none; box-shadow: 0 0 0 3px var(--berry-soft); }
.inline { display: flex; gap: 8px; align-items: stretch; }
.inline > input { flex: 1; }
.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--berry); }

.note { border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; margin: 8px 0; }
.note.ok { background: var(--pistachio-soft); color: #33501d; }
.note.bad { background: #FBE3E1; color: var(--danger); }
.note.info { background: var(--berry-soft); color: var(--berry-deep); }

/* option cards (addons, delivery) */
.opts { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 560px) { .opts.two { grid-template-columns: 1fr 1fr; } }
.opt {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: #fff; font-weight: 600; flex-direction: row;
}
.opt input { width: 20px; height: 20px; accent-color: var(--berry); flex: 0 0 auto; }
.opt .grow { flex: 1; }
.opt .p { font-weight: 800; color: var(--berry-deep); white-space: nowrap; font-size: 14px; }
.opt:has(input:checked) { border-color: var(--berry); background: #FFF7FA; }

.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--berry-soft); color: var(--berry-deep); font-size: 24px; font-weight: 800; cursor: pointer; }
.stepper output { font-size: 26px; font-weight: 900; min-width: 110px; text-align: center; }

.days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: thin; }
.day {
  flex: 0 0 auto; width: 86px; border: 1.5px solid var(--line); background: #fff; border-radius: var(--radius);
  padding: 8px 4px; text-align: center; cursor: pointer; line-height: 1.4;
}
.day b { display: block; font-size: 20px; font-weight: 900; }
.day span { font-size: 12px; color: var(--cocoa-2); }
.day em { display: block; font-style: normal; font-size: 10.5px; color: var(--danger); }
.day[aria-pressed="true"] { background: var(--cocoa); border-color: var(--cocoa); color: #fff; }
.day[aria-pressed="true"] span { color: #f3dcd8; }
.day:disabled { opacity: .55; cursor: not-allowed; background: #faf5f6; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.slot { border: 1.5px solid var(--line); background: #fff; border-radius: var(--radius-sm); padding: 8px 0; cursor: pointer; font-weight: 700; }
.slot[aria-pressed="true"] { background: var(--berry); color: #fff; border-color: var(--berry); }

.uploader { border: 2px dashed var(--line); border-radius: var(--radius); padding: 14px; text-align: center; cursor: pointer; background: #fffafb; position: relative; font-weight: 500; }
.uploader input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.uploader img { max-height: 180px; margin: 8px auto 0; border-radius: var(--radius-sm); }

/* ---------------------------------------------------- Order page */
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.order-layout > * { min-width: 0; }
@media (min-width: 900px) { .order-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } .order-layout .summary { position: sticky; top: 120px; } }
.cake-head { display: flex; gap: 14px; align-items: center; }
.cake-head img { width: 96px; height: 96px; border-radius: var(--radius); object-fit: cover; flex: 0 0 auto; }
.cake-head h2 { font-size: 18px; margin: 0; line-height: 1.5; }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 14px; }
.lines li.minus span:last-child { color: var(--pistachio); }
.lines li.total { border-top: 1.5px dashed var(--line); margin-top: 6px; padding-top: 10px; font-size: 18px; font-weight: 900; }
.paybar {
  position: fixed; inset-inline: 0; bottom: calc(var(--tab-h) + var(--safe-b)); z-index: 35;
  background: var(--cocoa); color: #fff; padding: 10px 16px; display: flex; align-items: center; gap: 12px;
}
.paybar .t { flex: 1; line-height: 1.3; }
.paybar .t b { font-size: 19px; font-weight: 900; display: block; }
.paybar .btn { background: var(--butter); color: var(--cocoa); }
@media (min-width: 900px) { .paybar { display: none; } }
.summary .btn.submit { display: none; }
@media (min-width: 900px) { .summary .btn.submit { display: flex; } }

/* ---------------------------------------------------- Payment / track */
.cardbox {
  background: linear-gradient(135deg, var(--cocoa), #5b302c); color: #fff; border-radius: 18px; padding: 18px; margin: 10px 0;
}
.cardbox .no { font-size: 22px; font-weight: 800; letter-spacing: 2px; direction: ltr; text-align: center; margin: 8px 0; }
.bigcode { font-size: 34px; font-weight: 900; letter-spacing: 3px; color: var(--berry-deep); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 26px 14px 0; }
.timeline li::before { content: ""; position: absolute; right: 6px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--berry); }
.timeline li::after { content: ""; position: absolute; right: 11px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline b { display: block; }
.status-pill { display: inline-block; border-radius: 99px; padding: 2px 12px; font-size: 13px; font-weight: 700; background: var(--berry-soft); color: var(--berry-deep); }
.status-pill.delivered, .status-pill.confirmed, .status-pill.ready { background: var(--pistachio-soft); color: #33501d; }
.status-pill.cancelled { background: #eee; color: #666; }

/* ---------------------------------------------------- Account */
.acc-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.avatar { width: 54px; height: 54px; border-radius: 50%; background: var(--butter); display: grid; place-items: center; font-weight: 900; font-size: 22px; }
.points {
  background: var(--pistachio); color: #fff; border-radius: var(--radius-lg); padding: 16px 18px; display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px;
}
.points b { font-size: 40px; font-weight: 900; line-height: 1; }
.subtabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
.subtabs button { flex: 0 0 auto; border: 0; background: transparent; padding: 8px 14px; border-radius: 99px; font-weight: 700; color: var(--cocoa-2); cursor: pointer; }
.subtabs button[aria-selected="true"] { background: var(--frost); color: var(--berry-deep); box-shadow: var(--shadow); }
.olist { display: flex; flex-direction: column; gap: 10px; }
.oitem { background: var(--frost); border-radius: var(--radius); padding: 12px 14px; display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.oitem img { width: 58px; height: 58px; border-radius: 10px; object-fit: cover; }
.oitem .grow { flex: 1; min-width: 0; }
.notif { border-inline-start: 4px solid var(--berry); }
.notif.read { border-color: var(--line); }
.divider-or { text-align: center; color: var(--cocoa-2); margin: 14px 0; font-size: 13px; }

/* ---------------------------------------------------- Toast & sheet */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + 78px + var(--safe-b)); z-index: 90;
  background: var(--cocoa); color: #fff; padding: 10px 18px; border-radius: 99px; font-weight: 600; max-width: 92vw; text-align: center;
  animation: toast .25s ease-out;
}
.toast.bad { background: var(--danger); }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 10px); } }
.loading { text-align: center; padding: 40px; color: var(--cocoa-2); }
.spin { width: 28px; height: 28px; border: 3px solid var(--berry-soft); border-top-color: var(--berry); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

footer.site { text-align: center; color: var(--cocoa-2); font-size: 13px; padding: 10px 16px 30px; }

/* ---------------------------------------------------- Builder promo */
.promo {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
  background: var(--cocoa); color: #fff; border-radius: var(--radius-lg); padding: 18px; margin: 18px 0 6px; text-decoration: none;
}
.promo h3 { margin: 0 0 2px; font-size: 18px; font-weight: 800; }
.promo p { margin: 0; color: #e8d3cf; font-size: 14px; }
.promo .btn { background: var(--butter); color: var(--cocoa); }

/* ---------------------------------------------------- Install */
body.install { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.install-card { background: #fff; padding: 24px; border-radius: var(--radius-lg); box-shadow: var(--shadow); width: min(420px, 100%); }
.install-card h1 { margin-top: 0; }

/* ---------------------------------------------------- 3D Builder */
body.builder { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--milk); }
body.builder .topbar::after { display: none; }
.bld { flex: 1; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); }
.bld > * { min-width: 0; }
@media (min-width: 900px) { .bld { grid-template-rows: minmax(0, 1fr); grid-template-columns: 400px minmax(0, 1fr); } .bld .stage { order: 2; } }
.stage { position: relative; min-height: 38vh; touch-action: none; cursor: grab; }
.stage:active { cursor: grabbing; }
.stage canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.stage .hintbar { position: absolute; bottom: 10px; inset-inline: 0; text-align: center; font-size: 12px; color: var(--cocoa-2); pointer-events: none; }
.stage .reset { position: absolute; top: 10px; inset-inline-start: 10px; }
.ctrl { background: var(--frost); border-radius: 22px 22px 0 0; box-shadow: 0 -8px 24px rgba(58,31,29,.08); display: flex; flex-direction: column; min-height: 0; max-height: 52dvh; }
@media (min-width: 900px) { .ctrl { border-radius: 0; max-height: none; box-shadow: -8px 0 24px rgba(58,31,29,.06); } }
.ctrl .steps { display: flex; gap: 4px; overflow-x: auto; padding: 10px 10px 6px; scrollbar-width: none; flex: 0 0 auto; }
.ctrl .steps::-webkit-scrollbar { display: none; }
.ctrl .steps button { flex: 0 0 auto; border: 0; background: transparent; padding: 7px 13px; border-radius: 99px; font-weight: 700; color: var(--cocoa-2); cursor: pointer; }
.ctrl .steps button[aria-selected="true"] { background: var(--cocoa); color: #fff; }
.ctrl .pane { overflow-y: auto; padding: 6px 14px 14px; flex: 1; min-height: 0; }
.ctrl .pane h4 { margin: 10px 0 6px; font-size: 14px; }
.sw { display: flex; flex-wrap: wrap; gap: 10px; }
.sw button { border: 0; background: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--cocoa); width: 64px; }
.sw .dotc { width: 44px; height: 44px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); display: grid; place-items: center; font-size: 22px; background: #f6eef0; }
.sw button[aria-pressed="true"] .dotc { box-shadow: 0 0 0 3px var(--frost), 0 0 0 5px var(--berry); }
.tops { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tops .opt { font-size: 14px; padding: 8px 10px; }
.bld-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--frost); flex: 0 0 auto; }
.bld-foot .t { flex: 1; line-height: 1.3; }
.bld-foot .t b { font-size: 18px; font-weight: 900; display: block; color: var(--berry-deep); }
