/* ============================================================
   Greg's Marketplace – Main Stylesheet
   Mobile-first, cross-browser, no framework
   ============================================================ */

/* --- Custom Properties ------------------------------------ */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary: #f59e0b;
  --secondary-dark: #d97706;
  --bg: #f1f5f9;
  --bg-alt: #e2e8f0;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-dark: #cbd5e1;
  --sold-bg: #f0fdf4;
  --sold-text: #16a34a;
  --sold-border: #bbf7d0;
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --ebay-blue: #0064d2;
  --fb-blue: #1877f2;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --transition: 0.2s ease;
  --max-width: 1280px;
}

/* --- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }
input, select, textarea { font-family: var(--font); }

/* --- Utility ---------------------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* --- Seller Away Banner ------------------------------------ */
.away-banner {
  background: var(--warning);
  color: #78350f;
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}
.away-banner strong { font-weight: 700; }

/* --- Header ----------------------------------------------- */
.site-header {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  max-width: var(--max-width);
  margin: 0 auto;
}
.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-img {
  height: 55px;
  width: auto;
  display: block;
}
.site-logo .logo-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.site-logo .logo-sub {
  font-size: 0.7rem;
  opacity: 0.8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.header-search {
  flex: 1;
  max-width: 480px;
}
.search-form {
  display: flex;
  background: var(--card);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-full);
  overflow: hidden;
  transition: background var(--transition);
}
.search-form:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: var(--text);
  min-width: 0;
}
.search-input::placeholder { color: var(--text-light); }
.search-btn {
  background: none;
  border: none;
  padding: 0.5rem 0.875rem;
  color: var(--text-muted);
  font-size: 1rem;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.admin-link {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.75);
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.admin-link:hover { background: rgba(255,255,255,0.15); color: #fff; text-decoration: none; }

/* --- Hero -------------------------------------------------- */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  text-align: center;
  padding: 2.5rem 1rem;
}
.hero h1 { font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 800; margin-bottom: 0.5rem; }
.hero p { font-size: 1rem; opacity: 0.85; max-width: 480px; margin: 0 auto; }

/* --- Category Bar ----------------------------------------- */
.category-bar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-bar::-webkit-scrollbar { display: none; }
.category-list {
  display: flex;
  gap: 0;
  padding: 0 0.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  min-width: max-content;
}
.cat-btn {
  padding: 0.875rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
  line-height: 1.2;
}
.cat-btn:hover { color: var(--primary); }
.cat-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.cat-btn .cat-count {
  display: inline-block;
  background: var(--bg-alt);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  padding: 0 0.4rem;
  margin-left: 0.35rem;
  line-height: 1.5;
}
.cat-btn.active .cat-count { background: var(--primary-light); color: var(--primary-dark); }

/* --- Toolbar ---------------------------------------------- */
.toolbar {
  max-width: var(--max-width);
  margin: 1rem auto 0;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.toolbar .search-form { flex: 1; max-width: 340px; min-width: 160px; }
.results-info { font-size: 0.875rem; color: var(--text-muted); flex: 1; }
.results-info strong { color: var(--text); }
.sort-select {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  outline: none;
}
.sort-select:focus { border-color: var(--primary); }

/* --- Product Grid ----------------------------------------- */
.listings-section {
  max-width: var(--max-width);
  margin: 1rem auto 2rem;
  padding: 0 1rem;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

/* --- Product Card ----------------------------------------- */
.card-full-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius-lg);
}
.card-footer, .card-body, .card-image-wrap { position: relative; z-index: 0; }
.view-btn, .card-cross-item { position: relative; z-index: 2; }

.product-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}
.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.product-card.sold { opacity: 0.75; }

.card-image-wrap {
  position: relative;
  overflow: hidden;
  background: var(--bg-alt);
  aspect-ratio: 4/3;
}
.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.product-card:hover .card-image-wrap img { transform: scale(1.03); }

.sold-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sold-overlay span {
  background: var(--sold-text);
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.12em;
  padding: 0.3rem 1rem;
  border-radius: var(--radius);
  transform: rotate(-15deg);
  text-transform: uppercase;
}

.card-badges {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
}
.badge-ebay { background: var(--ebay-blue); color: #fff; }
.badge-facebook { background: var(--fb-blue); color: #fff; }

.card-body { padding: 0.875rem; flex: 1; display: flex; flex-direction: column; gap: 0.4rem; }
.card-category {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
}
.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-condition { font-size: 0.78rem; color: var(--text-muted); }
.condition-label { font-weight: 600; color: var(--text); }

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0.75rem 0.875rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
  gap: 0.5rem;
}
.card-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.card-price.sold-price { color: var(--text-muted); text-decoration: line-through; font-size: 0.95rem; }
.sold-tag {
  background: var(--sold-bg);
  color: var(--sold-text);
  border: 1px solid var(--sold-border);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.view-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.4rem 0.875rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
  display: inline-block;
}
.view-btn:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }

/* --- Card cross-listing row -------------------------------- */
.card-cross {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  width: 100%;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
  margin-top: 0.1rem;
}
.card-cross-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.card-cross-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: opacity 0.15s;
  line-height: 1;
}
.card-cross-item:hover { opacity: 0.8; text-decoration: none; }
.card-cross-item span { color: var(--text-muted); }
.card-cross-ebay { background: #f0f6ff; border: 1px solid #c7defe; }
.card-cross-fb { background: #eef3ff; border: 1px solid #c3d0fa; }

/* --- No Results ------------------------------------------- */
.no-results {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  grid-column: 1 / -1;
}
.no-results .no-results-icon { font-size: 3rem; margin-bottom: 1rem; }
.no-results h3 { font-size: 1.1rem; color: var(--text); margin-bottom: 0.5rem; }

/* --- Footer ----------------------------------------------- */
.site-footer {
  background: #1e293b;
  color: #94a3b8;
  padding: 2rem 1rem;
  margin-top: auto;
  font-size: 0.875rem;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
}
.footer-brand .footer-name { color: #fff; font-weight: 700; font-size: 1rem; margin-bottom: 0.15rem; }
.footer-brand .footer-tagline { color: #94a3b8; font-size: 0.8rem; }
.footer-about-section {
  border-bottom: 1px solid #334155;
  padding: 2rem 1rem;
}
.footer-about-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.footer-about-inner .about-with-avatar { align-items: flex-start; }
.footer-about-inner .about-avatar { border-color: #334155; }
.footer-about-inner .about-text-block h2 { color: #e2e8f0; font-size: 1rem; }
.footer-about-inner .about-text-block p { color: #94a3b8; }
.footer-about-inner .about-profile-link { color: #cbd5e1; border-color: #334155; }
.footer-about-inner .about-profile-link:hover { background: #334155; }
.faq-footer-heading { color: #e2e8f0; font-size: 0.95rem; margin: 1.25rem 0 0.6rem; }
.footer-about-inner .faq-public-item { background: #0f172a; }
.footer-about-inner .faq-public-q { color: #e2e8f0; }
.footer-about-inner .faq-public-a { color: #94a3b8; }
.footer-bottom {
  max-width: var(--max-width);
  margin: 1.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid #334155;
  text-align: center;
  font-size: 0.8rem;
  color: #64748b;
}

/* ============================================================
   ITEM DETAIL PAGE
   ============================================================ */

.item-page { max-width: var(--max-width); margin: 0 auto; padding: 1rem; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--text-light); }

.item-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .item-layout { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .item-layout { grid-template-columns: 3fr 2fr; }
}

/* --- Gallery ---------------------------------------------- */
/* --- Featured card --------------------------------------- */
.product-card.featured-card {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary-light), var(--shadow-md);
}
.product-card.featured-card .card-category::before {
  content: '⭐ ';
}

/* --- Logo pill (white container for logo + avatar) ------- */
.logo-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  border-radius: 10px;
  padding: 4px 8px 4px 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

/* --- Logo avatar ----------------------------------------- */
.logo-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #e2e8f0;
  flex-shrink: 0;
  background: #1e3a8a;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.logo-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0; left: 0;
  border-radius: 50%;
}
.logo-avatar-fallback {
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  pointer-events: none;
}
.logo-avatar.initials-only .logo-avatar-img { display: none; }

/* --- About / FAQ section ---------------------------------- */
.about-section {
  max-width: var(--max-width);
  margin: 2rem auto 0;
  padding: 0 1rem;
}
.about-inner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
}
.about-text h2, .faq-section-public h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.about-text p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.65; }
#faq-section-public { margin-top: 1.25rem; }
.faq-list-public { display: flex; flex-direction: column; gap: 0.75rem; }
.faq-public-item { background: var(--bg); border-radius: var(--radius); padding: 0.75rem 1rem; }
.faq-public-q { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.25rem; }
.faq-public-a { font-size: 0.875rem; color: var(--text-muted); }

/* --- About section: avatar + text layout ----------------- */
.about-with-avatar {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.about-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--border);
}
.about-text-block h2 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.about-text-block p { margin: 0; font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }
.about-profile-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
}
.about-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--border);
  color: var(--text);
  transition: background var(--transition), border-color var(--transition);
}
.about-profile-link:hover { background: var(--bg); border-color: var(--text-muted); text-decoration: none; }
@media (max-width: 480px) {
  .about-with-avatar { flex-direction: column; align-items: center; text-align: center; }
  .about-profile-links { justify-content: center; }
}

/* --- Item gallery ---------------------------------------- */
.item-gallery { display: flex; flex-direction: column; gap: 0.75rem; }

.gallery-main {
  position: relative;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: zoom-in;
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s;
}
.gallery-sold-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--sold-text);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.1em;
  padding: 0.35rem 0.875rem;
  border-radius: var(--radius);
  text-transform: uppercase;
  box-shadow: var(--shadow-md);
  text-align: center;
  line-height: 1.3;
}
.sold-badge-stars { font-size: 0.85rem; letter-spacing: 0.05em; font-weight: 400; text-transform: none; }
.gallery-zoom-hint {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 0.72rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  pointer-events: none;
}

/* Portrait gallery layout */
.item-gallery.portrait-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0.5rem;
}
.item-gallery.portrait-layout .gallery-main {
  grid-column: 1;
  grid-row: 1;
  aspect-ratio: auto;
  max-width: 320px;
  width: auto;
}
.item-gallery.portrait-layout .gallery-main img {
  object-fit: contain;
  width: auto;
  max-width: 100%;
  max-height: 480px;
}
.item-gallery.portrait-layout .gallery-thumbs {
  grid-column: 1 / -1;
  grid-row: 2;
}
.gallery-side-stack {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.gallery-side-item {
  flex: 1;
  min-height: 80px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s;
}
.gallery-side-item:hover { border-color: var(--primary); }
.gallery-side-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.gallery-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  flex-shrink: 0;
  transition: border-color var(--transition);
  background: var(--bg-alt);
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active { border-color: var(--primary); }
.gallery-thumb:hover { border-color: var(--primary-dark); }

/* --- Item Info Panel -------------------------------------- */
.item-info { display: flex; flex-direction: column; gap: 1rem; }

.item-cross-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cross-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--transition);
}
.cross-badge:hover { opacity: 0.85; text-decoration: none; }
.cross-badge-ebay { background: var(--ebay-blue); color: #fff; }
.cross-badge-facebook { background: var(--fb-blue); color: #fff; }
.cross-badge svg { width: 14px; height: 14px; flex-shrink: 0; }

/* --- Cross-platform panel --------------------------------- */
.cross-platform-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card);
}
.cross-platform-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.875rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.cross-platform-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
.cross-platform-best {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--success);
  letter-spacing: 0.02em;
}
.cross-platform-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  text-decoration: none;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.cross-platform-row:last-child { border-bottom: none; }
.cross-platform-row:hover { background: var(--bg); text-decoration: none; }
.cross-platform-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cross-row-ebay .cross-platform-logo { background: #e6f0ff; color: var(--ebay-blue); }
.cross-row-facebook .cross-platform-logo { background: #e8f0fe; color: var(--fb-blue); }
.cross-platform-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.cross-platform-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.cross-row-ebay .cross-platform-name { color: var(--ebay-blue); }
.cross-row-facebook .cross-platform-name { color: var(--fb-blue); }
.cross-platform-note {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.cross-platform-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.item-title-area { border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
.item-category-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--primary);
  margin-bottom: 0.4rem;
}
.item-title-text { font-size: clamp(1.1rem, 2.5vw, 1.5rem); font-weight: 700; line-height: 1.3; margin-bottom: 0.4rem; }
.item-condition { font-size: 0.85rem; color: var(--text-muted); }

.item-price-area { display: flex; align-items: baseline; gap: 0.75rem; }
.item-price { font-size: 2rem; font-weight: 800; color: var(--text); }
.item-price.sold-price { color: var(--text-muted); font-size: 1.5rem; text-decoration: line-through; }
.item-sold-label {
  background: var(--sold-bg);
  color: var(--sold-text);
  border: 1px solid var(--sold-border);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.item-location {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.6rem 0;
  border-top: 1px solid var(--border);
}
.item-location svg { flex-shrink: 0; }

/* --- PayPal Area ------------------------------------------ */
.paypal-area {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.paypal-area.sold-state { opacity: 0.5; pointer-events: none; }

.paypal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #0070ba;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition);
  width: 100%;
}
.paypal-btn:hover { background: #005ea6; text-decoration: none; color: #fff; }
.paypal-btn svg { width: 24px; height: 24px; flex-shrink: 0; }

.sold-notice {
  text-align: center;
  background: var(--sold-bg);
  border: 1px solid var(--sold-border);
  color: var(--sold-text);
  border-radius: var(--radius);
  padding: 1rem;
  font-weight: 600;
}
.sold-notice p { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; font-weight: 400; }
.sold-notice .item-review-box { background: none; border: none; padding: 0.75rem 0 0; margin: 0; text-align: left; color: var(--text); font-weight: 400; }
.sold-notice .item-review-row-label { color: var(--text-muted); }
.sold-notice .item-review-stars { color: var(--warning); }
.sold-notice .item-review-buy-again,
.sold-notice .item-review-comment,
.sold-notice .item-review-meta { color: var(--text-muted); font-weight: 400; }

/* --- Shipping Estimate ------------------------------------ */
.shipping-estimate {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
}
.shipping-estimate h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
/* --- Flat shipping box ------------------------------------ */
.flat-ship-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}
.flat-ship-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0369a1;
  margin-bottom: 0.3rem;
}
.flat-ship-rate {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0c4a6e;
  margin-bottom: 0.3rem;
}
.flat-ship-contact { color: #0369a1; }
.flat-ship-detail { font-size: 0.82rem; color: #334155; line-height: 1.5; }
.flat-ship-policy {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #bae6fd;
  line-height: 1.5;
}

.zip-form { display: flex; gap: 0.5rem; }
.zip-input {
  flex: 1;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  outline: none;
  min-width: 0;
  transition: border-color var(--transition);
}
.zip-input:focus { border-color: var(--primary); }
.zip-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition);
}
.zip-btn:hover { background: var(--primary-dark); }
.shipping-result {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  padding: 0.6rem 0.75rem;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  line-height: 1.5;
}
.shipping-result .ship-cost { font-weight: 700; color: var(--text); }
.shipping-result .ship-note { color: var(--text-muted); font-size: 0.8rem; }
.no-ship-msg { font-size: 0.85rem; color: var(--text-muted); font-style: italic; }

/* --- QR Code --------------------------------------------- */
.qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}
.qr-section h4 { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
#qr-code { line-height: 0; }
#qr-code canvas, #qr-code img { border-radius: var(--radius-sm); }
.qr-url { font-size: 0.7rem; color: var(--text-muted); word-break: break-all; max-width: 180px; }

/* --- Accordion -------------------------------------------- */
.accordion-section { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }

.accordion-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.accordion-header {
  width: 100%;
  background: none;
  border: none;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  transition: background var(--transition);
}
.accordion-header:hover { background: var(--bg); }
.accordion-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.25s ease;
}
.accordion-item.open .accordion-icon { transform: rotate(180deg); }

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.2s;
}
.accordion-body-inner {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.details-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.details-table td { padding: 0.4rem 0; vertical-align: top; }
.details-table td:first-child { font-weight: 600; color: var(--text); min-width: 140px; padding-right: 1rem; }
.details-table tr:not(:last-child) td { border-bottom: 1px solid var(--border); }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  padding: 1rem;
}
.lightbox-overlay.open { opacity: 1; }

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-content img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  transition: background var(--transition);
  z-index: 10;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }

.lightbox-prev, .lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  transition: background var(--transition);
  z-index: 10;
}
.lightbox-prev { left: 0.75rem; }
.lightbox-next { right: 0.75rem; }
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.25); }

.lightbox-counter {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
  background: rgba(0,0,0,0.4);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

/* ============================================================
   LOADING STATES
   ============================================================ */
.loading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  max-width: var(--max-width);
  margin: 1rem auto;
  padding: 0 1rem;
}
.skeleton-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.skeleton-img { background: var(--bg-alt); aspect-ratio: 4/3; position: relative; overflow: hidden; }
.skeleton-body { padding: 0.875rem; display: flex; flex-direction: column; gap: 0.5rem; }
.skeleton-line { background: var(--bg-alt); border-radius: var(--radius-sm); height: 0.8rem; position: relative; overflow: hidden; }
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long { width: 100%; }

.skeleton-img::after,
.skeleton-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767px) {
  .product-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 479px) {
  .header-search { display: none; }
  .hero { padding: 1.5rem 1rem; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
  .card-body { padding: 0.625rem; }
  .card-footer { padding: 0.5rem 0.625rem; }
  .card-price { font-size: 0.95rem; }
  .view-btn { padding: 0.35rem 0.6rem; font-size: 0.75rem; }
  .gallery-thumb { width: 52px; height: 52px; }
}
@media (min-width: 1024px) {
  .container { padding: 0 2rem; }
  .hero { padding: 3.5rem 2rem; }
}


/* ============================================================
   Inquiry Form
   ============================================================ */

/* --- Trigger button --------------------------------------- */
.inquire-purchase-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1.25rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s;
  margin-bottom: 0;
}
.inquire-purchase-btn:hover { background: var(--primary-dark); }

.inq-chevron {
  width: 18px; height: 18px; flex-shrink: 0;
  transition: transform 0.2s;
}
.inq-chevron.flipped { transform: rotate(180deg); }

/* --- Collapsible form wrapper ----------------------------- */
.inq-form-wrap {
  border: 1.5px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  background: var(--card);
}

/* --- Map -------------------------------------------------- */
.inq-location-map {
  height: 200px;
  border-bottom: 1px solid var(--border);
}
.inq-map-popup .leaflet-popup-content-wrapper {
  background: #1e293b;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  padding: 0;
}
.inq-map-popup .leaflet-popup-content { margin: 0.35rem 0.65rem; }
.inq-map-popup .leaflet-popup-tip { background: #1e293b; }

/* --- Map location label (no arrow) ------------------------ */
.map-location-label {
  background: rgba(30, 41, 59, 0.82);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  pointer-events: none;
  letter-spacing: 0.01em;
}

/* --- Form layout ------------------------------------------ */
.inq-form {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.inq-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.inq-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}
.inq-input {
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 0.55rem 0.875rem;
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.18s;
  width: 100%;
  background: var(--bg);
  color: var(--text);
}
.inq-input:focus { border-color: var(--primary); background: #fff; }
.inq-textarea { resize: vertical; min-height: 72px; }

/* --- Radio groups ----------------------------------------- */
.inq-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.inq-radio-opt {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text);
}
.inq-radio-opt input[type=radio] {
  accent-color: var(--primary);
  width: 16px; height: 16px;
  cursor: pointer;
}

/* --- Error + submit --------------------------------------- */
.inq-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: var(--radius);
  padding: 0.6rem 0.875rem;
  font-size: 0.875rem;
}
.inq-submit-row { padding-top: 0.25rem; }
.inquire-submit-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s;
  font-family: var(--font);
}
.inquire-submit-btn:hover:not(:disabled) { background: var(--primary-dark); }
.inquire-submit-btn:disabled { opacity: 0.65; cursor: not-allowed; }

/* --- Confirmation ----------------------------------------- */
.inq-confirmation {
  padding: 2rem 1.5rem;
  text-align: center;
}
.inq-confirm-icon {
  width: 52px; height: 52px;
  background: #d1fae5;
  color: #065f46;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 900;
  margin: 0 auto 1rem;
}
.inq-confirmation h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.inq-confirmation p  { font-size: 0.9rem; color: var(--text-muted); }

/* --- Payment brand logos ----------------------------------- */
.pay-logo {
  width: 20px; height: 20px;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 3px;
  flex-shrink: 0;
}

/* --- Buyer review on listing ------------------------------- */
.item-review-box {
  background: var(--warning-bg);
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0 0.75rem;
}
.item-review-row { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.15rem; }
.item-review-row-label { font-size: 0.8rem; color: var(--text-muted); }
.item-review-stars { font-size: 1.05rem; color: var(--warning); letter-spacing: 0.05em; }
.item-review-buy-again { font-size: 0.82rem; color: var(--text-muted); margin: 0.25rem 0; }
.item-review-comment { font-size: 0.875rem; font-style: italic; color: var(--text); margin: 0.25rem 0 0.2rem; }
.item-review-meta { font-size: 0.78rem; color: var(--text-muted); }

/* --- Item location map (above inquiry button) -------------- */
.item-location-map {
  height: 220px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin: 0.5rem 0 0.75rem;
}

/* --- Shipping info toggle (inquiry form) ------------------- */
.inq-ship-info-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: 1px solid #bae6fd;
  border-radius: 20px;
  color: #0369a1;
  font-size: 0.8rem;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
  margin-bottom: 0.6rem;
}
.inq-ship-info-btn:hover { background: #f0f9ff; }
.inq-ship-detail {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-size: 0.82rem;
  color: #0c4a6e;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}
.inq-ship-detail svg { vertical-align: middle; margin-right: 0.3rem; }
.inq-fulfillment-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
  color: #0c4a6e;
  margin-bottom: 0.6rem;
}
/* Ensure hidden attribute is respected even when element has display:flex */
[hidden] { display: none !important; }
