/* ==========================================================================
   ChaatBazaar Premium Delivery Tracker & Active Map Layout Stylesheet
   ========================================================================== */

/* Design Tokens & Theme Variables */
:root {
  --primary-orange: #ff5722;
  --primary-orange-light: #ff8a65;
  --primary-orange-glow: rgba(255, 87, 34, 0.15);
  --bg-cream: #fffaf5;
  --bg-creamy-gradient: linear-gradient(180deg, #fffbf7 0%, #fff3e6 100%);
  --text-dark: #3e2723;
  --text-muted: #705c55;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 138, 101, 0.25);
  --card-shadow: 0 15px 35px rgba(62, 39, 35, 0.08);
  --hud-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  --border-radius-lg: 24px;
  --border-radius-md: 16px;
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --map-height: 580px;
}

/* Dark Mode Overrides */
body.dark {
  --bg-cream: #1e120f;
  --bg-creamy-gradient: linear-gradient(180deg, #1e120f 0%, #170d0b 100%);
  --text-dark: #ffe5dd;
  --text-muted: #bdaea9;
  --glass-bg: rgba(30, 18, 15, 0.88);
  --glass-border: rgba(255, 138, 101, 0.15);
  --card-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  --hud-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Main Layout Grid (Desktop Split) */
.tracking-section-container {
  padding: 0;
  margin: 0;
  background: var(--bg-creamy-gradient);
  border-bottom: 1px solid var(--glass-border);
  overflow: hidden;
}

.tracking-layout-wrapper {
  display: grid;
  grid-template-columns: 420px 1fr;
  height: var(--map-height);
  width: 100%;
  position: relative;
  transition: grid-template-columns 0.4s ease;
}

.tracking-layout-wrapper.sidebar-hidden {
  grid-template-columns: 0px 1fr;
}

.tracking-layout-wrapper.sidebar-hidden .tracking-sidebar-panel {
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  pointer-events: none;
}

/* Left Sidebar Panel */
.tracking-sidebar-panel {
  background: var(--bg-cream);
  border-right: 1px solid var(--glass-border);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.02);
  z-index: 10;
  transition: padding 0.4s ease, opacity 0.4s ease;
}

/* for the sidebar panel */
.tracking-sidebar-panel {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tracking-sidebar-panel::-webkit-scrollbar {
  display: none;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.active-pulse-badge {
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 0 10px rgba(46, 125, 50, 0.15);
}

.active-pulse-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #2e7d32;
  border-radius: 50%;
  animation: pulse-ring-green 1.5s infinite;
}

@keyframes pulse-ring-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(46, 125, 50, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
}

/* Compact ETA Card */
.eta-floating-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 1.25rem;
  border-radius: var(--border-radius-md);
  box-shadow: var(--card-shadow);
  transition: var(--transition-smooth);
}

.eta-pulse-ring {
  background: linear-gradient(135deg, var(--primary-orange-light) 0%, var(--primary-orange) 100%);
  color: #fff;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 10px 20px var(--primary-orange-glow);
  flex-shrink: 0;
  animation: pulse-avatar 2s infinite ease-in-out;
}

#eta-mins-val {
  font-size: 1.6rem;
  line-height: 1.1;
}

.mins-label {
  font-size: 0.65rem;
  letter-spacing: 0.05em;
}

.eta-status-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.eta-heading {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 0;
}

.eta-status-detail {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
  line-height: 1.3;
}

@keyframes pulse-avatar {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); box-shadow: 0 10px 25px rgba(255, 87, 34, 0.3); }
}

/* Swiggy/Zomato Stepper Timeline */
.timeline-stepper {
  position: relative;
  padding: 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.stepper-rail {
  position: absolute;
  left: 21px;
  top: 1.5rem;
  bottom: 1.5rem;
  width: 4px;
  background: rgba(255, 138, 101, 0.15);
  border-radius: 99px;
}

.stepper-rail-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(180deg, var(--primary-orange-light), var(--primary-orange));
  border-radius: 99px;
  transition: height 1.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.stepper-cart-icon {
  position: absolute;
  left: -17px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-orange);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  box-shadow: 0 5px 12px rgba(255, 87, 34, 0.4);
  transition: top 1.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 2;
}

.stepper-steps-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  position: relative;
  z-index: 1;
}

.stepper-step {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  opacity: 0.55;
  transition: var(--transition-smooth);
}

.stepper-step.active {
  opacity: 1;
}

