/* ===================== CBPN STYLES ===================== */
:root {
  --primary: #e63946;
  --secondary: #1d3557;
  --accent: #457b9d;
  --light: #f1faee;
  --white: #ffffff;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-500: #6c757d;
  --success: #2dc653;
  --warning: #fca311;
  --danger: #e63946;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f8f9fa;
  color: #2d3748;
  min-height: 100vh;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ===== HEADER ===== */
#header {
  background: linear-gradient(135deg, var(--secondary) 0%, #2a4a72 100%);
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  max-width: 1400px;
  margin: 0 auto;
  gap: 16px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: bold;
  color: white;
  flex-shrink: 0;
}

.logo-text h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  color: white;
}

.logo-text p {
  font-size: 10px;
  opacity: 0.8;
  line-height: 1.2;
}

.header-search {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border: none;
  border-radius: 25px;
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 14px;
  outline: none;
  transition: all 0.3s;
}

.header-search input::placeholder { color: rgba(255,255,255,0.6); }
.header-search input:focus { background: rgba(255,255,255,0.25); }
.header-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.7); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-header {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-header:hover { background: rgba(255,255,255,0.25); }

.cart-btn {
  position: relative;
  background: var(--primary);
  border: none;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #fca311;
  color: white;
  font-size: 10px;
  font-weight: bold;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-btn {
  background: #27ae60 !important;
  border-color: #27ae60 !important;
}

/* ===== CATEGORY NAV ===== */
.category-nav {
  background: rgba(0,0,0,0.2);
  padding: 0;
}

.category-nav-inner {
  display: flex;
  gap: 0;
  overflow-x: auto;
  max-width: 1400px;
  margin: 0 auto;
  scrollbar-width: none;
}

.category-nav-inner::-webkit-scrollbar { display: none; }

.cat-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.75);
  padding: 10px 18px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cat-btn:hover, .cat-btn.active {
  color: white;
  border-bottom-color: var(--primary);
  background: rgba(255,255,255,0.08);
}

/* ===== HERO BANNER ===== */
.hero-banner {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
  color: white;
  padding: 60px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
  pointer-events: none;
}

.hero-title {
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 800;
  margin-bottom: 12px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero-subtitle {
  font-size: clamp(14px, 2.5vw, 18px);
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto 24px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.hero-stat { text-align: center; }
.hero-stat .num { font-size: 28px; font-weight: 800; color: #fca311; }
.hero-stat .lbl { font-size: 12px; opacity: 0.8; }

/* ===== MAIN CONTENT ===== */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ===== SECTION TITLES ===== */
.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, var(--primary), transparent);
  margin-left: 10px;
}

/* ===== PRODUCT GRID ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* ===== PRODUCT CARD ===== */
.product-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

.product-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  flex-shrink: 0;
}

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

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

.product-category {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.product-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 8px;
  line-height: 1.3;
  flex: 1;
}

.product-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.product-stock {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 12px;
}

.product-stock.low { color: var(--warning); }
.product-stock.out { color: var(--danger); }

.btn-add-cart {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  width: 100%;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-add-cart:hover { background: #c62836; transform: scale(1.02); }
.btn-add-cart:disabled { background: #ccc; cursor: not-allowed; transform: none; }

/* ===== PRODUCT MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

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

.modal-content {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
  border-radius: 16px 16px 0 0;
}

.modal-close {
  background: var(--gray-100);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover { background: var(--gray-200); }

.product-detail-body {
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.product-images-gallery { position: relative; }

.main-image {
  width: 100%;
  height: 280px;
  border-radius: var(--radius);
  object-fit: cover;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  overflow: hidden;
  margin-bottom: 12px;
}

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

.thumbnails {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  flex-shrink: 0;
  overflow: hidden;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.2s;
}

.thumb.active { border-color: var(--primary); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-detail-info {}
.product-detail-name { font-size: 24px; font-weight: 700; color: var(--secondary); margin-bottom: 8px; }
.product-detail-price { font-size: 32px; font-weight: 800; color: var(--primary); margin-bottom: 16px; }
.product-detail-desc { font-size: 14px; color: var(--gray-500); line-height: 1.6; margin-bottom: 20px; }

.qty-control {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.qty-btn {
  width: 36px;
  height: 36px;
  border: 2px solid var(--primary);
  background: white;
  color: var(--primary);
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  transition: all 0.2s;
}

.qty-btn:hover { background: var(--primary); color: white; }
.qty-value { font-size: 18px; font-weight: 700; min-width: 30px; text-align: center; }

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  width: 100%;
  justify-content: center;
}

.btn-primary:hover { background: #c62836; transform: translateY(-1px); }

.btn-secondary {
  background: white;
  color: var(--secondary);
  border: 2px solid var(--secondary);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

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

/* ===== CART SIDEBAR ===== */
.cart-sidebar {
  position: fixed;
  right: -400px;
  top: 0;
  width: 380px;
  height: 100vh;
  background: white;
  z-index: 200;
  box-shadow: -4px 0 30px rgba(0,0,0,0.2);
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.cart-sidebar.open { right: 0; }
.cart-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 199; }
.cart-overlay.open { display: block; }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--gray-200);
  font-size: 18px;
  font-weight: 700;
  color: var(--secondary);
}

.cart-items { flex: 1; overflow-y: auto; padding: 16px; }

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-200);
  align-items: center;
}

