/* ============================================================
   ORDER / CHECKOUT — SabziBuddy  (v2 — uniform gap fix)
   ============================================================ */


/* ══════════════════════════════════════════════════════════
   1. CHECKOUT SCROLL WRAPPER
   ══════════════════════════════════════════════════════════ */

.checkout-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 40px;
  background: var(--cream);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--cream2) transparent;
}


/* ══════════════════════════════════════════════════════════
   2. ORDER SUMMARY CARD
   ══════════════════════════════════════════════════════════ */

.checkout-summary-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(28,56,41,0.08);
  border: 1px solid var(--cream2);
}

.checkout-summary-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--g4);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--cream2);
}

.checkout-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 2px dashed var(--cream2);
  padding-top: 10px;
  margin-top: 6px;
}
.checkout-total-lbl {
  font-weight: 700;
  color: var(--tm);
  font-size: 14px;
}
.checkout-total-amt {
  font-size: 22px;
  font-weight: 800;
  color: var(--g2);
}


/* ══════════════════════════════════════════════════════════
   3. ORDER FORM CARD
   ══════════════════════════════════════════════════════════ */

.order-form-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 16px 20px;
  box-shadow: 0 2px 10px rgba(28,56,41,0.08);
  border: 1px solid var(--cream2);
}

.order-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--td);
  margin: 0 0 4px;
  line-height: 1.2;
}

.order-sub {
  font-size: 13px;
  color: var(--tmut);
  margin: 0 0 20px;
}


/* ══════════════════════════════════════════════════════════
   4. FORM FIELD SYSTEM — uniform 16px gap everywhere
   ══════════════════════════════════════════════════════════

   Gap rule (single source of truth):
     • .input-group          → margin-bottom: 16px
     • .input-row            → gap: 0  (mb on children does it)
     • .field-error          → min-height: 0  (no phantom space)
     • .input-group:last-child → margin-bottom: 0
   ══════════════════════════════════════════════════════════ */

/* ── Two-field row wrapper ───────────────────────────────── */
.input-row {
  display: flex;
  flex-direction: column;   /* mobile: stacked */
  gap: 0;                   /* .input-group mb handles spacing */
}

/* ── Field group ─────────────────────────────────────────── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 16px;
}
.input-group:last-child {
  margin-bottom: 0;
}

/* ── Label ───────────────────────────────────────────────── */
.input-group > label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  font-size: 13px;
  font-weight: 700;
  color: var(--td);
  margin-bottom: 7px;
  line-height: 1.3;
}

/* ── Label badges ────────────────────────────────────────── */
.req-star {
  color: var(--terra, #e05c3a);
  font-size: 14px;
  line-height: 1;
}
.optional-lbl {
  font-size: 11px;
  font-weight: 400;
  color: var(--tmut);
}
.req-note {
  font-size: 11px;
  font-weight: 500;
  color: var(--terra, #e05c3a);
}

/* ── Text / email inputs ─────────────────────────────────── */
.input-group input[type="text"],
.input-group input[type="email"] {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  color: var(--td);
  background: var(--cream);
  border: 1.5px solid var(--cream2);
  border-radius: 10px;
  outline: none;
  -webkit-appearance: none;
  transition: border-color 0.18s ease,
              box-shadow   0.18s ease,
              background   0.18s ease;
}
.input-group input[type="text"]:focus,
.input-group input[type="email"]:focus {
  border-color: var(--g4);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(74,139,92,0.12);
}
.input-group input::placeholder {
  color: var(--tmut);
  font-size: 13px;
}

/* ── Phone field (+91 prefix) ────────────────────────────── */
.phone-field-wrap {
  display: flex;
  align-items: stretch;
  background: var(--cream);
  border: 1.5px solid var(--cream2);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.18s ease,
              box-shadow   0.18s ease,
              background   0.18s ease;
}
.phone-field-wrap.focused {
  border-color: var(--g4);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(74,139,92,0.12);
}
.phone-field-prefix {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0 10px 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tm);
  white-space: nowrap;
  border-right: 1.5px solid var(--cream2);
  background: transparent;
}
.phone-field-wrap input[type="tel"] {
  flex: 1;
  min-width: 0;
  padding: 12px 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  color: var(--td);
  background: transparent;
  border: none;
  outline: none;
  -webkit-appearance: none;
}
.phone-field-wrap input[type="tel"]::placeholder {
  color: var(--tmut);
  font-size: 13px;
}

/* ── Field error ─────────────────────────────────────────────
   min-height: 0  → no phantom space when JS has not set text.
   margin-top only matters when there IS error text.         */
.field-error {
  min-height: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--terra, #e05c3a);
  line-height: 1.4;
  margin-top: 4px;
  display: block;
}


/* ══════════════════════════════════════════════════════════
   5. LOCATION PICKER
   ══════════════════════════════════════════════════════════ */

.loc-picker-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  padding: 13px 14px;
  background: var(--cream);
  border: 1.5px solid var(--cream2);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.loc-picker-btn:hover {
  border-color: var(--g4);
  background: #fff;
}
.loc-picker-btn.confirmed {
  border-color: var(--ga);
  background: rgba(107,191,123,0.06);
}
.lpb-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(107,191,123,0.12);
  border-radius: 8px;
}
.lpb-text  { flex: 1; min-width: 0; }
.lpb-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--td);
  line-height: 1.3;
}
.lpb-sub {
  font-size: 12px;
  color: var(--tmut);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lpb-arrow {
  font-size: 20px;
  color: var(--tmut);
  flex-shrink: 0;
}


/* ══════════════════════════════════════════════════════════
   6. DELIVERY SLOTS
   ══════════════════════════════════════════════════════════ */

.slots-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.slot-card {
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 11px 10px;
  font-family: 'Outfit', sans-serif;
  text-align: left;
  background: var(--cream);
  border: 1.5px solid var(--cream2);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.18s ease,
              background   0.18s ease,
              box-shadow   0.18s ease;
}
.slot-card:hover:not(.disabled) {
  border-color: var(--g4);
  background: #fff;
}
.slot-card.selected {
  border-color: var(--g2);
  background: rgba(28,56,41,0.05);
  box-shadow: 0 0 0 2px rgba(28,56,41,0.12);
}
.slot-card.disabled {
  background: #f2f2f2;
  border-color: #ddd;
  cursor: not-allowed;
  opacity: 0.5;
}
.slot-day {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--g3);
  margin-bottom: 4px;
  line-height: 1.3;
}
.slot-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--td);
  margin-bottom: 3px;
  line-height: 1.3;
}
.slot-time {
  font-size: 11px;
  font-weight: 600;
  color: var(--green-price);
  line-height: 1.3;
}
.slot-cutoff {
  font-size: 10px;
  font-weight: 600;
  color: var(--terra);
  margin-top: 5px;
  line-height: 1.3;
}
.slot-check {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--g2);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
}
.slot-card.selected .slot-check {
  display: flex;
}


