/* ═══════════════════════════════════════════════════════════════════════════
   RevUp Shopping — Main Stylesheet
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Variables ─────────────────────────────────────────────────────────── */
:root {
  --blue:       #1a73e8;
  --blue-dark:  #1557b0;
  --blue-light: #e8f0fe;
  --green:      #1e8449;
  --green-bg:   #eafaf1;
  --red:        #c0392b;
  --red-bg:     #fde8e8;
  --orange:     #e67e22;
  --text:       #202124;
  --text-muted: #70757a;
  --border:     #dadce0;
  --bg:         #f8f9fa;
  --white:      #ffffff;
  --card-shadow: 0 1px 4px rgba(0,0,0,.08), 0 2px 12px rgba(0,0,0,.06);
  --card-shadow-hover: 0 4px 16px rgba(0,0,0,.14);
  --radius:     10px;
  --radius-sm:  6px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; }
body  { font-family: var(--font); font-size: 15px; color: var(--text); background: var(--bg); line-height: 1.5; }
img   { max-width: 100%; height: auto; display: block; }
a     { color: var(--blue); text-decoration: none; }
ul    { list-style: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

/* ─── Layout ────────────────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ─── Header ────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: .75rem 0;
  justify-content: space-between;
}
.header-inner .header-search {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, 55%);
}
.site-header .container { position: relative; }

.logo {
  display: flex;
  align-items: center;
  gap: .35rem;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-bolt     { font-size: 1.4rem; line-height: 1; }
.logo-text     { font-size: 1.25rem; font-weight: 800; color: var(--blue); letter-spacing: -.5px; }
.logo-img      { height: 48px; width: auto; display: block; }

/* Search bar */
.header-search {
  display: flex;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.header-search:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,115,232,.15);
  background: var(--white);
}
.search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: .6rem 1rem;
  font-size: .95rem;
  outline: none;
  color: var(--text);
}
.search-input::placeholder { color: var(--text-muted); }
.search-btn {
  background: var(--blue);
  border: none;
  color: var(--white);
  padding: 0 1rem;
  display: flex;
  align-items: center;
}

/* ─── Category Nav ──────────────────────────────────────────────────────── */
.cat-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
#cat-nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: .125rem;
}
#cat-nav a {
  display: block;
  padding: .65rem .9rem;
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
#cat-nav a:hover { color: var(--blue); }
#cat-nav a.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  font-weight: 600;
}

/* ─── Main Content ──────────────────────────────────────────────────────── */
#main-content { min-height: 60vh; }
#main-content > .container { padding-top: 1.75rem; padding-bottom: 2.5rem; }

