/* CSS Design System for SnapShop */
:root {
  /* Colors */
  --primary: #d31e28; /* Premium Red */
  --primary-hover: #b1131c;
  --secondary: #111111; /* Off-black */
  --text-main: #222222;
  --text-muted: #666666;
  --bg-main: #ffffff;
  --bg-light: #f7f7f8;
  --bg-card: #ffffff;
  --border-color: #e2e2e7;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  /* Typography */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
}

/* =====================
   THEME DEFINITIONS
   Applied via [data-theme] on <html>
   ===================== */

/* Classic Light (Default) */
[data-theme="light"] {
  --primary: #d31e28;
  --primary-hover: #b1131c;
  --secondary: #111111;
  --text-main: #222222;
  --text-muted: #666666;
  --bg-main: #ffffff;
  --bg-light: #f7f7f8;
  --bg-card: #ffffff;
  --border-color: #e2e2e7;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Sleek Dark Mode */
[data-theme="dark"] {
  --primary: #ef4444;
  --primary-hover: #dc2626;
  --secondary: #f1f5f9;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --bg-main: #0f172a;
  --bg-light: #1e293b;
  --bg-card: #1e293b;
  --border-color: #334155;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Glassmorphism Overlay */
[data-theme="glass"] {
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --secondary: #1e1b4b;
  --text-main: #1e1b4b;
  --text-muted: #6b7280;
  --bg-main: rgba(255, 255, 255, 0.6);
  --bg-light: rgba(243, 244, 246, 0.5);
  --bg-card: rgba(255, 255, 255, 0.7);
  --border-color: rgba(255, 255, 255, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Vibrant */
[data-theme="vibrant"] {
  --primary: #f59e0b;
  --primary-hover: #d97706;
  --secondary: #7c2d12;
  --text-main: #431407;
  --text-muted: #9a3412;
  --bg-main: #fffbeb;
  --bg-light: #fef3c7;
  --bg-card: #ffffff;
  --border-color: #fde68a;
  --shadow-sm: 0 1px 2px rgba(245, 158, 11, 0.1);
  --shadow-md: 0 4px 12px rgba(245, 158, 11, 0.15);
  --shadow-lg: 0 10px 30px rgba(245, 158, 11, 0.2);
}

/* Minimal */
[data-theme="minimal"] {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --secondary: #1e293b;
  --text-main: #334155;
  --text-muted: #94a3b8;
  --bg-main: #ffffff;
  --bg-light: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Midnight */
[data-theme="midnight"] {
  --primary: #06b6d4;
  --primary-hover: #0891b2;
  --secondary: #e2e8f0;
  --text-main: #cbd5e1;
  --text-muted: #64748b;
  --bg-main: #020617;
  --bg-light: #0f172a;
  --bg-card: #1e293b;
  --border-color: #1e293b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Nature */
[data-theme="nature"] {
  --primary: #22c55e;
  --primary-hover: #16a34a;
  --secondary: #14532d;
  --text-main: #052e16;
  --text-muted: #15803d;
  --bg-main: #f0fdf4;
  --bg-light: #dcfce7;
  --bg-card: #ffffff;
  --border-color: #bbf7d0;
  --shadow-sm: 0 1px 2px rgba(34, 197, 94, 0.08);
  --shadow-md: 0 4px 12px rgba(34, 197, 94, 0.12);
  --shadow-lg: 0 10px 30px rgba(34, 197, 94, 0.16);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text-main);
  background-color: var(--bg-light);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

img {
  max-width: 100%;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* =====================
   LAYOUT UTILITIES
   ===================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
}

.flex {
  display: flex;
}

.align-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.grid {
  display: grid;
}

/* =====================
   BUTTONS
   ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 50px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 480px) {
  .btn {
    padding: 10px 20px;
    font-size: 13px;
  }
}

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

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(211, 30, 40, 0.25);
}

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

.btn-secondary:hover {
  background-color: var(--bg-light);
  transform: translateY(-2px);
}

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

.btn-dark:hover {
  background-color: #2c2c2c;
  transform: translateY(-2px);
}

/* =====================
   ANIMATIONS
   ===================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* =====================
   BADGE / RATING
   ===================== */
.rating-stars {
  color: #fbbf24;
  font-size: 14px;
  display: inline-flex;
  gap: 2px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-sale {
  background-color: var(--primary);
  color: white;
}

/* =====================
   FORM STYLES
   ===================== */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 15px;
  transition: all 0.2s ease;
  background-color: var(--bg-main);
}

.form-input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

/* =====================
   NAVBAR RESPONSIVE
   ===================== */

/* (Legacy hamburger rules removed — the PHP-edition header rules below control the mobile menu) */

/* Desktop nav */
.nav-desktop {
  display: flex;
  gap: 32px;
  margin-left: 40px;
  align-items: center;
}

@media (max-width: 768px) {
  .nav-desktop {
    display: none !important;
  }
}

/* Language selector — hide on mobile */
.lang-selector-hide-mobile {
  display: flex;
}

@media (max-width: 600px) {
  .lang-selector-hide-mobile {
    display: none !important;
  }
}

/* Mobile Menu overlay */
.nav-mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
}

.nav-mobile-overlay.open {
  display: block;
}

/* Mobile Menu drawer */
.nav-mobile-drawer {
  position: fixed;
  top: 0;
  left: -100%;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  background: white;
  z-index: 200;
  transition: left 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 24px 0;
}

.nav-mobile-drawer.open {
  left: 0;
}

.nav-mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 8px;
}

.nav-mobile-link {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main);
  border-bottom: 1px solid #f5f5f7;
  transition: background-color 0.2s ease;
}

.nav-mobile-link:hover,
.nav-mobile-link.active {
  background-color: var(--bg-light);
  color: var(--secondary);
}

.nav-mobile-link.active {
  font-weight: 700;
  border-left: 3px solid var(--primary);
}

/* =====================
   SHOP PAGE RESPONSIVE
   ===================== */

/* Shop Filter toggle button on mobile */
.filter-toggle-btn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background-color: var(--secondary);
  color: white;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
  width: 100%;
  justify-content: center;
}

@media (max-width: 768px) {
  .filter-toggle-btn {
    display: flex;
  }
}

/* Shop layout sidebar */
.shop-layout {
  display: flex;
  gap: 40px;
  padding-top: 40px;
  padding-bottom: 80px;
}

.shop-sidebar {
  width: 260px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .shop-layout {
    flex-direction: column;
    gap: 0;
    padding-top: 24px;
  }

  .shop-sidebar {
    width: 100%;
    /* collapsible on mobile */
  }

  .shop-sidebar-hidden {
    display: none;
  }
}

/* =====================
   HERO SECTION
   ===================== */
.hero-title-responsive {
  font-size: 56px;
}

@media (max-width: 900px) {
  .hero-title-responsive {
    font-size: 42px;
  }
}

@media (max-width: 600px) {
  .hero-title-responsive {
    font-size: 32px;
  }
}

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

@media (max-width: 640px) {
  .products-grid-responsive {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 360px) {
  .products-grid-responsive {
    grid-template-columns: 1fr;
  }
}

/* =====================
   TRUST SECTION
   ===================== */
.trust-grid-responsive {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

@media (max-width: 480px) {
  .trust-grid-responsive {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* =====================
   CART / CHECKOUT
   ===================== */
.cart-layout-responsive {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .cart-layout-responsive {
    grid-template-columns: 1fr;
  }
}

/* =====================
   CHECKOUT FORM ROWS
   ===================== */
.form-row-responsive {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .form-row-responsive {
    grid-template-columns: 1fr;
  }
}

/* =====================
   SECTION HEADER
   ===================== */
.section-header-responsive {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

@media (max-width: 480px) {
  .section-header-responsive {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* =====================
   FOOTER RESPONSIVE
   ===================== */
.footer-grid-responsive {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 40px;
}

@media (max-width: 480px) {
  .footer-grid-responsive {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

/* =====================
   PRODUCT DETAIL
   ===================== */
.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

@media (max-width: 768px) {
  .product-detail-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* =====================
   HIDE / SHOW HELPERS
   ===================== */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .hide-desktop {
    display: none !important;
  }
}

/* =====================================================
   PHP EDITION SUPPLEMENTAL STYLES
   ===================================================== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:wght@500;700&display=swap');

/* Header / Navbar */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}
.nav-row { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; font-family: var(--font-serif); font-size: 22px; font-weight: 700; color: var(--secondary); white-space: nowrap; }
.brand img { height: 30px; width: 30px; object-fit: contain; margin-right: 8px; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { font-weight: 500; font-size: 15px; color: var(--text-main); }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.mobile-only-link { display: none; }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.nav-actions a, .nav-actions button { color: var(--text-main); display: inline-flex; align-items: center; position: relative; }
.nav-actions a:hover { color: var(--primary); }
.icon-btn { font-size: 20px; line-height: 1; padding: 6px; }
.cart-badge {
  position: absolute; top: -6px; right: -8px; background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.search-box { display: flex; align-items: center; background: var(--bg-light); border: 1px solid var(--border-color); border-radius: 50px; padding: 6px 14px; }
.search-box input { background: none; border: none; outline: none; width: 140px; color: var(--text-main); }

/* Hamburger (hidden on desktop) */
.mobile-toggle { display: none; font-size: 24px; line-height: 1; color: var(--secondary); padding: 4px 8px; }
.mobile-menu-backdrop { display: none; }

/* ---------- MOBILE HEADER ---------- */
@media (max-width: 860px) {
  .search-box { display: none; }
  .mobile-toggle { display: inline-flex; }
  .nav-actions { gap: 10px; }

  /* slide-down mobile menu */
  .nav-links {
    position: fixed; top: 64px; left: 0; right: 0;
    background: var(--bg-card);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 0; box-shadow: var(--shadow-lg);
    transform: translateY(-120%); transition: transform .28s ease;
    z-index: 210; max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 15px 24px; font-size: 16px; border-bottom: 1px solid var(--border-color); }
  .mobile-only-link { display: block; }

  .mobile-menu-backdrop.show {
    display: block; position: fixed; inset: 64px 0 0 0;
    background: rgba(0,0,0,.4); z-index: 205;
  }
}

/* Hero */
.hero { position: relative; background: var(--bg-light); overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 40px; padding: 70px 0; }
.hero h1 { font-family: var(--font-serif); font-size: 52px; line-height: 1.1; margin-bottom: 18px; color: var(--secondary); }
.hero p { color: var(--text-muted); font-size: 18px; margin-bottom: 28px; max-width: 480px; }
.hero-img img { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); object-fit: cover; aspect-ratio: 4/5; }
@media (max-width: 768px) { .hero-inner { grid-template-columns: 1fr; padding: 40px 0; } .hero h1 { font-size: 36px; } .hero-img { order: -1; } }

/* Section headings */
.section { padding: 56px 0; }
.section-title { font-family: var(--font-serif); font-size: 32px; text-align: center; margin-bottom: 8px; color: var(--secondary); }
.section-sub { text-align: center; color: var(--text-muted); margin-bottom: 36px; }

/* Product grid + card */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
@media (max-width: 992px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .product-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }

.product-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); overflow: hidden; transition: all .3s ease; display: flex; flex-direction: column; }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-card .thumb { aspect-ratio: 3/4; background: var(--bg-light); overflow: hidden; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.product-card:hover .thumb img { transform: scale(1.05); }
.product-card .info { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card .p-name { font-weight: 600; font-size: 15px; color: var(--text-main); }
.product-card .p-brand { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.product-card .p-price { font-weight: 700; color: var(--primary); font-size: 16px; margin-top: auto; }
.product-card .p-price .old { color: var(--text-muted); text-decoration: line-through; font-weight: 400; font-size: 13px; margin-left: 6px; }
.badge-sale { position: absolute; top: 10px; left: 10px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 50px; text-transform: uppercase; }

/* Forms / auth cards */
.auth-wrap { max-width: 420px; margin: 60px auto; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow-md); }
.auth-wrap h1 { font-family: var(--font-serif); font-size: 26px; margin-bottom: 6px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-main); }
.form-control { width: 100%; padding: 11px 14px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--bg-main); color: var(--text-main); outline: none; }
.form-control:focus { border-color: var(--primary); }
.btn-block { width: 100%; }
.alert { padding: 11px 15px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: rgba(211,30,40,.08); color: var(--primary); }
.alert-success { background: rgba(34,197,94,.1); color: #16a34a; }

/* Cart / checkout tables */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td { padding: 14px 10px; border-bottom: 1px solid var(--border-color); text-align: left; }
.cart-item-img { width: 64px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); }
.qty-input { width: 60px; padding: 6px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); }
.summary-box { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 24px; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; }
.summary-row.total { font-weight: 700; font-size: 18px; border-top: 1px solid var(--border-color); margin-top: 8px; padding-top: 14px; }

/* Footer */
.site-footer { background: var(--secondary); color: #cbd5e1; padding: 48px 0 24px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: #fff; margin-bottom: 14px; font-size: 15px; }
.site-footer a { display: block; color: #94a3b8; margin-bottom: 8px; font-size: 14px; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #334155; margin-top: 32px; padding-top: 18px; text-align: center; font-size: 13px; color: #64748b; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* Admin layout */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 240px; background: #0f172a; color: #cbd5e1; padding: 22px 0; flex-shrink: 0; }
.admin-sidebar .logo { padding: 0 22px 20px; font-family: var(--font-serif); font-size: 20px; color: #fff; border-bottom: 1px solid #1e293b; margin-bottom: 12px; }
.admin-sidebar a { display: flex; align-items: center; gap: 10px; padding: 11px 22px; color: #94a3b8; font-size: 14px; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: #1e293b; color: #fff; border-left: 3px solid var(--primary); }
.admin-main { flex: 1; background: var(--bg-light); }
.admin-topbar { background: var(--bg-card); border-bottom: 1px solid var(--border-color); padding: 16px 28px; display: flex; justify-content: space-between; align-items: center; }
.admin-content { padding: 28px; }
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; margin-bottom: 28px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 20px; }
.stat-card .label { color: var(--text-muted); font-size: 13px; }
.stat-card .value { font-size: 28px; font-weight: 700; margin-top: 6px; }
.data-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: var(--radius-md); overflow: hidden; }
.data-table th { background: var(--bg-light); text-align: left; padding: 12px 14px; font-size: 13px; color: var(--text-muted); }
.data-table td { padding: 12px 14px; border-top: 1px solid var(--border-color); font-size: 14px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 50px; font-size: 12px; font-weight: 600; }
.pill.pending { background: #fef3c7; color: #b45309; }
.pill.processing { background: #dbeafe; color: #1d4ed8; }
.pill.shipped { background: #e0e7ff; color: #4338ca; }
.pill.delivered { background: #dcfce7; color: #15803d; }
.pill.cancelled, .pill.returned { background: #fee2e2; color: #b91c1c; }
.pill.paid { background: #dcfce7; color: #15803d; }
.pill.unpaid { background: #fef3c7; color: #b45309; }
@media (max-width: 768px) { .admin-sidebar { width: 64px; } .admin-sidebar .logo span, .admin-sidebar a span { display:none; } .stat-grid { grid-template-columns: 1fr 1fr; } }

/* small utils */
.btn-sm { padding: 7px 16px; font-size: 12px; }
.mt-2 { margin-top: 16px; } .mb-2 { margin-bottom: 16px; } .text-center { text-align: center; }
.muted { color: var(--text-muted); }

/* =====================================================
   MOBILE-FIRST REFINEMENTS (phones are the priority)
   ===================================================== */

/* Bigger, thumb-friendly tap targets everywhere on touch */
@media (max-width: 768px) {
  .btn { padding: 13px 22px; font-size: 14px; }
  .form-control { padding: 13px 14px; font-size: 16px; } /* 16px stops iOS zoom-on-focus */
  .icon-btn { padding: 8px; }

  .section { padding: 36px 0; }
  .section-title { font-size: 24px; }
  .section-sub { margin-bottom: 24px; font-size: 14px; }

  /* Hero */
  .hero-inner { grid-template-columns: 1fr; padding: 28px 0; gap: 20px; text-align: center; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 15px; margin-left: auto; margin-right: auto; }
  .hero-img { order: -1; }
  .hero-img img { aspect-ratio: 3/4; max-height: 60vh; }

  /* Product grid: 2 across on phones */
  .product-grid { grid-template-columns: 1fr 1fr !important; gap: 12px; }
  .product-card .p-name { font-size: 14px; }
  .product-card .info { padding: 10px 12px 14px; }

  /* Category chips scroll horizontally instead of squeezing */
  .cat-scroll { display: flex; gap: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
  .cat-scroll .product-card { min-width: 130px; }

  /* Stacked single-column layouts */
  .cart-layout, .shop-layout { grid-template-columns: 1fr !important; }

  /* Tables become horizontally scrollable so they never break layout */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cart-table, .data-table { min-width: 520px; }

  /* Auth cards fill the screen nicely */
  .auth-wrap { margin: 24px 16px; padding: 24px; max-width: none; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
}

/* Very small phones */
@media (max-width: 380px) {
  .product-grid { gap: 10px; }
  .brand span { font-size: 18px; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* Sticky mobile checkout / add-to-cart bar helper (optional use) */
.sticky-buy {
  position: sticky; bottom: 0; background: var(--bg-card);
  border-top: 1px solid var(--border-color); padding: 12px 16px;
  box-shadow: 0 -4px 12px rgba(0,0,0,.06); z-index: 50;
}

/* Make any table scroll horizontally on small screens without a wrapper div */
@media (max-width: 768px) {
  .admin-content, .summary-box, .container { }
  .data-table, .cart-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .data-table thead, .cart-table thead { }
  /* keep admin content from forcing page-wide horizontal scroll */
  .admin-content { overflow-x: hidden; }
}

/* =====================================================
   CATEGORY ICONS + HERO MOBILE FIT (v3)
   ===================================================== */
.cat-icon { font-size: 40px; line-height: 1; display: block; }
.category-card { transition: all .25s ease; }
.category-card:hover { border-color: var(--primary); }
.category-card:hover .cat-icon { transform: scale(1.1); }

@media (max-width: 768px) {
  .cat-icon { font-size: 34px; }

  /* Hero: compact so image + heading + button all fit on one phone screen */
  .hero-inner { padding: 14px 0 20px; gap: 12px; }
  .hero-img img { width: 100%; height: 240px; max-height: 40vh; aspect-ratio: auto; object-fit: cover; object-position: top center; border-radius: var(--radius-lg); }
  .hero h1 { font-size: 26px; margin-bottom: 6px; }
  .hero p { font-size: 14px; margin-bottom: 14px; }
  .hero .btn { width: auto; padding: 12px 30px; }
}
@media (max-width: 400px) {
  .hero h1 { font-size: 23px; }
  .hero-img img { height: 200px; }
  .hero p { font-size: 13px; }
}
