/* ── Reset & base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cream:      #FDF8F2;
  --cream2:     #F4EBD9;
  --cream3:     #EBD9BE;
  --brown:      #2C1810;
  --brown-mid:  #6B3A25;
  --amber:      #C8703A;
  --amber-dark: #A85528;
  --gold:       #D4A853;
  --gold-lt:    #F0D898;
  --white:      #FFFFFF;
  --gray:       #9A8A7A;
  --gray-lt:    #E4D8C8;
  --green:      #4CAF50;
  --red:        #E53935;

  --header-h:   58px;
  --search-h:   52px;
  --promo-h:    32px;
  --tabs-h:     50px;
  --r:          14px;
  --r-sm:       10px;
  --shadow:     0 2px 12px rgba(44,24,16,.10);
  --shadow-lg:  0 8px 32px rgba(44,24,16,.18);
}

html, body {
  height: 100%; width: 100%;
  background: var(--cream);
  color: var(--brown);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* Telegram theme overrides */
body {
  background: var(--tg-theme-bg-color, var(--cream));
  color: var(--tg-theme-text-color, var(--brown));
}

/* ── Header ────────────────────────────────────────────────────── */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: var(--tg-theme-bg-color, var(--cream));
  border-bottom: 1px solid var(--gray-lt);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-brand { display: flex; flex-direction: column; gap: 1px; }
.header-logo {
  font-family: 'Great Vibes', cursive;
  font-size: 27px; line-height: 1;
  color: var(--brown);
  letter-spacing: .3px;
}
.header-sub {
  font-size: 9px; font-weight: 600;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--amber); line-height: 1;
}

.header-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--cream2);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--brown-mid);
  position: relative;
  transition: transform .12s, background .15s;
}
.icon-btn:active { transform: scale(.91); }

.fav-dot {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--cream);
}

.cart-pill {
  height: 36px; padding: 0 12px;
  border-radius: 50px;
  background: var(--amber); color: var(--white);
  border: none; cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  font-family: 'Inter', sans-serif;
  font-size: 14px; font-weight: 700;
  transition: transform .12s, background .15s;
  box-shadow: 0 2px 8px rgba(200,112,58,.35);
}
.cart-pill:active { transform: scale(.95); background: var(--amber-dark); }

/* ── Page body ─────────────────────────────────────────────────── */
.page-body {
  position: fixed;
  top: var(--header-h); left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--tg-theme-bg-color, var(--cream));
}

/* ── Search bar ────────────────────────────────────────────────── */
.search-bar {
  max-height: 0; overflow: hidden;
  background: var(--tg-theme-bg-color, var(--cream));
  transition: max-height .22s ease;
  border-bottom: 0 solid var(--gray-lt);
}
.search-bar.open {
  max-height: var(--search-h);
  border-bottom-width: 1px;
}
.search-inner {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  color: var(--gray);
  cursor: text;
}
.search-inner input {
  flex: 1; border: none; background: none;
  font-family: 'Inter', sans-serif; font-size: 15px;
  color: var(--tg-theme-text-color, var(--brown));
  outline: none; caret-color: var(--amber);
}
.search-inner input::placeholder { color: var(--gray); }
.search-clear {
  background: none; border: none; cursor: pointer;
  color: var(--gray); display: flex; padding: 4px;
  transition: color .15s;
}
.search-clear:active { color: var(--brown); }

/* ── Promo strip ───────────────────────────────────────────────── */
.promo-strip {
  height: var(--promo-h);
  background: linear-gradient(90deg, var(--brown) 0%, var(--brown-mid) 100%);
  overflow: hidden;
  display: flex; align-items: center;
}
.promo-track {
  display: flex; white-space: nowrap;
  animation: marquee 28s linear infinite;
}
.promo-track span {
  font-size: 11px; font-weight: 600;
  color: var(--gold-lt);
  letter-spacing: .2px;
  padding: 0 28px;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Tabs ──────────────────────────────────────────────────────── */
.tabs-wrap {
  position: sticky; top: 0; z-index: 50;
  background: var(--tg-theme-bg-color, var(--cream));
  border-bottom: 1px solid var(--gray-lt);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  height: var(--tabs-h);
}
.tabs-wrap::-webkit-scrollbar { display: none; }
.tabs {
  display: flex; gap: 6px;
  padding: 10px 12px;
  width: max-content;
}
.tab {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 14px;
  border-radius: 50px;
  border: 1.5px solid var(--gray-lt);
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--gray);
  cursor: pointer; white-space: nowrap;
  transition: all .16s;
}
.tab.active {
  background: var(--brown);
  border-color: var(--brown);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(44,24,16,.22);
}
.tab-fav.active {
  background: var(--red);
  border-color: var(--red);
}