.step-icon-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-cream);
  border: 3px solid rgba(255, 138, 101, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.stepper-step.active .step-icon-circle {
  background: var(--primary-orange);
  border-color: rgba(255, 87, 34, 0.2);
  box-shadow: 0 0 0 4px rgba(255, 87, 34, 0.15);
  width: 18px;
  height: 18px;
}

.stepper-step.current .step-icon-circle {
  background: #fff;
  border-color: var(--primary-orange);
  animation: pulse-step-active 1.6s infinite ease-in-out;
}

.step-icon-circle .icon {
  display: none; /* Hide emojies in dots, but keep readable for screenreaders */
}

.stepper-step .step-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.stepper-step.active .step-label {
  color: var(--text-dark);
  font-weight: 700;
}

@keyframes pulse-step-active {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 87, 34, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(255, 87, 34, 0); }
}

/* Location Address Panel */
.location-details-overlay {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: rgba(255, 138, 101, 0.05);
  border: 1px dashed rgba(255, 138, 101, 0.3);
  padding: 1rem;
  border-radius: var(--border-radius-md);
}

.location-icon-marker {
  font-size: 1.2rem;
  animation: bounce-marker 2s infinite ease-in-out;
}

.location-address-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.address-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 0;
}

.address-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
  line-height: 1.4;
}

@keyframes bounce-marker {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Sidebar Call/Chat Actions */
.active-support-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin-top: auto;
}

.support-action-btn {
  border: none;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-dark);
  padding: 0.65rem 0.35rem;
  border-radius: var(--border-radius-md);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
  transition: var(--transition-smooth);
}

.support-action-btn:hover {
  transform: translateY(-2px);
  background: var(--primary-orange);
  color: #fff;
  border-color: var(--primary-orange);
  box-shadow: 0 8px 16px var(--primary-orange-glow);
}

.support-action-btn .btn-icon {
  font-size: 1.1rem;
}

/* Map Panel Viewport styling */
.map-viewport-container {
  position: relative;
  width: 100%;
  height: 100%;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Search Overlay */
.floating-location-hud {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  right: 1.25rem;
  max-width: 440px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  box-shadow: var(--hud-shadow);
  padding: 0.5rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: var(--transition-smooth);
}

.hud-search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
}

.search-map-icon {
  font-size: 1rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

#location-search-input {
  border: none;
  background: transparent;
  flex: 1;
  padding: 0.65rem 0.25rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
}

#location-search-input:focus {
  outline: none;
}

/* Delivery Coverage Card */
.delivery-coverage-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  text-align: center;
  max-width: 400px;
  width: 90%;
  z-index: 1000;
  box-shadow: var(--hud-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.coverage-icon-wrapper {
  background: var(--primary-orange-glow);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 8px 16px rgba(255, 87, 34, 0.15);
}

.coverage-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.coverage-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.btn-explore-coverage {
  background: linear-gradient(135deg, var(--primary-orange-light) 0%, var(--primary-orange) 100%);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--primary-orange-glow);
  transition: var(--transition-smooth);
}

.btn-explore-coverage:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 87, 34, 0.4);
}

/* Floating GPS Button */
.floating-gps-action {
  position: absolute;
  bottom: 6rem;
  right: 1.5rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--hud-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 100;
  transition: var(--transition-smooth);
  color: var(--text-dark);
}

.floating-gps-action:hover {
  background: var(--bg-cream);
  transform: translateY(-3px) scale(1.05);
  color: var(--primary-orange);
}

.floating-gps-action.pulsing-gps {
  animation: pulse-ring-orange 1.5s infinite;
}

/* Confirm Location Button */
.confirm-location-container {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  justify-content: center;
}

.confirm-loc-btn {
  font-size: 1.1rem;
  padding: 0.9rem 2.5rem;
  box-shadow: 0 10px 25px rgba(255, 87, 34, 0.4);
  animation: slideUpFade 0.4s ease forwards;
}

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

/* Search Suggestions */
.hud-search-suggestions {
  background: transparent;
  border-top: 1px solid var(--glass-border);
  margin-top: 0.25rem;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hud-search-suggestions::-webkit-scrollbar {
  display: none;
}

.hud-search-suggestions .suggestion-item {
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  transition: var(--transition-smooth);
}

.hud-search-suggestions .suggestion-item:hover {
  background: rgba(255, 87, 34, 0.08);
}

.hud-search-suggestions .suggestion-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
}

.hud-search-suggestions .suggestion-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hud-search-suggestions .no-matches {
  text-align: center;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 1rem;
  pointer-events: none;
}

/* Error Banner */
.hud-info-banner {
  background: var(--glass-bg);
  border: 1px solid rgba(255, 138, 101, 0.25);
  color: var(--text-dark);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-top: 0.5rem;
  line-height: 1.4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Map Styling Overrides */
.leaflet-div-icon {
  background: transparent !important;
  border: none !important;
}

.leaflet-bar {
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--card-shadow) !important;
}

.leaflet-bar a {
  background: var(--glass-bg) !important;
  color: var(--text-dark) !important;
  border-bottom: 1px solid var(--glass-border) !important;
  transition: var(--transition-smooth);
}

.leaflet-bar a:hover {
  background: var(--primary-orange) !important;
  color: #fff !important;
}

/* Mobile Toggle Indicators */
.mobile-drawer-trigger-bar {
  display: none;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--glass-border);
  padding: 0.85rem 1rem;
  text-align: center;
  cursor: pointer;
  z-index: 100;
  position: relative;
}

.drawer-notch {
  width: 40px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 99px;
  margin: 0 auto 0.5rem;
  opacity: 0.5;
}

.drawer-trigger-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-orange);
}

/* History Section */
.orders-main-history {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.orders-history-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1.75rem;
  position: relative;
}

.orders-history-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 48px;
  height: 4px;
  background: var(--primary-orange);
  border-radius: 99px;
}

.orders-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Premium Previous Order Cards */
.order-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: var(--transition-smooth);
}

.order-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 45px rgba(62, 39, 35, 0.12);
  border-color: rgba(255, 87, 34, 0.3);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px dashed var(--glass-border);
  padding-bottom: 1rem;
}

.order-meta-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.order-id {
  color: var(--text-dark);
}

.order-date {
  font-weight: 600;
}

.order-distance {
  background: rgba(255, 138, 101, 0.08);
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
  color: var(--primary-orange);
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  letter-spacing: 0.02em;
}

.status-badge.status-pending { background: #fff8e1; color: #f57f17; }
.status-badge.status-preparing { background: #efebe9; color: #5d4037; }
.status-badge.status-on-the-way { background: #e3f2fd; color: #0d47a1; }
.status-badge.status-delivered { background: #e8f5e9; color: #1b5e20; }

.order-timeline {
  display: grid;
  grid-template-columns: 24px 1fr 24px 1fr 24px 1fr 24px;
  align-items: center;
  padding: 0.25rem 0.5rem;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  opacity: 0.4;
  transition: var(--transition-smooth);
}

.timeline-step.active {
  opacity: 1;
}

.timeline-step .step-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--text-muted);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  transition: var(--transition-smooth);
}

.timeline-step.active .step-circle {
  background: var(--primary-orange);
  box-shadow: 0 4px 10px var(--primary-orange-glow);
}

.timeline-step.current .step-circle {
  background: #fff;
  color: var(--primary-orange);
  box-shadow: inset 0 0 0 3px var(--primary-orange), 0 0 10px var(--primary-orange);
  animation: pulse-ring-orange 1.5s infinite;
}

@keyframes pulse-ring-orange {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.timeline-step .step-label {
  position: absolute;
  top: 30px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.timeline-step.active .step-label {
  color: var(--text-dark);
}

.timeline-line {
  height: 3px;
  background: rgba(255, 138, 101, 0.15);
  border-radius: 99px;
  transition: var(--transition-smooth);
}

.timeline-line.active {
  background: var(--primary-orange);
}

.order-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: rgba(255, 138, 101, 0.03);
  padding: 1.15rem;
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(255, 138, 101, 0.08);
}

.order-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
}

.order-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed var(--glass-border);
  padding-top: 1.15rem;
}

.order-total-price {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.order-total-price span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.order-total-price strong {
  font-size: 1.25rem;
  color: var(--primary-orange);
}

.btn-reorder {
  border: none;
  background: linear-gradient(135deg, var(--primary-orange-light) 0%, var(--primary-orange) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 15px var(--primary-orange-glow);
  transition: var(--transition-smooth);
}

.btn-reorder:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(255, 87, 34, 0.35);
}

/* ==========================================================================
   Responsive Breakpoints & Gestures
   ========================================================================== */

@media (max-width: 1023px) {
  .tracking-layout-wrapper {
    grid-template-columns: 1fr;
    height: 480px; /* Locked map container height on mobile */
  }

  /* Sidebar panel converts into mobile bottom sheet */
  .tracking-sidebar-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 380px;
    border-right: none;
    border-top: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.08);
    transform: translateY(100%); /* Start closed / hidden */
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1010;
  }

  .tracking-sidebar-panel.open {
    transform: translateY(0); /* Opened position */
  }

  /* Display Trigger bar */
  .mobile-drawer-trigger-bar {
    display: block;
  }

  .floating-location-hud {
    top: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    max-width: none;
  }
  
  .stepper-rail {
    left: 17px;
  }
  .stepper-cart-icon {
    left: -16px;
  }
  .step-icon-circle {
    width: 12px;
    height: 12px;
    border-width: 2px;
  }
  .stepper-step.active .step-icon-circle {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 600px) {
  .order-timeline {
    grid-template-columns: 20px 1fr 20px 1fr 20px 1fr 20px;
  }
  .timeline-step .step-circle {
    width: 20px;
    height: 20px;
    font-size: 0.65rem;
  }
  .timeline-step .step-label {
    font-size: 0.62rem;
    top: 26px;
  }
  
  .eta-floating-card {
    padding: 0.85rem;
  }
  .eta-pulse-ring {
    width: 54px;
    height: 54px;
  }
  #eta-mins-val {
    font-size: 1.25rem;
  }
}

/* ==========================================================================
   Premium Glassmorphism Checkout Modal & Bottom Sheet Styling
   ========================================================================== */

.checkout-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(18, 10, 8, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.checkout-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.checkout-modal-container {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--hud-shadow);
  width: 90%;
  max-width: 920px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(30px) scale(0.98);
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 10010;
}

.checkout-modal-overlay.open .checkout-modal-container {
  transform: translateY(0) scale(1);
}

.checkout-modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px dashed var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.checkout-modal-header h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.checkout-modal-close-btn {
  background: rgba(255, 87, 34, 0.08);
  border: none;
  color: var(--text-dark);
  font-size: 1.8rem;
  font-weight: 400;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.checkout-modal-close-btn:hover {
  background: var(--primary-orange);
  color: #fff;
  transform: rotate(90deg);
}

.checkout-modal-body {
  padding: 2rem;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
}

.checkout-modal-body::-webkit-scrollbar {
  width: 6px;
}
.checkout-modal-body::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 99px;
}

/* Layout Columns */
.checkout-form-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.checkout-summary-column {
  background: rgba(255, 138, 101, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: fit-content;
}

.checkout-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 0.25rem;
  position: relative;
  padding-bottom: 0.35rem;
}

.checkout-section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 32px;
  height: 3px;
  background: var(--primary-orange);
  border-radius: 99px;
}

/* Input Fields & Validation Styles */
.checkout-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.checkout-field-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.checkout-field-group label .required {
  color: #d32f2f;
  margin-left: 2px;
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 1rem;
  font-size: 1.1rem;
  pointer-events: none;
  opacity: 0.85;
}

.input-icon-wrapper input,
.input-icon-wrapper textarea {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.8rem;
  border: 1.5px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  background: rgba(255, 255, 255, 0.4);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
  transition: var(--transition-smooth);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.01);
}

body.dark .input-icon-wrapper input,
body.dark .input-icon-wrapper textarea {
  background: rgba(0, 0, 0, 0.2);
}

.input-icon-wrapper input:focus,
.input-icon-wrapper textarea:focus {
  outline: none;
  border-color: var(--primary-orange);
  background: #fff;
  box-shadow: 0 0 0 4px var(--primary-orange-glow);
}

body.dark .input-icon-wrapper input:focus,
body.dark .input-icon-wrapper textarea:focus {
  background: rgba(0, 0, 0, 0.4);
}

.field-error-msg {
  display: none;
  font-size: 0.72rem;
  font-weight: 700;
  color: #d32f2f;
  margin-top: 0.15rem;
}

/* Invalid state */
.checkout-field-group.invalid .input-icon-wrapper input,
.checkout-field-group.invalid .input-icon-wrapper textarea {
  border-color: #d32f2f !important;
  box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.15) !important;
}

.checkout-field-group.invalid .field-error-msg {
  display: block;
}

/* Payment Method Cards */
.payment-methods-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.payment-card {
  padding: 0.85rem 1.15rem;
  border: 1.5px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: var(--transition-smooth);
}

body.dark .payment-card {
  background: rgba(0, 0, 0, 0.15);
}

