/* ============================================
   JOUGA GROUP - Customer Panel Design System
   ============================================ */

/* --- CSS Reset / Normalize --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; background: none; border: none; outline: none; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.2; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

/* --- Design Tokens --- */
:root {
  --primary: #F8CB46;
  --primary-light: #FBD96B;
  --primary-dark: #D9A400;
  --primary-ink: #7A6200;
  --primary-bg: rgba(248,203,70,0.15);
  --bg: #F5F5F5;
  --bg-light: #FFFFFF;
  --surface: #FFFFFF;
  --card: #FFFFFF;
  --card-hover: #EEEEEE;
  --text: #212121;
  --text-secondary: #616161;
  --text-muted: #9E9E9E;
  --success: #22C55E;
  --success-bg: rgba(34,197,94,0.12);
  --error: #EF4444;
  --error-bg: rgba(239,68,68,0.12);
  --warning: #F59E0B;
  --warning-bg: rgba(245,158,11,0.12);
  --border: rgba(0,0,0,0.08);
  --border-light: rgba(0,0,0,0.12);
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-pill: 24px;
  --radius-full: 50%;
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-h: 56px;
  --tabbar-h: 64px;
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;
}

/* --- Typography Scale --- */
.text-xs { font-size: 11px; line-height: 1.3; }
.text-sm { font-size: 12px; line-height: 1.4; }
.text-base { font-size: 14px; line-height: 1.5; }
.text-md { font-size: 16px; line-height: 1.4; }
.text-lg { font-size: 18px; line-height: 1.3; }
.text-xl { font-size: 20px; line-height: 1.3; }
.text-2xl { font-size: 24px; line-height: 1.2; }
.text-3xl { font-size: 32px; line-height: 1.1; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-primary { color: var(--primary-ink); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-line-through { text-decoration: line-through; }
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* --- Layout / Spacing --- */
.container { width: 100%; max-width: 480px; margin: 0 auto; padding: 0 16px; }
.px-0 { padding-left: 0; padding-right: 0; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }
.pt-4 { padding-top: 16px; }
.pb-4 { padding-bottom: 16px; }
.pb-20 { padding-bottom: 80px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mr-2 { margin-right: 8px; }
.ml-auto { margin-left: auto; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.hidden { display: none !important; }
.block { display: block; }
.relative { position: relative; }
.absolute { position: absolute; }
.overflow-hidden { overflow: hidden; }
.w-full { width: 100%; }
.h-full { height: 100%; }

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-brand .logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #212121;
}

.header-brand .brand-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--primary-ink);
}

.header-brand .brand-lockup img {
  height: 34px;
  width: auto;
  display: block;
}

.header-brand .header-lockup {
  height: 34px;
  width: auto;
  display: block;
}

.header-location {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  padding: 4px 0;
}

.header-location .location-label {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-location .location-label svg {
  width: 12px;
  height: 12px;
  fill: #212121;
}

.header-location .location-text {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.header-action-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: background var(--transition);
  position: relative;
}

.header-action-btn:hover {
  background: rgba(0,0,0,0.05);
}

.header-action-btn svg {
  width: 22px;
  height: 22px;
  fill: var(--text);
}

/* --- Search Bar --- */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 14px;
  height: 44px;
  gap: 10px;
  transition: border-color var(--transition);
}

.search-bar:focus-within {
  border-color: var(--primary);
}

.search-bar svg {
  width: 18px;
  height: 18px;
  fill: var(--text-secondary);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  height: 100%;
  font-size: 14px;
  color: var(--text);
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--primary);
  color: #212121;
}

.btn-primary:hover { background: var(--primary-light); }
.btn-primary:active { background: var(--primary-dark); transform: scale(0.98); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover { background: var(--card-hover); }

.btn-ghost {
  background: transparent;
  color: var(--primary-ink);
}

.btn-ghost:hover { background: var(--primary-bg); }

.btn-danger {
  background: var(--error);
  color: #fff;
}

.btn-danger:hover { background: var(--error); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary-dark);
  color: var(--primary-ink);
}

.btn-outline:hover { background: var(--primary-bg); }

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-xs {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 16px;
}

