/* ===== QuickMart - Blinkit Style CSS ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  --yellow: #F8CC1B;
  --yellow-dark: #e6bb00;
  --dark: #1a1a1a;
  --gray: #f5f5f5;
  --gray2: #e8e8e8;
  --text: #3d3d3d;
  --text-light: #777;
  --green: #0c831f;
  --red: #e23744;
  --white: #fff;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --bottom-nav: 65px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Poppins', sans-serif;
  background: #f7f7f7;
  color: var(--text);
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ===== HEADER ===== */
.header {
  background: var(--yellow);
  padding: 14px 16px 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(248,204,27,0.3);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.logo { font-size: 22px; font-weight: 800; color: var(--dark); letter-spacing: -0.5px; }
.logo span { color: var(--green); }

.delivery-badge {
  background: var(--dark);
  color: var(--yellow);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.location-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 10px;
}

.location-bar .pin { font-size: 16px; }
.location-bar .chevron { font-size: 10px; opacity: 0.6; }

/* Search Bar */
.search-bar {
  background: var(--white);
  border-radius: 10px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.search-bar input {
  border: none;
  outline: none;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  flex: 1;
  color: var(--text);
}

.search-bar input::placeholder { color: #aaa; font-size: 13px; }
.search-icon { font-size: 16px; color: #aaa; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border-top: 1px solid var(--gray2);
  display: flex;
  z-index: 200;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 8px;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  color: #aaa;
  transition: all 0.2s;
  cursor: pointer;
}

.nav-item.active { color: var(--green); }
.nav-icon { font-size: 22px; }
.nav-item.active .nav-icon { transform: scale(1.1); }

/* Cart badge */
.cart-badge-wrap { position: relative; }
.cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--red);
  color: white;
  font-size: 9px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== PAGE CONTENT ===== */
.page-content {
  padding-bottom: calc(var(--bottom-nav) + 16px);
}

/* ===== BANNER SLIDER ===== */
.banner-section { padding: 14px 0 0; overflow: hidden; }
.banner-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 0 16px 10px; scrollbar-width: none; }
.banner-scroll::-webkit-scrollbar { display: none; }

.banner-card {
  min-width: 280px;
  height: 130px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  background: linear-gradient(135deg, #1a3c34, #0c831f);
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
}

.banner-card.yellow { background: linear-gradient(135deg, #f8cc1b, #f5a623); }
.banner-card.purple { background: linear-gradient(135deg, #6c3483, #a569bd); }
.banner-card.orange { background: linear-gradient(135deg, #e67e22, #f39c12); }

.banner-text h3 { font-size: 16px; font-weight: 700; color: white; line-height: 1.2; }
.banner-text p { font-size: 11px; color: rgba(255,255,255,0.85); margin-top: 4px; }
.banner-text .offer-badge {
  background: var(--yellow);
  color: var(--dark);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 8px;
  display: inline-block;
}

.banner-emoji { font-size: 52px; margin-left: auto; }

/* ===== SECTION HEADERS ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 10px;
}

.section-title { font-size: 16px; font-weight: 700; color: var(--dark); }
.see-all { font-size: 13px; font-weight: 600; color: var(--green); }

/* ===== CATEGORIES ===== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0 16px;
}

.category-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 12px 8px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 2px solid transparent;
}

.category-card:active { transform: scale(0.95); }
.category-card.active { border-color: var(--yellow); }

.category-emoji { font-size: 28px; margin-bottom: 5px; }
.category-name { font-size: 10px; font-weight: 600; color: var(--text); line-height: 1.2; }

/* ===== PRODUCTS ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 16px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
  transition: transform 0.15s;
}

.product-card:active { transform: scale(0.98); }

.product-img-wrap {
  height: 130px;
  background: var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.product-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.product-img-placeholder { font-size: 48px; }

.discount-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--green);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}

.product-info { padding: 10px 10px 12px; }
.product-unit { font-size: 11px; color: var(--text-light); margin-bottom: 2px; }
.product-name { font-size: 13px; font-weight: 600; color: var(--dark); margin-bottom: 6px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.price-wrap { display: flex; flex-direction: column; }
.current-price { font-size: 15px; font-weight: 700; color: var(--dark); }
.original-price { font-size: 11px; color: var(--text-light); text-decoration: line-through; }

/* Add to cart button */
.add-btn {
  background: var(--white);
  border: 2px solid var(--green);
  color: var(--green);
  font-size: 18px;
  font-weight: 700;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Poppins', sans-serif;
}

.add-btn:hover { background: var(--green); color: white; }

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--green);
  border-radius: 8px;
  padding: 2px 6px;
}

.qty-btn {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}

.qty-num { color: white; font-size: 14px; font-weight: 700; min-width: 16px; text-align: center; }

/* ===== CART BOTTOM BAR ===== */
.cart-bar {
  position: fixed;
  bottom: var(--bottom-nav);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  background: var(--green);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  z-index: 150;
  box-shadow: 0 4px 20px rgba(12,131,31,0.35);
  cursor: pointer;
  transition: transform 0.3s;
}

.cart-bar.hidden { transform: translateX(-50%) translateY(200px); }

.cart-bar-left { display: flex; align-items: center; gap: 10px; }
.cart-count-badge {
  background: var(--yellow);
  color: var(--dark);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
}

.cart-bar-text { color: white; font-size: 14px; font-weight: 600; }
.cart-bar-total { color: var(--yellow); font-size: 15px; font-weight: 700; }

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: 100vh;
  background: var(--white);
  display: flex;
  flex-direction: column;
}

.auth-header {
  background: var(--yellow);
  padding: 50px 24px 30px;
  border-radius: 0 0 28px 28px;
}

.auth-header .logo { font-size: 28px; margin-bottom: 6px; }
.auth-header p { font-size: 13px; color: rgba(0,0,0,0.6); font-weight: 500; }

.auth-body { padding: 28px 24px; flex: 1; }
.auth-title { font-size: 22px; font-weight: 700; color: var(--dark); margin-bottom: 6px; }
.auth-subtitle { font-size: 13px; color: var(--text-light); margin-bottom: 28px; }

.form-group { margin-bottom: 16px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-light); margin-bottom: 6px; display: block; text-transform: uppercase; letter-spacing: 0.5px; }

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--gray2);
  border-radius: 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: var(--dark);
  outline: none;
  transition: border-color 0.2s;
  background: var(--white);
}

.form-input:focus { border-color: var(--yellow); }
.form-input::placeholder { color: #bbb; }

.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--yellow);
  border: none;
  border-radius: 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 8px;
}

.btn-primary:active { transform: scale(0.98); background: var(--yellow-dark); }

.auth-switch { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-light); }
.auth-switch a { color: var(--green); font-weight: 600; }

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}