.payment-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-orange-light);
  box-shadow: 0 4px 12px rgba(255, 87, 34, 0.08);
}

.payment-card.active {
  border-color: var(--primary-orange);
  background: var(--primary-orange-glow);
  box-shadow: 0 4px 15px rgba(255, 87, 34, 0.12);
}

.payment-icon {
  font-size: 1.3rem;
}

.payment-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-dark);
}

/* Order Summary Items Row */
.checkout-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.checkout-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dark);
  border-bottom: 1px solid rgba(255, 138, 101, 0.08);
  padding-bottom: 0.45rem;
}

.checkout-item-row span:last-child {
  font-weight: 700;
  color: var(--primary-orange);
}

.checkout-empty-summary {
  font-size: 0.88rem;
  text-align: center;
  color: var(--text-muted);
  padding: 1.5rem 0;
}

/* Coupon Promo Row */
.checkout-coupon-row {
  display: flex;
  gap: 0.5rem;
}

.checkout-coupon-row input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  background: rgba(255, 255, 255, 0.4);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  text-transform: uppercase;
}

body.dark .checkout-coupon-row input {
  background: rgba(0, 0, 0, 0.2);
}

.checkout-coupon-row input:focus {
  outline: none;
  border-color: var(--primary-orange);
}

.checkout-coupon-row button {
  background: var(--text-dark);
  color: #fff;
  border: none;
  border-radius: var(--border-radius-md);
  padding: 0 1.25rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.checkout-coupon-row button:hover {
  background: var(--primary-orange);
}

.checkout-coupon-msg {
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.checkout-coupon-msg.success {
  color: #2e7d32;
}

.checkout-coupon-msg.error {
  color: #d32f2f;
}

/* Loyalty Points Switch Widget */
.checkout-loyalty-widget {
  background: rgba(255, 138, 101, 0.06);
  border: 1px dashed rgba(255, 87, 34, 0.25);
  border-radius: var(--border-radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
}

.checkout-loyalty-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  width: 100%;
}

.checkout-loyalty-toggle input {
  display: none;
}

.checkout-loyalty-toggle .toggle-slider {
  position: relative;
  width: 44px;
  height: 22px;
  background-color: rgba(255, 138, 101, 0.2);
  border-radius: 99px;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.checkout-loyalty-toggle .toggle-slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: var(--transition-smooth);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.checkout-loyalty-toggle input:checked + .toggle-slider {
  background-color: var(--primary-orange);
}

.checkout-loyalty-toggle input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

.checkout-loyalty-toggle .toggle-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dark);
}

.checkout-loyalty-toggle .toggle-label strong {
  color: var(--primary-orange);
}

.checkout-loyalty-empty {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.checkout-loyalty-empty strong {
  color: #2e7d32;
}

/* Pricing Breakdown Row List */
.checkout-pricing-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  border-top: 1px dashed var(--glass-border);
  padding-top: 1rem;
}

.price-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.price-row span:last-child {
  color: var(--text-dark);
  font-weight: 700;
}

.price-row.discount-row span {
  color: #2e7d32 !important;
}

.price-row.grand-total-row {
  border-top: 1px solid var(--glass-border);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
}

.price-row.grand-total-row span:last-child {
  font-size: 1.3rem;
  color: var(--primary-orange);
}

/* Error Banner in Form */
.checkout-error-banner {
  background: rgba(211, 47, 47, 0.08);
  border: 1px solid rgba(211, 47, 47, 0.2);
  color: #d32f2f;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius-md);
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* Modal Bottom sheet CTA */
.checkout-place-order-btn {
  width: 100%;
  font-size: 1.05rem;
  padding: 0.85rem 1rem;
  text-align: center;
  font-weight: 700;
  border-radius: 99px;
  box-shadow: 0 8px 22px var(--primary-orange-glow);
  margin-top: 0.5rem;
}

/* ==========================================================================
   Responsive Adaptations for Checkout Modal (Bottom Sheet for Mobile)
   ========================================================================== */

@media (max-width: 1023px) {
  .checkout-modal-overlay {
    align-items: flex-end;
  }

  .checkout-modal-container {
    width: 100%;
    max-width: none;
    max-height: 85vh;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  }

  .checkout-modal-overlay.open .checkout-modal-container {
    transform: translateY(0);
  }

  .checkout-modal-body {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
  }

  .checkout-summary-column {
    padding: 1.25rem;
  }
}