.btn-full { width: 100%; }

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
}

.btn-icon svg { width: 20px; height: 20px; }

.btn:disabled, .btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0,0,0,0.25);
  border-top-color: #212121;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* --- Form Inputs --- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
  transition: border-color var(--transition);
}

.form-input:focus {
  border-color: var(--primary);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input.error {
  border-color: var(--error);
}

.form-error {
  font-size: 12px;
  color: var(--error);
  margin-top: 4px;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238899AA' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* --- Cards --- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.card-body {
  padding: 14px;
}

/* Product Card */
.product-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform var(--transition);
}

.product-card:hover { transform: translateY(-2px); }

.product-card .product-img {
  width: 100%;
  aspect-ratio: 1;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.product-card .product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card .product-img .no-img {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  font-size: 34px;
  opacity: 1;
  color: var(--text-muted);
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg) 100%);
}

.product-card .product-img .no-img::after {
  content: 'No image';
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  opacity: 0.75;
}

.product-card .product-discount {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--success);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.product-card .product-info {
  padding: 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card .product-delivery {
  font-size: 11px;
  color: var(--success);
  font-weight: 500;
  margin-bottom: 4px;
}

.product-card .product-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
  flex: 1;
}

.product-card .product-weight {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.product-card .product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-card .product-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.product-card .product-price .price {
  font-size: 15px;
  font-weight: 700;
}

.product-card .product-price .mrp {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: line-through;
}

.product-card .out-of-stock-badge {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.product-card .out-of-stock-badge span {
  background: var(--error);
  color: #fff;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  transform: rotate(-8deg);
}

/* --- Quantity Stepper --- */
.qty-stepper {
  display: flex;
  align-items: center;
  background: var(--primary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  height: 32px;
}

.qty-stepper button {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #212121;
  font-size: 16px;
  font-weight: 700;
  transition: background var(--transition);
}

.qty-stepper button:hover {
  background: rgba(0,0,0,0.08);
}

.qty-stepper .qty-value {
  min-width: 28px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #212121;
}

.qty-stepper-sm {
  height: 28px;
}

.qty-stepper-sm button {
  width: 28px;
  height: 28px;
  font-size: 14px;
}

.qty-stepper-sm .qty-value {
  min-width: 24px;
  font-size: 13px;
}

.qty-stepper-outline {
  background: var(--primary-bg);
  border: 1.5px solid var(--primary);
}

.qty-stepper-outline button { color: var(--primary-ink); }
.qty-stepper-outline .qty-value { color: var(--primary-ink); }

/* Add button (not in cart) */
.add-btn {
  background: var(--primary);
  color: #212121;
  font-weight: 700;
  font-size: 13px;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  transition: all var(--transition);
}

.add-btn:hover { background: var(--primary-light); }

/* --- Category Grid --- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 4px;
  border-radius: var(--radius);
  transition: background var(--transition);
}

.category-item:hover {
  background: rgba(0,0,0,0.04);
}

.category-item .cat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 1px solid var(--border);
  transition: border-color var(--transition);
}

.category-item:hover .cat-icon {
  border-color: var(--primary);
}

.category-item .cat-name {
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
  color: var(--text-secondary);
}

/* Horizontal scroll category */
.category-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-scroll::-webkit-scrollbar { display: none; }

.category-scroll .category-item {
  flex-shrink: 0;
  min-width: 72px;
}

/* --- Product Grid --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.product-grid-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --- Banner / Carousel --- */
.banner-carousel {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 2.2;
}

.banner-carousel .banner-track {
  display: flex;
  transition: transform var(--transition-slow);
  height: 100%;
}

.banner-carousel .banner-slide {
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 20px 24px;
  position: relative;
}

.banner-carousel .banner-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-carousel .banner-content {
  position: relative;
  z-index: 1;
  max-width: 60%;
}

.banner-carousel .banner-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.banner-carousel .banner-subtitle {
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 12px;
}

.banner-carousel .banner-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}

.banner-carousel .banner-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0,0,0,0.25);
  transition: all var(--transition);
}