/* ══════════════════════════════════════════════════════════
   7. FREE DELIVERY BARS
   ══════════════════════════════════════════════════════════ */

/* ── CART PANEL FD BAR ───────────────────────────────────── */
.cart-fd-bar {
  margin: 0 14px 10px;
  padding: 10px 14px 12px;
  background: var(--cream);
  border: 1.5px solid var(--cream2);
  border-radius: 10px;
  display: none;
  flex-shrink: 0;
}
.cart-fd-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cart-fd-track-wrap {
  flex: 1;
  position: relative;
}
.cart-fd-track {
  position: relative;
  height: 6px;
  background: var(--cream2);
  border-radius: 50px;
  overflow: visible;
}
.cart-fd-fill {
  height: 100%;
  background: var(--g2);
  border-radius: 50px;
  transition: width 0.5s ease;
  width: 0%;
}
.cart-fd-truck {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translateY(-50%) scaleX(-1);
  font-size: 20px;
  line-height: 1;
  transition: left 0.5s ease;
  pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.18));
}
.cart-fd-text {
  font-size: 12px;
  color: var(--tm);
  margin-top: 14px;
  line-height: 1.4;
}

/* ── ORDER PAGE FD BAR ───────────────────────────────────── */
.order-fd-bar {
  padding: 12px 14px 10px;
  background: var(--cream);
  border: 1.5px solid var(--cream2);
  border-radius: 10px;
  margin-bottom: 14px;
  display: none;
}
.order-fd-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}
.order-fd-track-wrap {
  flex: 1;
}
.order-fd-wrap {
  position: relative;
  margin-bottom: 6px;
}
.order-fd-track {
  position: relative;
  height: 8px;
  background: var(--cream2);
  border-radius: 50px;
  overflow: visible;
}
.order-fd-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--g4), var(--ga));
  border-radius: 50px;
  transition: width 0.5s ease;
  width: 0%;
}
.truck {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translateY(-50%);
  font-size: 20px;
  line-height: 1;
  transition: left 0.5s ease;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.18));
}
.order-fd-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--green-price);
  margin-top: 6px;
  line-height: 1.4;
}


/* ══════════════════════════════════════════════════════════
   8. PLACE ORDER BUTTON
   ══════════════════════════════════════════════════════════ */

.order-btn {
  width: 100%;
  box-sizing: border-box;
  padding: 15px;
  margin-top: 6px;
  background: var(--g2);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s ease,
              transform  0.2s ease,
              box-shadow 0.2s ease;
}
.order-btn:hover:not(:disabled) {
  background: var(--g3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(28,56,41,0.28);
}
.order-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}
.order-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}


/* ══════════════════════════════════════════════════════════
   9. COUPON ROW
   ══════════════════════════════════════════════════════════ */

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


/* ══════════════════════════════════════════════════════════
   10. RESPONSIVE
   ══════════════════════════════════════════════════════════ */

@media (min-width: 480px) {
  /* Wide screens: Name + Phone side by side */
  .input-row {
    flex-direction: row;
    gap: 12px;
  }
  .input-row .input-group {
    flex: 1;
    margin-bottom: 0;
  }
}

@media (max-width: 360px) {
  .order-form-card { padding: 16px 12px; }
  .slots-grid      { gap: 6px; }
  .slot-label      { font-size: 12px; }
  .slot-time       { font-size: 10px; }
  .slot-cutoff     { font-size: 9.5px; }
  .order-title     { font-size: 23px; }
}
