/* BlinkMart - Premium Grocery App Styles */

:root {
  --primary: #0c831f;
  --primary-dark: #096b19;
  --secondary: #f8c301;
  --accent: #ff6b35;
  --text-dark: #1a1a2e;
  --text-light: #666;
  --bg-light: #f8f9fa;
  --border: #e5e7eb;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 24px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.3);
}

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

body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg-light); color: var(--text-dark); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }

/* Header */
.header {
  background: var(--primary);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 4px 12px rgba(12,131,31,0.25);
}
.header-content {
  max-width: 1280px; margin: 0 auto;
  display: flex; flex-direction: column;
  padding: 0;
}
.header-top-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; width: 100%; gap: 16px;
}
.header-bottom-row {
  padding: 8px 16px 12px; width: 100%;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.logo-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #0f9f28 0%, #0a6f1c 100%);
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 8px 18px rgba(0,0,0,0.18);
  position: relative;
  overflow: hidden;
}
.logo-mark::before {
  content: '';
  position: absolute;
  inset: -40% 35% auto auto;
  width: 24px;
  height: 50px;
  transform: rotate(28deg);
  background: linear-gradient(180deg, rgba(255,255,255,0.32), rgba(255,255,255,0));
}
.logo-bag {
  width: 22px;
  height: 18px;
  border-radius: 5px 5px 7px 7px;
  background: linear-gradient(180deg, #ffffff 0%, #ecfff0 100%);
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.14);
  animation: logo-bob 2.8s ease-in-out infinite;
}
.logo-handle {
  position: absolute;
  left: 3px;
  top: -8px;
  width: 16px;
  height: 10px;
  border: 2px solid #ffffff;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}
.logo-leaf {
  position: absolute;
  left: 7px;
  top: 5px;
  width: 9px;
  height: 11px;
  background: linear-gradient(180deg, #f8c301 0%, #ffdf62 100%);
  border-radius: 100% 0 100% 0;
  transform: rotate(-35deg);
  box-shadow: 0 0 0 1px rgba(12,131,31,0.08);
}
.logo-leaf::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 1px;
  height: 10px;
  background: rgba(12,131,31,0.35);
  transform: rotate(35deg);
  transform-origin: top center;
}
.logo-spark {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(248,195,1,0.95);
  box-shadow: 0 0 8px rgba(248,195,1,0.7);
}
.spark-one {
  top: -3px;
  right: -4px;
  animation: logo-twinkle 1.8s ease-in-out infinite;
}
.spark-two {
  right: -8px;
  bottom: 4px;
  width: 4px;
  height: 4px;
  animation: logo-twinkle 1.8s ease-in-out infinite 0.4s;
}
.logo-text { color: #ffffff; font-size: 22px; font-weight: 800; letter-spacing: -0.6px; }
.logo-sub { color: var(--secondary); font-size: 11px; font-weight: 600; margin-top: -2px; }
.delivery-badge {
  background: #f0fdf4; color: var(--primary);
  border: 1px solid #dcfce7; border-radius: 12px;
  padding: 4px 10px; font-size: 12px; display: flex; align-items: center; gap: 6px;
}
.delivery-badge .dot { width: 8px; height: 8px; background: var(--secondary); border-radius: 50%; animation: pulse 1.5s infinite; }

/* Search */
.search-wrap { flex: 1; max-width: 100%; position: relative; }
.search-input {
  width: 100%; padding: 12px 16px 12px 42px;
  border-radius: 12px; border: none; outline: none;
  font-size: 14px; background: #ffffff;
  transition: all 0.2s;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.search-input:focus { background: #ffffff; box-shadow: 0 0 10px rgba(0,0,0,0.1); }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 14px; }
.search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: white; border-radius: 10px; box-shadow: var(--shadow-lg);
  z-index: 200; max-height: 400px; overflow-y: auto;
}
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; cursor: pointer; transition: background 0.15s;
}
.search-result-item:hover { background: #f5f5f5; }
.search-result-img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }

/* Nav icons */
.nav-icons { display: flex; align-items: center; gap: 10px; }
.nav-btn {
  background: rgba(255,255,255,0.15); color: white;
  border: none; border-radius: 12px; padding: 10px 14px;
  cursor: pointer; font-size: 14px; display: flex; align-items: center; gap: 7px;
  transition: all 0.2s; font-weight: 600;
}
.nav-btn:hover { background: rgba(255,255,255,0.25); transform: translateY(-1px); }
.cart-count {
  background: var(--secondary); color: #333; border-radius: 50%;
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; margin-left: 2px;
}

/* Category tabs */
.category-bar {
  background: white; border-bottom: 1px solid var(--border);
  position: sticky; top: 64px; z-index: 90;
  padding: 12px 0;
}
.category-scroll {
  max-width: 1280px; margin: 0 auto;
  display: flex; gap: 12px; overflow-x: auto; padding: 0 16px;
  scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }
.cat-tab {
  flex: 0 0 120px; height: 80px; border-radius: 12px;
  position: relative; overflow: hidden; cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; border: 2px solid transparent;
}
.cat-tab::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.7) 100%);
  z-index: 1; transition: opacity 0.3s;
}
.cat-tab:hover { transform: translateY(-3px); box-shadow: 0 8px 15px rgba(0,0,0,0.2); }
.cat-tab:hover::before { opacity: 0.8; }
.cat-tab.active { border-color: var(--primary); transform: scale(1.05); }