.banner-carousel .banner-dot.active {
  width: 18px;
  border-radius: 3px;
  background: var(--primary);
}

/* --- Badge / Tag / Chip --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.badge-primary { background: var(--primary-bg); color: var(--primary-ink); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-error { background: var(--error-bg); color: var(--error); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }

.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.chip:hover { border-color: var(--text-secondary); color: var(--text); }

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #212121;
}

.chip-group {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.chip-group::-webkit-scrollbar { display: none; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
}

.tag-discount {
  background: var(--success);
  color: #fff;
}

/* --- Modal / Sheet --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-sheet {
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform var(--transition-slow);
  padding-bottom: var(--safe-bottom);
}

.modal-overlay.active .modal-sheet {
  transform: translateY(0);
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: rgba(0,0,0,0.15);
  border-radius: 2px;
  margin: 10px auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.modal-body {
  padding: 16px;
}

.modal-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

/* Centered modal */
.modal-overlay.modal-center {
  align-items: center;
}

.modal-overlay.modal-center .modal-sheet {
  border-radius: var(--radius-lg);
  max-height: 80vh;
  transform: scale(0.9);
  opacity: 0;
}

.modal-overlay.modal-center.active .modal-sheet {
  transform: scale(1);
  opacity: 1;
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 400px;
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.3s ease forwards;
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-success .toast-icon { background: var(--success-bg); color: var(--success); }
.toast-error .toast-icon { background: var(--error-bg); color: var(--error); }
.toast-warning .toast-icon { background: var(--warning-bg); color: var(--warning); }
.toast-info .toast-icon { background: var(--primary-bg); color: var(--primary-ink); }

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 13px;
  font-weight: 600;
}

.toast-message {
  font-size: 12px;
  color: var(--text-secondary);
}

.toast-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 16px;
  flex-shrink: 0;
}

/* --- Loading Skeleton --- */
.skeleton {
  background: linear-gradient(90deg, #EEEEEE 25%, #E0E0E0 50%, #EEEEEE 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 14px;
  border-radius: 4px;
}

.skeleton-text.w-50 { width: 50%; }
.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-full { width: 100%; }

.skeleton-circle {
  border-radius: 50%;
}

.skeleton-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid var(--border);
}

.skeleton-product {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.skeleton-product .skeleton-img {
  width: 100%;
  aspect-ratio: 1;
}

.skeleton-product .skeleton-info {
  padding: 10px 12px;
}

/* --- Empty State --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-state .empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 36px;
}

.empty-state .empty-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state .empty-text {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 280px;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* --- Error State --- */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.error-state .error-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--error-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 36px;
  color: var(--error);
}

.error-state .error-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.error-state .error-text {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 280px;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* --- Status Stepper --- */
.status-stepper {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 16px 0;
}

.stepper-step {
  display: flex;
  gap: 14px;
  position: relative;
}

.stepper-step:not(:last-child) {
  padding-bottom: 20px;
}

.stepper-step .step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 28px;
}

.stepper-step .step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  z-index: 1;
  transition: all var(--transition);
}

.stepper-step.completed .step-dot {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.stepper-step.active .step-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: #212121;
  box-shadow: 0 0 0 4px var(--primary-bg);
}

.stepper-step .step-line {
  width: 2px;
  flex: 1;
  background: var(--border);
  margin-top: 4px;
}

.stepper-step.completed .step-line {
  background: var(--success);
}

.stepper-step .step-content {
  flex: 1;
  min-width: 0;
}

.stepper-step .step-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.stepper-step .step-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.stepper-step.active .step-title {
  color: var(--primary);
}

/* --- Order Card --- */
.order-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px;
  cursor: pointer;
  transition: all var(--transition);
}

.order-card:hover {
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.order-card .order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.order-card .order-id {
  font-size: 14px;
  font-weight: 600;
}

.order-card .order-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.order-card .order-items {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.order-card .order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-card .order-total {
  font-size: 15px;
  font-weight: 700;
}

/* --- Bottom Tab Bar --- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #FFFFFF;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 6px 0 calc(6px + var(--safe-bottom));
  z-index: 200;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
}

.tabbar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
  color: var(--text-muted);
  min-width: 56px;
}

.tabbar-item svg {
  width: 22px;
  height: 22px;
  transition: all var(--transition);
}

.tabbar-item span {
  font-size: 10px;
  font-weight: 500;
  transition: color var(--transition);
}

.tabbar-item.active {
  color: var(--primary-ink);
}

.tabbar-item.active svg {
  fill: var(--primary-ink);
}

/* Cart badge on tabbar */
.tabbar-item .tabbar-badge {
  position: absolute;
  top: 0;
  right: 8px;
  background: var(--error);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* --- Cart Badge (floating) --- */
.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--error);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg);
}

/* --- Cart Bar (bottom floating) --- */
.cart-bar {
  position: fixed;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px);
  left: 16px;
  right: 16px;
  max-width: 448px;
  margin: 0 auto;
  background: var(--primary);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 150;
  box-shadow: 0 4px 20px rgba(248,203,70,0.4);
  cursor: pointer;
  transition: transform var(--transition);
}

.cart-bar:hover { transform: translateY(-2px); }

.cart-bar .cart-info {
  display: flex;
  flex-direction: column;
}

.cart-bar .cart-count {
  font-size: 14px;
  font-weight: 700;
  color: #212121;
}

.cart-bar .cart-total-text {
  font-size: 12px;
  color: rgba(0,0,0,0.65);
}

.cart-bar .cart-arrow {
  font-size: 18px;
  color: #212121;
}

/* --- Wallet Card --- */
.wallet-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-lg);
  padding: 24px;
  color: #212121;
  position: relative;
  overflow: hidden;
}

.wallet-card::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.wallet-card::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 160px;
  height: 160px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.wallet-card .wallet-balance-label {
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 4px;
}

.wallet-card .wallet-balance {
  font-size: 32px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.wallet-card .wallet-id {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 12px;
}

/* --- Transaction List --- */
.transaction-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.transaction-item:last-child {
  border-bottom: none;
}

.transaction-item .tx-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.transaction-item .tx-icon.credit {
  background: var(--success-bg);
  color: var(--success);
}

.transaction-item .tx-icon.debit {
  background: var(--error-bg);
  color: var(--error);
}

.transaction-item .tx-info {
  flex: 1;
  min-width: 0;
}

.transaction-item .tx-title {
  font-size: 14px;
  font-weight: 500;
}

.transaction-item .tx-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.transaction-item .tx-amount {
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.transaction-item .tx-amount.credit { color: var(--success); }
.transaction-item .tx-amount.debit { color: var(--error); }

/* --- Timeline --- */
.timeline-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
}

.timeline-item .timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  margin-top: 5px;
}

.timeline-item.active .timeline-dot {
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-bg);
}

.timeline-item .timeline-content {
  flex: 1;
}

.timeline-item .timeline-title {
  font-size: 14px;
  font-weight: 500;
}

.timeline-item .timeline-time {
  font-size: 12px;
  color: var(--text-secondary);
}

/* --- Map Placeholder --- */
.map-placeholder {
  width: 100%;
  height: 200px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px dashed var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.map-placeholder .map-icon {
  font-size: 32px;
  opacity: 0.5;
}

/* --- Offer Card --- */
.offer-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.offer-card:hover { border-color: var(--primary); }

.offer-card .offer-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.offer-card .offer-info {
  flex: 1;
  min-width: 0;
}

.offer-card .offer-title {
  font-size: 14px;
  font-weight: 600;
}

.offer-card .offer-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

/* --- Listing Card (Marketplace) --- */
.listing-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform var(--transition);
}

.listing-card:hover { transform: translateY(-2px); }

.listing-card .listing-img {
  width: 100%;
  aspect-ratio: 1.2;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.listing-card .listing-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-card .listing-info {
  padding: 12px;
}

.listing-card .listing-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  line-clamp: 2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.listing-card .listing-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.listing-card .listing-seller {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* --- Notification Item --- */
.notification-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}

.notification-item:hover {
  background: rgba(0,0,0,0.02);
}

.notification-item.unread {
  background: rgba(248,203,70,0.04);
}

.notification-item .notif-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.notification-item .notif-content {
  flex: 1;
  min-width: 0;
}

.notification-item .notif-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}

.notification-item .notif-body {
  font-size: 12px;
  color: var(--text-secondary);
  line-clamp: 2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-item .notif-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --- Avatar --- */
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-ink);
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-lg { width: 72px; height: 72px; font-size: 28px; }

/* --- Divider --- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* --- Section Header --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-header .section-title {
  font-size: 16px;
  font-weight: 600;
}

.section-header .section-link {
  font-size: 13px;
  color: var(--primary-ink);
  font-weight: 500;
  cursor: pointer;
}

/* --- Price Display --- */
.price-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.price-display .price-current {
  font-size: 18px;
  font-weight: 700;
}

.price-display .price-original {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: line-through;
}

.price-display .price-discount {
  font-size: 12px;
  color: var(--success);
  font-weight: 600;
}

/* --- Price Breakdown --- */
.price-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.price-row .price-label {
  color: var(--text-secondary);
}

.price-row.total {
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.price-row.total .price-label,
.price-row.total .price-value {
  font-weight: 700;
  font-size: 16px;
}

/* --- Notification Bell --- */
.notif-bell {
  position: relative;
}

.notif-bell .notif-count {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--error);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

/* --- Section Tabs --- */
.section-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.section-tabs::-webkit-scrollbar { display: none; }

.section-tab {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  position: relative;
  cursor: pointer;
  transition: color var(--transition);
}

.section-tab:hover { color: var(--text); }

.section-tab.active {
  color: var(--primary-ink);
}

.section-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 1px 1px 0 0;
}

/* --- Inline Stepper (product row) --- */
.product-row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.product-row:last-child { border-bottom: none; }

.product-row .product-row-img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.product-row .product-row-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-row .product-row-info {
  flex: 1;
  min-width: 0;
}

.product-row .product-row-name {
  font-size: 14px;
  font-weight: 500;
  line-clamp: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-row .product-row-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.product-row .product-row-price {
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
}

/* --- Sticky Bottom CTA --- */
.sticky-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + var(--safe-bottom));
  z-index: 150;
}

/* --- Wallet Quick Actions --- */
.wallet-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.wallet-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all var(--transition);
  cursor: pointer;
}

.wallet-action-btn:hover {
  border-color: var(--primary);
  background: var(--card-hover);
}

.wallet-action-btn .action-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.wallet-action-btn .action-label {
  font-size: 12px;
  font-weight: 500;
}

/* --- Plan Card --- */
.plan-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 2px solid var(--border);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.plan-card:hover, .plan-card.selected {
  border-color: var(--primary);
}

.plan-card.selected::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: #212121;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #212121;
}

.plan-card .plan-amount {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-ink);
}

.plan-card .plan-name {
  font-size: 14px;
  font-weight: 500;
  margin-top: 4px;
}

.plan-card .plan-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* --- Responsive --- */
@media (min-width: 481px) {
  .container { max-width: 480px; }
}

@media (max-width: 360px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .product-card .product-info { padding: 8px 10px; }
}

/* --- Animations --- */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

