/* ============================================================
   ASTRA CATALOG ENGINE v2 — Master Stylesheet
   Damerax Cloud Solutions
   ============================================================ */

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --theme:        #C9A96E;
  --theme-dark:   #a8813a;
  --theme-light:  #f5edd8;
  --bg:           #fafaf8;
  --surface:      #ffffff;
  --border:       #ebe8e0;
  --text:         #1a1714;
  --text-muted:   #7c7168;
  --text-light:   #b0a898;
  --danger:       #d94f4f;
  --success:      #2e9e6b;
  --warn:         #d97706;
  --radius:       10px;
  --radius-lg:    16px;
  --shadow:       0 2px 12px rgba(0,0,0,0.07);
  --shadow-md:    0 4px 24px rgba(0,0,0,0.11);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.14);
  --sidebar-w:    240px;
  --topbar-h:     60px;
  --font-serif:   'Georgia', 'Times New Roman', serif;
  --font-sans:    'Segoe UI', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── TYPOGRAPHY ───────────────────────────────────────────── */
h1, h2, h3, h4 { line-height: 1.25; font-weight: 600; }

/* ── UTILITY ──────────────────────────────────────────────── */
.req { color: var(--danger); }

/* ── ALERTS ───────────────────────────────────────────────── */
.alert {
  padding: .8rem 1.2rem;
  border-radius: var(--radius);
  margin-bottom: 1.2rem;
  font-size: .9rem;
  font-weight: 500;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warn    { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.2rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  transition: all .18s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--theme);
  color: #fff;
  border-color: var(--theme);
}
.btn-primary:hover { background: var(--theme-dark); border-color: var(--theme-dark); }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg); }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: .35rem .8rem; font-size: .8rem; }
.btn-sale   { background: #fff8ed; color: var(--warn);    border-color: #fde68a; }
.btn-edit   { background: #eff6ff; color: #2563eb;        border-color: #bfdbfe; }
.btn-delete { background: #fff5f5; color: var(--danger);  border-color: #fecaca; }
.btn-sale:hover   { background: #fef3c7; }
.btn-edit:hover   { background: #dbeafe; }
.btn-delete:hover { background: #fee2e2; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* WhatsApp button */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: #25D366;
  color: #fff;
  padding: .6rem 1.1rem;
  border-radius: 50px;
  font-size: .85rem;
  font-weight: 600;
  transition: background .18s;
  width: 100%;
  justify-content: center;
}
.btn-whatsapp:hover { background: #1ebe5d; }
.btn-whatsapp-lg {
  padding: .9rem 2rem;
  font-size: 1rem;
  border-radius: 50px;
  margin-top: 1.5rem;
}

/* ── FORMS ────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: .83rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .35rem;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .93rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s;
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--theme);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme) 15%, transparent);
}
.form-group input[type="file"] {
  padding: .5rem;
  background: var(--bg);
  border: 1.5px dashed var(--border);
}
.form-group small { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; display: block; }
.form-group small a { color: var(--theme); text-decoration: underline; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .93rem; font-weight: 500; }
.checkbox-label input { width: auto; accent-color: var(--theme); }
.color-row { display: flex; gap: .6rem; align-items: center; }
.color-row input[type="color"] { width: 48px; height: 42px; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 2px; cursor: pointer; }
.color-row input[type="text"] { flex: 1; }

/* ── CARD ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card-header { margin-bottom: 1.4rem; }
.card-header h3 { font-size: 1rem; font-weight: 700; color: var(--text); }
.card-header p  { font-size: .82rem; color: var(--text-muted); margin-top: .2rem; }

/* ── AUTH PAGE ────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1714 0%, #2d2218 50%, #1a1714 100%);
  padding: 1rem;
}
.sa-auth { background: linear-gradient(135deg, #0f0d0b 0%, #1e1815 50%, #0f0d0b 100%); }

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.auth-brand { text-align: center; margin-bottom: 2rem; }
.auth-logo-icon {
  font-size: 2.5rem;
  color: var(--theme);
  display: block;
  margin-bottom: .5rem;
}
.auth-logo-img {
  height: 64px;
  width: auto;
  margin: 0 auto .8rem;
  object-fit: contain;
}
.auth-brand h1 { font-size: 1.5rem; font-weight: 800; color: var(--text); font-family: var(--font-serif); }
.auth-brand h1 span { color: var(--theme); }
.auth-brand p { font-size: .82rem; color: var(--text-muted); margin-top: .3rem; }

/* ── ADMIN LAYOUT ─────────────────────────────────────────── */
.admin-body { display: flex; min-height: 100vh; background: var(--bg); }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s ease;
}
.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 1.4rem 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo { height: 56px; width: auto; max-width: 180px; object-fit: contain; border-radius: 8px; }
.brand-icon { font-size: 1.6rem; color: var(--theme); }
.brand-name { font-size: .95rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.brand-sub  { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }

.sidebar-nav { flex: 1; padding: 1rem 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .75rem 1.4rem;
  color: #4a4540;
  font-size: .88rem;
  font-weight: 500;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--bg); color: var(--theme); }
.nav-item.active {
  background: var(--theme-light);
  color: var(--theme);
  border-left-color: var(--theme);
}
.nav-item-danger { color: #d9a0a0 !important; }
.nav-item-danger:hover { color: #d94f4f !important; }
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.sa-sidebar .nav-item.active { background: var(--theme-light); }

.sidebar-footer {
  padding: 1rem 1.4rem;
  font-size: .72rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}

/* Main area */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.admin-topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text);
  padding: .2rem;
}
.topbar-title { font-size: 1rem; font-weight: 700; flex: 1; }
.topbar-badge {
  font-size: .72rem;
  font-weight: 700;
  padding: .25rem .7rem;
  border-radius: 50px;
  background: var(--theme-light);
  color: var(--theme-dark);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.sa-badge { background: #ffffff; color: var(--theme); }
.topbar-user { font-size: .83rem; color: var(--text-muted); }

/* Content */
.admin-content { padding: 1.8rem 1.5rem; flex: 1; max-width: 1200px; }

/* ── STATS ROW ────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .15s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card-highlight { border-color: var(--theme); background: linear-gradient(135deg, var(--theme-light), #fff); }
.stat-icon { font-size: 1.5rem; margin-bottom: .3rem; }
.stat-num  { font-size: 1.7rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-card-highlight .stat-num { color: var(--theme-dark); }
.stat-label { font-size: .75rem; color: var(--text-muted); margin-top: .3rem; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }

/* ── SECTION HEADER ───────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.section-header h3 { font-size: .95rem; font-weight: 700; }

/* ── PRODUCT MINI GRID (dashboard) ───────────────────────── */
.product-grid-mini {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.product-mini-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s;
}
.product-mini-card:hover { transform: translateY(-2px); }
.product-mini-card.soldout { opacity: .6; }
.product-mini-img { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--bg); }
.product-mini-img img { width: 100%; height: 100%; object-fit: cover; }
.soldout-badge {
  position: absolute; top: 6px; right: 6px;
  background: var(--danger); color: #fff;
  font-size: .65rem; font-weight: 700;
  padding: .2rem .5rem; border-radius: 50px;
  text-transform: uppercase;
}
.product-mini-info { padding: .7rem; }
.product-mini-title { font-size: .83rem; font-weight: 600; color: var(--text); line-height: 1.3; margin-bottom: .2rem; }
.product-mini-price { font-size: .88rem; font-weight: 700; color: var(--theme-dark); }
.product-mini-qty   { font-size: .72rem; color: var(--text-muted); margin-top: .2rem; }

/* ── SUPER ADMIN GRID ─────────────────────────────────────── */
.sa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.current-logo { display: flex; align-items: center; gap: .7rem; margin-bottom: .7rem; }
.current-logo img { height: 48px; width: auto; border-radius: 6px; border: 1px solid var(--border); }
.current-logo span { font-size: .8rem; color: var(--text-muted); }

.owner-status {
  display: flex;
  align-items: center;
  gap: .7rem;
  background: var(--bg);
  padding: .8rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.owner-name { font-size: .87rem; font-weight: 600; }
.badge { font-size: .72rem; font-weight: 700; padding: .2rem .6rem; border-radius: 50px; text-transform: uppercase; }
.badge-success { background: #d1fae5; color: #065f46; }

.info-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  font-size: .83rem;
}
.info-box code { font-family: monospace; font-size: .82rem; color: var(--theme-dark); word-break: break-all; }

.checklist h4 { font-size: .85rem; font-weight: 700; margin-bottom: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.checklist ul { list-style: none; }
.checklist li { font-size: .88rem; padding: .3rem 0; color: var(--text-muted); }
.checklist li.done { color: var(--text); }

/* ── PRODUCT TABLE ────────────────────────────────────────── */
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.search-bar-form { display: flex; gap: .5rem; flex: 1; min-width: 200px; }
.search-input { flex: 1; padding: .55rem .9rem; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: .88rem; outline: none; }
.search-input:focus { border-color: var(--theme); }

.filter-tabs { display: flex; gap: .4rem; }
.filter-tab {
  padding: .4rem .85rem;
  border-radius: 50px;
  font-size: .8rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  transition: all .15s;
}
.filter-tab:hover { border-color: var(--theme); color: var(--theme); }
.filter-tab.active { background: var(--theme); color: #fff; border-color: var(--theme); }

.table-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--bg);
  padding: .8rem 1rem;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td { padding: .8rem 1rem; border-bottom: 1px solid var(--border); font-size: .88rem; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafaf8; }

.table-thumb {
  width: 52px; height: 52px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.table-product-title { font-weight: 600; font-size: .9rem; }
.table-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.tag-pill {
  background: var(--theme-light);
  color: var(--theme-dark);
  font-size: .7rem;
  padding: .15rem .5rem;
  border-radius: 50px;
  font-weight: 600;
}
.status-badge {
  font-size: .72rem;
  font-weight: 700;
  padding: .25rem .65rem;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.status-active  { background: #d1fae5; color: #065f46; }
.status-soldout { background: #fee2e2; color: #991b1b; }

.action-btns { display: flex; gap: .4rem; }
.empty-cell { text-align: center; color: var(--text-muted); padding: 2rem !important; }

.pagination { display: flex; gap: .4rem; padding: 1rem; justify-content: center; }
.page-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  transition: all .15s;
}
.page-btn:hover { border-color: var(--theme); color: var(--theme); }
.page-btn.active { background: var(--theme); color: #fff; border-color: var(--theme); }

/* ── ADD PRODUCT ──────────────────────────────────────────── */
.add-product-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 260px;
  position: relative;
  transition: border-color .2s;
}
.upload-zone:has(#uploadPlaceholder:hover) { border-color: var(--theme); }
.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  cursor: pointer;
  padding: 2rem;
  transition: background .15s;
}
.upload-placeholder:hover { background: var(--bg); }
.upload-icon { font-size: 3rem; margin-bottom: .8rem; }
.upload-text { font-weight: 600; color: var(--text); margin-bottom: .3rem; }
.upload-sub  { font-size: .8rem; color: var(--text-muted); }

.upload-preview { width: 100%; height: 280px; object-fit: cover; }
.ai-loader {
  position: absolute; inset: 0;
  background: rgba(255,255,255,.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
}
.ai-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--theme);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ai-status {
  padding: .7rem 1rem;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 500;
  margin-top: .8rem;
}
.ai-success { background: #d1fae5; color: #065f46; }
.ai-error   { background: #fee2e2; color: #991b1b; }

/* Edit product */
.edit-current-image { aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); background: var(--bg); }
.edit-current-image img { width: 100%; height: 100%; object-fit: cover; }

/* ── STOREFRONT ───────────────────────────────────────────── */
.storefront { background: var(--bg); }

.store-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.2rem .8rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.store-header-inner { display: flex; align-items: center; gap: 1rem; margin-bottom: .8rem; }
.store-logo { height: 48px; width: auto; object-fit: contain; }
.store-logo-text { font-size: 2rem; color: var(--theme); font-family: var(--font-serif); }
.store-name {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-serif);
  color: var(--text);
  line-height: 1.2;
}
.store-tagline { font-size: .78rem; color: var(--text-muted); margin-top: .1rem; }

.store-search { position: relative; }
.search-wrap { position: relative; }
.search-wrap .search-icon {
  position: absolute; left: .9rem; top: 50%;
  transform: translateY(-50%);
  font-size: .9rem; pointer-events: none;
}
.search-wrap input {
  width: 100%;
  padding: .6rem .9rem .6rem 2.4rem;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-size: .9rem;
  background: var(--bg);
  outline: none;
  transition: border-color .15s;
}
.search-wrap input:focus { border-color: var(--theme); }

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  z-index: 200;
  overflow: hidden;
  max-height: 360px;
  overflow-y: auto;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg); }
.search-result-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.sr-title { font-size: .88rem; font-weight: 600; }
.sr-price { font-size: .8rem; color: var(--theme-dark); font-weight: 600; }

/* Tag filter bar */
.tag-filter-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .6rem 1rem;
}
.tag-filter-scroll { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tag-filter-scroll::-webkit-scrollbar { display: none; }
.tag-chip {
  display: inline-block;
  padding: .3rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all .15s;
}
.tag-chip:hover { border-color: var(--theme); color: var(--theme); }
.tag-chip.active { background: var(--theme); border-color: var(--theme); color: #fff; }

/* Main & Sections */
.store-main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

.section-label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.product-count {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: .15rem .5rem;
  border-radius: 50px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-light);
}

/* Featured strip */
.featured-section { margin-bottom: 2.5rem; }
.featured-strip {
  display: flex;
  gap: .8rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 6px;
}
.featured-strip::-webkit-scrollbar { display: none; }
.featured-card {
  flex: 0 0 160px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .18s;
}
.featured-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.featured-card img { width: 160px; height: 160px; object-fit: cover; }
.featured-card-info { padding: .6rem .7rem; }
.featured-card-title { font-size: .78rem; font-weight: 600; color: var(--text); line-height: 1.3; margin-bottom: .2rem; }
.featured-card-price { font-size: .82rem; font-weight: 700; color: var(--theme-dark); }

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.1rem;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s;
  display: flex;
  flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.product-card-link { flex: 1; display: flex; flex-direction: column; }
.product-card-img  { aspect-ratio: 1; overflow: hidden; background: var(--bg); position: relative; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.product-card:hover .product-card-img img { transform: scale(1.05); }
.featured-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--theme);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .5rem;
  border-radius: 50px;
}
.product-card-body { padding: .8rem .9rem .5rem; flex: 1; }
.product-card-title { font-size: .88rem; font-weight: 600; color: var(--text); line-height: 1.35; margin-bottom: .3rem; }
.product-card-price { font-size: .95rem; font-weight: 800; color: var(--theme-dark); font-family: var(--font-serif); }
.product-card-footer { padding: .7rem .9rem .9rem; }

.empty-store {
  grid-column: 1/-1;
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }

/* Product detail */
.product-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .9rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky; top: 0; z-index: 50;
}
.back-btn { font-size: .9rem; font-weight: 600; color: var(--theme); }
.back-btn:hover { color: var(--theme-dark); }
.product-header-brand { display: flex; align-items: center; gap: .5rem; font-size: .88rem; font-weight: 600; color: var(--text-muted); }
.store-logo-sm { height: 28px; width: auto; border-radius: 4px; }

.product-detail { max-width: 1000px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}
.product-detail-image { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--bg); aspect-ratio: 1; }
.product-detail-image img { width: 100%; height: 100%; object-fit: cover; }
.soldout-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.5rem; font-weight: 800;
  letter-spacing: .08em;
}

.product-detail-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.product-detail-title { font-size: 1.6rem; font-weight: 800; font-family: var(--font-serif); line-height: 1.2; margin-bottom: .8rem; }
.product-detail-price { font-size: 2rem; font-weight: 900; color: var(--theme-dark); font-family: var(--font-serif); }
.product-detail-desc { margin-top: 1.2rem; color: var(--text-muted); line-height: 1.75; font-size: .95rem; }
.product-detail-meta { margin-top: 1.5rem; font-size: .82rem; color: var(--text-light); }
.soldout-msg { margin-top: 1.5rem; padding: .9rem 1.2rem; background: #fee2e2; color: #991b1b; border-radius: var(--radius); font-weight: 600; }

.related-section { margin-top: 3rem; }

/* Search page header */
.product-header .search-header-form {
  display: flex; flex: 1; gap: .5rem;
}
.search-input-header {
  flex: 1; padding: .5rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: 50px; font-size: .9rem; outline: none;
}
.btn-search {
  padding: .5rem .9rem; border: none;
  background: var(--theme); color: #fff;
  border-radius: 50px; font-size: .9rem;
}

/* ── STORE FOOTER ─────────────────────────────────────────── */
.store-footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: .78rem;
  color: var(--text-light);
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .sa-grid                { grid-template-columns: 1fr; }
  .add-product-layout     { grid-template-columns: 1fr; }
  .product-detail-grid    { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open {
    display: block;
  }
  .admin-main    { margin-left: 0; }
  .menu-toggle   { display: block; }
  .admin-content { padding: 1.2rem 1rem; }

  .form-row { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(3, 1fr); }

  .product-grid  { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  .product-grid-mini { grid-template-columns: repeat(2, 1fr); }

  .list-toolbar { flex-direction: column; align-items: stretch; }
  .search-bar-form { width: 100%; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .product-card-title { font-size: .8rem; }
  .btn-whatsapp { font-size: .78rem; padding: .55rem .7rem; }
  .featured-card { flex: 0 0 140px; }
  .featured-card img { width: 140px; height: 140px; }
}

/* ============================================================
   ASTRA v2 UPGRADE — Additional Styles
   Cart, Checkout, Orders, Bill
   ============================================================ */

/* ── CART ─────────────────────────────────────────────────── */
.cart-layout { display:grid; grid-template-columns:1fr 360px; gap:1.5rem; align-items:start; }
.cart-item { display:flex; gap:1rem; padding:1rem 0; border-bottom:1px solid var(--border); align-items:flex-start; }
.cart-item:last-child { border-bottom:none; }
.cart-item-img { width:80px; height:80px; object-fit:cover; border-radius:var(--radius); flex-shrink:0; border:1px solid var(--border); }
.cart-item-info { flex:1; }
.cart-item-title { font-weight:600; font-size:.92rem; margin-bottom:.3rem; }
.cart-item-price { font-size:.82rem; color:var(--text-muted); }
.cart-item-subtotal { font-weight:700; font-size:.95rem; color:var(--theme-dark); white-space:nowrap; }
.cart-qty-row { display:flex; align-items:center; gap:.5rem; margin-top:.6rem; }
.qty-btn { width:28px; height:28px; border:1.5px solid var(--border); background:var(--surface); border-radius:6px; font-size:1rem; font-weight:700; display:flex; align-items:center; justify-content:center; cursor:pointer; transition:all .15s; }
.qty-btn:hover { border-color:var(--theme); color:var(--theme); }
.qty-num { font-weight:700; min-width:24px; text-align:center; }
.remove-btn { background:none; border:none; color:var(--danger); font-size:.78rem; cursor:pointer; margin-left:.5rem; }
.remove-btn:hover { text-decoration:underline; }

.summary-row { display:flex; justify-content:space-between; padding:.5rem 0; border-bottom:1px solid var(--border); font-size:.9rem; }
.summary-row:last-child { border-bottom:none; }
.summary-total { font-weight:800; font-size:1.05rem; color:var(--theme-dark); padding-top:.8rem; }

/* Cart icon float */
.cart-float { position:fixed; bottom:1.5rem; right:1.5rem; z-index:80; }
.cart-float-btn {
  background:var(--theme);
  color:#fff;
  border:none;
  width:56px; height:56px;
  border-radius:50%;
  font-size:1.4rem;
  box-shadow:var(--shadow-lg);
  cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  position:relative;
  text-decoration:none;
  transition:transform .18s;
}
.cart-float-btn:hover { transform:scale(1.08); }
.cart-count-badge {
  position:absolute;
  top:-4px; right:-4px;
  background:var(--danger);
  color:#fff;
  font-size:.65rem;
  font-weight:800;
  width:20px; height:20px;
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  border:2px solid #fff;
}

/* Add to cart button */
.btn-addcart {
  display:inline-flex;
  align-items:center;
  gap:.5rem;
  background:var(--theme);
  color:#fff;
  padding:.6rem 1.1rem;
  border-radius:50px;
  font-size:.85rem;
  font-weight:600;
  border:none;
  cursor:pointer;
  transition:background .18s;
  width:100%;
  justify-content:center;
}
.btn-addcart:hover { background:var(--theme-dark); }
.btn-addcart-lg { padding:.9rem 2rem; font-size:1rem; }

/* Product card footer 2-button layout */
.product-card-footer-2 { display:grid; grid-template-columns:1fr 1fr; gap:.5rem; padding:.7rem .9rem .9rem; }

/* ── CHECKOUT ─────────────────────────────────────────────── */
.checkout-layout { display:grid; grid-template-columns:1fr 360px; gap:1.5rem; align-items:start; }
.checkout-item { display:flex; gap:.8rem; padding:.7rem 0; border-bottom:1px solid var(--border); align-items:center; }
.checkout-item:last-child { border-bottom:none; }
.checkout-item-img { width:52px; height:52px; object-fit:cover; border-radius:6px; border:1px solid var(--border); flex-shrink:0; }
.checkout-item-info { flex:1; }
.checkout-item-title { font-size:.88rem; font-weight:600; }
.checkout-item-meta  { font-size:.78rem; color:var(--text-muted); }
.checkout-item-sub   { font-weight:700; font-size:.9rem; color:var(--theme-dark); }

/* Payment options */
.payment-options { display:flex; flex-direction:column; gap:.7rem; }
.payment-option {
  display:flex;
  align-items:center;
  gap:.9rem;
  padding:.9rem 1rem;
  border:1.5px solid var(--border);
  border-radius:var(--radius);
  cursor:pointer;
  transition:all .15s;
}
.payment-option:hover { border-color:var(--theme); }
.payment-option.selected { border-color:var(--theme); background:var(--theme-light); }
.payment-option input[type="radio"] { display:none; }
.payment-icon { font-size:1.5rem; }
.payment-label { font-weight:600; font-size:.9rem; }
.payment-sub   { font-size:.78rem; color:var(--text-muted); margin-top:.1rem; }

/* ── ORDERS ───────────────────────────────────────────────── */
.status-new       { background:#dbeafe; color:#1d4ed8; }
.status-confirmed { background:#d1fae5; color:#065f46; }
.status-shipped   { background:#fef3c7; color:#92400e; }
.status-delivered { background:#f0fdf4; color:#166534; }
.status-cancelled { background:#fee2e2; color:#991b1b; }

/* ── PRODUCT GALLERY ──────────────────────────────────────── */
.product-gallery { position:relative; }
.product-gallery-main { aspect-ratio:1; overflow:hidden; border-radius:var(--radius-lg); background:var(--bg); }
.product-gallery-main img { width:100%; height:100%; object-fit:cover; transition:opacity .2s; }
.product-gallery-thumbs { display:flex; gap:.5rem; margin-top:.6rem; overflow-x:auto; scrollbar-width:none; }
.product-gallery-thumbs::-webkit-scrollbar { display:none; }
.gallery-thumb { width:60px; height:60px; border-radius:8px; overflow:hidden; flex-shrink:0; border:2px solid transparent; cursor:pointer; transition:border-color .15s; }
.gallery-thumb.active { border-color:var(--theme); }
.gallery-thumb img { width:100%; height:100%; object-fit:cover; }

/* ── STORE SETTINGS (dxpanel) ─────────────────────────────── */
.settings-grid { display:grid; grid-template-columns:1fr 1fr; gap:1.5rem; }

/* ── QUICK ORDER FORM (product page) ──────────────────────── */
.quick-order-card { background:var(--bg); border:1.5px solid var(--border); border-radius:var(--radius-lg); padding:1.2rem; margin-top:1.2rem; }
.quick-order-title { font-size:.88rem; font-weight:700; margin-bottom:1rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:.04em; }

/* ── RESPONSIVE UPGRADES ──────────────────────────────────── */
@media(max-width:900px) {
  .cart-layout     { grid-template-columns:1fr; }
  .checkout-layout { grid-template-columns:1fr; }
  .settings-grid   { grid-template-columns:1fr; }
}
@media(max-width:480px) {
  .product-card-footer-2 { grid-template-columns:1fr; }
}

/* ── HEADER CART BUTTON ───────────────────────────────────── */
.header-cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--theme-light);
  border-radius: 50%;
  font-size: 1.2rem;
  margin-left: auto;
  flex-shrink: 0;
  transition: background .15s;
}
.header-cart-btn:hover { background: var(--border); }
.store-header-inner { position: relative; }