/* ─── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  color: var(--white);
  padding: 3.5rem 1rem;
  text-align: center;
  margin: -1.75rem -1rem 2rem;
}
.hero h1  { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; margin-bottom: .5rem; }
.hero p   { font-size: 1.05rem; opacity: .9; margin-bottom: 1.75rem; }

.hero-search {
  display: flex;
  max-width: 580px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.25);
}
.hero-search input {
  flex: 1;
  border: none;
  padding: .9rem 1.25rem;
  font-size: 1rem;
  outline: none;
  color: var(--text);
}
.hero-search button {
  background: var(--blue);
  color: var(--white);
  border: none;
  padding: 0 1.5rem;
  font-size: .95rem;
  font-weight: 600;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.hero-stats span { font-size: .9rem; opacity: .85; }
.hero-stats strong { color: var(--white); font-weight: 700; }

/* ─── Section Headers ───────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}
.section-header h2 { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.section-header a  { font-size: .875rem; color: var(--blue); }

/* ─── Category Grid (homepage) ──────────────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .75rem;
  margin-bottom: 2.5rem;
}
.cat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem .75rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
}
.cat-card-icon { margin-bottom: .5rem; display: flex; justify-content: center; color: var(--blue); }
.cat-card-name { font-size: .85rem; font-weight: 600; }

/* ─── Product Cards ─────────────────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}

.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.product-card a { text-decoration: none; color: inherit; }

.product-card-img {
  aspect-ratio: 1;
  overflow: hidden;
  background: #f4f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-card-img .no-image {
  color: #ccc;
  font-size: 3rem;
}

.product-card-body { padding: .85rem; flex: 1; display: flex; flex-direction: column; }
.product-card-brand { font-size: .75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-bottom: .2rem; }
.product-card-title { font-size: .9rem; font-weight: 600; color: var(--text); line-height: 1.35; margin-bottom: auto; }

.product-card-footer { margin-top: .75rem; display: flex; align-items: center; justify-content: space-between; }
.price-from { font-size: .7rem; color: var(--text-muted); display: block; }
.price-amount { font-size: 1.15rem; font-weight: 800; color: var(--green); }
.offer-count {
  font-size: .75rem;
  background: var(--blue-light);
  color: var(--blue);
  padding: .2rem .5rem;
  border-radius: 20px;
  font-weight: 600;
}

.badge-best { position: absolute; top: .6rem; left: .6rem; background: var(--red); color: var(--white); font-size: .7rem; font-weight: 700; padding: .2rem .5rem; border-radius: 4px; text-transform: uppercase; letter-spacing: .4px; }
.badge-new  { position: absolute; top: .6rem; left: .6rem; background: var(--green); color: var(--white); font-size: .7rem; font-weight: 700; padding: .2rem .5rem; border-radius: 4px; }

/* ─── Search / Results Page ─────────────────────────────────────────────── */
.results-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.toggle-filters-btn {
  display: none;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: .55rem .8rem;
  font-size: .875rem;
  font-weight: 700;
}

/* Filter sidebar */
.filters-sidebar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: sticky;
  top: 80px;
}
.filters-sidebar h3 {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.filters-clear { font-size: .8rem; color: var(--blue); cursor: pointer; font-weight: 400; }

.filter-group { margin-bottom: 1.25rem; }
.filter-group:last-child { margin-bottom: 0; }
.filter-group h4 { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: .6rem; }

.filter-group label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  cursor: pointer;
  padding: .2rem 0;
  color: var(--text);
}

.price-range-inputs { display: flex; gap: .5rem; align-items: center; }
.price-range-inputs input {
  width: 80px;
  padding: .4rem .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  outline: none;
}
.price-range-inputs input:focus { border-color: var(--blue); }
.price-range-inputs span { color: var(--text-muted); font-size: .8rem; }

.btn-apply-filters {
  width: 100%;
  background: var(--blue);
  color: var(--white);
  border: none;
  padding: .6rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  margin-top: .75rem;
}

/* Results header */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.results-count { font-size: .9rem; color: var(--text-muted); }
.results-count strong { color: var(--text); }

.sort-select {
  padding: .45rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--text);
  background: var(--white);
  cursor: pointer;
  outline: none;
}
.sort-select:focus { border-color: var(--blue); }

/* ─── Product Detail Page ───────────────────────────────────────────────── */
.product-page {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 2rem;
  align-items: start;
}

