/* ============================================================
   Ability Bakery – Main Stylesheet
   Color palette inspired by Project Ready (projectready.org):
     Primary orange:   #dd8500
     Hover / accent:   #ba4025
     Warm cream bg:    #fdf9f3
     Dark brown text:  #2c1810
     Secondary text:   #6b5744
     Border / muted:   #e8d5b7
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@400;500;600&display=swap');

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  --primary:        #dd8500;
  --primary-hover:  #c0730a;
  --secondary:      #ba4025;
  --bg:             #fdf9f3;
  --card-bg:        #ffffff;
  --text:           #2c1810;
  --text-muted:     #6b5744;
  --border:         #e8d5b7;
  --footer-bg:      #2c1810;
  --footer-text:    #f5e6d3;
  --success:        #4caf50;
  --error:          #e53935;
  --radius:         8px;
  --shadow:         0 2px 12px rgba(44,24,16,0.10);
  --shadow-hover:   0 6px 24px rgba(44,24,16,0.18);
  --transition:     0.2s ease;
  --font-heading:   'Playfair Display', Georgia, serif;
  --font-body:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width:      1200px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }
a   { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }
ul  { list-style: none; }

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--text); }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem);   font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }

/* ── Utility ──────────────────────────────────────────────── */
.container    { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.sr-only      { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.flex         { display: flex; align-items: center; }
.gap-sm       { gap: 0.5rem; }
.gap-md       { gap: 1rem; }
.text-center  { text-align: center; }
.text-muted   { color: var(--text-muted); }
.mt-1         { margin-top: 0.5rem; }
.mt-2         { margin-top: 1rem; }
.mt-3         { margin-top: 1.5rem; }
.mb-2         { margin-bottom: 1rem; }
.hidden       { display: none !important; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.4rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: #fff;
  box-shadow: 0 4px 12px rgba(221,133,0,0.35);
}
.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}
.btn-danger {
  background: var(--error);
  color: #fff;
  border-color: var(--error);
}
.btn-danger:hover { background: #c62828; }
.btn-sm  { padding: 0.35rem 0.9rem; font-size: 0.85rem; }
.btn-lg  { padding: 0.75rem 2rem;   font-size: 1.05rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Badge ────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  text-transform: capitalize;
  letter-spacing: 0.03em;
}
.badge-category { background: #fde8c3; color: #9a5500; }
.badge-out      { background: #fce4e4; color: #c62828; }
.badge-featured { background: var(--primary); color: #fff; }

/* ── Form elements ────────────────────────────────────────── */
.form-group        { margin-bottom: 1.2rem; }
.form-group label  { display: block; font-weight: 600; margin-bottom: 0.4rem; font-size: 0.9rem; }
.form-control {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(221,133,0,0.18);
}
.form-control::placeholder { color: #bba88a; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── Alert / Toast ────────────────────────────────────────── */
.alert {
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 1rem;
}
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.alert-error   { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.alert-info    { background: #fff8e1; color: #8a5d00; border: 1px solid #ffe082; }

/* toast notification */
#toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  min-width: 240px;
  max-width: 340px;
  padding: 1rem 1.3rem;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.93rem;
  font-weight: 500;
  box-shadow: var(--shadow-hover);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
#toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#toast.toast-success { background: var(--success); }
#toast.toast-error   { background: var(--error); }

/* ── Header / Navigation ──────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 2px solid var(--border);
  box-shadow: 0 2px 8px rgba(44,24,16,0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-icon { font-size: 1.9rem; }
.logo-text { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700; color: var(--text); }
.logo-text span { color: var(--primary); }

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}
.nav-links a {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}
.nav-links a:hover,
.nav-links a.active { color: var(--primary); }

/* Header right: search + cart + auth */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* Inline search bar in header */
.header-search {
  position: relative;
  display: flex;
  align-items: center;
}
.header-search input {
  padding: 0.45rem 0.8rem 0.45rem 2.2rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 0.88rem;
  width: 200px;
  transition: width var(--transition), border-color var(--transition);
  background: var(--bg);
}
.header-search input:focus {
  outline: none;
  border-color: var(--primary);
  width: 260px;
}
.header-search .search-icon {
  position: absolute;
  left: 0.65rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

/* Cart button with item count badge */
.cart-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0.3rem;
  color: var(--text);
  transition: color var(--transition), transform var(--transition);
  text-decoration: none;
  display: flex;
  align-items: center;
}
.cart-btn:hover { color: var(--primary); transform: scale(1.1); }
.cart-count {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--secondary);
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-count.hidden { display: none; }

/* Auth buttons */
.auth-btn {
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 999px;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text);
}

/* ── Hero Section (index.html) ────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #2c1810 0%, #6b3520 60%, #dd8500 100%);
  color: #fff;
  padding: 5rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60"><circle cx="30" cy="30" r="28" fill="none" stroke="rgba(255,255,255,0.06)" stroke-width="1"/></svg>') repeat;
  background-size: 60px 60px;
}
.hero-inner { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  padding: 0.3rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}
.hero h1 { color: #fff; margin-bottom: 1rem; text-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.hero p {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.88);
  margin-bottom: 2rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-actions .btn-primary { background: #fff; color: var(--primary); font-size: 1rem; }
.hero-actions .btn-primary:hover { background: #fde8c3; }
.hero-actions .btn-outline  { border-color: rgba(255,255,255,0.7); color: #fff; }
.hero-actions .btn-outline:hover { background: rgba(255,255,255,0.15); }

/* ── Section headers ──────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}
.section-header h2 { margin: 0; }

/* ── Filter / Sort bar ────────────────────────────────────── */
.filters-bar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

/* Category tabs */
.category-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 0.35rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.tab-btn:hover, .tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Sort & stock controls */
.filters-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sort-select {
  padding: 0.38rem 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  cursor: pointer;
}
.sort-select:focus { outline: none; border-color: var(--primary); }
.instock-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
}
.instock-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Result count */
.results-info { font-size: 0.88rem; color: var(--text-muted); }

/* ── Product Grid ─────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

/* Product Card */
.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
}
.product-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}
.product-card.out-of-stock { opacity: 0.75; }

.card-img-wrap {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #f3e8d8;
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.product-card:hover .card-img-wrap img { transform: scale(1.06); }

.card-badges {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.card-body {
  padding: 1rem 1.1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.card-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.1rem;
  border-top: 1px solid var(--border);
  background: #fdf9f3;
}
.card-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-heading);
}
.add-to-cart-btn {
  padding: 0.38rem 0.9rem;
  font-size: 0.85rem;
}

/* skeleton loader */
.skeleton {
  background: linear-gradient(90deg, #f3e8d8 25%, #fdf3e3 50%, #f3e8d8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.product-card-skeleton .card-img-wrap { height: 200px; }
.product-card-skeleton .card-body { gap: 0.8rem; padding: 1rem 1.1rem; }
.skel-line { height: 14px; border-radius: 4px; }
.skel-line.w-70 { width: 70%; }
.skel-line.w-50 { width: 50%; }

/* empty state */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  grid-column: 1 / -1;
}
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.empty-state p { font-size: 1.05rem; }

/* ── Cart Page ────────────────────────────────────────────── */
.page-content { flex: 1; padding: 2.5rem 0 3rem; }

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}

.cart-items-card,
.cart-summary-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.3rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h2 { font-size: 1.1rem; margin: 0; }
.card-body-pad { padding: 1.2rem 1.3rem; }

/* Individual cart item row */
.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.3rem;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img {
  width: 80px;
  height: 80px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f3e8d8;
}
.cart-item-info { flex: 1; }
.cart-item-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.98rem;
  margin-bottom: 0.2rem;
}
.cart-item-price { font-size: 0.88rem; color: var(--text-muted); }

/* Quantity control */
.qty-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: none;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  color: var(--text);
}
.qty-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.qty-value { font-weight: 700; min-width: 24px; text-align: center; }
.remove-item-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.2rem;
  transition: color var(--transition);
  flex-shrink: 0;
}
.remove-item-btn:hover { color: var(--error); }

/* Cart summary */
.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.93rem;
  margin-bottom: 0.7rem;
  color: var(--text-muted);
}
.summary-row.total {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  padding-top: 0.8rem;
  margin-top: 0.8rem;
  border-top: 2px solid var(--border);
}
.summary-row .amount { font-weight: 600; color: var(--text); }
.summary-row.total .amount { color: var(--primary); font-size: 1.3rem; }

.empty-cart {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-cart .icon { font-size: 3rem; margin-bottom: 1rem; }

/* ── Checkout Page ────────────────────────────────────────── */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  align-items: start;
}

.checkout-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.checkout-card .card-header { padding: 1rem 1.5rem; }
.checkout-card .card-body-pad { padding: 1.5rem; }

/* Order summary list */
.order-items { list-style: none; padding: 0; margin: 0; }
.order-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.order-item:last-child { border-bottom: none; }
.order-item img {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  background: #f3e8d8;
}
.order-item-name { flex: 1; font-weight: 600; }
.order-item-qty  { color: var(--text-muted); }
.order-item-price { font-weight: 700; color: var(--primary); }

/* ── Auth Pages (login / signup) ──────────────────────────── */
.auth-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  background: var(--bg);
}
.auth-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 440px;
}
.auth-card .auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-card .auth-logo .logo-icon { font-size: 2.5rem; }
.auth-card h2 { text-align: center; margin-bottom: 0.5rem; }
.auth-card .auth-sub { text-align: center; color: var(--text-muted); margin-bottom: 1.8rem; font-size: 0.9rem; }
.auth-divider {
  text-align: center;
  margin: 1.2rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  position: relative;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-brand .logo-text { color: #fff; }
.footer-brand .logo-text span { color: var(--primary); }
.footer-tagline { margin-top: 0.6rem; font-size: 0.9rem; opacity: 0.75; line-height: 1.6; }
.footer-project {
  margin-top: 1rem;
  font-size: 0.82rem;
  opacity: 0.6;
}
.footer-project a { color: var(--primary); }
.footer-col h4 {
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1rem;
  margin-bottom: 0.9rem;
}
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul li a { color: rgba(255,255,255,0.65); font-size: 0.9rem; transition: color var(--transition); }
.footer-col ul li a:hover { color: var(--primary); }
.footer-bottom {
  max-width: var(--max-width);
  margin: 1rem auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  opacity: 0.55;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ── Page header (cart / checkout / auth page titles) ─────── */
.page-header {
  background: linear-gradient(135deg, #2c1810, #6b3520);
  color: #fff;
  padding: 2rem 1.5rem;
}
.page-header h1 { color: #fff; font-size: 1.8rem; }
.page-header .breadcrumb { font-size: 0.85rem; opacity: 0.7; margin-top: 0.3rem; }
.page-header .breadcrumb a { color: rgba(255,255,255,0.8); }
.page-header .breadcrumb span { margin: 0 0.4rem; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .cart-layout,
  .checkout-layout { grid-template-columns: 1fr; }
  .footer-grid     { grid-template-columns: 1fr 1fr; }
  .form-row        { grid-template-columns: 1fr; }
  .header-search input { width: 160px; }
  .header-search input:focus { width: 200px; }
}

@media (max-width: 640px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: #fff; padding: 1rem 1.5rem; border-bottom: 2px solid var(--border); box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .header-search { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 3.5rem 1rem; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .filters-right { margin-left: 0; width: 100%; }
  .cart-item-img { width: 64px; height: 64px; }
  .auth-card { padding: 2rem 1.2rem; }
}

/* ── Sale price ────────────────────────────────────────────── */
.card-price.sale { color: var(--error); }
.card-price-original { font-size: .85rem; color: var(--text-muted); text-decoration: line-through; margin-left: .3rem; }

/* ── Admin Panel ───────────────────────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--footer-bg); color: var(--footer-text);
  padding: 1.5rem 0; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar .sidebar-logo { padding: 0 1.3rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 1rem; }
.admin-nav a {
  display: flex; align-items: center; gap: .7rem;
  padding: .65rem 1.3rem; color: rgba(255,255,255,.7);
  font-size: .92rem; font-weight: 600; transition: all .2s;
  border-left: 3px solid transparent;
}
.admin-nav a:hover, .admin-nav a.active {
  color: #fff; background: rgba(255,255,255,.08);
  border-left-color: var(--primary);
}
.admin-nav .nav-icon { font-size: 1.1rem; }
.admin-nav .nav-divider { height: 1px; background: rgba(255,255,255,.1); margin: .6rem 1.3rem; }

.admin-main { flex: 1; background: #f5f0ea; min-height: 100vh; overflow-x: hidden; }
.admin-topbar {
  background: #fff; border-bottom: 2px solid var(--border);
  padding: .9rem 2rem; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 50;
}
.admin-topbar h1 { font-size: 1.3rem; margin: 0; }
.admin-body { padding: 2rem; }

/* Admin table */
.admin-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 1.5rem; }
.admin-card-header {
  padding: 1rem 1.5rem; border-bottom: 2px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .8rem;
}
.admin-card-header h2 { font-size: 1.05rem; margin: 0; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th { background: #fdf9f3; padding: .7rem 1rem; text-align: left; font-weight: 700; color: var(--text-muted); border-bottom: 2px solid var(--border); white-space: nowrap; }
.admin-table td { padding: .7rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fdf9f3; }
.admin-table .thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: #f3e8d8; }
.admin-table .product-name { font-weight: 600; max-width: 180px; }
.admin-table .actions { display: flex; gap: .4rem; white-space: nowrap; }
.table-search { padding: .4rem .8rem; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: .88rem; width: 220px; }
.table-search:focus { outline: none; border-color: var(--primary); }

/* Status pills */
.pill { display: inline-block; padding: .18rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.pill-green  { background: #e8f5e9; color: #2e7d32; }
.pill-red    { background: #ffebee; color: #c62828; }
.pill-orange { background: #fff3e0; color: #e65100; }
.pill-gray   { background: #eeeeee; color: #555; }
.pill-blue   { background: #e3f2fd; color: #1565c0; }
.pill-purple { background: #f3e5f5; color: #6a1b9a; }

/* Order status inline select */
.status-select {
  font-size: .78rem; font-weight: 700; border-radius: 999px; padding: .18rem .55rem;
  border: 1px solid transparent; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .4rem center; padding-right: 1.3rem;
}
.status-select.s-placed    { background-color: #e3f2fd; color: #1565c0; border-color: #90caf9; }
.status-select.s-paid      { background-color: #f3e5f5; color: #6a1b9a; border-color: #ce93d8; }
.status-select.s-processed { background-color: #fff3e0; color: #e65100; border-color: #ffcc80; }
.status-select.s-completed { background-color: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.status-select.s-hold      { background-color: #ffebee; color: #c62828; border-color: #ef9a9a; }

/* Drawer (slide-in form panel) */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 200; opacity: 0; pointer-events: none; transition: opacity .25s;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: -600px; width: min(580px, 100vw);
  height: 100vh; background: #fff; z-index: 201; overflow-y: auto;
  box-shadow: -4px 0 24px rgba(0,0,0,.15); transition: right .3s ease;
  display: flex; flex-direction: column;
}
.drawer.open { right: 0; }
.drawer-header {
  padding: 1.2rem 1.5rem; border-bottom: 2px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.drawer-header h2 { font-size: 1.15rem; margin: 0; }
.drawer-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text-muted); padding: .2rem .4rem; border-radius: 4px; }
.drawer-close:hover { background: var(--border); color: var(--text); }
.drawer-body { padding: 1.5rem; flex: 1; }
.drawer-footer {
  padding: 1rem 1.5rem; border-top: 2px solid var(--border);
  display: flex; gap: .8rem; justify-content: flex-end;
  position: sticky; bottom: 0; background: #fff;
}

/* Image manager */
.image-list { display: flex; flex-direction: column; gap: .6rem; margin-bottom: .6rem; }
.image-row { display: flex; align-items: center; gap: .6rem; }
.image-preview { width: 52px; height: 52px; border-radius: 6px; object-fit: cover; background: #f3e8d8; flex-shrink: 0; border: 1px solid var(--border); }
.image-row input { flex: 1; }
.image-remove { background: none; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; padding: .3rem .5rem; color: var(--text-muted); transition: all .2s; }
.image-remove:hover { border-color: var(--error); color: var(--error); }
.image-primary-tag { font-size: .7rem; font-weight: 700; color: var(--primary); white-space: nowrap; }

/* Coupon card in cart */
.coupon-section { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.3rem; margin-bottom: 1.2rem; }
.coupon-applied-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; background: #e8f5e9; border-radius: 6px; padding: .5rem .9rem; margin-bottom: .5rem; }
.coupon-applied-row .coupon-code-badge { font-weight: 700; color: #2e7d32; font-size: .92rem; }
.coupon-applied-row .coupon-savings { font-size: .85rem; color: #2e7d32; }

/* Responsive admin */
@media (max-width: 768px) {
  .admin-sidebar { display: none; }
  .admin-body { padding: 1rem; }
  .drawer { width: 100vw; }
}