.alert-error { background: #fff0f0; color: var(--red); border-left: 3px solid var(--red); }
.alert-success { background: #f0fff4; color: var(--green); border-left: 3px solid var(--green); }

/* ===== ORDER CARD ===== */
.order-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 16px 12px;
  box-shadow: var(--shadow);
}

.order-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.order-id { font-size: 13px; font-weight: 700; color: var(--dark); }
.order-date { font-size: 11px; color: var(--text-light); }

.order-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: capitalize;
}

.status-pending { background: #fff8e1; color: #f57c00; }
.status-confirmed { background: #e8f5e9; color: var(--green); }
.status-out_for_delivery { background: #e3f2fd; color: #1976d2; }
.status-delivered { background: #e8f5e9; color: var(--green); }
.status-cancelled { background: #ffebee; color: var(--red); }

.order-items-preview { font-size: 12px; color: var(--text-light); margin-bottom: 10px; }
.order-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--gray2); }
.order-total { font-size: 15px; font-weight: 700; color: var(--dark); }
.order-count { font-size: 12px; color: var(--text-light); }

/* ===== CART PAGE ===== */
.cart-item {
  background: var(--white);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--gray2);
}

.cart-item-img {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--gray);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 13px; font-weight: 600; color: var(--dark); margin-bottom: 4px; }
.cart-item-price { font-size: 14px; font-weight: 700; color: var(--dark); }

.bill-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 16px;
  box-shadow: var(--shadow);
}

.bill-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text);
}

.bill-row.total {
  border-top: 1px solid var(--gray2);
  margin-top: 6px;
  padding-top: 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
}

.checkout-btn {
  background: var(--green);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 16px 24px;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
}