.cart-item-img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  background: #f5f5f5;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  overflow: hidden;
}

.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(--secondary); margin-bottom: 4px; }
.cart-item-price { font-size: 14px; color: var(--primary); font-weight: 700; }
.cart-item-qty { font-size: 12px; color: var(--gray-500); }

.cart-item-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
}

.cart-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-100);
}

.cart-total { font-size: 18px; font-weight: 700; color: var(--secondary); margin-bottom: 12px; display: flex; justify-content: space-between; }

/* ===== AUTH PAGES ===== */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
  padding: 20px;
}

.auth-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.auth-logo { text-align: center; margin-bottom: 30px; }
.auth-logo .icon { font-size: 48px; margin-bottom: 8px; }
.auth-logo h2 { font-size: 28px; font-weight: 800; color: var(--secondary); }
.auth-logo p { color: var(--gray-500); font-size: 14px; }

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

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all 0.2s;
  outline: none;
  background: white;
}

.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(230,57,70,0.1); }

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

/* ===== TABS ===== */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-btn {
  padding: 12px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-500);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover { color: var(--secondary); }

/* ===== ORDER STATUS ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-pending { background: #fff3cd; color: #856404; }
.status-confirmed { background: #cfe2ff; color: #084298; }
.status-processing { background: #e0cffc; color: #421987; }
.status-ready_for_delivery { background: #d1ecf1; color: #0c5460; }
.status-delivered { background: #d4edda; color: #155724; }
.status-not_delivered { background: #f8d7da; color: #721c24; }
.status-cancelled { background: #f5c6cb; color: #721c24; }

.order-timeline {
  position: relative;
  padding-left: 28px;
}

.order-timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}

.timeline-item {
  position: relative;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-item.latest::before { background: var(--primary); box-shadow: 0 0 0 2px var(--primary); }

/* ===== ADMIN ===== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--secondary) 0%, #152b45 100%);
  color: white;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo .logo-icon { width: 44px; height: 44px; font-size: 18px; }
.sidebar-logo .logo-text h1 { font-size: 18px; }
.sidebar-logo .logo-text p { font-size: 9px; }

.sidebar-nav { flex: 1; padding: 16px 0; }

.nav-section {
  margin-bottom: 8px;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  padding: 8px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  border-left: 3px solid transparent;
}

.nav-item:hover { background: rgba(255,255,255,0.08); color: white; }
.nav-item.active { background: rgba(230,57,70,0.2); color: white; border-left-color: var(--primary); }
.nav-item i { width: 20px; text-align: center; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.admin-main {
  flex: 1;
  margin-left: 260px;
  padding: 24px;
  background: #f8f9fa;
  min-height: 100vh;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-200);
}

.admin-page-title { font-size: 24px; font-weight: 700; color: var(--secondary); }

/* ===== STATS CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  border-left: 4px solid var(--primary);
  transition: all 0.2s;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.stat-card:nth-child(2) { border-left-color: #27ae60; }
.stat-card:nth-child(3) { border-left-color: #f39c12; }
.stat-card:nth-child(4) { border-left-color: var(--accent); }

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(230,57,70,0.1);
  color: var(--primary);
  flex-shrink: 0;
}

.stat-card:nth-child(2) .stat-icon { background: rgba(39,174,96,0.1); color: #27ae60; }
.stat-card:nth-child(3) .stat-icon { background: rgba(243,156,18,0.1); color: #f39c12; }
.stat-card:nth-child(4) .stat-icon { background: rgba(69,123,157,0.1); color: var(--accent); }

.stat-value { font-size: 28px; font-weight: 800; color: var(--secondary); }
.stat-label { font-size: 13px; color: var(--gray-500); margin-top: 2px; }

/* ===== TABLES ===== */
.table-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
  gap: 12px;
}