.cat-bg {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
.cat-content {
  position: relative; z-index: 2; padding: 8px;
}
.cat-icon { 
  font-size: 20px; color: white; display: block; margin-bottom: 4px; 
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); 
}
.cat-name { 
  font-size: 13px; font-weight: 700; color: white; 
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  line-height: 1.2;
}

/* Hero Banner */
.hero-banner {
  max-width: 1280px; margin: 0 auto;
  padding: 16px;
}
.hero-slider {
  border-radius: 20px; overflow: hidden;
  padding: 40px; color: white;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 200px; position: relative;
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
  transition: all 0.5s ease;
}
.hero-text {
  position: relative; z-index: 2;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 24px 32px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.2);
  max-width: 50%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.hero-text h2 { 
  font-size: 36px; font-weight: 900; line-height: 1.1; 
  margin-bottom: 8px;
  background: linear-gradient(to bottom, #fff, #eee);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-text p { font-size: 16px; opacity: 0.95; margin-top: 8px; font-weight: 500; }
.hero-cta {
  margin-top: 20px; background: white; color: var(--text-dark);
  border: none; border-radius: 12px; padding: 12px 28px;
  font-weight: 800; cursor: pointer; font-size: 15px;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.hero-cta:hover { 
  transform: scale(1.05); 
  box-shadow: 0 6px 20px rgba(255,255,255,0.4);
  background: var(--primary); color: white;
}
.hero-emoji { 
  font-size: 100px; z-index: 2; 
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.2));
}

@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(3deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes logo-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes logo-twinkle {
  0%, 100% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.35); opacity: 1; }
}

/* Product Grid */
.section-title {
  font-size: 20px; font-weight: 700; color: var(--text-dark);
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.product-card {
  background: white; border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow-sm); transition: all 0.25s; cursor: pointer;
  border: 1px solid var(--border); position: relative;
}
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.product-img-wrap { position: relative; padding-top: 75%; overflow: hidden; background: #f8f9fa; }
.product-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.product-card:hover .product-img { transform: scale(1.05); }
.wishlist-btn {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.92); color: #64748b;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(15,23,42,0.14);
  cursor: pointer; transition: transform 0.2s, color 0.2s, background 0.2s;
}
.wishlist-btn:hover { transform: scale(1.08); color: #e11d48; }
.wishlist-btn.active { color: #e11d48; background: #fff1f2; }
.discount-badge {
  position: absolute; top: 8px; left: 8px;
  background: #ff4444; color: white; border-radius: 6px;
  font-size: 11px; font-weight: 700; padding: 2px 6px;
}
.product-body { padding: 10px; }
.product-name { font-size: 14px; font-weight: 600; color: var(--text-dark); line-height: 1.3; margin-bottom: 2px; }
.product-unit { font-size: 12px; color: var(--text-light); margin-bottom: 8px; }
.product-price-row { display: flex; align-items: center; justify-content: space-between; }
.price-current { font-size: 16px; font-weight: 700; color: var(--text-dark); }
.price-mrp { font-size: 12px; color: #999; text-decoration: line-through; margin-left: 4px; }

/* Add to cart button */
.add-btn {
  background: white; color: var(--primary);
  border: 2px solid var(--primary); border-radius: 8px;
  padding: 5px 12px; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all 0.2s; display: flex; align-items: center; gap: 4px;
}
.add-btn:hover { background: var(--primary); color: white; }
.qty-ctrl {
  display: flex; align-items: center; gap: 8px;
  background: var(--primary); border-radius: 8px; padding: 4px 8px;
}
.qty-btn {
  background: none; border: none; color: white;
  font-size: 16px; cursor: pointer; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.qty-num { color: white; font-weight: 700; font-size: 15px; min-width: 20px; text-align: center; }

/* Cart Sidebar */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 300; display: none;
}
.cart-overlay.open { display: block; }
.cart-panel {
  position: fixed; right: -420px; top: 0; bottom: 0; width: 400px;
  background: white; z-index: 301;
  transition: right 0.3s ease; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.cart-panel.open { right: 0; }
.cart-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.cart-header h2 { font-size: 18px; font-weight: 700; }
.cart-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #666; }
.cart-items { flex: 1; overflow-y: auto; padding: 12px; }
.cart-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 8px;
}
.cart-item-img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 14px; font-weight: 600; }
.cart-item-price { font-size: 13px; color: var(--text-light); }
.cart-footer {
  border-top: 1px solid var(--border); padding: 16px 20px;
  background: #fafafa;
}
.cart-summary-row {
  display: flex; justify-content: space-between;
  font-size: 14px; padding: 4px 0; color: var(--text-dark);
}
.cart-summary-row.total {
  font-size: 16px; font-weight: 700; border-top: 1px solid var(--border);
  margin-top: 8px; padding-top: 12px;
}
.checkout-btn {
  width: 100%; background: var(--primary); color: white;
  border: none; border-radius: 10px; padding: 14px;
  font-size: 16px; font-weight: 700; cursor: pointer; margin-top: 12px;
  transition: background 0.2s;
}
.checkout-btn:hover { background: var(--primary-dark); }
.empty-cart { text-align: center; padding: 40px 20px; color: var(--text-light); }
.empty-cart i { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 400; display: flex; align-items: center; justify-content: center; padding: 20px;
  display: none;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white; border-radius: 16px; width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: white;
}
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #666; }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-dark); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; outline: none; transition: border 0.2s;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(12,131,31,0.1); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Buttons */
.btn {
  padding: 10px 20px; border-radius: 8px; font-size: 14px;
  font-weight: 600; cursor: pointer; border: none; transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-outline { background: white; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: #e8f5e9; }
.btn-secondary { background: #6b7280; color: white; }
.btn-secondary:hover { background: #4b5563; }
.btn-warning { background: #f59e0b; color: white; }
.btn-warning:hover { background: #d97706; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* Admin Layout */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; background: #1e293b; color: white;
  position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto;
  z-index: 50; transition: transform 0.3s;
}
.admin-sidebar-header {
  padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.admin-logo { font-size: 20px; font-weight: 800; color: var(--secondary); }
.admin-logo small { display: block; font-size: 11px; color: rgba(255,255,255,0.5); font-weight: 400; margin-top: 2px; }
.admin-nav { padding: 12px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border-radius: 8px; color: rgba(255,255,255,0.7); cursor: pointer;
  transition: all 0.2s; font-size: 14px; font-weight: 500; margin-bottom: 4px;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: white; }
.nav-item.active { background: var(--primary); color: white; }
.nav-item i { width: 18px; text-align: center; font-size: 15px; }

.admin-main { margin-left: 240px; flex: 1; min-height: 100vh; background: #f1f5f9; }
.admin-topbar {
  background: white; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40;
  box-shadow: var(--shadow-sm);
}
.admin-topbar h1 { font-size: 20px; font-weight: 700; }
.admin-content { padding: 24px; }

/* Stat Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: white; border-radius: 14px; padding: 20px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
}
.stat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
}
.stat-info .value { font-size: 26px; font-weight: 800; line-height: 1; }
.stat-info .label { font-size: 13px; color: var(--text-light); margin-top: 4px; }
.stat-info .change { font-size: 12px; margin-top: 4px; font-weight: 600; }
.change-up { color: #22c55e; }
.change-down { color: #ef4444; }

/* Tables */
.table-wrap { background: white; border-radius: 14px; box-shadow: var(--shadow-sm); overflow: hidden; border: 1px solid var(--border); }
.table-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.table-header h3 { font-size: 16px; font-weight: 700; }
.table-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-box {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; outline: none; min-width: 200px;
}
.search-box:focus { border-color: var(--primary); }
.select-filter {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; outline: none; cursor: pointer; background: white;
}
table { width: 100%; border-collapse: collapse; }
th { background: #f8fafc; padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; font-size: 14px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }
.td-img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }

/* Status badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #dbeafe; color: #1e40af; }
.badge-processing { background: #e0e7ff; color: #4338ca; }
.badge-out_for_delivery { background: #fce7f3; color: #9d174d; }
.badge-delivered { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-blue { background: #dbeafe; color: #1e40af; }

/* Charts */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 24px; }
.chart-card {
  background: white; border-radius: 14px; padding: 20px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.chart-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 16px; }

/* Login */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0c831f 0%, #1a9e30 100%);
}
.login-card {
  background: white; border-radius: 20px; padding: 40px;
  width: 100%; max-width: 420px; box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .icon { font-size: 48px; margin-bottom: 8px; }
.login-logo h1 { font-size: 24px; font-weight: 800; color: var(--primary); }
.login-logo p { color: var(--text-light); font-size: 14px; }

/* Pagination */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px; 
}
.page-btn {
  padding: 7px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: white; cursor: pointer; font-size: 14px; transition: all 0.2s;
}
.page-btn:hover, .page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Order status timeline */
.status-timeline { display: flex; gap: 0; margin: 16px 0; }
.status-step {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  position: relative;
}
.status-step::before {
  content: ''; position: absolute; top: 14px; left: 50%; right: -50%;
  height: 2px; background: #e5e7eb; z-index: 0;
}
.status-step:last-child::before { display: none; }
.status-step.done::before { background: var(--primary); }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid #e5e7eb;
  background: white; z-index: 1; display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.status-step.done .step-dot { background: var(--primary); border-color: var(--primary); color: white; }
.status-step.active .step-dot { border-color: var(--primary); color: var(--primary); }
.step-label { font-size: 10px; color: var(--text-light); margin-top: 4px; text-align: center; }
.status-step.done .step-label { color: var(--primary); font-weight: 600; }

/* Invoice */
.invoice-page { max-width: 700px; margin: 0 auto; padding: 20px; }
.invoice-card { background: white; border-radius: 16px; padding: 32px; box-shadow: var(--shadow-md); }
.invoice-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.invoice-actions {
  margin-bottom: 16px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
}
.invoice-meta-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px;
}
.invoice-summary-wrap {
  display: flex; justify-content: flex-end;
}
.invoice-summary-card {
  min-width: 260px;
}
.invoice-logo { font-size: 24px; font-weight: 800; color: var(--primary); }
.invoice-badge { background: #d1fae5; color: #065f46; padding: 4px 12px; border-radius: 6px; font-size: 13px; font-weight: 700; }
.invoice-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.invoice-table th { background: #f8fafc; }
.invoice-total-row { font-weight: 700; font-size: 16px; }
.invoice-footer { text-align: center; color: var(--text-light); font-size: 13px; margin-top: 24px; }
@media print {
  .no-print { display: none !important; }
  body { background: white; }
  .invoice-card { box-shadow: none; }
}

/* Toast */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 1000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: #1e293b; color: white; padding: 12px 20px;
  border-radius: 10px; font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  animation: slideInUp 0.3s ease; box-shadow: var(--shadow-lg);
  min-width: 240px;
}
.toast.success { background: var(--primary); }
.toast.error { background: #ef4444; }
.toast.warning { background: #f59e0b; }

/* Reusable layout helpers */
.modal-actions-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.modal-actions-row {
  display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; flex-wrap: wrap;
}
.dashboard-split-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px;
}
.status-card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px;
}
.detail-header-row {
  display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; gap: 12px;
}
.detail-info-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;
}
.delivery-jobs-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 16px;
}
.delivery-job-head {
  display: flex; justify-content: space-between; width: 100%; gap: 10px; align-items: flex-start;
}
.delivery-job-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%;
}
.sidebar-toggle {
  display: none; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 10px;
  background: white; color: #1e293b; align-items: center; justify-content: center; cursor: pointer;
}
.topbar-actions {
  display: flex; align-items: center; gap: 12px; margin-left: auto;
}
.admin-sidebar-overlay {
  display: none;
}

/* Loading */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--text-light); }
.spinner { width: 36px; height: 36px; border: 3px solid #e5e7eb; border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 12px; }

/* Animations */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes slideInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Responsive */
@media (max-width: 768px) {
  .header { position: sticky; top: 0; }
  .header-top-row { padding: 10px 16px; border-bottom: 1px solid #f8fafc; }
  .header-bottom-row { padding: 8px 12px 10px; }
  .logo-text { font-size: 19px; }
  .logo-sub { display: none; }
  .logo-mark { width: 36px; height: 36px; }
  .search-wrap { width: 100%; max-width: 100%; }
  .search-input { font-size: 14px; padding: 10px 16px 10px 40px; }
  .nav-btn { padding: 8px 10px; border: none; background: transparent; }
  .nav-btn:hover { background: #f1f5f9; }
  .category-bar { position: static; padding: 10px 0; }
  .cat-tab { flex-basis: 110px; height: 74px; }
  .promo-strip { justify-content: flex-start; overflow-x: auto; padding: 8px 12px; }
  .main-content { padding: 12px; }
  .hero-banner { padding: 12px; }
  .hero-slider { flex-direction: column; align-items: flex-start; gap: 18px; padding: 24px 18px; min-height: 0; }
  .hero-text { max-width: 100%; padding: 18px; }
  .hero-text h2 { font-size: 28px; }
  .hero-emoji { font-size: 72px; align-self: center; }
  .section-title { font-size: 18px; flex-wrap: wrap; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 4px 0; }
  .product-card { display: flex; flex-direction: column; height: auto; min-height: 290px; border-radius: 12px; box-shadow: var(--shadow-sm); border: 1px solid #f1f5f9; background: #fff; overflow: hidden; }
  .product-img-wrap { width: 100%; padding-top: 100%; position: relative; flex-shrink: 0; background: #fff; border-bottom: 1px solid #f1f5f9; }
  .product-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
  .product-body { padding: 10px; display: flex; flex-direction: column; flex: 1; }
  .product-name { font-size: 13px; line-height: 1.4; height: 36px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; font-weight: 600; color: #1e293b; margin-bottom: 2px; }
  .product-unit { font-size: 11px; margin-bottom: 8px; color: #64748b; }
  .product-price-row { align-items: center; justify-content: space-between; margin-top: auto; padding-top: 4px; }
  .price-current { font-size: 15px; font-weight: 700; color: #1e293b; }
  .add-btn, .qty-ctrl { padding: 6px 12px; min-width: 70px; justify-content: center; font-size: 12px; border-radius: 8px; font-weight: 700; }
  .discount-badge { top: 8px; left: 8px; padding: 2px 6px; font-size: 10px; border-radius: 4px; z-index: 10; }
  .wishlist-btn { top: 8px; right: 8px; width: 28px; height: 28px; font-size: 12px; z-index: 10; background: rgba(255,255,255,0.9); }
  .account-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-layout { grid-template-columns: 1fr; }
  .account-order-grid { grid-template-columns: 1fr; }
  .account-order-head { flex-direction: column; }
  .account-section { padding: 16px; }
  .mini-timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-overlay { padding: 10px; align-items: flex-end; }
  .modal { max-height: 94vh; border-radius: 18px 18px 0 0; }
  .modal-header { padding: 16px 18px 12px; }
  .modal-body, .modal-footer { padding: 16px 18px; }
  .modal-actions-grid { grid-template-columns: 1fr; }
  .invoice-page { padding: 10px; }
  .invoice-card { padding: 18px; }
  .invoice-card { overflow-x: auto; }
  .invoice-table { min-width: 560px; }
  .invoice-header { flex-direction: column; gap: 14px; }
  .invoice-actions { justify-content: stretch; }
  .invoice-actions .btn { width: 100%; justify-content: center; }
  .invoice-meta-grid { grid-template-columns: 1fr; gap: 16px; }
  .invoice-summary-wrap { justify-content: stretch; }
  .invoice-summary-card { min-width: 0; width: 100%; }
  .table-wrap { overflow: auto; }
  .table-wrap table { min-width: 620px; }
  .search-box, .select-filter { width: 100%; min-width: 0; }
  .table-controls { width: 100%; }
  .chart-grid, .dashboard-split-grid { grid-template-columns: 1fr; }
  .status-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-header-row, .detail-info-grid { grid-template-columns: 1fr; display: grid; }
  .status-timeline { overflow-x: auto; padding-bottom: 6px; }
  .status-step { min-width: 76px; }
  .delivery-jobs-grid { grid-template-columns: 1fr; }
  .delivery-job-actions { grid-template-columns: 1fr; }
  .login-page { padding: 16px; }
  .login-card { padding: 24px 18px; border-radius: 18px; }
  .sidebar-toggle { display: inline-flex; }
  .admin-sidebar-overlay {
    display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); opacity: 0; visibility: hidden; z-index: 45; transition: opacity 0.2s;
  }
  .admin-sidebar-overlay.open { opacity: 1; visibility: visible; }
  .admin-sidebar { transform: translateX(-100%); z-index: 60; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-topbar { padding: 14px 16px; gap: 12px; flex-wrap: wrap; }
  .admin-topbar h1 { font-size: 18px; }
  .topbar-actions { width: 100%; justify-content: space-between; margin-left: 0; }
  .admin-content { padding: 16px; }
  .cart-panel { width: 100%; right: -100%; }
  .cart-header, .cart-footer { padding-left: 16px; padding-right: 16px; }
  .cart-item { align-items: flex-start; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid-2 { grid-template-columns: 1fr; }
  .btn { justify-content: center; }
  .toast-container { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; width: 100%; }
}

/* Product detail modal */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.product-detail-img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
@media (max-width: 500px) {
  .nav-btn { flex-basis: 100%; }
  .stats-grid, .account-stats-grid, .status-card-grid { grid-template-columns: 1fr; }
  .mini-timeline { grid-template-columns: 1fr; }
  .account-order-item { align-items: flex-start; }
  .account-order-item img { width: 44px; height: 44px; }
  .product-detail { grid-template-columns: 1fr; }
}

/* User Profile & Delivery Extras */
.user-order-card {
  background: white; border-radius: 12px; padding: 16px; margin-bottom: 12px;
  border: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center;
}
.delivery-job-card {
  background: white; border-radius: 14px; padding: 20px; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); transition: all 0.2s;
}
.delivery-job-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }

/* Animation for pulsating active job indicator */
@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(12, 131, 31, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(12, 131, 31, 0); }
  100% { box-shadow: 0 0 0 0 rgba(12, 131, 31, 0); }
}
.status-step.active .step-dot { animation: pulse-green 2s infinite; }

/* Main content area */
.main-content { max-width: 1280px; margin: 0 auto; padding: 16px; }

/* Promo strip */
.promo-strip {
  background: var(--secondary); display: flex; align-items: center; justify-content: center;
  gap: 16px; padding: 6px 12px; font-size: 11px; font-weight: 700; color: #1a1a2e;
  overflow: hidden; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.05em;
}

/* Page headers */
.page-header { margin-bottom: 20px; }
.page-header h2 { font-size: 22px; font-weight: 800; }
.page-header p { color: var(--text-light); font-size: 14px; margin-top: 4px; }

/* Account dashboard */
.account-stats-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px;
}
.account-layout {
  display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start;
}
.account-sidebar, .account-main {
  display: flex; flex-direction: column; gap: 20px;
}
.account-section {
  background: white; border: 1px solid var(--border); border-radius: 18px; padding: 20px; box-shadow: var(--shadow-sm);
}
.account-section-header {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px;
}
.account-section-header h3, .account-section-header h4 {
  font-size: 17px; font-weight: 800;
}
.address-stack, .settings-stack, .coupon-list, .support-ticket-list, .account-order-list {
  display: flex; flex-direction: column; gap: 12px;
}
.address-card, .coupon-card, .support-ticket-card, .account-order-panel {
  border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: #fff;
}
.address-card.default {
  border-color: rgba(12,131,31,0.35); background: linear-gradient(180deg, #f7fff8 0%, #ffffff 100%);
}
.address-title {
  font-size: 15px; font-weight: 800; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.address-actions, .account-order-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.settings-item {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer;
}
.settings-item span { display: flex; flex-direction: column; gap: 3px; }
.settings-item small { color: var(--text-light); font-size: 12px; }
.settings-item input { width: 18px; height: 18px; accent-color: var(--primary); }
.coupon-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.coupon-card { background: linear-gradient(180deg, #fffdf5 0%, #ffffff 100%); }
.coupon-card.locked { opacity: 0.72; }
.coupon-card code {
  font-size: 13px; font-weight: 800; letter-spacing: 0.08em; color: #92400e;
  background: #fef3c7; border-radius: 999px; padding: 6px 10px;
}
.account-order-card {
  border: 1px solid var(--border); border-radius: 18px; padding: 18px; background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}
.account-order-head {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px;
}
.account-order-number { font-size: 18px; font-weight: 800; }
.account-order-meta {
  display: flex; flex-wrap: wrap; gap: 12px; color: #64748b; font-size: 13px; margin-top: 6px;
}
.account-order-meta span { display: inline-flex; align-items: center; gap: 6px; }
.mini-timeline {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 14px 0;
}
.mini-step {
  position: relative; display: flex; flex-direction: column; gap: 8px; font-size: 11px; color: #94a3b8;
}
.mini-step::after {
  content: ''; position: absolute; top: 5px; left: calc(50% + 10px); right: -10px; height: 2px; background: #e2e8f0;
}
.mini-step:last-child::after { display: none; }
.mini-step.done::after { background: var(--primary); }
.mini-dot {
  width: 12px; height: 12px; border-radius: 50%; background: #cbd5e1; position: relative; z-index: 1;
}
.mini-step.done .mini-dot { background: var(--primary); }
.mini-step.active { color: #0f172a; font-weight: 700; }
.mini-step.active .mini-dot { box-shadow: 0 0 0 5px rgba(12,131,31,0.12); }
.account-order-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px;
}
.account-panel-title {
  font-size: 12px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px;
}
.account-order-panel p {
  margin: 0 0 5px; font-size: 13px; color: #475569;
}
.account-order-items {
  display: flex; flex-direction: column; gap: 10px;
}
.account-order-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f1f5f9;
}
.account-order-item:last-child { border-bottom: none; }
.account-order-item img {
  width: 52px; height: 52px; object-fit: cover; border-radius: 10px;
}
.compact-empty {
  padding: 24px 16px; border: 1px dashed #dbe3ea; border-radius: 14px; background: #fcfdff;
}

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state i { font-size: 56px; color: #d1d5db; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: #374151; margin-bottom: 8px; }
.empty-state p { color: var(--text-light); margin-bottom: 20px; }

/* Admin product image preview */
.img-preview { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; margin-top: 8px; border: 1px solid var(--border); }

/* Stock indicator */
.stock-low { color: #ef4444; font-weight: 600; }
.stock-ok { color: #22c55e; font-weight: 600; }

/* Final responsive overrides */
@media (max-width: 768px) {
  .account-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .account-sidebar,
  .account-main {
    gap: 16px;
  }

  .account-section {
    padding: 16px;
  }

  .account-section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .account-section-header .btn {
    width: 100%;
  }

  .account-order-head {
    flex-direction: column;
  }

  .account-order-grid {
    grid-template-columns: 1fr;
  }

  .address-actions,
  .account-order-actions {
    flex-direction: column;
  }

  .address-actions .btn,
  .account-order-actions .btn {
    width: 100%;
  }

  .coupon-row {
    flex-direction: column;
    align-items: stretch;
  }

  .coupon-row .btn {
    width: 100%;
  }

  .mini-timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 500px) {
  .account-stats-grid {
    grid-template-columns: 1fr;
  }

  .mini-timeline {
    grid-template-columns: 1fr;
  }

  .account-order-meta {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
  }

  .settings-item {
    align-items: flex-start;
  }
}