.checkout-btn:hover { background: #0a6e19; }

/* ===== ADMIN STYLES ===== */
.admin-body {
  max-width: 100%;
  font-family: 'Poppins', sans-serif;
  background: #f5f7fa;
  min-height: 100vh;
}

.admin-navbar {
  background: var(--dark);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-logo { font-size: 20px; font-weight: 800; color: var(--yellow); }
.admin-logo span { color: white; }

.admin-nav-links { display: flex; gap: 4px; }
.admin-nav-link {
  color: rgba(255,255,255,0.7);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
}

.admin-nav-link:hover, .admin-nav-link.active { background: rgba(248,204,27,0.15); color: var(--yellow); }

.admin-content { padding: 24px; max-width: 1200px; margin: 0 auto; }
.admin-page-title { font-size: 22px; font-weight: 700; color: var(--dark); margin-bottom: 20px; }

.admin-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.admin-card-title { font-size: 15px; font-weight: 700; color: var(--dark); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--gray2); }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { font-size: 12px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; padding: 10px 12px; text-align: left; background: var(--gray); }
.admin-table td { font-size: 13px; padding: 12px; border-bottom: 1px solid var(--gray2); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fffbea; }

.btn-sm {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: 'Poppins', sans-serif;
  transition: all 0.2s;
}

.btn-green { background: var(--green); color: white; }
.btn-red { background: var(--red); color: white; }
.btn-yellow { background: var(--yellow); color: var(--dark); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon { font-size: 36px; }
.stat-info h3 { font-size: 24px; font-weight: 800; color: var(--dark); }
.stat-info p { font-size: 12px; color: var(--text-light); font-weight: 500; }

.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-form-group { margin-bottom: 14px; }
.admin-form-group.full { grid-column: 1 / -1; }
.admin-label { font-size: 12px; font-weight: 600; color: var(--text-light); display: block; margin-bottom: 6px; text-transform: uppercase; }

.admin-input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--gray2);
  border-radius: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.admin-input:focus { border-color: var(--yellow); }

.admin-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--gray2);
  border-radius: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  outline: none;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s;
}

.admin-textarea:focus { border-color: var(--yellow); }

.admin-submit {
  background: var(--yellow);
  border: none;
  border-radius: 10px;
  padding: 12px 28px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  cursor: pointer;
  transition: background 0.2s;
}

.admin-submit:hover { background: var(--yellow-dark); }

/* ===== PRODUCT DETAIL ===== */
.product-detail-img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  background: var(--gray);
}

.product-detail-body { padding: 20px 16px; }
.product-detail-name { font-size: 20px; font-weight: 700; color: var(--dark); margin-bottom: 6px; }
.product-detail-unit { font-size: 13px; color: var(--text-light); margin-bottom: 12px; }
.product-detail-price { font-size: 26px; font-weight: 800; color: var(--dark); margin-bottom: 4px; }
.product-detail-desc { font-size: 13px; color: var(--text-light); line-height: 1.6; margin-top: 14px; }

/* ===== EMPTY STATES ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state .emoji { font-size: 56px; margin-bottom: 12px; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--dark); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ===== PROFILE PAGE ===== */
.profile-header {
  background: var(--yellow);
  padding: 40px 20px 30px;
  text-align: center;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  background: var(--dark);
  color: var(--yellow);
  font-size: 28px;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.profile-name { font-size: 18px; font-weight: 700; color: var(--dark); }
.profile-phone { font-size: 13px; color: rgba(0,0,0,0.6); margin-top: 3px; }

.profile-menu { background: var(--white); margin: 16px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--gray2);
  cursor: pointer;
  transition: background 0.15s;
}

.profile-menu-item:last-child { border-bottom: none; }
.profile-menu-item:active { background: var(--gray); }
.menu-icon { font-size: 22px; width: 28px; text-align: center; }
.menu-label { font-size: 14px; font-weight: 500; flex: 1; }
.menu-arrow { color: #ccc; font-size: 14px; }

/* Animations */
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.slide-up { animation: slideUp 0.3s ease forwards; }
.fade-in { animation: fadeIn 0.4s ease forwards; }

/* Pulse on add */
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.pulse { animation: pulse 0.3s ease; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }
