/* ============================================================
   CART — SabziBuddy
   Slide-in right panel: overlay, header, items, qty, footer
   Free delivery bar → components/progress-bar.css
   ============================================================ */

/* ── BACKDROP OVERLAY ────────────────────────────────────── */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 56, 41, 0.5);
  z-index: var(--z-overlay);        /* 500 */
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base) var(--ease);
}
.cart-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ── CART PANEL ──────────────────────────────────────────── */
.cart-panel {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: min(420px, 100vw);
  background: #fff;
  z-index: calc(var(--z-overlay) + 1); /* 501 — above overlay */
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
}
.cart-panel.open { transform: translateX(0); }

/* ── CART HEADER ─────────────────────────────────────────── */
.cart-panel-header {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--g2);
  color: var(--cream);
  flex-shrink: 0;
}
.cart-panel-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 15px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.cart-panel-header h2 svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor;
  stroke-width: 2;
}
.cart-header-actions { display: flex; gap: 8px; }

/* × close button */
.close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none; color: #fff;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  transition: background var(--t-fast) var(--ease);
}
.close-btn:hover { background: rgba(255, 255, 255, 0.25); }

/* ── SAVINGS BANNER ──────────────────────────────────────── */
.cart-savings-banner {
  margin: 0 0 8px 0;
  box-shadow: 0 4px 8px rgba(0,0,0,0.06);
  background: #f0faf0;
  border: none;
  border-bottom: 1px solid #d4edda;
  border-radius: 0;
  padding: 10px 16px;
  font-size: 13px; color: var(--g2);
  font-weight: 500;
  display: flex; align-items: center;
  justify-content: center;
  gap: 4px;
}
.cart-savings-banner strong {
  color: var(--green-price); font-size: 14px;
}

/* ── FREE DELIVERY BAR ───────────────────────────────────── */
.cart-fd-bar {
  margin: 15px 0 0 0;
  padding: 8px 14px 10px 14px;
  background: var(--cream);
  flex-shrink: 0;
  border-bottom: 1px solid var(--cream2);
}

.cart-fd-track-wrap {
  position: relative;
  padding-top: 26px; /* truck ke liye upar jagah */
}

.cart-fd-track {
  height: 6px;
  background: #ddd;
  border-radius: 3px;
  overflow: hidden;
}

.cart-fd-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease, background 0.3s;
}

.cart-fd-truck {
  position: absolute;
  top: 8px;                        /* track ke bilkul upar chipka */
  left: 0%;
  font-size: 22px;
  line-height: 1;
  transition: left 0.4s ease;
  transform: scaleX(-1) translateX(50%); /* sahi direction + center align */
  display: inline-block;
}

.cart-fd-text {
  font-size: 12px;
  color: var(--tm);
  margin-top: 6px;
}

/* ── CART ITEMS LIST ─────────────────────────────────────── */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--cream2) transparent;
}

.cart-item {
  display: flex;
  align-items: center; gap: 10px;
  padding: 10px;
  background: var(--cream);
  border-radius: 10px;
  margin-bottom: 8px;
}

/* Item thumbnail */
.cart-item-thumb {
  width: 52px; height: 52px;
  border-radius: 10px;
  background: var(--cream2);
  flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.cart-item-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-weight: 600; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cart-qty-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.cart-item-price {
  font-size: 12px;
  color: var(--tmut);
  text-align: right;
  margin-top: 2px;
}

.cart-item-weight {
  font-size: 11px;
  color: var(--tmut);
  margin-top: 2px;
}

/* ── CART QTY CONTROLS ───────────────────────────────────── */
.cart-qty {
  display: flex; align-items: center;
  background: var(--g2);
  border-radius: 8px; overflow: hidden; flex-shrink: 0;
}
.cart-qbtn {
  background: none; border: none;
  color: #fff;
  width: 30px; height: 30px;
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast);
}
.cart-qbtn:hover { background: rgba(255, 255, 255, 0.15); }

.cart-qinput {
  background: none; border: none;
  color: #fff;
  width: 30px; height: 30px;
  font-size: 13px; font-weight: 700;
  text-align: center; outline: none;
  pointer-events: none;
  user-select: none; -webkit-user-select: none;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 30px;
  padding: 0;
}

/* ── CART EMPTY STATE ────────────────────────────────────── */
.cart-empty {
  text-align: center;
  padding: 24px;
  color: var(--tmut);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
}
.cart-empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ── CART FOOTER ─────────────────────────────────────────── */
.cart-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--cream2);
  background: var(--cream);
  flex-shrink: 0;
}
.cart-total-row {
  display: flex;
  justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.cart-total-label { font-weight: 600; color: var(--tm); font-size: 14px; }
.cart-total-amt {
  font-family: 'Outfit', sans-serif;
  font-size: 24px; font-weight: 700; color: var(--g2);
}

/* Min order warning */
.min-order-notice {
  background: rgba(200, 112, 74, 0.08);
  border: 1px solid rgba(200, 112, 74, 0.25);
  border-radius: 8px;
  padding: 9px 12px; margin-bottom: 10px;
  font-size: 12px; color: var(--terra);
  font-weight: 500; display: none;
}

/* ── BILL SUMMARY BOX ────────────────────────────────────── */
.bill-summary-box {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px; margin-bottom: 12px;
  border: 1px solid var(--cream2);
}
.bill-summary-title {
  font-size: 13px; font-weight: 700;
  color: var(--g2); margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--cream2);
}
.bill-row {
  display: flex;
  justify-content: space-between; align-items: center;
  padding: 5px 0; font-size: 13px;
}
.bill-label   { color: var(--tmut); font-weight: 500; }
.bill-val     { display: flex; align-items: center; gap: 6px; }
.bill-amount  { font-weight: 700; color: var(--td); }
.bill-strike  { font-size: 11px; color: #bbb; text-decoration: line-through; }
.bill-free    { font-size: 12px; font-weight: 700; color: var(--green-price); }

.bill-total-row {
  border-top: 1.5px dashed var(--cream2);
  margin-top: 8px; padding-top: 10px;
}
.bill-label-total { font-size: 14px; font-weight: 700; color: var(--g2); }
.bill-val-total {
  font-size: 18px; font-weight: 800;
  color: var(--g2); font-family: 'Outfit', sans-serif;
}

/* Utility: mirror emoji (truck facing right) */
.mirror { transform: scaleX(-1); }

/* ── WISHLIST PAGE — cart ke upar rehna chahiye ── */
#wishlist-page {
  z-index: 99999 !important;
}