/* ── Products grid ─────────────────────────────────────────────── */
.products {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 14px 10px 130px;
}

/* ── Product card ──────────────────────────────────────────────── */
.product-card {
  background: var(--white);
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
  position: relative;
  animation: slideUp .28s ease both;
}
.product-card:active { opacity: .88; transform: scale(.98); }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* staggered entrance */
.product-card:nth-child(1)  { animation-delay: .00s; }
.product-card:nth-child(2)  { animation-delay: .04s; }
.product-card:nth-child(3)  { animation-delay: .08s; }
.product-card:nth-child(4)  { animation-delay: .12s; }
.product-card:nth-child(5)  { animation-delay: .16s; }
.product-card:nth-child(6)  { animation-delay: .20s; }
.product-card:nth-child(7)  { animation-delay: .24s; }
.product-card:nth-child(8)  { animation-delay: .28s; }

.card-img-wrap {
  position: relative; aspect-ratio: 4/3; overflow: hidden;
}
.card-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 46px;
}
.card-img-wrap img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .4s;
}
.card-img-wrap img.loaded { opacity: 1; }
.card-veil {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 35%, rgba(44,24,16,.55) 100%);
  pointer-events: none;
}

.card-fav {
  position: absolute; top: 7px; left: 7px; z-index: 2;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.88);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s;
}
.card-fav:active { transform: scale(.86); }
.card-fav svg { transition: fill .15s, stroke .15s; }
.card-fav.active svg { fill: var(--red); stroke: var(--red); }

.card-badge {
  position: absolute; top: 7px; right: 7px; z-index: 2;
  padding: 3px 7px; border-radius: 50px;
  font-size: 9px; font-weight: 700; letter-spacing: .5px;
}
.badge-hit  { background: var(--gold); color: var(--brown); }
.badge-new  { background: var(--green); color: var(--white); }

.card-body  { padding: 9px 10px 10px; }
.card-name  {
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px; font-weight: 700;
  line-height: 1.25; color: var(--brown);
  margin-bottom: 7px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot  { display: flex; align-items: center; justify-content: space-between; }
.card-price { font-size: 14px; font-weight: 700; color: var(--amber); }

.card-add {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--amber); color: var(--white);
  border: none; font-size: 22px; font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; line-height: 1;
  box-shadow: 0 2px 6px rgba(200,112,58,.35);
  transition: transform .12s, background .15s;
}
.card-add:active { transform: scale(.86); background: var(--amber-dark); }

.card-stepper { display: flex; align-items: center; gap: 5px; }
.card-dec, .card-inc {
  width: 26px; height: 26px; border-radius: 50%;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; line-height: 1;
  transition: transform .12s;
}
.card-dec:active, .card-inc:active { transform: scale(.86); }
.card-dec { background: var(--cream2); color: var(--brown); }
.card-inc  { background: var(--amber); color: var(--white); }
.card-qty  { font-size: 14px; font-weight: 700; min-width: 16px; text-align: center; color: var(--brown); }

/* ── Empty / search states ─────────────────────────────────────── */
.state-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px 40px;
  color: var(--gray);
}
.state-empty .icon { font-size: 52px; opacity: .4; margin-bottom: 14px; }
.state-empty .title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px; font-weight: 700;
  color: var(--brown); margin-bottom: 6px;
}
.state-empty .sub { font-size: 13px; line-height: 1.5; }

/* ── Product modal ─────────────────────────────────────────────── */
.modal-bg {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.55);
  opacity: 0; pointer-events: none;
  transition: opacity .22s;
  display: flex; align-items: flex-end;
}
.modal-bg.open { opacity: 1; pointer-events: all; }