.table-title { font-size: 16px; font-weight: 700; color: var(--secondary); }

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: var(--gray-100);
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-200);
  font-size: 13px;
  vertical-align: middle;
}

tr:hover td { background: var(--gray-100); }
tr:last-child td { border-bottom: none; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  border: none;
  transition: all 0.2s;
}

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

.btn-red { background: var(--primary); color: white; }
.btn-red:hover { background: #c62836; }
.btn-green { background: #27ae60; color: white; }
.btn-green:hover { background: #219a52; }
.btn-blue { background: var(--accent); color: white; }
.btn-blue:hover { background: #356c8d; }
.btn-yellow { background: #f39c12; color: white; }
.btn-yellow:hover { background: #e08e0b; }
.btn-gray { background: var(--gray-200); color: var(--secondary); }
.btn-gray:hover { background: #d0d5da; }
.btn-outline { background: white; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }

/* ===== FORM ELEMENTS ===== */
.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  background: white;
  cursor: pointer;
}

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

.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  resize: vertical;
  min-height: 100px;
  outline: none;
  font-family: inherit;
}

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

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-success { background: #d4edda; color: #155724; border-left: 4px solid #28a745; }
.alert-error { background: #f8d7da; color: #721c24; border-left: 4px solid #dc3545; }
.alert-info { background: #cfe2ff; color: #084298; border-left: 4px solid #0d6efd; }
.alert-warning { background: #fff3cd; color: #856404; border-left: 4px solid #ffc107; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
}

.empty-state .icon { font-size: 64px; margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ===== LOADING ===== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  font-size: 14px;
  color: var(--gray-500);
  gap: 12px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== PWA INSTALL BANNER ===== */
.pwa-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: white;
  border-radius: 16px;
  padding: 16px 24px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 320px;
  max-width: 420px;
  width: 90%;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pwa-banner.show { transform: translateX(-50%) translateY(0); }

.pwa-banner-icon { font-size: 36px; }
.pwa-banner-text { flex: 1; }
.pwa-banner-text strong { display: block; font-size: 14px; color: var(--secondary); }
.pwa-banner-text span { font-size: 12px; color: var(--gray-500); }

/* ===== DELIVERY PAGE ===== */
.delivery-layout {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px;
}

/* ===== INVOICE PRINT ===== */
@media print {
  body * { visibility: hidden !important; }
  .print-area, .print-area * { visibility: visible !important; }
  .print-area { position: fixed; left: 0; top: 0; width: 100%; }
  .no-print { display: none !important; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header-search { display: none; }
  .product-detail-body { grid-template-columns: 1fr; }
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; padding: 16px; }
  .hero-stats { gap: 20px; }
  .form-row { grid-template-columns: 1fr; }
  .cart-sidebar { width: 100%; right: -100%; }
}

@media (max-width: 480px) {
  .header-top { padding: 10px 12px; }
  .logo-text p { display: none; }
  .hero-banner { padding: 40px 16px; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .product-img { height: 150px; }
}