.animate-fadeIn { animation: fadeIn 0.3s ease; }
.animate-slideUp { animation: slideUp 0.3s ease; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-bounce { animation: bounce 1s infinite; }

/* --- Pull to Refresh --- */
.ptr-wrapper {
  position: relative;
  overflow: hidden;
}

.ptr-indicator {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: top 0.2s;
  z-index: 10;
}

.ptr-indicator.visible { top: 10px; }

.ptr-indicator .ptr-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* --- Misc --- */
.page-content {
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  min-height: 100vh;
}

.page-content.no-tabbar {
  padding-bottom: 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.no-scroll { overflow: hidden; }

/* QR/Barcode placeholder */
.qr-area, .barcode-area {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-area canvas, .barcode-area canvas {
  display: block;
}

/* Barcode lines placeholder */
.barcode-lines {
  display: flex;
  gap: 1px;
  align-items: flex-end;
  height: 50px;
}

.barcode-lines .line {
  background: #000;
  height: 100%;
}

/* --- Quick Actions Grid (home) --- */
.quick-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

/* --- Desktop-only chrome (hidden on mobile) --- */
.header-search-desktop,
.header-nav-desktop,
.desktop-footer {
  display: none;
}

/* --- Tablet --- */
@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
}

/* --- Desktop: full-width fluid layout --- */
@media (min-width: 1024px) {
  /* Pin short pages' footer to the bottom of the viewport instead of
     pushing it a full 100vh below the content */
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .page-content {
    flex: 1 0 auto;
    min-height: 0;
  }

  .container {
    max-width: none;
    padding: 0 32px;
  }

  /* Full-width header */
  .header {
    height: 72px;
    padding: 0 32px;
    gap: 24px;
  }

  .header-brand .logo {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }

  .header-brand .brand-name {
    font-size: 19px;
  }

  .header-brand .header-lockup {
    height: 40px;
  }

  .header-location {
    flex: 0 1 auto;
    max-width: 220px;
  }

  /* Desktop search */
  .header-search-desktop {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 520px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 16px;
    height: 46px;
    gap: 10px;
    transition: border-color var(--transition);
  }

  .header-search-desktop:focus-within {
    border-color: var(--primary);
  }

  .header-search-desktop svg {
    width: 18px;
    height: 18px;
    fill: var(--text-secondary);
    flex-shrink: 0;
  }

  .header-search-desktop input {
    flex: 1;
    height: 100%;
    font-size: 16px;
    color: var(--text);
  }

  .header-search-desktop input::placeholder {
    color: var(--text-muted);
  }

  /* Desktop nav */
  .header-nav-desktop {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .header-nav-desktop a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    white-space: nowrap;
  }

  .header-nav-desktop a:hover {
    color: var(--text);
    background: rgba(0,0,0,0.05);
  }

  .header-nav-desktop a.active {
    color: #212121;
    background: rgba(0,0,0,0.08);
  }

  /* Mobile-only elements */
  .home-mobile-search {
    display: none !important;
  }

  body.page-home .tabbar {
    display: none;
  }

  body.page-home .page-content {
    padding-bottom: 40px;
  }

  body.page-home .cart-bar {
    left: auto;
    right: 24px;
    bottom: 24px;
    max-width: 360px;
  }

  /* Fluid grids that stretch full width */
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
  }

  .category-scroll {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    overflow: visible;
  }

  .category-scroll .category-item {
    min-width: 0;
  }

  /* Full-width hero */
  .banner-carousel {
    aspect-ratio: auto;
    height: 340px;
    border-radius: var(--radius-lg);
  }

  .banner-carousel .banner-title {
    font-size: 28px;
  }

  .banner-carousel .banner-subtitle {
    font-size: 15px;
  }

  .section-header {
    margin-bottom: 16px;
  }

  .section-header .section-title {
    font-size: 20px;
  }

  .section-header .section-link {
    font-size: 14px;
  }

  .product-card .product-name {
    font-size: 14px;
  }

  .product-card .product-price .price {
    font-size: 17px;
  }

  /* Footer */
  .desktop-footer {
    display: block;
    border-top: 1px solid var(--border);
    margin-top: 48px;
    background: var(--bg-light);
  }

  .desktop-footer-inner {
    max-width: none;
    margin: 0;
    padding: 40px 32px 24px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
  }

  .footer-brand .logo {
    width: 38px;
    height: 38px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 17px;
    color: #fff;
    margin-bottom: 12px;
  }

  .footer-brand p {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 260px;
    line-height: 1.6;
  }

  .footer-col h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
  }

  .footer-col a {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 5px 0;
    transition: color var(--transition);
  }

  .footer-col a:hover {
    color: var(--primary-ink);
  }

  .footer-bottom {
    max-width: none;
    margin: 0;
    padding: 16px 32px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
  }
}

@media (min-width: 1400px) {
  .container {
    padding: 0 48px;
  }

  .header {
    padding: 0 48px;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
  }

  .banner-carousel {
    height: 380px;
  }

  .desktop-footer-inner {
    padding: 48px 48px 28px;
  }

  .footer-bottom {
    padding: 16px 48px 24px;
  }
}
