/* Foodigo cart — clean app-style layout (mobile-first) */
:root {
  --z-red: #e23744;
  --fg-primary: #ff6648;
  --fg-primary-dark: #e94222;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --line: #eceff3;
  --bg-page: #f3f4f6;
  --card: #ffffff;
  --qty-bg: #fff0f2;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  --sticky-h: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg-page);
  min-height: 100vh;
  line-height: 1.45;
}

body.has-items {
  padding-bottom: calc(var(--sticky-h) + env(safe-area-inset-bottom, 0px) + 12px);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.container {
    width: min(1116px, calc(100% - 28px)) !important;
    margin: auto;
}

/* ——— Top bar ——— */
.cart-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.cart-topbar-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: #f9fafb;
  border: 1px solid var(--line);
}

.cart-topbar-btn:active {
  transform: scale(0.96);
}

.cart-topbar-center {
  text-align: center;
  min-width: 0;
}

.cart-topbar-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.cart-topbar-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ——— Page ——— */
.cart-page {
  padding: 12px 0 24px;
}

.cart-container {
  width: min(640px, 100% - 24px);
  margin: 0 auto;
}

/* ——— Cards ——— */
.cart-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid rgba(15, 23, 42, 0.04);
  padding: 14px 14px 12px;
  margin-bottom: 12px;
}

.cart-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.cart-card-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.cart-item-pill {
  font-size: 0.75rem;
  font-weight: 700;
  background: #f3f4f6;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--text);
}

.cart-lines {
  list-style: none;
}

.cart-line {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.cart-line:last-of-type {
  border-bottom: none;
}

.cart-line-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(145deg, #fff5f2, #f3f4f6);
  flex-shrink: 0;
}

.cart-line-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-line-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-line-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.diet-dot {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  border-radius: 2px;
  border: 2px solid #16a34a;
  display: grid;
  place-content: center;
  box-sizing: border-box;
}

.diet-dot--veg::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
}

.diet-dot--nonveg {
  border-color: #dc2626;
}

.diet-dot--nonveg::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: #dc2626;
}

.cart-line-names {
  flex: 1;
  min-width: 0;
}

.cart-line-title {
  display: block;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.cart-line-size {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.cart-line-remove {
  color: var(--text-muted);
  padding: 6px;
  border-radius: 8px;
  flex-shrink: 0;
}

.cart-line-remove:hover {
  color: var(--z-red);
  background: #fff0f0;
}

.cart-line-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: var(--qty-bg);
  border: 1px solid #ffd6dc;
  border-radius: 10px;
  overflow: hidden;
}

.qty-step {
  width: 36px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--z-red);
  font-size: 0.75rem;
}

.qty-step:active {
  background: rgba(226, 55, 68, 0.12);
}

.qty-value {
  min-width: 28px;
  text-align: center;
  font-weight: 800;
  font-size: 0.9rem;
}

.cart-line-price {
  text-align: right;
}

.line-unit {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.line-total {
  font-size: 1rem;
  font-weight: 800;
  color: var(--fg-primary-dark);
}

/* Add more */
.add-more-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 4px 4px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--z-red);
}

.add-more-row i {
  font-size: 1.15rem;
}

/* Quick chips */
.cart-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.quick-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fafafa;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  text-align: left;
}

.quick-chip--muted {
  color: var(--text-muted);
  font-weight: 600;
}

.quick-chip i {
  color: var(--fg-primary);
  opacity: 0.9;
}

.cart-note-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.cart-note-panel label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.cart-note-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.85rem;
  resize: vertical;
  min-height: 64px;
}

/* Coupon strip */
.coupon-strip {
  margin-bottom: 10px;
}

.coupon-strip-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: linear-gradient(100deg, #e0f2fe 0%, #f0f9ff 50%, #e8f4fc 100%);
  border: 1px solid #bae6fd;
  font-size: 0.78rem;
  font-weight: 700;
  color: #0369a1;
}

.coupon-strip-inner i {
  font-size: 1rem;
}

.cart-card--coupon {
  padding-bottom: 14px;
}

.coupon-row {
  display: flex;
  gap: 8px;
}

.coupon-row input {
  flex: 1;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  font-size: 0.9rem;
}

.btn-apply-coupon {
  padding: 0 18px;
  height: 46px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--fg-primary), var(--fg-primary-dark));
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  white-space: nowrap;
}

.coupon-msg {
  font-size: 0.78rem;
  margin-top: 8px;
  color: var(--text-muted);
  min-height: 1.2em;
}

/* Bill */
.cart-card--bill {
  padding: 16px;
}

.bill-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.bill-rows {
  list-style: none;
  font-size: 0.88rem;
}

.bill-rows li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.bill-rows li:last-child {
  border-bottom: none;
}

.bill-rows span {
  color: var(--text-muted);
}

.bill-discount strong {
  color: #16a34a;
}

.bill-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid var(--text);
  font-weight: 800;
  font-size: 1.05rem;
}

.bill-hint {
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Empty */
.cart-card--empty {
  padding: 40px 24px;
  text-align: center;
}

.empty-inner {
  max-width: 280px;
  margin: 0 auto;
}

.empty-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, #fff0ec, #ffe8e0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--fg-primary-dark);
}

.cart-card--empty h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.cart-card--empty p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.btn-primary-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--z-red), #c81e2a);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 10px 24px rgba(226, 55, 68, 0.35);
}

/* Sticky pay bar */
.cart-sticky-spacer {
  height: 8px;
}

.cart-sticky-pay {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  padding: 10px 14px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.08);
}

.sticky-inner {
  width: min(722px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.sticky-pay-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4px 8px 4px 4px;
}

.sticky-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sticky-method {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
}

.sticky-cta {
  flex: 1.2;
  max-width: 56%;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 0;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--z-red), #c81e2a);
  color: #fff;
  box-shadow: 0 8px 24px rgba(226, 55, 68, 0.4);
}

.sticky-cta-total {
  grid-column: 1;
  grid-row: 1;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sticky-cta-label {
  grid-column: 1;
  grid-row: 2;
  font-size: 0.62rem;
  font-weight: 700;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sticky-cta-action {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-weight: 800;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.sticky-cta:active {
  transform: scale(0.98);
}

/* Desktop: wider two-column feel for bill + optional future split */
@media (min-width: 900px) {
  .cart-container {
    width: min(720px, 100% - 40px);
  }

  .cart-line-title {
    font-size: 1rem;
  }
}

.me-1 {
  margin-right: 0.25rem;
}
.me-2 {
  margin-right: 0.5rem;
}