.product-modal {
  width: 100%;
  background: var(--tg-theme-bg-color, var(--cream));
  border-radius: 22px 22px 0 0;
  max-height: 88vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.32,.72,0,1);
  padding-bottom: max(env(safe-area-inset-bottom), 20px);
}
.modal-bg.open .product-modal { transform: translateY(0); }

.modal-hero {
  position: relative; height: 220px; overflow: hidden;
  border-radius: 22px 22px 0 0;
}
.modal-hero-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 72px;
}
#modalImg {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.modal-close-btn {
  position: absolute; top: 12px; left: 12px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0,0,0,.48); color: var(--white);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.modal-close-btn:active { background: rgba(0,0,0,.7); }
.modal-fav-btn {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.88);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s;
}
.modal-fav-btn:active { transform: scale(.86); }
.modal-fav-btn.active svg { fill: var(--red); stroke: var(--red); }

.modal-content { padding: 18px 18px 8px; }

.modal-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.modal-badge {
  padding: 4px 10px; border-radius: 50px;
  font-size: 10px; font-weight: 700; letter-spacing: .4px;
}
.mb-hit { background: rgba(212,168,83,.18); color: #9A7030; }
.mb-new { background: rgba(76,175,80,.14); color: #2E7D32; }

.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px; font-weight: 700;
  color: var(--brown); margin-bottom: 10px; line-height: 1.2;
}
.modal-desc {
  font-size: 13px; line-height: 1.65;
  color: var(--gray); margin-bottom: 12px;
}
.modal-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 18px; }
.modal-tag {
  padding: 4px 10px; border-radius: 50px;
  background: var(--cream2);
  font-size: 11px; font-weight: 500; color: var(--brown-mid);
}
.modal-actions {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--gray-lt);
}
.modal-price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px; font-weight: 700; color: var(--amber);
}
.modal-qty { display: flex; align-items: center; gap: 12px; }
.qty-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--cream2); color: var(--brown);
  border: none; font-size: 22px; font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; line-height: 1;
  transition: transform .12s, background .15s;
}
.qty-btn:active { transform: scale(.86); }
.qty-plus { background: var(--amber); color: var(--white); box-shadow: 0 2px 8px rgba(200,112,58,.35); }
.qty-plus:active { background: var(--amber-dark); }
.qty-num { font-size: 22px; font-weight: 700; min-width: 26px; text-align: center; color: var(--brown); }

/* ── Cart drawer ───────────────────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,.42);
  opacity: 0; pointer-events: none;
  transition: opacity .22s;
}
.drawer-overlay.show { opacity: 1; pointer-events: all; }

.cart-drawer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 160;
  background: var(--tg-theme-bg-color, var(--cream));
  border-radius: 22px 22px 0 0;
  max-height: 84vh;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.32,.72,0,1);
  padding-bottom: max(env(safe-area-inset-bottom), 8px);
}
.cart-drawer.open { transform: translateY(0); }

.drawer-pill {
  width: 34px; height: 4px; border-radius: 2px;
  background: var(--gray-lt); margin: 11px auto 3px;
}
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px 12px;
  border-bottom: 1px solid var(--gray-lt);
}
.drawer-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 700; color: var(--brown);
}
.btn-clear {
  background: none; border: none;
  color: var(--red); font-size: 13px; font-weight: 600;
  cursor: pointer; padding: 4px 2px;
}

.drawer-items { overflow-y: auto; flex: 1; }

.drawer-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(44,24,16,.05);
}
.di-thumb {
  width: 50px; height: 50px; border-radius: var(--r-sm);
  overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.di-info { flex: 1; min-width: 0; }
.di-name { font-size: 13px; font-weight: 600; color: var(--brown); line-height: 1.3; }
.di-price { font-size: 12px; color: var(--gray); margin-top: 2px; }
.di-controls { display: flex; align-items: center; gap: 7px; }
.di-btn {
  width: 27px; height: 27px; border-radius: 50%;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; line-height: 1;
  transition: transform .12s;
}
.di-btn:active { transform: scale(.86); }
.di-minus { background: var(--cream2); color: var(--brown); }
.di-plus  { background: var(--amber); color: var(--white); }
.di-qty   { font-size: 14px; font-weight: 700; min-width: 16px; text-align: center; color: var(--brown); }

.cart-empty {
  text-align: center; padding: 44px 20px;
}
.cart-empty .icon  { font-size: 50px; opacity: .35; margin-bottom: 12px; }
.cart-empty .title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px; font-weight: 700; color: var(--brown); margin-bottom: 4px;
}
.cart-empty .sub   { font-size: 13px; color: var(--gray); }

/* Note field */
.drawer-note-wrap { padding: 10px 14px; border-top: 1px solid var(--gray-lt); }
.drawer-note {
  width: 100%; border: 1.5px solid var(--gray-lt);
  border-radius: var(--r-sm); padding: 9px 11px;
  font-family: 'Inter', sans-serif; font-size: 13px;
  color: var(--tg-theme-text-color, var(--brown));
  background: var(--cream2);
  resize: none; outline: none;
  transition: border-color .15s;
}
.drawer-note:focus { border-color: var(--amber); }

