:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --accent: #06b6d4;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --success: #10b981;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(15,23,42,0.08);
  --shadow-lg: 0 12px 28px rgba(15,23,42,0.12);
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: #0b0f19;
  color: var(--text-main);
  line-height: 1.5;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

/* Constrain mobile app to max 440px on desktop, full width on 390px mobile */
.app-container {
  width: 100%;
  max-width: 440px;
  background-color: var(--bg-body);
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 40px rgba(0,0,0,0.3);
  padding-bottom: 90px;
  display: flex;
  flex-direction: column;
}

/* Top Notice */
.top-notice {
  background: linear-gradient(90deg, #4f46e5, #06b6d4);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  padding: 6px 12px;
  letter-spacing: 0.3px;
}

/* App Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.brand-icon {
  font-size: 24px;
}

.brand-text h1 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
  line-height: 1.1;
}

.brand-text .accent {
  color: var(--primary);
}

.brand-text .tagline {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.cart-trigger {
  position: relative;
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.cart-trigger:active {
  transform: scale(0.92);
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: #ef4444;
  color: #ffffff;
  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-card);
}

/* Hero Banner */
.hero-banner {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #ffffff;
  margin: 12px 16px;
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.hero-tag {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
}

.hero-content h2 {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 6px;
}

.hero-content p {
  font-size: 12px;
  color: #cbd5e1;
  margin-bottom: 14px;
}

.hero-perks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.perk-pill {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

/* Category Filter */
.category-scroll {
  display: flex;
  gap: 8px;
  padding: 4px 16px 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.cat-pill {
  flex-shrink: 0;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cat-pill.active {
  background-color: var(--text-main);
  color: #ffffff;
  border-color: var(--text-main);
}

/* Products Section */
.products-section {
  padding: 0 16px 20px 16px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title h3 {
  font-size: 16px;
  font-weight: 700;
}

.item-count {
  font-size: 11px;
  color: var(--text-light);
}

.products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Product Card */
.product-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card:active {
  transform: scale(0.98);
}

.product-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #f1f5f9;
  position: relative;
  overflow: hidden;
}

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

.badge-cod {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background-color: rgba(15,23,42,0.85);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

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

.product-category {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.product-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  margin: 4px 0 8px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 34px;
}

.product-price-row {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}

.current-price {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.original-price {
  font-size: 11px;
  color: var(--text-light);
  text-decoration: line-through;
}

.add-btn {
  width: 100%;
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(79,70,229,0.2);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 38px;
}

.add-btn:active {
  background-color: var(--primary);
  color: #ffffff;
}

/* Sticky Bottom Bar */
.sticky-cart-bar {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: none;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
  z-index: 60;
}

.sticky-cart-bar.visible {
  display: flex;
}

.bar-summary {
  display: flex;
  flex-direction: column;
}

.bar-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.bar-total {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
}

/* Modals & Bottom Sheets */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15,23,42,0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop.active {
  display: flex;
}

.cart-sheet, .checkout-sheet {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

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

.sheet-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.close-btn {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
}

.sheet-body {
  padding: 16px;
  overflow-y: auto;
  flex-grow: 1;
}

.sheet-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

.bill-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.bill-row.highlight .free-tag {
  color: var(--success);
  font-weight: 700;
}

.bill-row.total-row {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  margin-bottom: 14px;
}

/* Cart Item Row */
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

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

.cart-item-img {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  object-fit: cover;
}

.cart-item-info {
  flex-grow: 1;
}

.cart-item-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
}

.cart-item-price {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 6px;
}

.qty-btn {
  background: none;
  border: none;
  width: 24px;
  height: 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-num {
  font-size: 12px;
  font-weight: 700;
  min-width: 14px;
  text-align: center;
}

/* Checkout Form */
.checkout-form {
  padding: 16px 18px 24px 18px;
  overflow-y: auto;
}

.order-summary-box {
  background: var(--primary-light);
  border: 1px solid rgba(79,70,229,0.15);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

.order-summary-box .box-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  margin-bottom: 4px;
}

.cod-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
  min-height: 44px;
}

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

.phone-input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #ffffff;
}

.phone-input-wrap .prefix {
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  background: #f1f5f9;
  border-right: 1px solid var(--border);
  line-height: 44px;
}

.phone-input-wrap input {
  border: none;
  border-radius: 0;
}

.helper-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

/* Buttons */
.btn {
  font-family: inherit;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  text-decoration: none;
  min-height: 46px;
  padding: 0 18px;
}

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

.btn-primary:active {
  background-color: var(--primary-hover);
}

.btn-outline {
  background: #ffffff;
  color: var(--text-main);
  border: 1.5px solid var(--border);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  min-height: 50px;
  font-size: 15px;
}

/* Success Card */
.success-card {
  background: var(--bg-card);
  width: 90%;
  max-width: 400px;
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  animation: popIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  margin: auto;
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.success-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.success-card h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 4px;
}

.success-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.success-details {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  text-align: left;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
}

.detail-row:last-child {
  margin-bottom: 0;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}

.whatsapp-note {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-light);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}
