/* ─── WEB SAVATCHA / CHECKOUT ─────────────────────────────────────────────── */

/* ─── Navbar cart ─────────────────────────────────────────────────────────── */
.nav-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--muted);
  transition: color .2s, background .2s;
}
.nav-cart:hover, .nav-cart.active { color: var(--brand); background: var(--brand-soft); }
.nav-cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.nav-cart-badge.is-hidden { display: none; }

/* ─── Layout ──────────────────────────────────────────────────────────────── */
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  align-items: start;
}
.cart-items-col   { min-width: 0; }
.cart-summary-col { position: sticky; top: calc(var(--nav-h) + 16px); }

/* ─── Restoran head ───────────────────────────────────────────────────────── */
.cart-resto-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.cart-resto-name { font-size: 22px; font-weight: 800; margin-bottom: 6px; }

/* ─── Free delivery ───────────────────────────────────────────────────────── */
.free-delivery-bar {
  background: rgba(245,200,66,.1);
  border: 1px solid rgba(245,200,66,.3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 18px;
}
.free-delivery-bar strong { color: var(--accent); }

/* ─── Cart items ──────────────────────────────────────────────────────────── */
.cart-items { display: flex; flex-direction: column; gap: 12px; }
.cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
}
.cart-item.is-static { padding: 10px 12px; }
.cart-item-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.cart-item-img-placeholder {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: var(--card2);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.cart-item-body { flex: 1; min-width: 0; }
.cart-item-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.cart-item-weight { font-size: 12px; color: var(--muted); }
.cart-item-price { font-size: 14px; font-weight: 700; color: var(--accent); }
.cart-item-bottom { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.cart-item-remove {
  background: none;
  border: none;
  color: var(--red);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 10px 4px;
}
.cart-item-remove:hover { opacity: .8; }
.cart-item-total { font-size: 16px; font-weight: 800; white-space: nowrap; }

/* ─── Bonus ───────────────────────────────────────────────────────────────── */
.bonus-box {
  background: rgba(76,175,80,.08);
  border: 1px solid rgba(76,175,80,.3);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 16px;
}
.bonus-box h3 { font-size: 15px; margin-bottom: 8px; }
.bonus-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 4px 0; }
.bonus-free {
  display: inline-block;
  background: rgba(76,175,80,.15);
  color: #2e7d32;
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 10px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ─── Summary card ────────────────────────────────────────────────────────── */
.cart-summary-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.summary-title { font-size: 20px; font-weight: 800; margin-bottom: 16px; }
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 15px;
}
.summary-row.summary-total {
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 14px;
  font-size: 18px;
  font-weight: 800;
}
.summary-total span:last-child { color: var(--accent); }
.summary-delivery-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }

/* ─── Checkout form ───────────────────────────────────────────────────────── */
.checkout-form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 14px; font-weight: 600; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group input[type="text"],
.form-group input[type="tel"],
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  transition: border-color .2s;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-hint { font-size: 12px; color: var(--muted); }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: 500 !important; cursor: pointer; }
.checkbox-label input { width: 18px; height: 18px; accent-color: var(--accent); }

.payment-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.payment-option {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  transition: border-color .2s, background .2s;
}
.payment-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(245,200,66,.08);
}
.payment-option input { accent-color: var(--accent); }

.checkout-submit { justify-content: center; margin-top: 4px; }
.checkout-submit:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.checkout-note { font-size: 12px; color: var(--muted); text-align: center; }
.checkout-note a { color: var(--accent); text-decoration: underline; }

.checkout-alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 12px;
}
.checkout-alert.is-error { background: rgba(214,59,39,.08); border: 1px solid rgba(214,59,39,.3); color: var(--red); }

/* ─── Empty cart ──────────────────────────────────────────────────────────── */
.empty-cart { text-align: center; padding: 60px 20px; }
.empty-cart-icon { font-size: 64px; margin-bottom: 16px; }
.empty-cart h2 { font-size: 24px; margin-bottom: 8px; }
.empty-cart p { color: var(--muted); margin-bottom: 24px; }

/* ─── Qty stepper / add button (restoran sahifasi) ────────────────────────── */
.menu-item-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--card);
}
.qty-stepper.is-hidden { display: none; }
.qty-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: var(--card2);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  transition: background .15s;
}
.qty-btn:hover { background: rgba(245,200,66,.25); }
.qty-btn:focus-visible { outline-offset: -3px; }
.qty-value {
  min-width: 44px;
  text-align: center;
  font-weight: 800;
  font-size: 15px;
}
.add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #1a1200;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity .2s;
}
.add-btn:hover { opacity: .88; }
.add-btn-icon { font-size: 16px; line-height: 1; }
.add-btn.is-soldout { background: var(--card2); color: var(--muted); cursor: not-allowed; }
.add-btn.is-hidden { display: none; }

/* ─── Toast ───────────────────────────────────────────────────────────────── */
#web-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(26,18,8,.92);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
#web-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Order success / tracking ────────────────────────────────────────────── */
.order-success-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.order-status-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.order-time { color: var(--muted); font-size: 14px; }

.order-steps { display: flex; gap: 4px; margin-bottom: 24px; flex-wrap: wrap; }
.order-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.order-step.is-done { background: rgba(76,175,80,.12); color: #2e7d32; }
.order-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: .5;
}

.order-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  background: var(--card2);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 20px;
}
.order-info-grid h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.order-info-grid p { font-size: 14px; font-weight: 600; word-break: break-word; }
.order-info-grid p.muted { color: var(--muted); font-weight: 400; }

.order-items-list { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.order-note {
  background: var(--card2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  margin: 14px 0;
}
.order-actions { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn-outline-danger {
  background: transparent;
  border: 1.5px solid var(--red);
  color: var(--red);
  margin-top: 16px;
}
.btn-outline-danger:hover { background: rgba(214,59,39,.08); }

/* ─── Responsive ──────────────────────────────────────────────────────────── */
/* ─── Manzil turi ────────────────────────────────────────────────────────── */
.address-type-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.address-type-option {
  display: block;
  cursor: pointer;
}
.address-type-option input { position: absolute; opacity: 0; pointer-events: none; }
.address-type-option span {
  display: block;
  text-align: center;
  padding: 12px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: border-color .15s, background .15s;
  background: var(--card);
}
.address-type-option input:checked + span {
  border-color: var(--accent);
  background: rgba(245,200,66,.12);
  color: var(--text);
}
.address-type-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ─── Manzil tafsilotlari (uy/podyezd/qavat/xonadon) ─────────────────────── */
.form-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* ─── Xarita orqali manzil ───────────────────────────────────────────────── */
.map-pick-btn { width: 100%; justify-content: center; }
.map-pick-status {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: #1a9e5c;
  font-weight: 600;
}

/* ─── Forma validatsiya ──────────────────────────────────────────────────── */
.field-error {
  display: block;
  margin-top: 6px;
  color: var(--red);
  font-size: 13px;
}
input.is-invalid, textarea.is-invalid {
  border-color: var(--red) !important;
}

/* ─── Buyurtma natijasi: qo'shimcha izoh ─────────────────────────────────── */
.order-success-note {
  margin-top: 18px;
  background: rgba(26,158,92,.08);
  border: 1px solid rgba(26,158,92,.25);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.6;
}
.order-success-note h3 { font-size: 15px; margin-bottom: 6px; }

/* ─── Katalog: qidiruv ───────────────────────────────────────────────────── */
/* (resto-search stillari components.css'da — katalog sahifasida ham yuklanadi) */

@media (max-width: 900px) {
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary-col { position: static; }
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .cart-item { flex-wrap: wrap; }
  .cart-item-total { margin-left: auto; }
}

/* Compact checkout refresh */
.cart-page { padding: 36px 0 72px; background: linear-gradient(180deg, rgba(15,61,40,.04), transparent 360px); }
.cart-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.cart-page-head h1 { margin: 2px 0; font-size: clamp(30px, 5vw, 42px); line-height: 1.1; }
.cart-page-head p { color: var(--muted); }
.cart-kicker { color: var(--brand); font-size: 13px; font-weight: 800; }
.cart-layout { grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); gap: 22px; }
.cart-items-col, .cart-summary-card { border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 12px 36px rgba(15,61,40,.045); }
.cart-items-col { padding: 22px; }
.cart-summary-card { padding: 22px; }
.cart-resto-head { padding-bottom: 16px; }
.cart-resto-head > div { display: flex; align-items: center; gap: 10px; }
.cart-item-count, .summary-top span { color: var(--muted); font-size: 12px; }
.cart-item { padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 0; border-radius: 0; }
.cart-item:first-child { border-top: 0; }
.cart-item-img, .cart-item-img-placeholder { width: 82px; height: 82px; border-radius: 14px; }
.cart-item-img-placeholder { display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 900; }
.cart-item-total { align-self: center; white-space: nowrap; }
.free-delivery-bar { margin: 0 0 12px; }
.summary-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.checkout-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); gap: 13px; }
.checkout-section-head { display: flex; align-items: center; gap: 10px; margin: 5px 0 2px; }
.checkout-section-head > span { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; }
.checkout-section-head > div { display: flex; flex-direction: column; line-height: 1.25; }
.checkout-section-head small { color: var(--muted); font-size: 11px; }
.address-type-options, .payment-options { gap: 7px; }
.address-type-option, .payment-option { flex: 1; }
.address-type-option span, .payment-option span { display: block; padding: 9px 8px; text-align: center; }
.checkout-details { border: 1px solid var(--line); border-radius: 13px; background: #fafaf8; }
.checkout-details summary { padding: 12px 14px; cursor: pointer; color: var(--brand); font-size: 13px; font-weight: 700; }
.checkout-details[open] { padding-bottom: 13px; }
.checkout-details[open] summary { margin-bottom: 10px; }
.checkout-details > .form-row, .checkout-details > .form-group { margin-left: 13px; margin-right: 13px; }
.checkout-details > .form-group + .form-group { margin-top: 10px; }
.checkout-account { display: flex; align-items: center; gap: 10px; padding: 11px; border-radius: 13px; background: var(--brand-soft); }
.checkout-account > span { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 800; }
.checkout-account > div { display: flex; flex: 1; flex-direction: column; min-width: 0; line-height: 1.2; }
.checkout-account strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.checkout-account small { color: var(--muted); font-size: 11px; }
.checkout-account a { color: var(--brand); font-size: 12px; font-weight: 700; }
.checkbox-label { padding: 11px 0; font-weight: 600; }
.checkout-submit { width: 100%; justify-content: center; margin-top: 5px; }
.checkout-login-prompt { display: grid; justify-items: center; gap: 10px; margin-top: 18px; padding: 24px 14px 8px; border-top: 1px solid var(--line); text-align: center; }
.checkout-login-prompt > span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: #229ed9; color: #fff; font-weight: 900; }
.checkout-login-prompt p { color: var(--muted); font-size: 13px; }
.checkout-login-prompt .btn { width: 100%; justify-content: center; }
.empty-cart { min-height: 480px; display: grid; place-content: center; justify-items: center; text-align: center; }
.empty-cart-icon { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 18px; border-radius: 22px; background: var(--brand-soft); color: var(--brand); font-weight: 900; }
.empty-cart p { margin: 8px 0 22px; color: var(--muted); }
@media (max-width: 900px) { .cart-layout { grid-template-columns: 1fr; } .cart-summary-col { position: static; } }
@media (max-width: 600px) { .cart-page { padding: 16px 0 50px; } .cart-page-head { align-items: flex-start; margin-bottom: 18px; } .cart-page-head .btn { display: none; } .cart-items-col, .cart-summary-card { padding: 15px; border-radius: 16px; } .cart-item { display: grid; grid-template-columns: 68px minmax(0, 1fr); align-items: start; gap: 12px; } .cart-item-img, .cart-item-img-placeholder { width: 68px; height: 68px; } .cart-item-body { grid-column: 2; text-align: left; } .cart-item-total { display: none; } .form-row-4 { grid-template-columns: 1fr 1fr; } .checkout-submit { position: sticky; bottom: 10px; z-index: 5; box-shadow: 0 8px 28px rgba(230,168,0,.32); } }

/* ── Order share card (public token link) ─────────────────────────────── */
.order-share-card {
  margin-top: 16px;
  padding: 16px;
  background: var(--surface, #fff);
  border: 1px dashed var(--border, #ddd);
  border-radius: 12px;
}
.order-share-card h3 { margin: 0 0 6px; font-size: 15px; }
.order-share-card .muted { margin: 0 0 10px; font-size: 13px; }
.order-share-row { display: flex; gap: 8px; align-items: center; }
.order-share-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text, #222);
  background: var(--bg, #fafafa);
}
@media (max-width: 600px) {
  .order-share-row { flex-direction: column; align-items: stretch; }
  .order-share-row .btn { justify-content: center; }
}