/* Footer */
.drawer-foot { padding: 13px 16px 10px; border-top: 1px solid var(--gray-lt); }
.foot-row { display: flex; align-items: center; justify-content: space-between; }
.foot-label { font-size: 13px; color: var(--gray); margin-bottom: 2px; }
.foot-delivery { font-size: 11px; font-weight: 600; color: var(--amber); }
.foot-total {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px; font-weight: 700; color: var(--amber);
}

/* ── Unavailable (под заказ) ───────────────────────────────────── */
.card-unavail {
  opacity: .6;
}
.card-unavail .card-img-wrap::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(240,230,220,.38);
  pointer-events: none;
}

.badge-preorder {
  background: rgba(44,24,16,.72);
  color: var(--gold-lt);
  backdrop-filter: blur(4px);
}

.price-unavail { color: var(--gray); }

.card-preorder-btn {
  height: 28px; padding: 0 10px;
  border-radius: 50px;
  background: transparent;
  border: 1.5px solid var(--gray-lt);
  color: var(--gray);
  font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.card-preorder-btn:active { border-color: var(--amber); color: var(--amber); }

/* Modal pre-order badge */
.mb-preorder { background: rgba(44,24,16,.1); color: var(--brown-mid); }

/* Modal pre-order notice */
.modal-preorder-note {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--cream2);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--amber);
  font-size: 13px; line-height: 1.55;
  color: var(--brown-mid);
}

/* ── Pop animation for add button ──────────────────────────────── */
@keyframes pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.22); }
  100% { transform: scale(1); }
}
.popping { animation: pop .18s ease; }

/* ── Back bar (catalog header) ─────────────────────────────────── */
.back-bar {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; cursor: pointer;
  color: var(--brown);
  padding: 4px 0;
  font-family: 'Inter', sans-serif;
  font-size: 17px; font-weight: 700;
  transition: opacity .15s;
  min-width: 0;
}
.back-bar:active { opacity: .65; }
.back-bar svg    { flex-shrink: 0; color: var(--amber); }
#backBarTitle    { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Home view ─────────────────────────────────────────────────── */
#homeView {
  display: flex; flex-direction: column;
  min-height: calc(100vh - var(--header-h));
}

.home-intro {
  padding: 22px 18px 8px;
}
.home-intro-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px; font-weight: 700;
  color: var(--brown); line-height: 1.2;
}
.home-intro-sub {
  font-size: 13px; color: var(--gray); margin-top: 4px;
}

.home-avail-cards {
  display: flex; flex-direction: column; gap: 12px;
  padding: 12px 14px 24px;
  flex: 1;
}

.avail-card {
  width: 100%;
  display: flex; align-items: center; gap: 16px;
  background: var(--white);
  border-radius: 20px;
  padding: 22px 18px;
  border: none; cursor: pointer; text-align: left;
  box-shadow: var(--shadow);
  transition: transform .13s, box-shadow .15s;
  position: relative; overflow: hidden;
}
.avail-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(200,112,58,.06) 0%, transparent 60%);
  pointer-events: none;
}
.avail-card:active { transform: scale(.98); box-shadow: 0 1px 5px rgba(44,24,16,.08); }