.product-gallery {
  position: sticky;
  top: 80px;
}
.product-main-img {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  aspect-ratio: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .75rem;
}
.product-main-img img { width: 100%; height: 100%; object-fit: contain; padding: 1.5rem; }
.product-main-img .no-image { font-size: 5rem; color: #ddd; }

.product-info { }
.product-breadcrumb { font-size: .8rem; color: var(--text-muted); margin-bottom: .75rem; }
.product-breadcrumb a { color: var(--text-muted); }
.product-breadcrumb span { margin: 0 .3rem; }

.product-brand-label {
  display: inline-block;
  background: var(--blue-light);
  color: var(--blue);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: .2rem .6rem;
  border-radius: 4px;
  margin-bottom: .6rem;
}

.product-title { font-size: 1.6rem; font-weight: 800; line-height: 1.25; margin-bottom: .75rem; }

.product-price-summary {
  background: var(--green-bg);
  border: 1px solid #a9dfbf;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.product-price-summary .from    { font-size: .85rem; color: var(--text-muted); }
.product-price-summary .amount  { font-size: 2rem; font-weight: 800; color: var(--green); line-height: 1.1; }
.product-price-summary .savings { font-size: .85rem; color: var(--green); margin-top: .25rem; }

.product-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem .75rem;
  margin-bottom: 1.5rem;
  font-size: .875rem;
}
.product-meta dt { color: var(--text-muted); font-weight: 600; }
.product-meta dd { color: var(--text); }

.product-description { font-size: .9rem; color: #444; line-height: 1.7; }

/* Offers Table */
.offers-section { margin-top: 2rem; }
.offers-section h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: .75rem; }

.offers-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.offers-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  font-size: .875rem;
}
.offers-table thead th {
  background: #f1f3f4;
  padding: .7rem 1rem;
  text-align: left;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.offers-table tbody tr { border-bottom: 1px solid var(--border); }
.offers-table tbody tr:last-child { border-bottom: none; }
.offers-table tbody tr.best-offer { background: #f0fff8; }

.offers-table td { padding: .85rem 1rem; vertical-align: middle; }

.merchant-cell { display: flex; align-items: center; gap: .6rem; }
.merchant-cell > div { min-width: 0; }
.merchant-logo { width: 48px; height: 32px; object-fit: contain; border-radius: 4px; border: 1px solid var(--border); padding: 2px; background: #f5f5f5; }
.merchant-logo--light { background: #1a1a1a; border-color: #333; }
.merchant-logo--dark  { background: #f5f5f5; border-color: #ddd; }
.merchant-logo-placeholder { width: 48px; height: 32px; background: var(--bg); border-radius: 4px; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: .6rem; color: var(--text-muted); text-align: center; }
.merchant-name { font-weight: 600; color: var(--text); }

.offer-price { font-size: 1.1rem; font-weight: 800; color: var(--green); }
.offer-price-best { color: var(--red); }
.best-tag { display: inline-block; background: var(--red); color: var(--white); font-size: .65rem; font-weight: 700; padding: .1rem .35rem; border-radius: 3px; margin-left: .35rem; vertical-align: middle; text-transform: uppercase; }

.condition-badge {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}
.condition-new          { background: #e8f5e9; color: #2e7d32; }
.condition-refurbished  { background: #fff3e0; color: #e65100; }
.condition-used         { background: #f3e5f5; color: #7b1fa2; }

.availability-badge {
  font-size: .8rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.avail-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.avail-in  .avail-dot { background: var(--green); }
.avail-out .avail-dot { background: var(--red); }

.btn-view-deal {
  background: var(--blue);
  color: var(--white);
  border: none;
  padding: .55rem 1.1rem;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.btn-view-deal svg   { flex-shrink: 0; }

/* ─── Pagination ────────────────────────────────────────────────────────── */
.pagination { margin-top: 2rem; display: flex; justify-content: center; }
.pagination ul { display: flex; gap: .25rem; align-items: center; }
.pagination li a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 .5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .875rem;
  text-decoration: none;
  background: var(--white);
}
.pagination li a.active        { background: var(--blue); border-color: var(--blue); color: var(--white); font-weight: 700; }.pagination li[aria-current]   { }
.pagination li.dots a          { border: none; background: none; cursor: default; }

/* ─── Breadcrumb ────────────────────────────────────────────────────────── */
.breadcrumb { font-size: .82rem; color: var(--text-muted); margin-bottom: 1rem; display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb-sep { color: #ccc; }

/* ─── Alert / Notice boxes ──────────────────────────────────────────────── */
.alert { padding: .9rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .9rem; }
.alert-info    { background: var(--blue-light); color: #1557b0; border-left: 4px solid var(--blue); }
.alert-success { background: var(--green-bg);   color: var(--green); border-left: 4px solid #2ecc71; }
.alert-error   { background: var(--red-bg);     color: var(--red); border-left: 4px solid #e74c3c; }
.alert a       { color: inherit; font-weight: 700; }

/* ─── Empty state ───────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}
.empty-state svg  { margin: 0 auto 1rem; opacity: .3; }
.empty-state h2   { font-size: 1.2rem; color: var(--text); margin-bottom: .5rem; }
.empty-state p    { font-size: .9rem; }

/* ─── Footer ────────────────────────────────────────────────────────────── */
.site-footer {
  background: #1a1a2e;
  color: #aaa;
  margin-top: 3rem;
  padding: 2.5rem 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-brand .logo-text { color: var(--white); }
.footer-brand .logo-bolt { }
.footer-brand p   { font-size: .875rem; line-height: 1.6; color: #999; }
.footer-note      { font-size: .78rem; color: #666; margin-top: .5rem; }
.site-footer h4   { color: var(--white); font-size: .9rem; font-weight: 700; margin-bottom: .75rem; }
.site-footer ul   { display: flex; flex-direction: column; gap: .35rem; }
.site-footer a    { color: #888; font-size: .875rem; text-decoration: none; }
.footer-bottom    { padding: 1rem 0; text-align: center; font-size: .78rem; color: #555; }

/* ─── Admin Layout ──────────────────────────────────────────────────────── */
.admin-body { background: #f0f4f8; font-family: var(--font); color: var(--text); }
.admin-topbar {
  background: #1a1a2e;
  color: var(--white);
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
}
.admin-topbar .logo-text { color: var(--white); font-size: 1.1rem; }
.admin-topbar nav a { color: #aaa; font-size: .875rem; margin-left: 1.25rem; text-decoration: none; }
.admin-topbar nav a.active { color: var(--white); font-weight: 600; }

.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 56px);
}
.admin-sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
}
.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem 1.5rem;
  color: var(--text-muted);
  font-size: .9rem;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.admin-sidebar a.active { color: var(--blue); background: var(--blue-light); border-left-color: var(--blue); font-weight: 600; }

.admin-main { padding: 2rem; }
.admin-page-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 1.5rem; }

/* Stats cards */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon { font-size: 1.8rem; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }

/* Tables (admin) */
.admin-table-wrap { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.admin-table thead th {
  background: #f8f9fa;
  padding: .75rem 1rem;
  text-align: left;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.admin-table tbody td { padding: .8rem 1rem; border-bottom: 1px solid #f0f1f2; vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table .actions a,
.admin-table .actions button { margin-right: .5rem; font-size: .82rem; }

/* Forms (admin) */
.admin-form-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.admin-form-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1.25rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.form-row    { margin-bottom: 1rem; }
.form-row label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; color: var(--text); }
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: .6rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  background: var(--white);
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,115,232,.12);
}
.form-row textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }
.form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Buttons */
.btn         { display: inline-flex; align-items: center; gap: .4rem; padding: .6rem 1.15rem; border-radius: var(--radius-sm); font-size: .875rem; font-weight: 600; border: none; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--blue); color: var(--white); }
.btn-success { background: var(--green); color: var(--white); }
.btn-danger  { background: var(--red); color: var(--white); }
.btn-outline { background: var(--white); color: var(--text); border: 1px solid var(--border); }
.btn-sm      { padding: .35rem .75rem; font-size: .8rem; }

/* Status badges */
.status-badge { display: inline-block; padding: .2rem .55rem; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.status-ok    { background: var(--green-bg); color: var(--green); }
.status-error { background: var(--red-bg); color: var(--red); }
.status-none  { background: #f0f0f0; color: #888; }

/* Progress */
.progress-bar-wrap { background: #e0e0e0; border-radius: 10px; height: 10px; overflow: hidden; margin: .5rem 0; }
.progress-bar-fill { height: 100%; background: var(--blue); border-radius: 10px; transition: width .4s; }

/* Import Results */
.import-results { background: #1a1a2e; color: #e0e0e0; border-radius: var(--radius); padding: 1.25rem; font-family: 'Courier New', monospace; font-size: .85rem; line-height: 1.7; min-height: 120px; max-height: 400px; overflow-y: auto; }
.import-results .line-ok    { color: #2ecc71; }
.import-results .line-error { color: #e74c3c; }
.import-results .line-info  { color: #3498db; }

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .results-layout { grid-template-columns: 1fr; }
  .toggle-filters-btn { display: inline-flex; align-items: center; justify-content: center; width: fit-content; }
  .filters-sidebar { position: static; display: none; top: auto; }
  .filters-sidebar.open { display: block; }
  .product-page { grid-template-columns: 1fr; }
  .product-gallery { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── Search Autocomplete Dropdown ─────────────────────────────────────────── */
.search-suggest-list {
  position: absolute;
  z-index: 9000;
  list-style: none;
  margin: 4px 0 0;
  padding: .35rem 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 28px rgba(0,0,0,.13);
  overflow: hidden;
  display: none;
}
.ssi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .55rem 1rem;
  cursor: pointer;
  font-size: .9rem;
  color: var(--text);
  line-height: 1.3;
}
.ssi:hover,
.ssi--active {
  background: #f0f7ff;
  color: var(--blue);
}
.ssi__label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ssi__label mark {
  background: none;
  color: var(--blue);
  font-weight: 700;
}
.ssi__type {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .1rem .5rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.ssi--brand  .ssi__type { background: #eef3ff; border-color: #c7d7ff; color: #3b5fde; }
.ssi--category .ssi__type { background: #f0fdf4; border-color: #b5f0c8; color: #166534; }

@media (max-width: 640px) {
  .hero { padding: 2.5rem 1rem; }
  .header-inner { gap: .75rem; flex-wrap: wrap; justify-content: flex-start; }
  .header-inner .header-search { position: static; transform: none; width: 100%; order: 3; }
  .logo-text { font-size: 1.1rem; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }

  /* Mobile offers view: stacked cards instead of wide table */
  .offers-table-wrap { overflow: visible; }
  .offers-table { min-width: 0; border: none; background: transparent; }
  .offers-table thead { display: none; }
  .offers-table,
  .offers-table tbody,
  .offers-table tr,
  .offers-table td { display: block; width: 100%; }
  .offers-table tbody tr {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .5rem .65rem;
    margin-bottom: .7rem;
  }
  .offers-table tbody tr.best-offer {
    border-color: #b7ebd1;
    box-shadow: 0 0 0 1px #d8f6e7 inset;
  }
  .offers-table td {
    border: none;
    padding: .45rem 0;
    text-align: left !important;
    white-space: normal;
    word-break: break-word;
  }
  .offers-table td:nth-child(1) { padding-top: .2rem; }
  .offers-table td:nth-child(5) { padding-bottom: .2rem; }

  .offers-table td:nth-child(2)::before,
  .offers-table td:nth-child(3)::before,
  .offers-table td:nth-child(4)::before {
    display: block;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: .2rem;
  }
  .offers-table td:nth-child(2)::before { content: 'Price'; }
  .offers-table td:nth-child(3)::before { content: 'Condition'; }
  .offers-table td:nth-child(4)::before { content: 'Availability'; }

  .merchant-cell { align-items: flex-start; }
  .offer-price { font-size: 1rem; }
  .offers-table .btn-view-deal {
    width: 100%;
    justify-content: center;
    white-space: nowrap;
    font-size: .82rem;
    padding: .55rem .8rem;
    border-radius: 999px;
  }
  .form-cols { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .product-grid { grid-template-columns: 1fr; }
}