.avail-card-pre {
  background: var(--cream2);
  box-shadow: 0 2px 10px rgba(44,24,16,.07);
}
.avail-card-pre::before { display: none; }

.avail-card-icon {
  font-size: 42px; flex-shrink: 0; line-height: 1;
}
.avail-card-body { flex: 1; min-width: 0; }
.avail-card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 700;
  color: var(--brown); line-height: 1.2;
}
.avail-card-sub {
  font-size: 13px; color: var(--gray); margin-top: 4px;
}
.avail-card-arrow { color: var(--gray-lt); flex-shrink: 0; }
.avail-card:active .avail-card-arrow { color: var(--amber); }

/* ── Checkout button in cart drawer ───────────────────────────── */
.checkout-btn {
  width: 100%; height: 50px;
  margin-top: 12px; border-radius: 14px;
  background: var(--amber); color: var(--white);
  border: none; font-family: 'Inter', sans-serif;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(200,112,58,.38);
  transition: background .15s, transform .12s;
}
.checkout-btn:active { transform: scale(.98); background: var(--amber-dark); }

/* ── Checkout overlay ──────────────────────────────────────────── */
.co-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: var(--cream);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.co-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-lt);
  flex-shrink: 0;
  min-height: 54px;
}
.co-back-btn, .co-close-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--cream2); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--brown-mid);
  transition: background .15s, transform .12s;
  flex-shrink: 0;
}
.co-back-btn:active, .co-close-btn:active { transform: scale(.9); background: var(--cream3); }

.co-dots { display: flex; gap: 7px; align-items: center; }
.co-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gray-lt);
  transition: background .22s, transform .22s;
}
.co-dot.active { background: var(--amber); transform: scale(1.25); }
.co-dot.done   { background: var(--amber-dark); }

/* Body — scrollable */
.co-body {
  flex: 1; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 max(env(safe-area-inset-bottom), 24px);
}

/* Individual screens */
.co-screen {
  display: flex; flex-direction: column;
  padding: 28px 20px 24px;
  min-height: 100%;
  animation: coFadeIn .18s ease both;
}
.co-screen-center { align-items: center; justify-content: center; text-align: center; }
.co-screen-summary { padding-bottom: 16px; }

@keyframes coFadeIn {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}

.co-s-icon { font-size: 52px; margin-bottom: 14px; }
.co-s-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px; font-weight: 700;
  color: var(--brown); margin-bottom: 6px;
}
.co-s-hint { font-size: 13px; color: var(--gray); margin-bottom: 22px; }

/* Choices (delivery type) */
.co-choices { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.co-choice {
  width: 100%; display: flex; align-items: center; gap: 14px;
  background: var(--white); border: 1.5px solid var(--gray-lt);
  border-radius: 18px; padding: 18px 16px;
  cursor: pointer; text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .12s;
  box-shadow: 0 1px 6px rgba(44,24,16,.07);
}
.co-choice:active { transform: scale(.98); border-color: var(--amber); box-shadow: 0 2px 12px rgba(200,112,58,.2); }
.co-ch-icon  { font-size: 32px; flex-shrink: 0; }
.co-ch-text  { flex: 1; }
.co-ch-title { font-size: 17px; font-weight: 700; color: var(--brown); }
.co-ch-sub   { font-size: 12px; color: var(--gray); margin-top: 2px; }
.co-ch-arrow { color: var(--gray-lt); flex-shrink: 0; }

/* Input */
.co-input {
  width: 100%; height: 52px; border-radius: 14px;
  border: 1.5px solid var(--gray-lt);
  background: var(--white);
  padding: 0 16px;
  font-family: 'Inter', sans-serif; font-size: 16px;
  color: var(--brown); outline: none;
  margin-bottom: 16px;
  transition: border-color .15s;
  box-shadow: 0 1px 5px rgba(44,24,16,.06);
}
.co-input:focus { border-color: var(--amber); }
.co-input::placeholder { color: var(--gray); }

/* CTA button */
.co-cta {
  width: 100%; height: 52px; border-radius: 14px;
  background: var(--amber); color: var(--white);
  border: none; font-family: 'Inter', sans-serif;
  font-size: 16px; font-weight: 700; cursor: pointer;
  box-shadow: 0 2px 10px rgba(200,112,58,.35);
  transition: background .15s, transform .12s;
}
.co-cta:active { background: var(--amber-dark); transform: scale(.98); }

/* Shake animation for invalid input */
@keyframes coShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.co-shake {
  animation: coShake .22s ease;
  border-color: var(--red) !important;
}

/* Order summary */
.co-summary-box {
  background: var(--white);
  border-radius: 18px; overflow: hidden;
  margin-bottom: 18px;
  box-shadow: 0 1px 8px rgba(44,24,16,.08);
}
.co-sum-items { padding: 14px 16px 0; }
.co-sum-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; color: var(--brown); padding: 7px 16px;
}
.co-sum-row > span:first-child { flex: 1; padding-right: 12px; }
.co-sum-row > span:last-child  { font-weight: 600; white-space: nowrap; }
.co-sum-divider { height: 1px; background: var(--gray-lt); margin: 4px 16px; }
.co-sum-total { font-size: 17px !important; font-weight: 700 !important; padding-bottom: 14px; }
.co-sum-total span:last-child { color: var(--amber); font-size: 20px; }
.co-sum-meta { padding: 12px 16px; background: var(--cream2); border-top: 1px solid var(--gray-lt); }
.co-sum-meta-row { font-size: 12px; color: var(--gray); padding: 2px 0; }

/* Payment buttons */
.co-pay-btns { display: flex; flex-direction: column; gap: 10px; }
.co-pay-btn {
  width: 100%; height: 52px; border-radius: 14px;
  border: none; font-family: 'Inter', sans-serif;
  font-size: 16px; font-weight: 700; cursor: pointer;
  transition: background .15s, transform .12s;
}
.co-pay-btn:active { transform: scale(.98); }
.co-pay-online {
  background: var(--brown); color: var(--white);
  box-shadow: 0 2px 10px rgba(44,24,16,.28);
}
.co-pay-online:active { background: rgba(44,24,16,.82); }
.co-pay-cash {
  background: var(--cream2); color: var(--brown);
  border: 1.5px solid var(--gray-lt);
}
.co-pay-cash:active { background: var(--cream3); }

/* Payment card animation */
.co-card {
  width: 280px; background: linear-gradient(135deg, var(--brown) 0%, var(--brown-mid) 100%);
  border-radius: 18px; padding: 22px 24px 20px;
  margin-bottom: 30px;
  box-shadow: 0 8px 28px rgba(44,24,16,.35);
}
.co-card-chip {
  width: 36px; height: 28px; border-radius: 6px;
  background: var(--gold);
  margin-bottom: 20px;
}
.co-card-number {
  font-family: 'Courier New', monospace;
  font-size: 17px; color: rgba(255,255,255,.9);
  letter-spacing: 2px; margin-bottom: 14px;
}
.co-card-meta {
  display: flex; justify-content: space-between;
  font-size: 13px; color: rgba(255,255,255,.65);
  letter-spacing: 1px;
}
.co-pay-status {
  font-size: 15px; font-weight: 600; color: var(--brown);
  margin-bottom: 16px; text-align: center;
}
.co-prog-wrap {
  width: 220px; height: 6px; border-radius: 3px;
  background: var(--gray-lt); overflow: hidden;
}
.co-prog-fill {
  height: 100%; border-radius: 3px;
  background: var(--amber);
  width: 0; transition: width .55s ease, background .35s;
}

/* Success screen */
.co-success-icon {
  font-size: 72px; margin-bottom: 16px;
  animation: coPopIn .4s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes coPopIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.co-success-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px; font-weight: 700; color: var(--brown); margin-bottom: 20px;
}
.co-success-details { margin-bottom: 24px; }
.co-suc-row {
  font-size: 14px; color: var(--gray); padding: 4px 0; text-align: center;
}
.co-suc-total { font-size: 20px; font-weight: 700; color: var(--amber); margin-top: 10px; }
.co-close-hint { font-size: 12px; color: var(--gray-lt); font-style: italic; }
