/*
  UsedFindr — Light Theme Styles
  - Off-white background
  - Distinct header
  - Responsive product grid (1–2 cols mobile, 3–4 cols desktop)
  - Card shadows, rounded corners, hover zoom
  - Prominent "Buy on Amazon" button
*/

@import './components/product-card.css';
@import './shell.css';

/* ======================================================================== */
/* Redesign token system (homepage + cards; parity with docs reference)     */
/* Single layer for navy / lime / surface / ink — prefer these over hex.   */
/* ======================================================================== */
:root {
  /* Navy scale — Homepage.html */
  --redesign-navy-900: #0b1129;
  --redesign-navy-800: #111a3a;
  --redesign-navy-700: #1a2644;
  --redesign-navy-600: #243156;

  /* Lime scale */
  --redesign-lime-500: #1fdb00;
  --redesign-lime-400: #36e81a;
  --redesign-lime-300: #87f56b;
  --redesign-lime-50: #ecfde4;

  /* Surfaces & lines */
  --redesign-bg: #f6f5f0;
  --redesign-bg-alt: #eceae2;
  --redesign-surface: #ffffff;
  --redesign-line: #e4e1d6;
  --redesign-line-strong: #c9c5b5;

  /* Ink (text on light surfaces) */
  --redesign-ink-900: #0e1322;
  --redesign-ink-700: #2b3142;
  --redesign-ink-500: #5a6076;
  --redesign-ink-400: #7b8198;

  /* Hero / marketplace dashboard */
  --redesign-hero-spotlight: rgba(91, 125, 184, 0.08);
  --home-hero-gradient: linear-gradient(
    90deg,
    var(--redesign-navy-900) 0%,
    var(--redesign-navy-700) 100%
  );
  --home-hero-radial-glow: radial-gradient(
    circle at 30% 50%,
    var(--redesign-hero-spotlight) 0%,
    transparent 50%
  );
  --home-dashboard-card-shadow: 0 10px 25px -5px rgba(11, 17, 41, 0.2);
  --home-dashboard-card-shadow-hover: 0 10px 25px -5px rgba(11, 17, 41, 0.28);
  --navy-alpha-06: rgba(11, 17, 41, 0.06);
  --home-featured-tile-gradient: linear-gradient(
    135deg,
    var(--redesign-surface) 0%,
    var(--redesign-lime-50) 100%
  );

  /* Lime translucency (matches #1fdb00 / legacy 124,252,0 usage) */
  --lime-alpha-05: rgba(31, 219, 0, 0.05);
  --lime-alpha-20: rgba(31, 219, 0, 0.2);
  --lime-alpha-30: rgba(31, 219, 0, 0.3);
  --lime-alpha-40: rgba(31, 219, 0, 0.4);
  --lime-focus-ring: rgba(124, 252, 0, 0.35);

  /* Neutrals shared by cards / pills */
  --surface-muted: #fafafa;
  --pill-neutral-bg: #f3f4f6;
  --pill-neutral-text: var(--redesign-ink-700);
  --success-surface: #dcfce7;
  --success-text: #065f46;
  --success-border: rgba(5, 150, 105, 0.4);
  --warning-surface: rgba(251, 191, 36, 0.9);
  --warning-text: #78350f;
}

/* ======================================================================== */
/* Complex Page Styles (Product grids, forms, modals, account features) */
/* ======================================================================== */
/* IMPORTANT: core.css must be loaded BEFORE this file in HTML */
/* All HTML pages should have: */
/*   <link rel="stylesheet" href="/src/css/core.css"> */
/*   <link rel="stylesheet" href="/src/css/style.css"> */
/* This ensures CSS variables are available in development mode */

/* Page Content Container - Safety container for content sections */
.page-content-container {
  max-width: 80rem;
  margin-left: 0;
  margin-right: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* ======================================================================== */
/* Button Animations */
/* ======================================================================== */
@keyframes ripple {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.button-ripple {
  position: relative;
  overflow: hidden;
}

.button-ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: var(--lime-alpha-30);
  transform: translate(-50%, -50%);
  animation: ripple 0.6s ease-out;
}

.button-bounce:active {
  animation: bounce 0.3s ease;
}

/* ======================================================================== */
/* Quick Filter Pills */
/* ======================================================================== */
.quick-filters {
  display: none; /* Hidden for now */
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  justify-content: center;
}

.quick-filter-pill {
  padding: 6px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 200ms ease;
  white-space: nowrap;
}

.quick-filter-pill:hover {
  border-color: var(--accent);
  background: var(--lime-alpha-05);
  color: var(--accent);
}

.quick-filter-pill.active {
  background: var(--navy-dark);
  color: var(--lime-vibrant);
  border-color: var(--navy-dark);
  font-weight: 600;
}

/* ======================================================================== */
/* Product Badges */
/* ======================================================================== */
.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gradient-navy-start) 0%, var(--gradient-navy-end) 100%);
  color: white;
  z-index: 10;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-badge-hot {
  background: linear-gradient(135deg, var(--gradient-navy-start) 0%, var(--gradient-navy-end) 100%);
}

.product-badge-new {
  background: linear-gradient(135deg, var(--gradient-navy-start) 0%, var(--gradient-navy-end) 100%);
}

/* ======================================================================== */
/* Marketplace Dashboard - Night Mode Hero */
/* ======================================================================== */
.marketplace-dashboard {
  width: 100%;
  margin: 0 0 2.5rem;
  padding: 2rem 1.5rem 2.5rem;
  position: relative;
  background: var(--home-hero-radial-glow), var(--home-hero-gradient);
}

/* Soft transition from hero to lower sections */
.marketplace-dashboard::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2.5rem;
  background: linear-gradient(to bottom, transparent, var(--redesign-bg));
  pointer-events: none;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 3fr 1fr;
  grid-template-rows: auto auto;
  gap: 1.25rem;
  min-height: 180px;
}

.dashboard-module {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  transition: box-shadow 200ms ease, transform 200ms ease;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Hero section: white floating cards on deep blue gradient */
.marketplace-dashboard .dashboard-module {
  background-color: var(--redesign-surface);
  border-radius: 12px;
  box-shadow: var(--home-dashboard-card-shadow);
  padding: 1rem;
}

.marketplace-dashboard .dashboard-module:hover {
  box-shadow: var(--home-dashboard-card-shadow-hover);
  transform: translateY(-2px);
}

.marketplace-dashboard .module-title {
  margin: 0 0 0.75rem;
}

.dashboard-module:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.featured-deal-module {
  grid-column: span 1;
  grid-row: span 2;
  overflow: hidden;
  background: var(--home-featured-tile-gradient);
}

/* Hero: featured deal as solid white tile */
.marketplace-dashboard .featured-deal-module {
  background: var(--redesign-surface);
}

.top-categories-module {
  grid-column: span 1;
  grid-row: span 1;
  flex: 1;
  padding: 8px 12px;
  min-height: 0;
}

.top-categories-module .module-title {
  margin: 0 0 8px;
  font-size: 1rem;
}

.featured-deal-content {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.featured-deal-link {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  align-items: center;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.featured-deal-link:hover .featured-deal-cta {
  background: var(--navy-deep);
  color: var(--lime-vibrant);
  opacity: 0.9;
}

.featured-deal-image {
  flex-shrink: 0;
  width: 40%;
  max-width: min(40vw, 420px);
  aspect-ratio: 4 / 3;
  max-height: min(48vh, 380px);
  height: auto;
  align-self: center;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--redesign-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.featured-deal-image img {
  width: 100%;
  height: 100%;
  max-height: min(48vh, 380px);
  object-fit: cover;
  display: block;
  padding: 0;
  border-radius: var(--radius-sm);
}

@media (min-width: 768px) {
  .featured-deal-image {
    max-width: min(40vw, 420px);
    max-height: min(48vh, 380px);
  }

  .featured-deal-image img {
    max-height: min(48vh, 380px);
  }
}

.featured-deal-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.featured-deal-info h3 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-deal-price {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 8px;
}

.featured-deal-cta {
  display: inline-block;
  width: fit-content;
  padding: 10px 24px;
  background: var(--navy-dark);
  color: var(--lime-vibrant);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background-color 200ms ease;
}

.featured-deal-cta:hover {
  background: var(--navy-deep);
  color: var(--lime-vibrant);
  opacity: 0.9;
}

.module-title {
  margin: 0 0 1.25rem;
  font-size: clamp(1.125rem, 1.5vw, 1.25rem);
  font-weight: 600;
  color: var(--text);
}

.module-placeholder {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0;
}

.continue-browsing-module {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  flex: 0 0 auto;
}

.continue-browsing-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  justify-content: center;
}

.continue-browsing-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background-color 200ms ease;
  text-decoration: none;
  color: var(--text);
}

.continue-browsing-item:hover {
  background: var(--bg);
}

.continue-browsing-item img {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
  border-radius: 8px;
  background: #f3f4f6;
  border: 1px solid #eee;
}

.continue-browsing-item-info {
  flex: 1;
  min-width: 0;
}

.continue-browsing-item-info h4 {
  margin: 0 0 4px;
  font-size: 0.875rem;
  font-weight: 700;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.continue-browsing-item-info p {
  margin: 0;
  font-size: 0.75rem;
  color: #6b7280;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  flex: 1;
  min-height: 0;
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border: 1px solid #eee;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: background-color 200ms ease, border-color 200ms ease;
  min-height: 0;
  overflow: hidden;
}

.category-item:hover {
  background: var(--bg);
  border-color: var(--accent);
}

.category-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--category-family-neutral-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.category-item-icon[data-family="tech"] { background: var(--category-family-tech-bg); }
.category-item-icon[data-family="tech"] svg { color: var(--category-family-tech-stroke); }
.category-item-icon[data-family="home"] { background: var(--category-family-home-bg); }
.category-item-icon[data-family="home"] svg { color: var(--category-family-home-stroke); }
.category-item-icon[data-family="sports"] { background: var(--category-family-sports-bg); }
.category-item-icon[data-family="sports"] svg { color: var(--category-family-sports-stroke); }
.category-item-icon[data-family="apparel"] { background: var(--category-family-apparel-bg); }
.category-item-icon[data-family="apparel"] svg { color: var(--category-family-apparel-stroke); }
.category-item-icon[data-family="neutral"] { background: var(--category-family-neutral-bg); }
.category-item-icon[data-family="neutral"] svg { color: var(--category-family-neutral-stroke); }

.category-item-icon svg {
  flex-shrink: 0;
  display: block;
  margin: 0;
  padding: 0;
}

.category-item-label {
  font-size: 0.6875rem;
  font-weight: 500;
  text-align: center;
}

/* ======================================================================== */
/* Category Quadrants */
/* ======================================================================== */
.category-quadrants {
  width: 100%;
  margin: 4rem 0 32px;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.quadrant-card {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  padding: 1.5rem;
  transition: box-shadow 200ms ease;
}

.quadrant-card:hover {
  box-shadow: var(--shadow-hover);
}

.quadrant-title {
  margin: 0 0 12px;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.quadrant-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 0.75rem;
  height: 100%;
  min-height: 0;
}

.quadrant-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  transition: transform 200ms ease;
}

.quadrant-item:hover {
  transform: translateY(-2px);
}

.quadrant-item-image {
  width: 100%;
  height: 80px;
  object-fit: contain;
  border-radius: 1rem;
  background: #f9fafb;
  padding: 4px;
}

.quadrant-item-title {
  font-size: clamp(0.875rem, 1.1vw, 0.9375rem);
  font-weight: 600;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.quadrant-item-price {
  font-size: clamp(0.875rem, 1.1vw, 0.9375rem);
  font-weight: 600;
  color: var(--accent);
  margin: 0;
}

/* Empty quadrant slot - intentional placeholder styling */
.quadrant-item-placeholder {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 1rem;
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.875rem;
  min-height: 80px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.quadrant-item-placeholder .quadrant-item-image {
  color: var(--muted);
  font-size: 0.75rem;
}

.quadrant-item-placeholder .quadrant-item-title,
.quadrant-item-placeholder .quadrant-item-price {
  color: var(--muted);
}

/* Pad quadrant grid without repeating listings — subtle empty cell */
.quadrant-item-placeholder--spacer {
  border: 1px dashed var(--border);
  border-radius: 1rem;
  min-height: 80px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  opacity: 0.85;
}

.quadrant-item-placeholder-visual {
  min-height: 72px;
  border-radius: 0.75rem;
  background: repeating-linear-gradient(
    -45deg,
    #e2e8f0,
    #e2e8f0 6px,
    #f1f5f9 6px,
    #f1f5f9 12px
  );
}

/* ======================================================================== */
/* Homepage Layout: Full-width main, no top/left whitespace */
/* ======================================================================== */
main:has(.marketplace-dashboard) {
  margin-top: 0;
  padding-top: 0;
  max-width: none;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
  margin-bottom: 4rem;
}

body.has-account-sidebar main:has(.marketplace-dashboard) {
  width: calc(100vw - var(--account-sidebar-width-collapsed));
  max-width: none;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html.account-sidebar-expanded body.has-account-sidebar main:has(.marketplace-dashboard) {
  width: calc(100vw - var(--account-sidebar-width-expanded));
}

/* ======================================================================== */
/* Marketplace Content: Two-Column Layout */
/* ======================================================================== */
.marketplace-content {
  display: flex;
  align-items: stretch;
  gap: 2rem;
  width: 100%;
  margin: 0;
  padding: 0 2rem;
}

.marketplace-feed {
  flex: 1;
  min-width: 0;
}

/* Let Hot Deals use full feed width; avoid right-side blank space */
.marketplace-feed .page-content-container {
  max-width: none;
  width: 100%;
}

.marketplace-widgets {
  width: 300px;
  flex-shrink: 0;
  padding-top: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  background-color: var(--bg);
}

.widget-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  padding: 1.5rem;
  margin: 0;
}

.widget-card.widget-widescreen-only {
  display: none;
}

.widget-card:not(:last-child) {
  margin-bottom: 1.5rem;
}

.widget-card:last-child {
  margin-bottom: 0;
}

.widget-title {
  margin: 0 0 1.25rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.widget-placeholder {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0;
}

.trending-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trending-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: background-color 200ms ease;
}

.trending-item:hover {
  background: var(--bg);
}

.trending-item-rank {
  flex-shrink: 0;
  width: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

.trending-item-image {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.trending-item-info {
  flex: 1;
  min-width: 0;
}

.trending-item-title {
  margin: 0 0 2px;
  font-size: 0.8125rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.trending-item-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.6875rem;
  color: var(--muted);
}

.trending-item-price {
  font-weight: 600;
  color: var(--accent);
}

.quick-links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-link {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 0.875rem;
  transition: background-color 200ms ease, color 200ms ease;
}

.quick-link:hover {
  background: var(--bg);
  color: var(--accent);
}

.deal-alerts-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.widget-description {
  margin: 0 0 16px;
  font-size: 0.875rem;
  color: var(--muted);
}

.deal-alerts-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.deal-alerts-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 252, 0, 0.1);
}

.deal-alerts-submit {
  width: 100%;
  padding: 10px 12px;
  background: var(--accent);
  color: var(--navy-dark);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 200ms ease;
}

.deal-alerts-submit:hover {
  background: var(--accent-hover);
}

.deal-alerts-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
}

.deal-alerts-consent input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 2px;
}

.deal-alerts-consent a {
  color: var(--accent);
  text-decoration: underline;
}

.deal-alerts-message {
  font-size: 0.875rem;
  margin-top: 8px;
}

.deal-alerts-message-success {
  color: var(--accent);
}

.deal-alerts-message-error {
  color: #dc2626;
}

.widget-cta-link {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--lime-vibrant) 0%, var(--lime-dark) 100%);
  color: #FFFFFF;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  transition: box-shadow 200ms ease, opacity 200ms ease;
}

.widget-cta-link:hover {
  opacity: 0.95;
  box-shadow: 0 2px 8px rgba(31, 219, 0, 0.3);
}

.top-deals {
  margin-bottom: 2.5rem;
}

.top-deals h2 {
  margin: 0px 0 1rem;
  font-size: clamp(1.75rem, 2.5vw, 2rem);
  color: var(--text);
  font-weight: 700;
}

.disclaimer {
  margin: 0 0 1rem;
  font-size: clamp(0.875rem, 1vw, 0.9375rem);
  color: var(--muted);
  font-style: italic;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* ======================================================================== */

/* Responsive Product Grid - Multi-column, cards fill cells */
.deals-grid {
  display: grid;
  /* Pinned density (04-01/04-03): deterministic columns across breakpoints */
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  max-width: none;
  width: 100%;
  margin: 0;
  grid-auto-rows: auto;
}

/* Cards in grid fill their cell for a polished, consistent layout */
.deals-grid .product-card {
  max-width: none;
  margin: 0;
  width: 100%;
}

/* Featured items span 2 rows */
.product-card[data-featured="true"] {
  grid-row: span 2;
}

/* Legacy navbar removed from main site shell; keep compact search touch targets on small screens */
@media (max-width: 480px) {
  .search-input {
    font-size: 14px;
    padding: 10px 14px;
    padding-right: 44px;
  }

  .search-button {
    padding: 6px;
  }

  .search-button svg {
    width: 14px;
    height: 14px;
  }
}

@media (min-width: 640px) {
  .deals-grid {
    gap: 1.25rem;
  }
}

@media (min-width: 768px) {
  .deals-grid {
    gap: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .deals-grid {
    gap: 1.5rem;
  }
}

/* Widescreen Optimizations (1400px+) */
@media (min-width: 1400px) {
  .dashboard-grid {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto;
    gap: 1.5rem;
    min-height: 180px;
  }

  .continue-browsing-module,
  .top-categories-module {
    min-height: 100px;
  }
  
  .category-quadrants {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
  
  .deals-grid {
    gap: 1.5rem;
  }
  
  .marketplace-widgets {
    width: 340px;
    position: sticky;
    top: 120px;
  }
  
  .marketplace-content {
    gap: 2.5rem;
  }

  .widget-card.widget-widescreen-only {
    display: block;
  }
}

/* Ultra-wide Optimizations (1600px+) */
@media (min-width: 1600px) {
  .deals-grid {
    gap: 1.5rem;
  }
}

/* 4K+ Optimizations (1920px+) */
@media (min-width: 1920px) {
  .deals-grid {
    gap: 1.5rem;
  }
}

/* ======================================================================== */
/* Responsive Marketplace Styles */
/* ======================================================================== */
@media (max-width: 1024px) {
  .marketplace-content {
    flex-direction: column;
  }
  
  .marketplace-widgets {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
  }
  
  .widget-card {
    margin-bottom: 0;
  }
}

@media (max-width: 768px) {
  .homepage-shell.redesign-shell .hero.marketplace-dashboard {
    padding: 0;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
  }
  
  .featured-deal-module {
    grid-column: span 1;
    grid-row: span 1;
  }
  
  .top-categories-module {
    grid-column: span 1;
    grid-row: span 1;
  }
  
  .featured-deal-link {
    flex-direction: column;
  }

  .homepage-shell.redesign-shell a.featured-deal-link {
    flex-direction: unset;
    display: grid;
    grid-template-columns: 1fr;
  }
  
  .featured-deal-image {
    width: 100%;
    height: 200px;
  }
  
  .featured-deal-info {
    width: 100%;
  }
  
  .category-quadrants {
    grid-template-columns: 1fr;
  }
  
  .marketplace-widgets {
    grid-template-columns: 1fr;
  }
  
  .category-quadrants,
  .marketplace-content {
    padding: 0 1rem;
  }

  /* Ensure page-content-container has reasonable padding on mobile */
  .page-content-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .marketplace-dashboard {
    padding: 2rem 1rem 2.5rem 1rem;
  }
}

@media (max-width: 480px) {
  .dashboard-module {
    padding: 16px;
  }
  
  .quadrant-card {
    padding: 16px;
  }
  
  .widget-card {
    padding: 16px;
  }
  
  .featured-deal-info h3 {
    font-size: 1.25rem;
  }

  /* Redesign shell: keep hero-first type scale (Homepage.html), not legacy 1.25rem */
  .homepage-shell.redesign-shell .hero-text h1#featuredDealTitle,
  .homepage-shell.redesign-shell .hero-text .featured-deal-title {
    font-size: clamp(1.15rem, 5vw, 1.65rem);
    line-height: 1.12;
  }

  .homepage-shell.redesign-shell .hero-text .price,
  .homepage-shell.redesign-shell #featuredDealPrice {
    font-size: clamp(1.35rem, 5.5vw, 1.75rem);
  }
  
  .featured-deal-price {
    font-size: 1.125rem;
  }
}

/* Product Card */
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
  min-height: 440px;
  margin: 0 auto;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 12px 32px rgba(0, 0, 0, 0.12), 0 0 20px var(--lime-alpha-30);
  border: 2px solid var(--lime-vibrant);
}

.product-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  background: var(--pill-neutral-bg);
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  vertical-align: bottom;
}

.floating-report-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  opacity: 0.85;
  z-index: 10;
}

.floating-report-btn:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(220, 38, 38, 0.3);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
  opacity: 1;
  transform: scale(1.1);
}

.floating-report-btn svg {
  color: #6b7280;
  transition: color 0.3s ease;
}

.floating-report-btn:hover svg {
  color: #dc2626;
}

.floating-save-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  opacity: 0.85;
  z-index: 10;
}

.floating-save-btn:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  opacity: 1;
  transform: scale(1.1);
}

.floating-save-btn svg {
  color: #6b7280;
  transition: color 0.3s ease;
}

.floating-save-btn:hover svg {
  color: #ef4444;
}

.floating-save-btn.saved {
  background: rgba(239, 68, 68, 0.95);
  border-color: #ef4444;
  opacity: 1;
}

.floating-save-btn.saved svg {
  color: #fff;
}

.floating-save-btn.saved:hover {
  background: #dc2626;
  border-color: #dc2626;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.product-title {
  margin: 0 0 4px;
  font-size: clamp(0.9375rem, 1.2vw, 1rem);
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Listing cards: title line-clamp lives on inner <a>; avoid :has() for older engines */
.product-title.product-title--has-detail-link {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  -webkit-box-orient: initial;
  overflow: visible;
}

.product-title .product-card-detail-link {
  color: inherit;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-title .product-card-detail-link:hover {
  text-decoration: underline;
}

.product-condition {
  margin: 0;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 12px;
}

.product-condition-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  z-index: 5;
}

.product-price-container {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  margin: 0 0 4px 0;
}

.product-price {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1.2;
  color: var(--redesign-ink-900);
}

.product-price.na-price {
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--redesign-ink-400);
  font-style: italic;
}

.price-cents {
  font-size: 0.875rem;
  vertical-align: top;
}

.buy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 10px 12px;
  background: var(--redesign-navy-900);
  color: var(--lime-vibrant);
  font-weight: 700;
  font-size: clamp(0.8125rem, 1vw, 0.875rem);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 16px;
  border: none;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: background-color 160ms ease, transform 120ms ease, box-shadow 160ms ease;
  text-shadow: none;
}

.buy-button:hover {
  background: var(--redesign-navy-800);
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.buy-button:active {
  transform: translateY(0);
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.08);
}

.buy-button:focus-visible {
  outline: 3px solid var(--lime-focus-ring);
  outline-offset: 2px;
}

/* Save/Saved Text Button */
.save-text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 14px 16px;
  padding: 10px 14px;
  background: transparent;
  color: #6b7280;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.save-text-btn:hover {
  background: rgba(59, 130, 246, 0.05);
  border-color: #3b82f6;
  color: #3b82f6;
}

.save-text-btn.saved {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
  opacity: 1;
}

.save-text-btn.saved:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: white;
}

.save-text-btn:active {
  transform: scale(0.98);
}

.save-text-btn:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
}

/* Footer sits flush; internal spacing is handled by .card-footer-actions padding */
.product-card > *:last-child {
  margin-bottom: 0;
}

/* Categories Page */
body:has(.categories-section) {
  background: #f9fafb;
}

.categories-section {
  max-width: 100%;
  margin: 24px auto 64px;
  padding: 0 20px;
}

.categories-section h1 {
  margin: 0 0 8px;
  font-size: 28px;
  color: var(--text);
}

.categories-intro {
  margin: 0 0 32px;
  font-size: 16px;
  color: var(--muted);
}

.category-group {
  margin-bottom: 48px;
}

.category-group h2 {
  margin: 0 0 20px;
  font-size: 22px;
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 8px;
}

.categories-grid {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  max-width: 100%;
  margin: 0 auto;
}

.condition-categories .categories-grid {
  flex-direction: column;
  width: 100%;
}

.category-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  min-width: 280px;
  aspect-ratio: 1;
  cursor: pointer;
  position: relative;
  text-decoration: none;
  color: inherit;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.category-icon {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 200ms ease;
  background: var(--category-family-neutral-bg);
  border-radius: 50%;
  padding: 1rem;
  width: 56px;
  height: 56px;
  margin-left: auto;
  margin-right: auto;
}

.category-icon[data-family="tech"] { background: var(--category-family-tech-bg); }
.category-icon[data-family="tech"] svg { color: var(--category-family-tech-stroke); }
.category-icon[data-family="home"] { background: var(--category-family-home-bg); }
.category-icon[data-family="home"] svg { color: var(--category-family-home-stroke); }
.category-icon[data-family="sports"] { background: var(--category-family-sports-bg); }
.category-icon[data-family="sports"] svg { color: var(--category-family-sports-stroke); }
.category-icon[data-family="apparel"] { background: var(--category-family-apparel-bg); }
.category-icon[data-family="apparel"] svg { color: var(--category-family-apparel-stroke); }
.category-icon[data-family="neutral"] { background: var(--category-family-neutral-bg); }
.category-icon[data-family="neutral"] svg { color: var(--category-family-neutral-stroke); }

.category-icon svg {
  flex-shrink: 0;
  display: block;
  margin: 0;
  padding: 0;
}

.category-card:hover .category-icon {
  opacity: 0.9;
}

.category-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  color: var(--text);
  font-weight: 600;
}

.category-card p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.category-link {
  display: none;
}

/* Condition Cards - Banner Style */
.condition-categories .category-card {
  flex-direction: row;
  text-align: left;
  aspect-ratio: auto;
  min-height: 120px;
  min-width: 100%;
  background: #fff7ed;
  padding: 24px 32px;
  gap: 24px;
}

.condition-categories .category-card .category-icon {
  margin-bottom: 0;
  margin-left: 0;
  margin-right: 0;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
}

.condition-categories .category-card .category-icon svg {
  width: 40px;
  height: 40px;
}

.condition-categories .category-card .category-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.condition-categories .category-card h3 {
  margin: 0 0 8px;
}

.condition-categories .category-card p {
  margin: 0;
}

/* Widescreen Optimizations for Categories Page (1400px+) */
@media (min-width: 1400px) {
  .categories-section {
    padding: 0 2rem;
  }
  
  .categories-grid {
    gap: 1.5rem;
  }
  
  /* Allow condition cards to display side-by-side */
  .condition-categories .categories-grid {
    flex-direction: row;
    justify-content: flex-start;
  }
  
  .category-card {
    padding: 2rem 1.5rem;
  }
}

/* Ultra-wide Optimizations for Categories (1600px+) */
@media (min-width: 1600px) {
  .categories-grid {
    gap: 2rem;
  }
  
  /* Show 4-5 category cards per row */
  .categories-grid .category-card {
    flex: 0 1 calc(20% - 1.6rem);
    min-width: 280px;
  }
}

/* Notification Center Styles */
.inbox-container {
  position: relative;
  margin-right: 8px;
}

.notification-container {
  position: relative;
  margin-right: 8px;
}

.notification-icon-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: background-color 200ms ease, color 200ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-icon-btn:hover {
  background-color: rgba(124, 252, 0, 0.05);
  color: var(--accent);
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
}

.notification-badge:empty {
  display: none;
}

/* Inbox Icon Styles */
.inbox-icon-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: background-color 200ms ease, color 200ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inbox-icon-btn:hover {
  background-color: rgba(16, 185, 129, 0.05);
  color: #10b981;
}

.inbox-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #10b981;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
}

.inbox-badge:empty {
  display: none;
}

/* Inbox Panel Styles */
.inbox-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-height: 500px;
  display: flex;
  flex-direction: column;
}

.inbox-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.inbox-panel-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.inbox-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: var(--muted);
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background-color 200ms ease, color 200ms ease;
}

.inbox-close-btn:hover {
  background-color: var(--border);
  color: var(--text);
}

.inbox-list {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}

.no-inbox-items {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
}

.no-inbox-items p {
  margin: 0;
  font-size: 14px;
}

.inbox-item {
  display: flex;
  align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 150ms ease;
  gap: 12px;
}

.inbox-item:last-child {
  border-bottom: none;
}

.inbox-item:hover {
  background-color: rgba(16, 185, 129, 0.05);
}

.inbox-item-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  color: #10b981;
}

.inbox-item-content {
  flex: 1;
  min-width: 0;
}

.inbox-item-message {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 4px 0;
  line-height: 1.4;
}

.inbox-item-time {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.inbox-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.inbox-footer a {
  display: block;
  color: #10b981;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background-color 150ms ease;
}

.inbox-footer a:hover {
  background-color: rgba(16, 185, 129, 0.1);
}

.notification-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-height: 500px;
  display: flex;
  flex-direction: column;
}

.notification-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.notification-panel-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.notification-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: var(--muted);
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background-color 200ms ease, color 200ms ease;
}

.notification-close-btn:hover {
  background-color: var(--border);
  color: var(--text);
}

.notification-list {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}

.no-notifications {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
}

.no-notifications p {
  margin: 0;
  font-size: 14px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 150ms ease;
  gap: 12px;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background-color: rgba(124, 252, 0, 0.05);
}

.notification-item.unread {
  background-color: rgba(59, 130, 246, 0.05);
  font-weight: 500;
}

.notification-item.unread:hover {
  background-color: rgba(59, 130, 246, 0.1);
}

.notification-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-message {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 4px 0;
  line-height: 1.4;
}

.notification-time {
  font-size: 12px;
  color: var(--muted);
}

.notification-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.notification-footer a {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 200ms ease;
}

.notification-footer a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

@media (max-width: 768px) {
  .notification-panel {
    width: calc(100vw - 32px);
    right: -16px;
  }
}

.logout-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

/* Legal Pages */
.legal-section {
  max-width: var(--container);
  margin: 24px auto 64px;
  padding: 0 20px;
}

.legal-container {
  max-width: 800px;
  margin: 0 auto;
}

.legal-header {
  text-align: center;
  margin-bottom: 40px;
}

.legal-header h1 {
  margin: 0 0 8px;
  font-size: 32px;
  color: var(--text);
}

.legal-intro {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
}

.legal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  line-height: 1.6;
}

.legal-content h2 {
  margin: 32px 0 16px;
  font-size: 20px;
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 8px;
}

.legal-content h3 {
  margin: 24px 0 12px;
  font-size: 18px;
  color: var(--text);
}

.legal-content p {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 15px;
}

.legal-content ul {
  margin: 0 0 16px;
  padding-left: 24px;
}

.legal-content li {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 15px;
}

.contact-info {
  background: rgba(124, 252, 0, 0.05);
  border: 1px solid rgba(124, 252, 0, 0.2);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin: 20px 0;
}

.contact-info p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

/* Cookie Consent Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
  z-index: 1000;
  padding: 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

@media (min-width: 769px) {
  .cookie-banner {
    padding: 22px 28px;
    padding-bottom: max(22px, env(safe-area-inset-bottom));
  }

  .cookie-actions {
    gap: 16px;
  }

  .cookie-btn {
    min-height: 44px;
    padding: 12px 20px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .cookie-banner {
    max-height: 50vh;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  
  .cookie-content {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  .cookie-text {
    min-width: 0;
  }
  
  .cookie-actions .cookie-btn {
    min-height: 44px;
  }
}

.cookie-content {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.cookie-text {
  flex: 1;
  min-width: 300px;
}

.cookie-text h4 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--text);
}

.cookie-text p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
}

.cookie-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cookie-btn {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 200ms ease;
  white-space: nowrap;
}

.decline-btn {
  background: var(--surface);
  color: var(--text);
}

.decline-btn:hover {
  background: var(--border);
}

.accept-btn {
  background: var(--accent);
  color: #111827;
  border-color: var(--accent);
}

.accept-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.preferences-btn {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent);
}

.preferences-btn:hover {
  background: var(--accent);
  color: #111827;
}

@media (max-width: 768px) {
  .cookie-content {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  .cookie-text {
    min-width: auto;
  }
  
  .cookie-actions {
    justify-content: center;
  }
}

/* Cookie Preferences Page */
.cookie-preferences {
  margin-bottom: 40px;
}

.cookie-category {
  background: rgba(124, 252, 0, 0.05);
  border: 1px solid rgba(124, 252, 0, 0.2);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.cookie-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.cookie-category-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text);
}

.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: 0.3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.cookie-toggle input:checked + .toggle-slider {
  background-color: var(--accent);
}

.cookie-toggle input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

.cookie-toggle input:disabled + .toggle-slider {
  background-color: var(--muted);
  cursor: not-allowed;
}

.cookie-category p {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
}

.cookie-category ul {
  margin: 0;
  padding-left: 20px;
}

.cookie-category li {
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--muted);
}

.cookie-preferences .cookie-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
  flex-wrap: wrap;
}

.cookie-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.cookie-info h3 {
  margin: 0 0 16px;
  font-size: 18px;
  color: var(--text);
}

.cookie-info h4 {
  margin: 20px 0 12px;
  font-size: 16px;
  color: var(--text);
}

.cookie-info p {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
}

.cookie-info ul {
  margin: 0;
  padding-left: 20px;
}

.cookie-info li {
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
}

/* Admin styles moved to src/css/admin.css */

/* Utilities */
.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;
}

/* Report System Styles */
.product-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

/* Add Item Button Styling */
/* Add Item - Primary CTA, matches Find Deals button (gradient pill + lime glow) */
.add-item-btn {
  background: linear-gradient(135deg, var(--lime-vibrant) 0%, var(--lime-dark) 100%);
  color: #FFFFFF;
  border: none;
  padding: 8px 16px;
  border-radius: 9999px; /* Full rounded pill */
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: box-shadow 200ms ease, transform 150ms ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 1;
}

.add-item-btn:hover {
  background: linear-gradient(120deg, var(--lime-vibrant) 0%, var(--lime-dark) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(31, 219, 0, 0.4); /* Lime glow shadow */
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--background-secondary);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
  background: #ffffff !important;
  color: #000000 !important;
  display: block !important;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.submit-button {
  background: var(--accent);
  color: white;
  font-weight: 600;
  border: none;
  padding: 12px 20px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.submit-button:hover:not(:disabled) {
  background: var(--accent-hover);
}

.submit-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #9ca3af;
}

.submit-button.rate-limited {
  background: #dc2626;
  color: white;
  opacity: 0.9;
  cursor: not-allowed;
  font-weight: 600;
}

.submit-button.rate-limited:hover {
  background: #dc2626;
  opacity: 0.9;
}

.btn-secondary {
  background: var(--background-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--background-tertiary);
}

.btn-danger {
  background: #ef4444;
  color: white;
  border: 1px solid #dc2626;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}

.btn-danger:hover {
  background: #dc2626;
}

.view-btn {
  background: var(--accent);
  color: var(--text-primary);
}

.form-note {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin: 0 0 1rem;
}

.form-help {
  display: block;
  color: #6b7280;
  font-size: 0.8125rem;
  margin-top: 4px;
  margin-bottom: 0;
  line-height: 1.3;
  font-style: italic;
  opacity: 0.85;
}

.refurbished-indicator {
  display: block;
  margin-top: 6px;
  font-size: 0.8125rem;
  color: var(--text-secondary, #6b7280);
  font-weight: 500;
}

.refurbished-indicator .refurbished-indicator-link {
  color: var(--link-color, #2563eb);
  text-decoration: underline;
}

.refurbished-indicator .refurbished-indicator-link:hover {
  text-decoration: none;
}

/* Product Name Input Field - Make wider for longer product names */
#modalItemName {
  min-width: 100%;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Make Add Item Modal wider to accommodate longer product names */
#addItemModal .modal-content {
  max-width: 700px;
}

/* Add Item Modal: auto-approval tip */
.modal-auto-approval-tip {
  margin: 0.375rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-secondary, #6b7280);
  line-height: 1.4;
}

#addItemModal .modal-header {
  padding-bottom: 12px;
}

/* Add Item Modal: title + subtitle block */
#addItemModal .modal-header-title {
  flex: 1;
  min-width: 0;
}
#addItemModal .modal-header .modal-subtitle {
  margin: 4px 0 0 0;
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
  font-weight: normal;
}

/* Add Item Modal body: padding and scroll */
#addItemModal .modal-body {
  padding: 24px;
  padding-top: 8px;
  flex: 1;
  overflow-y: auto;
}

/* Add Item Modal: URL label row (label + open link button) */
#addItemModal .add-item-form .url-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

/* Add Item Modal: Open link in new tab button */
#addItemModal #openUrlLinkBtn {
  display: none;
  padding: 4px 8px;
  background: transparent;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  color: inherit;
}
#addItemModal #openUrlLinkBtn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* Add Item Modal: autofill-only fields (readonly) – greyed out, no user edit */
#addItemModal .add-item-autofill-field[readonly],
#addItemModal input.add-item-autofill-field {
  background: var(--background-secondary, #f3f4f6);
  color: var(--text-secondary, #6b7280);
  cursor: default;
  border-color: var(--border, #e5e7eb);
}
#addItemModal .price-input-wrapper .add-item-autofill-field[readonly] {
  background: var(--background-secondary, #f3f4f6);
}

/* Add Item Modal: condition pills display-only – set by URL autofill, not user click */
#addItemModal .add-item-condition-pills-readonly .condition-pill {
  pointer-events: none;
  opacity: 0.85;
  cursor: default;
}

/* Condition pill: visible focus for keyboard users */
.condition-pill:focus-visible {
  outline: 2px solid var(--lime-vibrant, #eab308);
  outline-offset: 2px;
}

/* Affiliate Link Input Fields - Make wider to prevent text cutoff */
#approvalAffiliateLink,
#linkUpdateNewLink,
#productEditAffiliateLink,
#reviewAffiliateLink,
#modalItemUrl {
  min-width: 100%;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Report Items in Admin Dashboard */
.report-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: white;
}

.report-details h4 {
  margin: 0 0 8px 0;
  color: var(--text-primary);
  font-size: 1rem;
}

.report-meta {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 8px;
}

.report-details-text {
  background: var(--background-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin: 8px 0;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.reporter-info {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 8px;
}

.report-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.no-reports {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

/* Notification Styles */
.notification {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive Design for Reports */
@media (max-width: 768px) {
  .report-item {
    flex-direction: column;
    gap: 12px;
  }
  
  .report-actions {
    width: 100%;
    justify-content: stretch;
  }
  
  .report-actions .admin-btn {
    flex: 1;
  }
  
  .modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .modal-actions {
    flex-direction: column;
  }
  
  .modal-actions button {
    width: 100%;
  }
}

/* CAPTCHA Styling */
.g-recaptcha {
  margin: 16px 0;
  display: flex;
  justify-content: flex-start;
}

.g-recaptcha > div {
  margin: 0 auto 0 0;
}

@media (max-width: 576px) {
  .g-recaptcha {
    transform: scale(0.85);
    transform-origin: left center;
  }
}

/* Required field indicator */
.optional-text {
  color: #666;
  font-size: 0.9em;
  font-weight: normal;
}

.required {
  color: #ef4444;
  font-weight: 600;
  font-size: 0.75rem;
  vertical-align: super;
  line-height: 0;
}

/* Modal form labels - prettier styling */
.modal label,
.add-item-form label,
.form-group label {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 500;
  font-size: 0.9375rem;
  color: #1f2937;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  display: block;
}

/* Modal form group spacing */
.modal .form-group,
.add-item-form .form-group {
  margin-bottom: 18px;
  position: relative;
  overflow: visible; /* Allow dropdown to overflow */
}

/* Ensure input stays above dropdown when typing */
.modal .form-group input,
.add-item-form .form-group input {
  position: relative;
  z-index: 10; /* Keep input above dropdown */
  background: white; /* Ensure input background is opaque */
  min-height: 44px;
  padding: 14px 16px;
  box-sizing: border-box;
}

/* Ensure form allows dropdown overflow */
.add-item-form {
  overflow: visible;
}

/* Condition Pills Styling */
.condition-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.condition-pill {
  padding: 12px 16px;
  min-height: 44px;
  border: 2px solid #e5e7eb;
  background: #f3f4f6;
  border-radius: 20px;
  transition: all 0.2s ease;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  transition: all 0.2s ease;
  font-family: inherit;
  flex: 1;
  min-width: 90px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ensure 6 pills wrap properly on smaller screens */
@media (max-width: 768px) {
  .condition-pill {
    min-width: calc(50% - 4px);
    flex: 0 0 calc(50% - 4px);
  }
}

.condition-pill:hover {
  border-color: #d1d5db;
  background: #e5e7eb;
  color: #1f2937;
}

.condition-pill.active {
  background: var(--lime-vibrant);
  border-color: var(--lime-vibrant);
  color: white;
  font-weight: 600;
  transform: scale(1.05);
}

.condition-pill.active:hover {
  background: #e68900;
  border-color: #e68900;
}

/* Add Item Modal: URL input wrapper (when used with validation icon) */
#addItemModal .url-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
#addItemModal .url-input-wrapper input {
  flex: 1;
}

/* Price Input with Prefix */
.price-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.price-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  pointer-events: none;
  font-size: 1rem;
  z-index: 11; /* Higher than input z-index to ensure visibility */
  font-weight: 500;
}

.price-input-wrapper input {
  padding-left: 28px;
  width: 100%;
  position: relative;
}

/* URL Input with Validation Icon */
.url-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.url-input-wrapper input {
  width: 100%;
  padding-right: 40px;
}

.url-validation-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  display: flex;
  align-items: center;
}

/* eBay Image Preview Container */
.ebay-image-preview-container {
  margin-top: 12px;
  display: none;
}

.ebay-item-preview {
  max-width: 200px;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: block;
}

/* Loading spinner for URL input - removed transform to prevent input rotation */
.loading-spinner {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234CAF50' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-6.219-8.56'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 40px;
  /* Removed animation: spin to prevent input field rotation */
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.url-validation-icon svg {
  width: 100%;
  height: 100%;
}

.url-validation-icon.valid {
  color: #10b981;
}

.url-validation-icon.invalid {
  color: #6b7280;
}

/* Loading state for validation icon */
.url-validation-icon.loading {
  color: #ff9900;
}

.url-validation-icon.loading svg {
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

/* Error state for validation icon */
.url-validation-icon.error {
  color: #dc2626;
}

.url-validation-icon.error svg {
  width: 20px;
  height: 20px;
}

/* Error state for input field */
input.error-state {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Inline error message */
.url-error-message {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 4px;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Field auto-fill animation */
.field-auto-filled {
  animation: fieldFillIn 0.4s ease-out;
}

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

/* Image preview animation - triggered when visible */
.ebay-image-preview-container.image-preview-visible {
  animation: imagePreviewFadeIn 0.5s ease-out;
}

@keyframes imagePreviewFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Disabled input styling */
input:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background-color: #f9fafb;
}


/* Price field formatting */
#itemPrice {
  font-family: monospace;
}

/* Contest Entries Display */
.contest-entries-display {
  text-align: center;
  padding: 20px 0;
}

.contest-drawing-text {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.5;
}

.contest-entry-number {
  margin: 16px 0;
}

.entry-count {
  display: inline-block;
  font-size: 64px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin: 0;
  text-align: center;
}

@media (max-width: 768px) {
  .entry-count {
    font-size: 48px;
  }
  
  .contest-drawing-text {
    font-size: 14px;
  }
}

/* Readonly field styling */
.readonly-field {
  background: var(--background-secondary);
  color: var(--text-secondary);
  cursor: not-allowed;
  border: 1px solid var(--border);
}

.readonly-field:focus {
  outline: none;
  border-color: var(--border);
}

/* Advanced Search Page Styles */
.search-page-container {
  max-width: clamp(1200px, 95vw, 2400px);
  margin: 0 auto;
  padding: 24px;
}

.search-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
}

.search-filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  border-right: 1px solid #e5e7eb;
  position: sticky;
  top: 24px;
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.filters-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.clear-filters-btn {
  background: none;
  border: none;
  color: #f97316;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: text-decoration 0.2s ease, color 0.2s ease;
}

.clear-filters-btn:hover {
  text-decoration: underline;
  color: #c2410c;
}

.filter-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #f3f4f6;
}

.filter-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.filter-section h3 {
  margin: 0 0 0.75rem 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: #111827;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 0;
}

.filter-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #f97316;
}

.filter-checkbox span {
  font-size: 0.875rem;
  color: #374151;
}

.filter-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent);
}

.price-inputs {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 0.5rem;
  width: 100%;
}

.price-separator {
  color: #6b7280;
  font-size: 0.875rem;
  flex-shrink: 0;
  align-self: flex-end;
  padding: 0 0.25rem;
  line-height: 1.5;
  white-space: nowrap;
  /* Align with input field baseline - account for label + gap */
  margin-bottom: calc(1.25rem + 4px); /* Label height + gap to align with input top */
}

.price-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 0;
  min-width: 0;
}

.price-input-group label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.price-input {
  padding: 14px 16px;
  min-height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background: #f9fafb;
  font-size: 0.875rem;
  color: var(--text-primary);
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .price-inputs {
    flex-direction: column;
    align-items: stretch;
  }
  
  .price-separator {
    display: none;
  }
}

.price-input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-results {
  min-height: 400px;
  min-width: 0; /* Allow grid child to shrink so .deals-grid gets correct width */
  width: 100%;
}

/* Search page: denser grid to minimize right-side blank space */
.search-results .deals-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.results-info h1 {
  margin: 0 0 4px 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
}

.results-count {
  margin: 0;
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 400;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-controls label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.sort-select {
  padding: 0.5rem 2.5rem 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: white;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 0.75rem center;
  background-size: 1rem;
  background-repeat: no-repeat;
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.sort-select:focus {
  outline: none;
  border-color: var(--accent);
}

.active-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 12px 16px;
  background: var(--background-secondary);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.active-filters-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.active-filters-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--text-primary);
}

.remove-filter-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.remove-filter-btn:hover {
  background: var(--background-secondary);
  color: var(--text-primary);
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.no-results p {
  font-size: 1.125rem;
  margin-bottom: 16px;
}

/* Responsive Design for Search Page */
@media (max-width: 968px) {
  .search-layout {
    grid-template-columns: 1fr;
  }
  
  .search-filters {
    position: static;
    margin-bottom: 24px;
  }
  
  .results-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .sort-controls {
    width: 100%;
    justify-content: space-between;
  }
  
  .sort-select {
    flex: 1;
    max-width: 200px;
  }
}

@media (max-width: 640px) {
  .search-page-container {
    padding: 16px;
  }
  
  .search-filters {
    padding: 16px;
  }
  
  .active-filters {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Widescreen Optimizations for Search Page (1400px+) */
@media (min-width: 1400px) {
  .search-layout {
    gap: 2rem;
  }
  
  .search-results .deals-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1.25rem;
  }
}

/* Ultra-wide Optimizations for Search Page (1600px+) */
@media (min-width: 1600px) {
  .search-layout {
    grid-template-columns: 320px 1fr;
    gap: 2.5rem;
  }
  
  .search-filters {
    padding: 2rem;
  }
  
  .search-results .deals-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
  }
}

/* 1920px+ for Search Page - fill ultrawide displays */
@media (min-width: 1920px) {
  .search-page-container {
    max-width: 2400px;
  }
  .search-layout {
    grid-template-columns: 340px 1fr;
    gap: 3rem;
  }
  .search-results .deals-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1.25rem;
  }
}

/* 2560px+ for ultra-wide - more columns, less blank space */
@media (min-width: 2560px) {
  .search-page-container {
    max-width: 2800px;
  }
  .search-results .deals-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }
}

/* Site Footer - dark sandwich to align with L-frame */
.site-footer {
  background: #0f172a;
  border-top: 1px solid #1e293b;
  padding: 32px 20px;
  margin-top: 64px;
  color: #94a3b8;
}

.footer-container {
  max-width: var(--container);
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 200ms ease, text-decoration 200ms ease;
}

.footer-links a:hover {
  color: var(--lime-vibrant);
  text-decoration: underline;
}

/* Responsive Footer */
@media (max-width: 640px) {
  .site-footer {
    padding: 24px 16px;
  }
  
  .footer-links {
    gap: 16px;
    font-size: 13px;
  }
}

/* Account Sidebar Styles (similar to admin sidebar) */
/* Note: Variables are already defined at top of file (lines 30-32) */

/* Shift navbar and main content when sidebar is present (works on all pages) */
body.has-account-sidebar .navbar,
body.has-account-sidebar header {
  margin-left: var(--account-sidebar-width-collapsed);
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html.account-sidebar-expanded body.has-account-sidebar .navbar,
html.account-sidebar-expanded body.has-account-sidebar header {
  margin-left: var(--account-sidebar-width-expanded);
}

/* Main content shift for account page */
.account-main-content {
  margin-left: var(--account-sidebar-width-collapsed);
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html.account-sidebar-expanded .account-main-content {
  margin-left: var(--account-sidebar-width-expanded);
}

/* Main content shift for other pages (search, index, categories, etc.) */
body.has-account-sidebar main {
  margin-left: var(--account-sidebar-width-collapsed);
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg-pale);
}

html.account-sidebar-expanded body.has-account-sidebar main {
  margin-left: var(--account-sidebar-width-expanded);
}

/* Account Sidebar - Flush with navbar, seamless L-frame (Command Center) */
#accountSidebar.account-sidebar,
aside.account-sidebar,
.account-sidebar {
  width: var(--account-sidebar-width-collapsed);
  background: var(--sidebar-bg);
  border-right: none;
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;  /* Fixed: Start at top, flush with navbar */
  height: 100vh !important;  /* Fixed: Full viewport height */
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  z-index: 100;
  box-sizing: border-box;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: none;
  /* Hide scrollbar by default, show on hover/scroll */
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  /* Remove any padding/margin that could cause white space at top */
  padding: 0 !important;
  margin: 0 !important;
  border-top: none !important;
  /* Ensure first child is flush with top */
  align-items: stretch;
}

/* Ensure first child (toggle button) is absolutely flush with top */
.account-sidebar > *:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Remove any potential spacing from flex gaps */
.account-sidebar {
  gap: 0 !important;
  row-gap: 0 !important;
}

/* Ensure aside element itself has no spacing */
aside.account-sidebar {
  margin: 0 !important;
  padding: 0 !important;
  border-top: none !important;
}

.account-sidebar:hover,
.account-sidebar:focus-within {
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.account-sidebar::-webkit-scrollbar {
  width: 6px;
}

.account-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.account-sidebar::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
  transition: background 0.2s ease;
}

.account-sidebar:hover::-webkit-scrollbar-thumb,
.account-sidebar:focus-within::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

.account-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

body.account-sidebar-transitions-enabled .account-sidebar {
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: width;
}

/* Only expand when explicitly set - exactly like admin sidebar */
html.account-sidebar-expanded .account-sidebar,
html.account-sidebar-expanded #accountSidebar.account-sidebar,
html.account-sidebar-expanded aside.account-sidebar {
  width: var(--account-sidebar-width-expanded) !important;
}

/* Ensure collapsed state when class is not present */
html:not(.account-sidebar-expanded) .account-sidebar {
  width: var(--account-sidebar-width-collapsed);
}

/* Account sidebar toggle styles */
/* NOTE: Admin sidebar has its own scoped styles in admin.css (.admin-sidebar .sidebar-toggle) */
/* Toggle button height matches navbar (60px) for flush alignment with top header */
/* Hamburger icon perfectly centered with vertical center axis of avatar and navigation icons */
.account-sidebar .sidebar-toggle {
  margin: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  height: var(--account-sidebar-header-height);
  border-bottom: 1px solid var(--sidebar-border);
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex-shrink: 0;
  background: transparent;
  border: none;
  border-right: none;
  border-top: none !important;
  cursor: pointer;
  color: var(--sidebar-text-secondary);
  transition: background 0.3s ease-in-out, color 0.3s ease-in-out;
  outline: none;
  line-height: 1;
}

.account-sidebar .sidebar-toggle:hover {
  background: var(--sidebar-hover-bg);
}

.account-sidebar .sidebar-toggle svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease-in-out;
  stroke-width: 2;
  /* Perfect center alignment - icon center aligns with avatar and nav icons */
  display: block;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
}

html.account-sidebar-expanded .account-sidebar .sidebar-toggle svg {
  transform: rotate(90deg);
}

.account-sidebar .sidebar-toggle:focus {
  outline: none;
}

.account-sidebar .sidebar-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.3);
  outline-offset: -2px;
}

/* Ensure toggle button SVG is visible and properly sized - already defined above */

.account-sidebar .sidebar-header {
  padding: 0 20px;
  border-bottom: 1px solid var(--sidebar-border);
  height: var(--account-sidebar-header-height);
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

/* Hide sidebar-header if it's empty (guest sidebar shouldn't have one) */
.account-sidebar .sidebar-header:empty {
  display: none;
}

.account-sidebar .sidebar-header h2 {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  white-space: nowrap;
  overflow: hidden;
  margin: 0;
  padding: 0 24px;
  flex: 1;
  font-size: 20px;
  font-weight: 700;
  color: var(--sidebar-text-primary);
  letter-spacing: -0.3px;
  height: 100%;
  display: flex;
  align-items: center;
}

html.account-sidebar-expanded .account-sidebar .sidebar-header h2 {
  opacity: 1;
}

.account-sidebar .sidebar-site-nav {
  padding: 12px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 8px;
  padding-bottom: 12px;
}

.account-sidebar .sidebar-site-nav .sidebar-link {
  margin: 0 8px;
}

html.account-sidebar-expanded .account-sidebar .sidebar-site-nav .sidebar-link {
  margin: 0 12px;
}

.account-sidebar .sidebar-nav {
  padding: 12px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  flex: 1;
}

/* Guest sidebar divider */
.account-sidebar .sidebar-nav-divider {
  height: 1px;
  background: var(--sidebar-border);
  margin: 8px 16px;
  opacity: 0.5;
  transition: opacity 0.3s ease-in-out, margin 0.3s ease-in-out;
}

html.account-sidebar-expanded .account-sidebar .sidebar-nav-divider {
  margin: 8px 20px;
}

html:not(.account-sidebar-expanded) .account-sidebar .sidebar-nav-divider {
  margin: 8px 8px;
  opacity: 0.3;
}

.account-sidebar .sidebar-link,
.account-sidebar .sidebar-add-item-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  color: var(--sidebar-text-secondary);
  text-decoration: none;
  transition: all 0.3s ease-in-out;
  position: relative;
  white-space: nowrap;
  justify-content: center;
  font-size: 15px;
  font-weight: 500;
  border-radius: 8px;
  margin: 0 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

.account-sidebar .sidebar-add-item-btn {
  text-align: left;
}

html.account-sidebar-expanded .account-sidebar .sidebar-link,
html.account-sidebar-expanded .account-sidebar .sidebar-add-item-btn {
  justify-content: flex-start;
  padding: 10px 16px;
  margin: 0 12px;
}

.account-sidebar .sidebar-link:hover,
.account-sidebar .sidebar-add-item-btn:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-text-primary);
}

.account-sidebar .sidebar-link.active {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: var(--sidebar-text-primary);
  font-weight: 600;
  /* Floating pill design - centered, doesn't touch edges */
  margin: 0 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
}

.account-sidebar .sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--lime-vibrant);
  border-radius: 0 2px 2px 0;
}

html.account-sidebar-expanded .account-sidebar .sidebar-link.active {
  margin: 0 12px;
}

.account-sidebar .sidebar-link svg,
.account-sidebar .sidebar-add-item-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke-width: 2;
  transition: color 0.3s ease-in-out;
}

.account-sidebar .sidebar-link.active svg {
  color: var(--lime-vibrant);
}

.account-sidebar .sidebar-link .nav-text,
.account-sidebar .sidebar-add-item-btn .nav-text {
  opacity: 0;
  display: none;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.3s ease-in-out, width 0.3s ease-in-out;
}

body.account-sidebar-transitions-enabled .account-sidebar .sidebar-link .nav-text,
body.account-sidebar-transitions-enabled .account-sidebar .sidebar-add-item-btn .nav-text {
  transition: opacity 0.3s ease-in-out, width 0.3s ease-in-out;
}

html.account-sidebar-expanded .account-sidebar .sidebar-link,
html.account-sidebar-expanded .account-sidebar .sidebar-add-item-btn {
  justify-content: flex-start;
}

html.account-sidebar-expanded .account-sidebar .sidebar-link .nav-text,
html.account-sidebar-expanded .account-sidebar .sidebar-add-item-btn .nav-text {
  opacity: 1;
  display: inline-block;
  width: auto;
}

.account-sidebar .sidebar-link.highlight-add-item {
  background: var(--sidebar-active-bg) !important;
  color: var(--accent) !important;
  animation: pulse-highlight 2s ease-in-out;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(124, 252, 0, 0.4);
  margin: 0 12px;
}

/* Guest sidebar Sign Up button - outlined style */
.account-sidebar .sidebar-link-signup {
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  margin: 0 12px;
}

.account-sidebar .sidebar-link-signup:hover {
  background: rgba(124, 252, 0, 0.1);
  border-color: var(--accent-hover);
  color: var(--accent-hover);
}

html.account-sidebar-expanded .account-sidebar .sidebar-link-signup {
  margin: 0 12px;
}

@keyframes pulse-highlight {
  0% {
    box-shadow: 0 0 0 0 rgba(124, 252, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(124, 252, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(124, 252, 0, 0);
  }
}

/* Sidebar sign-in form (guest sidebar, expanded only) */
.account-sidebar .sidebar-signin {
  display: none;
  padding: 12px 12px 16px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

html.account-sidebar-expanded .account-sidebar .sidebar-signin {
  display: block;
}

html:not(.account-sidebar-expanded) .account-sidebar .sidebar-signin {
  display: none;
}

.account-sidebar .sidebar-signin-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-sidebar .sidebar-signin .form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-sidebar .sidebar-signin label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--sidebar-text-secondary);
}

.account-sidebar .sidebar-signin input[type="email"],
.account-sidebar .sidebar-signin input[type="password"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--sidebar-border);
  border-radius: 6px;
  font-size: 0.875rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--sidebar-text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.account-sidebar .sidebar-signin input[type="email"]::placeholder,
.account-sidebar .sidebar-signin input[type="password"]::placeholder {
  color: var(--sidebar-text-muted);
}

.account-sidebar .sidebar-signin input[type="email"]:focus,
.account-sidebar .sidebar-signin input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(31, 219, 0, 0.2);
}

.account-sidebar .sidebar-signin .password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.account-sidebar .sidebar-signin .password-input-wrapper input {
  padding-right: 2.25rem;
}

.account-sidebar .sidebar-signin .password-input-wrapper .password-toggle {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--sidebar-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.account-sidebar .sidebar-signin .password-input-wrapper .password-toggle:hover {
  color: var(--sidebar-text-primary);
}

.account-sidebar .sidebar-signin .password-input-wrapper .password-toggle .icon-hide {
  display: none;
}

.account-sidebar .sidebar-signin .password-input-wrapper .password-toggle[aria-pressed="true"] .icon-show {
  display: none;
}

.account-sidebar .sidebar-signin .password-input-wrapper .password-toggle[aria-pressed="true"] .icon-hide {
  display: block;
}

.account-sidebar .sidebar-signin .checkbox-group {
  gap: 0;
}

.account-sidebar .sidebar-signin .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--sidebar-text-secondary);
  cursor: pointer;
}

.account-sidebar .sidebar-signin .checkbox-label input {
  width: auto;
  accent-color: var(--accent);
}

.account-sidebar .sidebar-signin .form-help {
  margin: 0 0 4px;
  font-size: 0.8125rem;
}

.account-sidebar .sidebar-signin-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.account-sidebar .sidebar-signin-link:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

.account-sidebar .sidebar-signin-submit {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0B1129;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.account-sidebar .sidebar-signin-submit:hover {
  background: var(--accent-hover);
}

.account-sidebar .sidebar-signin-submit:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

.account-sidebar .sidebar-signin-switch {
  margin: 10px 0 0;
  font-size: 0.8125rem;
  color: var(--sidebar-text-muted);
  text-align: center;
}

.account-sidebar .sidebar-signin-switch .sidebar-signin-link {
  margin-left: 2px;
}

/* Account View Styles */
.account-view {
  display: none;
}

.account-view.is-account-view-active {
  display: block !important;
}

/* Saved Items Styles */
.saved-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  max-width: 1400px;
  margin: 24px auto 0;
}

.no-saved-items {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}

.no-saved-items p {
  margin: 0;
  font-size: 16px;
}

/* Saved items now use .product-card classes, so they inherit all product card styles */
/* Responsive adjustments for saved items grid */
@media (min-width: 768px) {
  .saved-items-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
  }
}

@media (min-width: 1024px) {
  .saved-items-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
  }
}

/* Voting System Styles */
.vote-container {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 10;
}

.vote-btn {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  color: #6b7280;
  padding: 0;
}

.vote-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.vote-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.vote-btn.upvote.active {
  background: #10b981;
  border-color: #10b981;
  color: white;
}

.vote-btn.downvote.active {
  background: #ef4444;
  border-color: #ef4444;
  color: white;
}

.vote-score {
  font-size: 14px;
  font-weight: 700;
  color: #6b7280;
  min-width: 32px;
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  padding: 2px 6px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.vote-score.positive {
  color: #10b981;
}

.vote-score.negative {
  color: #ef4444;
}

/* Hide numeric score on product cards; upvote/downvote remain visible */
.product-card .vote-container .vote-score {
  display: none;
}

/* Deprecated: seller/submitter line on product cards – hidden (was wired wrong) */
.submitter-info {
  display: none !important;
}

/* Deals Tabs Styles */
.deals-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.deals-tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 4px;
  border: 1px solid var(--border);
}

.deals-tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.deals-tab:hover {
  background: var(--background-secondary);
  color: var(--text);
}

.deals-tab.active {
  background: var(--navy-dark);
  color: var(--lime-vibrant);
  font-weight: 600;
  border-bottom: 2px solid var(--lime-vibrant);
}

/* Category Filter Styles */
.category-filters {
  display: flex;
  gap: 8px;
  margin: 8px 0;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  flex-wrap: wrap;
}

.category-filters::-webkit-scrollbar {
  height: 6px;
}

.category-filters::-webkit-scrollbar-track {
  background: transparent;
}

.category-filters::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.category-filters::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.category-filter-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.category-filter-btn .category-filter-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.category-filter-btn .category-filter-icon svg {
  width: 18px;
  height: 18px;
}

.category-filter-btn .category-filter-icon[data-family="tech"] svg { color: var(--category-family-tech-stroke); }
.category-filter-btn .category-filter-icon[data-family="home"] svg { color: var(--category-family-home-stroke); }
.category-filter-btn .category-filter-icon[data-family="sports"] svg { color: var(--category-family-sports-stroke); }
.category-filter-btn .category-filter-icon[data-family="apparel"] svg { color: var(--category-family-apparel-stroke); }
.category-filter-btn .category-filter-icon[data-family="neutral"] svg { color: var(--category-family-neutral-stroke); }

.category-filter-btn:hover {
  background: var(--bg);
  border-color: var(--accent);
  color: var(--text);
}

.category-filter-btn.active {
  background: var(--navy-dark);
  border-color: var(--navy-dark);
  color: var(--lime-vibrant);
  font-weight: 600;
}

.filter-count {
  opacity: 0.7;
  font-size: 12px;
  margin-left: 4px;
}

.in-stock-only-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  user-select: none;
}
.in-stock-only-filter input { cursor: pointer; }

@media (max-width: 768px) {
  .category-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
}

/* Modal Backdrop Click to Close */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop, 1000);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease-out, visibility 0.25s ease-out;
  will-change: opacity;
}

.modal.is-visible {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.modal-content {
  background: #ffffff !important;
  border-radius: var(--radius, 8px);
  padding: 0;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: scale(0.95) translateY(20px);
  transition: transform 0.25s ease-out;
  will-change: transform;
  display: flex !important;
  flex-direction: column;
  z-index: var(--z-modal-content, 1001);
  color: #000000 !important;
}

.modal.is-visible .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: #ffffff;
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #000000;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.modal-close:hover {
  background: var(--background-secondary);
  color: var(--text);
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.btn-secondary {
  background: var(--background-secondary);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--background);
  border-color: var(--text-secondary);
}

/* Responsive: Account Sidebar */
@media (max-width: 768px) {
  /* CRITICAL: Hide the ::before pseudo-element that creates the grey bar on mobile */
  body.has-account-sidebar::before,
  html.account-sidebar-expanded body.has-account-sidebar::before {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    content: none !important;
  }
  
  /* Ensure main content and header NEVER shift on mobile - sidebar is overlay-only */
  /* Override ALL main element margin rules including trusted-finder-page specific ones */
  .account-main-content,
  body.has-account-sidebar main,
  html.account-sidebar-expanded body.has-account-sidebar main,
  html.account-sidebar-expanded .account-main-content,
  body.trusted-finder-page.has-account-sidebar main,
  body.has-account-sidebar.trusted-finder-page main,
  html.account-sidebar-expanded body.trusted-finder-page.has-account-sidebar main,
  html.account-sidebar-expanded body.has-account-sidebar.trusted-finder-page main,
  body.trusted-finder-page.has-account-sidebar main,
  html.account-sidebar-expanded body.trusted-finder-page.has-account-sidebar main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
  }

  html.account-sidebar-expanded body.has-account-sidebar main:has(.marketplace-dashboard) {
    margin-left: 0 !important;
    width: 100% !important;
  }
  
  body.has-account-sidebar .navbar,
  body.has-account-sidebar header,
  html.account-sidebar-expanded body.has-account-sidebar .navbar,
  html.account-sidebar-expanded body.has-account-sidebar header {
    margin-left: 0 !important;
    width: 100% !important;
  }
  
  /* Sidebar: overlay-only on mobile - slides in from left, never pushes content */
  .account-sidebar,
  #accountSidebar.account-sidebar,
  aside.account-sidebar {
    width: min(320px, 85vw) !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001 !important; /* Above backdrop, below modals */
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  html.account-sidebar-expanded .account-sidebar,
  html.account-sidebar-expanded #accountSidebar.account-sidebar,
  html.account-sidebar-expanded aside.account-sidebar {
    transform: translateX(0) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  /* Backdrop: reuse mobile-menu-overlay for sidebar backdrop */
  .mobile-menu-overlay {
    z-index: 1000 !important; /* Below sidebar, above content */
    display: block !important; /* Ensure it's available for sidebar */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.5) !important;
  }
  
  /* Show backdrop when sidebar is expanded on mobile */
  html.account-sidebar-expanded .mobile-menu-overlay {
    opacity: 1 !important;
    visibility: visible !important;
  }
  
  /* Ensure backdrop is hidden when sidebar is closed (unless drawer is open) */
  html:not(.account-sidebar-expanded) .mobile-menu-overlay:not(.is-open) {
    opacity: 0;
    visibility: hidden;
  }
  
  .saved-items-grid {
    grid-template-columns: 1fr;
  }
}

/* Contest History Page Styles */
.contest-history-section {
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.contest-history-container {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.contest-history-header {
  margin-bottom: 2rem;
  text-align: center;
}

.contest-history-header h1 {
  font-size: 2rem;
  margin: 0 0 0.5rem 0;
  color: var(--text);
}

.contest-history-intro {
  color: var(--muted);
  font-size: 1rem;
}

.contest-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.contest-stat-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  text-align: center;
  border: 1px solid var(--border);
}

.contest-stat-card .stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.contest-stat-card .stat-label {
  color: var(--muted);
  font-size: 0.875rem;
}

.contest-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-group label {
  font-weight: 600;
  color: var(--text);
  font-size: 0.875rem;
}

.filter-select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
}

.filter-select:hover {
  border-color: var(--accent);
}

.contest-drawings-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contest-drawing-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.contest-drawing-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.drawing-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.drawing-card-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text);
}

.drawing-date {
  color: var(--muted);
  font-size: 0.875rem;
}

.drawing-card-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.winner-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.winner-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  width: fit-content;
}

.winner-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.winner-details {
  display: flex;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  flex-wrap: wrap;
}

.runner-ups {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.runner-ups h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  color: var(--text);
}

.runner-ups ul {
  margin: 0;
  padding-left: 1.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.no-drawings {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

/* Winner Announcement Styles */
.winner-announcement-banner {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-hover);
  animation: slideIn 0.5s ease;
}

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

.winner-banner-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: #fff;
}

.winner-banner-icon {
  font-size: 3rem;
  line-height: 1;
}

.winner-banner-text {
  flex: 1;
}

.winner-banner-text h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  color: #fff;
}

.winner-banner-text p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
}

.winner-banner-link {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.winner-banner-link:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* Homepage Winner Announcement */
.winner-announcement-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2rem auto;
  max-width: 1200px;
  box-shadow: var(--shadow-hover);
  color: #fff;
}

.winner-announcement-container {
  max-width: 800px;
  margin: 0 auto;
}

.winner-announcement-content {
  text-align: center;
}

.winner-announcement-content h2 {
  margin: 0 0 1rem 0;
  font-size: 2rem;
  color: #fff;
}

.winner-announcement-text {
  font-size: 1.25rem;
  margin: 0 0 0.5rem 0;
  color: rgba(255, 255, 255, 0.95);
}

.winner-announcement-text strong {
  color: #fff;
  font-weight: 700;
}

.winner-announcement-subtext {
  font-size: 1rem;
  margin: 0 0 1.5rem 0;
  color: rgba(255, 255, 255, 0.8);
}

.contest-history-link {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.contest-history-link:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* Contest Management Styles */
.contest-management-content {
  padding: 1rem 0;
}

.contest-info-display {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Orange stat number for pending drawings */
.stat-number.orange {
  color: #f97316;
}

/* Responsive adjustments for contest pages */
@media (max-width: 768px) {
  .contest-history-container {
    padding: 1rem;
  }
  
  .contest-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .contest-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .winner-banner-content {
    flex-direction: column;
    text-align: center;
  }
  
  .winner-banner-icon {
    font-size: 2rem;
  }
  
  .drawing-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* Phase 4: Enhanced Features Styles */

/* Unified action zone - Buy button + share icons */
.product-card .card-footer-actions {
  display: flex;
  flex-direction: column;
  margin-top: auto;
  background: #fafafa;
  border-top: 1px solid #eaeaea;
  padding: 12px 16px;
  gap: 0;
}

.product-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
}

.card-footer-actions .product-card-actions {
  margin-bottom: 0;
  padding: 0 0 8px 0;
}

/* Social Sharing Styles - Utility bar at card bottom */
.product-share-buttons {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0;
  padding: 8px 0 0;
  flex-shrink: 0;
  background: transparent;
  align-items: center;
  border-top: none;
}

.share-btn {
  background: transparent;
  border: none;
  border-radius: 50%;
  padding: 8px;
  cursor: pointer;
  transition: all 200ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  min-width: auto;
  height: auto;
}

.share-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--lime-vibrant);
  transform: scale(1.1);
}

.share-btn:active {
  transform: scale(1.05);
  opacity: 0.8;
}

.share-x {
  color: #6b7280;
}

.share-x:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--lime-vibrant);
  transform: scale(1.1);
}

.share-facebook:hover,
.share-copy:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--lime-vibrant);
  transform: scale(1.1);
}

.share-native {
  color: #6b7280;
}

.share-native:hover {
  background: rgba(124, 252, 0, 0.1);
  color: var(--accent);
  transform: scale(1.1);
  border-radius: 50%;
}

/* Discount Badge Styles */
.discount-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(238, 90, 36, 0.3);
  white-space: nowrap;
  z-index: 5;
}

/* Email Preferences Styles */
.email-preferences-content {
  max-width: 600px;
  margin: 0 auto;
}

.preferences-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.preference-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.preference-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  cursor: pointer;
}

.preference-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--accent);
}

.preference-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.preference-label strong {
  color: var(--text);
  font-size: 1rem;
}

.preference-label small {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.form-actions {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.settings-form .form-actions {
  padding-top: 0.5rem;
  border-top: 1px solid var(--bg);
  margin-top: 1.5rem;
}

.settings-form .btn-primary {
  padding: 0.875rem 2rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(124, 252, 0, 0.2);
}

.settings-form .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(124, 252, 0, 0.3);
}

.settings-form .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(124, 252, 0, 0.2);
}

/* Category Following Styles */
.follow-category-btn {
  display: inline-block;
  margin: 12px 0;
  padding: 8px 16px;
  background: transparent;
  color: #6b7280;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  max-width: 200px;
}

.follow-category-btn:hover {
  background: rgba(59, 130, 246, 0.05);
  border-color: #3b82f6;
  color: #3b82f6;
}

.follow-category-btn.following {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
  opacity: 1;
}

.follow-category-btn.following:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: white;
}

.follow-category-btn:active {
  transform: scale(0.98);
}

.follow-category-btn:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
}

/* Followed Categories Section */
.followed-categories-section {
  width: 100%;
}

.followed-categories-section h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--text);
}

.followed-categories-intro {
  margin: 0 0 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Activity Center Styles */
.activity-center-content {
  max-width: 800px;
  margin: 0 auto;
}

.activity-filters {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.activity-filter-btn {
  padding: 0.625rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.activity-filter-btn:hover {
  background: var(--bg);
  border-color: var(--accent);
  color: var(--accent);
}

.activity-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-timeline-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.activity-timeline-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.activity-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.activity-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.activity-content p {
  margin: 0;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.activity-content small {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.activity-date {
  color: var(--muted);
  font-size: 0.8125rem;
}

.activity-status-badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.activity-status-badge.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.activity-status-badge.status-approved {
  background: #d1fae5;
  color: #065f46;
}

.activity-status-badge.status-rejected {
  background: #fee2e2;
  color: #991b1b;
}

.activity-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.25rem;
}

.activity-link:hover {
  text-decoration: underline;
}

.activity-product-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.activity-product-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.no-submissions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
}

.btn-submit-first-item {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-submit-first-item:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-submit-first-item:active {
  transform: translateY(0);
}

.activity-loading,
.activity-error,
.no-activity {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.activity-error {
  color: #dc2626;
}

/* Account Page Header Styles */
.account-container {
  max-width: clamp(600px, 50vw, 800px);
  margin: 0 auto;
  padding: 1.5rem 1.5rem;
}

/* Auth Pages (Login/Register) - Focus Mode: slate background + centered card */
body.auth-page,
body.auth-page main {
  background: #F1F5F9;
}

body.auth-page .account-container {
  background: #ffffff;
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  border-top: 3px solid #0B1129;
  animation: authCardEnter 0.35s ease-out;
}

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

@media (max-width: 768px) {
  body.auth-page .account-container {
    padding: 1.5rem max(1rem, env(safe-area-inset-left)) max(1.5rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-right));
    margin-left: 0;
    margin-right: 0;
  }
}

/* Contest block divider inside auth card (login page) */
body.auth-page .contest-info {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* Auth secondary links: Forgot password, Create one here - brand accent */
body.auth-page .form-help .link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

body.auth-page .form-help .link:hover {
  text-decoration: underline;
  color: var(--lime-dark);
}

/* Login/register in redesign shell — explicit ink + inputs (avoid washed-out inherited colors) */
body.auth-page .homepage-shell.redesign-shell .account-header h1,
body.auth-page .homepage-shell.redesign-shell .account-intro,
body.auth-page .homepage-shell.redesign-shell .account-form label,
body.auth-page .homepage-shell.redesign-shell .account-switch {
  color: var(--ink-900, var(--text));
}

body.auth-page .homepage-shell.redesign-shell .account-form input[type='email'],
body.auth-page .homepage-shell.redesign-shell .account-form input[type='password'],
body.auth-page .homepage-shell.redesign-shell .account-form input[type='text'] {
  color: var(--ink-900, #0b1129);
  background: #fff;
  border-color: var(--line-strong, var(--border));
}

body.auth-page .homepage-shell.redesign-shell .account-container {
  background: var(--surface, #fff);
  border: 1px solid var(--line, var(--border));
}

.account-header {
  margin-bottom: 1.5rem;
}

.account-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.account-intro {
  font-size: 1rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

/* Split-Screen Layout for Login/Register */
.split-screen-container {
  display: flex;
  min-height: calc(100vh - 84px - 200px); /* Account for header and footer */
  width: 100%;
}

.split-screen-form {
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg);
}

.account-form-wrapper {
  width: 100%;
  max-width: 480px;
}

.split-screen-image {
  width: 50%;
  background-image: url('https://images.unsplash.com/photo-1468495244123-6c6c332eeece?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
  background-size: cover;
  background-position: center;
  position: relative;
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
}

/* Account Form Styling */
.account-form-container {
  width: 100%;
}

.account-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.account-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Password requirements - dynamic guidance as user types */
.password-requirements {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  font-size: 0.875rem;
  color: var(--muted);
}
.password-requirements li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  transition: color 150ms ease;
}
.password-requirements li::before {
  content: '○';
  font-size: 0.75rem;
  flex-shrink: 0;
  color: var(--muted);
}
.password-requirements li.met {
  color: var(--accent);
}
.password-requirements li.met::before {
  content: '✓';
  color: var(--accent);
  font-weight: bold;
}

.account-form label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
}

.account-form input[type="text"],
.account-form input[type="email"],
.account-form input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  min-height: 44px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 200ms ease, box-shadow 200ms ease;
  background: var(--surface);
  color: var(--text);
  box-sizing: border-box;
}

.account-form input[type="text"]:focus,
.account-form input[type="email"]:focus,
.account-form input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 252, 0, 0.1);
}

/* Password visibility toggle wrapper */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  padding-right: 3.5rem; /* Increased to accommodate larger toggle button */
}

.password-input-wrapper .password-toggle {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.password-input-wrapper .password-toggle:hover {
  color: var(--text);
}

.password-input-wrapper .password-toggle:focus {
  outline: none;
}

.password-input-wrapper .password-toggle .icon-hide {
  display: none;
}

.password-input-wrapper .password-toggle[aria-pressed="true"] .icon-show {
  display: none;
}

.password-input-wrapper .password-toggle[aria-pressed="true"] .icon-hide {
  display: block;
}

/* Show invalid/valid borders only after form has been submitted */
.account-form.form-submitted input[type="text"]:invalid,
.account-form.form-submitted input[type="email"]:invalid,
.account-form.form-submitted input[type="password"]:invalid {
  border-color: #dc2626;
}

.account-form.form-submitted input[type="text"]:valid:not(:placeholder-shown),
.account-form.form-submitted input[type="email"]:valid:not(:placeholder-shown),
.account-form.form-submitted input[type="password"]:valid:not(:placeholder-shown) {
  border-color: #10b981;
}

.validation-message {
  display: none;
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.validation-message.show {
  display: block;
}

.account-form .submit-button {
  width: 100%;
  background: var(--accent);
  color: white;
  font-weight: 700;
  border-radius: 8px;
  padding: 14px 20px;
  min-height: 44px;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 200ms ease;
}

.account-form .submit-button:hover {
  background: var(--accent-hover);
}

.account-form .submit-button:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

.account-switch {
  margin-top: 1.5rem;
  text-align: center;
}

.account-switch p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.account-switch .link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.account-switch .link:hover {
  text-decoration: underline;
}

/* Mobile Responsiveness for Split-Screen */
@media (max-width: 768px) {
  .split-screen-container {
    flex-direction: column;
    min-height: auto;
  }

  .split-screen-form {
    width: 100%;
    padding: 2rem 1.5rem;
  }

  .split-screen-image {
    display: none;
  }

  .account-form-wrapper {
    max-width: 100%;
  }
}

/* Settings Styles */
.settings-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .settings-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.settings-section:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 8px 16px rgba(0, 0, 0, 0.06);
}

.settings-section.security {
  border-left: 3px solid var(--accent);
}

.security-quick-actions {
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

.security-quick-actions .link,
.security-quick-actions .btn-link {
  color: var(--accent);
}

.security-quick-actions .link:hover,
.security-quick-actions .btn-link:hover {
  text-decoration: underline;
}

.security-quick-actions-sep {
  margin: 0 0.5rem;
  color: var(--text-muted, #6b7280);
}

.settings-details {
  margin-top: 0.5rem;
}

.settings-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  padding: 0.5rem 0;
  user-select: none;
}

.settings-details summary:hover {
  color: var(--accent);
}

.settings-details[open] summary {
  margin-bottom: 0.75rem;
}

.settings-details .settings-form {
  padding-top: 0.25rem;
}

.settings-section h2 {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  color: var(--text);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  letter-spacing: -0.02em;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--bg);
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-reset-link {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

.btn-link:hover {
  text-decoration: underline;
}

.btn-link:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.email-display-value {
  margin: 0.25rem 0 0.75rem;
  font-size: 1rem;
  color: var(--text);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

/* Compact Profile Icon Preview Button */
.profile-icon-preview-compact {
  display: flex;
  align-items: center;
}

.profile-icon-preview-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text);
}

.profile-icon-preview-btn:hover {
  border-color: var(--accent);
  background: rgba(124, 252, 0, 0.05);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(124, 252, 0, 0.15);
}

.profile-icon-preview-btn:active {
  transform: translateY(0);
}

.profile-icon-display-compact {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  background: linear-gradient(135deg, var(--lime-vibrant) 0%, var(--accent-hover) 100%);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(255, 153, 0, 0.25);
  flex-shrink: 0;
}

.profile-icon-change-text {
  font-weight: 500;
  color: var(--text);
}

/* Profile Icon Modal Styles */
.profile-icon-modal-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.profile-icon-preview-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem;
  background: linear-gradient(135deg, rgba(124, 252, 0, 0.03) 0%, rgba(124, 252, 0, 0.08) 100%);
  border: 2px dashed rgba(124, 252, 0, 0.2);
  border-radius: 16px;
}

.profile-icon-display-modal {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--lime-vibrant) 0%, var(--accent-hover) 100%);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(124, 252, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-icon-label-modal {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-icon-selector-modal {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-icon-selector-label-modal {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.profile-icon-grid-modal {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.profile-icon-button-modal {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  position: relative;
  overflow: hidden;
}

.profile-icon-button-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(124, 252, 0, 0.1) 0%, rgba(124, 252, 0, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.profile-icon-button-modal:hover {
  border-color: var(--accent);
  background: rgba(255, 153, 0, 0.08);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 12px rgba(124, 252, 0, 0.15);
}

.profile-icon-button-modal:hover::before {
  opacity: 1;
}

.profile-icon-button-modal.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(124, 252, 0, 0.15) 0%, rgba(255, 153, 0, 0.08) 100%);
  box-shadow: 0 0 0 3px rgba(124, 252, 0, 0.2), 0 4px 12px rgba(124, 252, 0, 0.2);
  transform: scale(1.05);
}

.profile-icon-button-modal.selected::before {
  opacity: 1;
}

.profile-icon-button-modal:active {
  transform: scale(0.98);
}

/* Profile Icon Section (kept for backwards compatibility if needed) */
.profile-icon-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.profile-icon-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem;
  background: linear-gradient(135deg, rgba(124, 252, 0, 0.03) 0%, rgba(124, 252, 0, 0.08) 100%);
  border: 2px dashed rgba(124, 252, 0, 0.2);
  border-radius: 16px;
  transition: all 0.3s ease;
}

.profile-icon-preview:hover {
  background: linear-gradient(135deg, rgba(124, 252, 0, 0.05) 0%, rgba(255, 153, 0, 0.12) 100%);
  border-color: rgba(124, 252, 0, 0.3);
}

.profile-icon-display {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--lime-vibrant) 0%, var(--accent-hover) 100%);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(124, 252, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-icon-preview:hover .profile-icon-display {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(124, 252, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-icon-label {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-icon-selector {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-icon-selector-label {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.profile-icon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.profile-icon-button {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  position: relative;
  overflow: hidden;
}

.profile-icon-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(124, 252, 0, 0.1) 0%, rgba(124, 252, 0, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.profile-icon-button:hover {
  border-color: var(--accent);
  background: rgba(255, 153, 0, 0.08);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 12px rgba(124, 252, 0, 0.15);
}

.profile-icon-button:hover::before {
  opacity: 1;
}

.profile-icon-button.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(124, 252, 0, 0.15) 0%, rgba(255, 153, 0, 0.08) 100%);
  box-shadow: 0 0 0 3px rgba(124, 252, 0, 0.2), 0 4px 12px rgba(124, 252, 0, 0.2);
  transform: scale(1.05);
}

.profile-icon-button.selected::before {
  opacity: 1;
}

.profile-icon-button:active {
  transform: scale(0.98);
}

.settings-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-form label {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.125rem;
}

.settings-form .form-input {
  padding: 0.75rem 0.875rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  width: 100%;
}

.settings-form .form-input:hover {
  border-color: rgba(124, 252, 0, 0.3);
}

.settings-form .form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 153, 0, 0.12), 0 2px 8px rgba(124, 252, 0, 0.1);
  background: var(--surface);
}

.settings-form .form-input[readonly] {
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
  border-color: var(--border);
}

.settings-form .form-input[readonly]:hover {
  border-color: var(--border);
}

.settings-form .form-help {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 0.125rem;
  line-height: 1.4;
}

.form-message {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  font-size: 0.9375rem;
  margin-top: 1rem;
  font-weight: 500;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-message.success {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border: 2px solid #10b981;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.form-message.error {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  border: 2px solid #dc2626;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
}

.form-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.form-loading .loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive styles for activity and settings */
@media (max-width: 768px) {
  .activity-filters {
    gap: 0.5rem;
  }

  .activity-filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .activity-timeline-item {
    padding: 0.75rem;
  }

  .activity-icon {
    width: 32px;
    height: 32px;
    font-size: 1.25rem;
  }

  .settings-section {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .settings-section h2 {
    font-size: 1.125rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.875rem;
  }
  
  .profile-icon-section {
    gap: 1.5rem;
  }
  
  .profile-icon-preview {
    padding: 1.5rem 1rem;
  }
  
  .profile-icon-display {
    width: 72px;
    height: 72px;
    font-size: 2.75rem;
  }
  
  .profile-icon-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.875rem;
  }
  
  .profile-icon-button {
    font-size: 2rem;
  }
  
  .settings-form {
    gap: 1.25rem;
  }
}

@media (max-width: 480px) {
  .settings-content {
    padding: 0 0.5rem;
    gap: 1rem;
  }
  
  .settings-section {
    padding: 1rem;
    border-radius: 12px;
  }
  
  .settings-section h2 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
  }
  
  .profile-icon-grid-modal {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
  }
  
  .profile-icon-button-modal {
    font-size: 1.75rem;
  }
  
  .profile-icon-display-modal {
    width: 56px;
    height: 56px;
    font-size: 2rem;
  }
  
  .settings-form {
    gap: 0.75rem;
  }
  
  .account-container {
    padding: 1rem 0.75rem;
  }
  
  .account-header {
    margin-bottom: 1rem;
  }
  
  .account-header h1 {
    font-size: 1.375rem;
  }
}

/* Widescreen Optimizations for Register/Account Pages (1400px+) */
@media (min-width: 1400px) {
  .account-container {
    max-width: 900px;
    padding: 2rem;
  }
  
  /* Two-column layout for name fields */
  .account-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    column-gap: 1.5rem;
  }
  
  /* First two form groups (firstName, lastName) stay in grid */
  .account-form .form-group:nth-child(1),
  .account-form .form-group:nth-child(2) {
    grid-column: span 1;
  }
  
  /* All other form groups span full width */
  .account-form .form-group:nth-child(n+3) {
    grid-column: span 2;
  }
  
  /* Submit button spans full width under both columns */
  .account-form .submit-button {
    grid-column: 1 / -1;
  }
  
  .profile-icon-preview-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }
  
  .profile-icon-display-compact {
    width: 32px;
    height: 32px;
    font-size: 1.375rem;
  }
}

.followed-categories-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.followed-category-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.no-followed-categories {
  text-align: center;
  padding: 1rem;
}

.no-followed-categories a {
  color: var(--accent);
  text-decoration: none;
}

.no-followed-categories a:hover {
  text-decoration: underline;
}

/* Mobile Enhancements */
@media (max-width: 768px) {
  .product-share-buttons {
    gap: 0.5rem;
  }
  
  .share-btn {
    min-width: auto;
    height: auto;
    padding: 0.25rem;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .preference-group {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .product-share-buttons {
    justify-content: center;
  }
  
  .share-btn {
    min-width: auto;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .share-btn {
    padding: 0.5rem;
  }
  
  .floating-report-btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  .buy-button {
    min-height: 44px;
    padding: 0.75rem 1.5rem;
  }
  
  .btn-small {
    min-height: 40px;
    padding: 0.5rem 1rem;
  }
}

/* PWA Install Prompt Styles (if needed) */
.pwa-install-prompt {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-hover);
  z-index: 1000;
  max-width: 400px;
  display: none;
}

.pwa-install-prompt.show {
  display: block;
}

.pwa-install-prompt-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pwa-install-prompt-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* API Connection Status Banner */
.api-status-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #fef3c7;
  border-bottom: 2px solid #f59e0b;
  z-index: 51;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  display: block;
}

.api-status-banner.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}


.api-status-banner-content {
  max-width: var(--container);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.api-status-banner-icon {
  flex-shrink: 0;
  color: #d97706;
  display: flex;
  align-items: center;
}

.api-status-banner-message {
  flex: 1;
  color: #92400e;
  font-size: 0.9375rem;
  line-height: 1.5;
  min-width: 200px;
}

.api-status-banner-message strong {
  font-weight: 600;
}

.api-status-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.api-status-banner-btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.api-status-banner-btn.retry-btn {
  background: #d97706;
  color: white;
}

.api-status-banner-btn.retry-btn:hover {
  background: #b45309;
}

.api-status-banner-btn.retry-btn:active {
  background: #92400e;
}

.api-status-banner-btn.retry-btn:disabled {
  background: #d1d5db;
  color: #6b7280;
  cursor: not-allowed;
}

.api-status-banner-btn.dismiss-btn {
  background: transparent;
  color: #92400e;
  padding: 8px;
  min-width: 32px;
  width: 32px;
  height: 32px;
}

.api-status-banner-btn.dismiss-btn:hover {
  background: rgba(217, 119, 6, 0.1);
  color: #78350f;
}

.api-status-banner-btn.dismiss-btn:active {
  background: rgba(217, 119, 6, 0.2);
}

/* When banner is visible, push header down */
body:has(.api-status-banner.show) header {
  margin-top: 60px;
  transition: margin-top 0.3s ease;
}

/* Adjust main content when banner is visible */
body:has(.api-status-banner.show) .admin-main-content {
  padding-top: 0;
}

/* File Protocol Warning Banner */
.file-protocol-warning {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #fee2e2;
  border-bottom: 2px solid #dc2626;
  z-index: 52;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: none;
}

.file-protocol-warning.show {
  display: block;
}

.file-protocol-warning-content {
  max-width: var(--container);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.file-protocol-warning-icon {
  flex-shrink: 0;
  color: #dc2626;
  display: flex;
  align-items: center;
}

.file-protocol-warning-message {
  flex: 1;
  color: #991b1b;
  font-size: 0.9375rem;
  line-height: 1.5;
  min-width: 200px;
}

.file-protocol-warning-message strong {
  font-weight: 600;
}

.file-protocol-warning-message a {
  color: #dc2626;
  text-decoration: underline;
  font-weight: 600;
}

.file-protocol-warning-message a:hover {
  color: #b91c1c;
  text-decoration: none;
}

.file-protocol-warning-btn {
  background: transparent;
  color: #991b1b;
  padding: 8px;
  min-width: 32px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.file-protocol-warning-btn:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #7f1d1d;
}

.file-protocol-warning-btn:active {
  background: rgba(220, 38, 38, 0.2);
}

/* When file protocol warning is visible, push header down */
body:has(.file-protocol-warning.show) header {
  margin-top: 60px;
  transition: margin-top 0.3s ease;
}

/* Adjust main content when file protocol warning is visible */
body:has(.file-protocol-warning.show) .admin-main-content {
  padding-top: 0;
}

body:has(.file-protocol-warning.show) main {
  margin-top: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .api-status-banner-content {
    padding: 10px 16px;
    gap: 12px;
  }
  
  .api-status-banner-message {
    font-size: 0.875rem;
    min-width: 100%;
    order: 2;
  }
  
  .api-status-banner-icon {
    order: 1;
  }
  
  .api-status-banner-actions {
    order: 3;
    width: 100%;
    justify-content: flex-end;
    margin-top: 4px;
  }
  
  .api-status-banner-btn.retry-btn {
    flex: 1;
  }
  
  body:has(.api-status-banner.show) .admin-main-content {
    padding-top: 80px;
  }
}

/* History Timeline Styles */
.history-entry {
  padding: 12px;
  border-left: 3px solid var(--border);
  margin-bottom: 12px;
  background: var(--background-secondary);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.history-entry:hover {
  background: var(--background);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.history-entry.created {
  border-left-color: #10b981;
}

.history-entry.updated {
  border-left-color: #3b82f6;
}

.history-entry.deleted {
  border-left-color: #ef4444;
}

.history-entry.conflict {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.history-entry.conflict:hover {
  background: rgba(245, 158, 11, 0.15);
}

.change-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 8px;
}

/* History modal specific styles */
#historyTimeline {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

#historyTimeline::-webkit-scrollbar {
  width: 8px;
}

#historyTimeline::-webkit-scrollbar-track {
  background: transparent;
}

#historyTimeline::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 4px;
}

#historyTimeline::-webkit-scrollbar-thumb:hover {
  background-color: var(--muted);
}

/* Reputation & Badge Display Styles */
.reputation-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card-header-with-explainer {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.reputation-explainer-trigger {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-family: inherit;
}

.reputation-explainer-trigger:hover {
  color: var(--accent);
}

.reputation-explainer-popover {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  max-width: 320px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  z-index: 10;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.5;
}

.reputation-explainer-popover p {
  margin: 0;
}

.reputation-display {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.reputation-score {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--radius);
  color: white;
}

.reputation-label {
  font-size: 0.875rem;
  opacity: 0.9;
  margin: 0 0 8px 0;
}

.reputation-number {
  font-size: 3rem;
  font-weight: 700;
  margin: 8px 0;
}

.reputation-level {
  font-size: 1.125rem;
  font-weight: 600;
  opacity: 0.95;
}

.reputation-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.reputation-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-hint {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin: 0;
}

.empty-state-tip {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin: 0.5rem 0 0;
}

.progress-label {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}

.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar {
  flex: 1;
  height: 24px;
  background: var(--bg);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
  border-radius: 12px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  min-width: 80px;
  text-align: right;
}

.badges-section {
  margin-top: 8px;
}

.badges-section h4 {
  margin: 0 0 16px 0;
  font-size: 1.125rem;
  color: var(--text);
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.badge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  transition: all 0.2s ease;
  cursor: pointer;
}

.badge-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.badge-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.badge-name {
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  margin-bottom: 4px;
}

.badge-date {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

.no-badges {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 24px;
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  .reputation-stats {
    grid-template-columns: 1fr;
  }
  
  .badges-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
  
  .reputation-number {
    font-size: 2rem;
  }
}

/* Sidebar Profile Styles - Dark Theme */
.account-sidebar .sidebar-profile {
  position: relative;
  padding: 20px 16px;
  background: transparent;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.account-sidebar .sidebar-profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  color: white;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
  border: 2px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.account-sidebar .sidebar-profile-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(124, 252, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
}

.account-sidebar .sidebar-profile-avatar:active {
  transform: scale(0.98);
}

.account-sidebar .sidebar-profile-avatar svg {
  width: 24px;
  height: 24px;
}

.account-sidebar .sidebar-profile-avatar.has-icon {
  background: linear-gradient(135deg, var(--lime-vibrant) 0%, var(--accent-hover) 100%);
}

.account-sidebar .sidebar-profile-icon-emoji {
  font-size: 1.5rem;
  line-height: 1;
  display: block;
}

/* Sidebar Footer */
.account-sidebar .sidebar-footer {
  margin-top: auto;
  padding: 8px 0;
  border-top: 1px solid var(--sidebar-border);
}

/* Sidebar Sign-Out Button */
.account-sidebar .sidebar-signout-btn {
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease-in-out;
  padding: 12px 16px;
  color: var(--sidebar-text-secondary);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  font-family: inherit;
  margin: 0 8px;
}

.account-sidebar .sidebar-signout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.account-sidebar .sidebar-signout-btn:active {
  transform: scale(0.98);
}

html.account-sidebar-expanded .account-sidebar .sidebar-signout-btn {
  margin: 0 12px;
}

.account-sidebar .sidebar-signout-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  flex-shrink: 0;
  transition: color 0.3s ease-in-out;
}

.account-sidebar .sidebar-signout-btn .nav-text {
  white-space: nowrap;
  overflow: hidden;
}

/* Collapsed state - show icon only, centered */
html:not(.account-sidebar-expanded) .account-sidebar .sidebar-signout-btn {
  justify-content: center;
  padding: 12px;
}

html:not(.account-sidebar-expanded) .account-sidebar .sidebar-signout-btn .nav-text {
  display: none;
}

/* Expanded state - show icon and text */
html.account-sidebar-expanded .account-sidebar .sidebar-signout-btn {
  justify-content: flex-start;
}

.account-sidebar .sidebar-profile-info {
  text-align: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.account-sidebar .sidebar-profile-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--sidebar-text-primary);
  margin: 0;
  line-height: 1.3;
  text-transform: capitalize;
}

.account-sidebar .sidebar-profile-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.6875rem;
  color: #9ca3af;
  line-height: 1.3;
}

.account-sidebar .sidebar-profile-level {
  font-size: 0.6875rem;
  color: #9ca3af;
  font-weight: 400;
  margin: 0;
  line-height: 1.3;
}

.account-sidebar .sidebar-profile-meta-separator {
  color: #6b7280;
  font-size: 0.6875rem;
  line-height: 1.3;
}

.account-sidebar .sidebar-profile-reputation {
  font-size: 0.6875rem;
  color: #9ca3af;
  line-height: 1.3;
  margin: 0;
  text-transform: capitalize;
}

.account-sidebar .sidebar-profile-stats {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 8px 16px;
  background: transparent;
  border-radius: 12px;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

.account-sidebar .sidebar-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  max-width: 80px;
}

.account-sidebar .sidebar-stat:first-child {
  border-right: 1px solid var(--sidebar-border);
  padding-right: 12px;
}

.account-sidebar .sidebar-stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--sidebar-text-primary);
  line-height: 1.2;
}

.account-sidebar .sidebar-stat-label {
  font-size: 0.6875rem;
  color: var(--sidebar-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.account-sidebar .sidebar-profile-badges {
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  min-height: 16px;
  width: 100%;
}

.account-sidebar .sidebar-badge-icon {
  font-size: 1.5rem;
  display: inline-block;
  cursor: help;
  transition: transform 0.3s ease-in-out;
}

.account-sidebar .sidebar-badge-icon:hover {
  transform: scale(1.2);
}

/* Collapsed sidebar profile styles */
html:not(.account-sidebar-expanded) .account-sidebar .sidebar-profile {
  padding: 16px 0;
  gap: 0;
}

html:not(.account-sidebar-expanded) .account-sidebar .sidebar-profile-info,
html:not(.account-sidebar-expanded) .account-sidebar .sidebar-profile-stats,
html:not(.account-sidebar-expanded) .account-sidebar .sidebar-profile-badges {
  display: none;
}

html:not(.account-sidebar-expanded) .account-sidebar .sidebar-profile-avatar {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  position: relative;
}

html:not(.account-sidebar-expanded) .account-sidebar .sidebar-profile-avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 3px 8px rgba(124, 252, 0, 0.4);
}

html:not(.account-sidebar-expanded) .account-sidebar .sidebar-profile-avatar:hover::after {
  content: attr(data-user-name);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

html:not(.account-sidebar-expanded) .account-sidebar .sidebar-profile-avatar svg {
  width: 24px;
  height: 24px;
}

html:not(.account-sidebar-expanded) .account-sidebar .sidebar-profile-icon-emoji {
  font-size: 1.5rem;
}

/* Notification Toast Styles */
.notification-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notification-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow-hover);
  min-width: 320px;
  animation: slideInRight 0.3s ease-out;
}

.notification-toast.error {
  border-left-color: #ef4444;
}

.notification-toast.success {
  border-left-color: #10b981;
}

@keyframes slideInRight {
  from {
    transform: translateX(110%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(110%);
    opacity: 0;
  }
}

.notification-toast.fade-out {
  animation: slideOutRight 0.3s ease-in forwards;
}
/* Leaderboard Styles */
.leaderboard-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.leaderboard-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.leaderboard-card h2 {
    margin: 0 0 1rem 0;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
}

.leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.leaderboard-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
}

.leaderboard-list li:last-child {
    border-bottom: none;
}

/* ========================================
   Service Worker Update Notification
   ======================================== */

.sw-update-notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
  display: none; /* Hidden by default */
  align-items: center;
  gap: 16px;
  z-index: var(--z-toast, 2000);
  max-width: 500px;
  width: calc(100% - 40px);
  animation: slideUpFadeIn 0.4s ease-out;
}

@keyframes slideUpFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.sw-update-notification-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sw-update-notification-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.sw-update-notification-text {
  flex: 1;
}

.sw-update-notification-text strong {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

.sw-update-notification-text p {
  margin: 0;
  font-size: 0.875rem;
  opacity: 0.95;
}

.sw-update-notification-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.sw-update-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sw-update-btn-primary {
  background: white;
  color: #667eea;
}

.sw-update-btn-primary:hover {
  background: #f0f0f0;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sw-update-btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.sw-update-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Mobile responsiveness */
@media (max-width: 600px) {
  .sw-update-notification {
    bottom: 10px;
    padding: 12px 16px;
    flex-direction: column;
    align-items: stretch;
  }
  
  .sw-update-notification-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .sw-update-btn {
    width: 100%;
  }
}



/* ===========================
   Product Detail Page Styles
   =========================== */

/* Breadcrumb Navigation */
.breadcrumb-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px 24px;
}

/* Product page: let main use full content width (override core.css main max-width) so container can fill */
body.has-account-sidebar main:has(.product-detail-container) {
  max-width: none;
  width: calc(100vw - var(--account-sidebar-width-collapsed));
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}

html.account-sidebar-expanded body.has-account-sidebar main:has(.product-detail-container) {
  width: calc(100vw - var(--account-sidebar-width-expanded));
}

/* Product page: align breadcrumb with container; reduced vertical padding for density */
main:has(.product-detail-container) .breadcrumb-container {
  max-width: 1440px;
  margin-inline: auto;
  padding: 8px clamp(16px, 2vw, 24px);
}

body.has-account-sidebar main:has(.product-detail-container) .breadcrumb-container {
  max-width: min(1440px, calc(100vw - var(--account-sidebar-width-collapsed) - 48px));
  padding: 8px clamp(16px, 2vw, 24px);
}

html.account-sidebar-expanded body.has-account-sidebar main:has(.product-detail-container) .breadcrumb-container {
  max-width: min(1440px, calc(100vw - var(--account-sidebar-width-expanded) - 48px));
  padding: 8px clamp(16px, 2vw, 24px);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 200ms ease;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb-separator {
  color: var(--border);
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 500;
}

/* Product Detail Loading State */
.product-detail-loading {
  max-width: var(--container);
  margin: 48px auto;
  padding: 0 24px;
}

main:has(.product-detail-container) .product-detail-loading {
  max-width: 1440px;
  margin-inline: auto;
}

body.has-account-sidebar main:has(.product-detail-container) .product-detail-loading {
  max-width: min(1440px, calc(100vw - var(--account-sidebar-width-collapsed) - 48px));
}

html.account-sidebar-expanded body.has-account-sidebar main:has(.product-detail-container) .product-detail-loading {
  max-width: min(1440px, calc(100vw - var(--account-sidebar-width-expanded) - 48px));
}

.loading-skeleton {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.skeleton-image {
  width: 100%;
  height: 500px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton-product-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  min-height: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), var(--shadow);
}

/* Deal grid skeleton media matches live card geometry (4:3, CLS-safe) */
.skeleton-product-card .skeleton-image {
  flex-shrink: 0;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  min-height: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.skeleton-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-line {
  height: 16px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-title {
  width: 80%;
  height: 20px;
}

.skeleton-price {
  width: 40%;
  height: 24px;
}

.skeleton-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skeleton-title {
  height: 32px;
  width: 80%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-line {
  height: 16px;
  width: 100%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-line.short {
  width: 60%;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Product Detail Error State */
.product-detail-error {
  max-width: 600px;
  margin: 96px auto;
  padding: 48px 24px;
  text-align: center;
}

.error-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.error-content svg {
  color: #ef4444;
}

.error-content h2 {
  margin: 0;
  font-size: 1.875rem;
  color: var(--text);
}

.error-content p {
  margin: 0;
  color: var(--muted);
  font-size: 1.125rem;
}

/* Product Detail Container - high-density desktop: cap at 1440px, center */
.product-detail-container {
  max-width: 1440px;
  margin-inline: auto;
  padding: clamp(20px, 2.5vw, 32px) clamp(16px, 2vw, 24px);
}

body.has-account-sidebar main .product-detail-container {
  max-width: min(1440px, calc(100vw - var(--account-sidebar-width-collapsed) - 48px));
}

html.account-sidebar-expanded body.has-account-sidebar main .product-detail-container {
  max-width: min(1440px, calc(100vw - var(--account-sidebar-width-expanded) - 48px));
}

/* High-density grid: fixed Buy Box width (350px), image/info use fr so layout stays rigid on zoom out */
.product-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) 350px;
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Large Desktop Breakpoint - keep Buy Box fixed width */
@media (max-width: 1440px) {
  .product-detail-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) 350px;
    gap: 1.75rem;
  }
}

/* Standard Desktop Breakpoint */
@media (max-width: 1280px) {
  .product-detail-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 320px;
    gap: 1.5rem;
  }
}

/* Product detail: single column below 1024px; buy box first, then image, then info (xs <576, sm 576-767, md 768-1023) */
@media (max-width: 1024px) {
  .product-detail-layout {
    grid-template-columns: 1fr;
    gap: clamp(24px, 3vw, 32px);
  }
  
  .product-detail-image-section {
    position: static;
    order: 1;
  }
  
  .product-detail-info-section {
    order: 2;
  }
  
  .buy-box {
    position: sticky;
    bottom: 0;
    order: -1; /* Show buy box first on tablet/mobile */
    z-index: var(--z-header, 500);
    background: var(--surface);
    padding-top: 1rem;
    margin-top: -1rem;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
  }
  
  .buy-box-content {
    border-width: 2px;
  }
  
  .buy-box-button {
    padding: 14px 20px;
    font-size: 1rem;
    min-height: 44px;
  }
  
  .market-pulse-pills {
    flex-direction: column;
    align-items: stretch;
  }
  
  .price-pill {
    text-align: center;
  }
}

/* Large Phone Breakpoint */
@media (max-width: 640px) {
  .product-detail-layout {
    gap: clamp(20px, 3vw, 28px);
  }
  
  .product-detail-container {
    padding: clamp(16px, 2vw, 24px);
  }
}

@media (max-width: 768px) {
  .product-detail-container {
    padding: 16px;
  }
  
  .product-detail-layout {
    gap: 20px;
    margin-bottom: 32px;
  }
  
  .product-image-container {
    padding: 16px;
  }
  
  .product-detail-title {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
  }
  
  .buy-box-price {
    font-size: clamp(1.5rem, 5vw, 2.25rem);
  }
  
  .condition-filter-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .condition-filter-pills {
    width: 100%;
  }
  
  .condition-filter-pill {
    flex: 1;
    min-width: 0;
    text-align: center;
  }
  
  .offers-table-container {
    overflow-x: visible;
  }
  
  .offers-table {
    min-width: 0;
    display: block;
  }
  
  .offers-table thead {
    display: none;
  }
  
  .offers-table tbody {
    display: block;
  }
  
  .offers-table tbody tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 1rem;
    box-shadow: var(--shadow);
  }
  
  .offers-table tbody tr:nth-child(even) {
    background: var(--surface);
  }
  
  .offers-table tbody tr:hover {
    transform: none;
    box-shadow: var(--shadow-hover);
  }
  
  .offers-table td {
    display: block;
    padding: 0.5rem 0;
    text-align: left;
    border: none;
  }
  
  .offers-table td:before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: var(--text-secondary);
    display: inline-block;
    min-width: 100px;
  }
  
  .offers-table td:last-child {
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid var(--border);
  }
  
  .marketplace-icon {
    width: 20px;
    height: 20px;
  }
  
  .view-deal-btn {
    width: 100%;
    padding: 12px 20px;
    min-height: 44px;
    font-size: 0.875rem;
  }
  
  .image-zoom-btn {
    bottom: 12px;
    padding: 6px 12px;
    font-size: 0.8125rem;
  }
  
  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
  
  .lightbox-prev {
    left: 10px;
  }
  
  .lightbox-next {
    right: 10px;
  }
}

@media (max-width: 480px) {
  .product-detail-title {
    font-size: clamp(1.125rem, 4vw, 1.5rem);
  }
  
  .buy-box-price {
    font-size: clamp(1.375rem, 6vw, 2rem);
  }
  
  .product-detail-actions-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .product-detail-voting {
    width: 100%;
    justify-content: space-around;
  }
  
  .product-share-buttons {
    width: 100%;
    justify-content: center;
  }
  
  .condition-filter-pill {
    font-size: 0.8125rem;
    padding: 5px 12px;
  }
  
  /* Touch targets: min 44px for product detail actions */
  .product-detail-actions-row .vote-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 10px;
  }
  
  .product-detail-actions-row .btn-secondary.btn-icon {
    min-height: 44px;
    padding: 10px 16px;
  }
  
  .product-detail-actions-row .share-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 10px;
  }
  
  .buy-box .buy-box-button {
    min-height: 44px;
    padding: 14px 20px;
  }
}

/* Product Image Section - no overflow scrollbar; constrain height so Buy Box above fold */
.product-detail-image-section {
  position: sticky;
  top: clamp(80px, 10vh, 100px);
  align-self: start;
  overflow: visible;
}

.product-image-container {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  min-height: 200px;
  max-height: min(500px, 60vh);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-detail-image {
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

/* Image Slider */
.image-slider {
  width: 100%;
}

.image-slider-main {
  position: relative;
  width: 100%;
  margin-bottom: 16px;
}

.slider-main-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
}

.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  color: var(--text);
  cursor: pointer;
  transition: all 200ms ease;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.slider-nav:hover {
  background: white;
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.slider-prev {
  left: 12px;
}

.slider-next {
  right: 12px;
}

.image-slider-thumbnails {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.thumbnail-btn {
  width: 60px;
  height: 60px;
  padding: 4px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: all 200ms ease;
  overflow: hidden;
}

.thumbnail-btn:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

.thumbnail-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(124, 252, 0, 0.2);
}

.thumbnail-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

/* Image Zoom Button */
.image-zoom-btn {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 200ms ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 5;
}

.image-zoom-btn:hover {
  background: white;
  border-color: var(--accent);
  color: var(--accent);
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-zoom-btn svg {
  width: 18px;
  height: 18px;
}

/* Image Lightbox */
.image-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.95);
  animation: fadeIn 200ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  cursor: pointer;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 200ms ease;
  z-index: 10;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: white;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  transition: all 200ms ease;
  z-index: 10;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.product-detail-badges {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.discount-badge {
  background: #dc2626;
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
  white-space: nowrap;
}

.early-access-badge {
  background: #7c3aed;
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 2px 4px rgba(124, 58, 237, 0.3);
}

/* Actions Row (Voting + Save + Share) */
.product-detail-actions-row {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 16px);
  flex-wrap: wrap;
  margin-top: clamp(12px, 1.5vw, 24px);
}

/* Voting Section */
.product-detail-voting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  flex: 0 0 auto;
}

.vote-score-large {
  font-size: 1.5rem;
  font-weight: 700;
  min-width: 60px;
  text-align: center;
}

.vote-score-large.positive {
  color: #10b981;
}

.vote-score-large.negative {
  color: #ef4444;
}

/* Product Info Section - compact for density */
.product-detail-info-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.9375rem;
}

/* High-density: smaller H1, tighter line-height */
.product-detail-title {
  margin: 0 0 12px 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* Phase 4.3: Variant Selector */
.variant-selector {
  margin: 24px 0;
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.variant-selector-title {
  margin: 0 0 16px 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.variant-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.variant-swatch {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 200ms ease;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
}

.variant-swatch:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--surface);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.variant-swatch.active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.variant-swatch.out-of-stock {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f3f4f6;
  border-color: #d1d5db;
}

.variant-swatch.out-of-stock:hover {
  transform: none;
  box-shadow: none;
}

.variant-swatch-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.variant-name {
  font-weight: 600;
}

.variant-count {
  font-size: 0.8125rem;
  opacity: 0.8;
  font-weight: 400;
}

.variant-swatch.active .variant-count {
  opacity: 0.9;
}

.variant-out-of-stock-label {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 400;
}

.product-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.9375rem;
}

.product-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.product-meta-item::before {
  content: "•";
  color: var(--border);
}

.product-meta-item:first-child::before {
  display: none;
}

.product-detail-submitter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  background: #f3f4f6;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.product-detail-submitter strong {
  color: var(--accent);
}

.product-added-date {
  color: var(--muted);
  font-size: 0.8125rem;
}

/* Price Section */
.product-detail-price-section {
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.product-price-main {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.price-label {
  font-size: 1rem;
  color: var(--muted);
}

.price-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text);
}

.product-retail-price {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.retail-price-label {
  font-size: 0.875rem;
  color: var(--muted);
}

.retail-price-value {
  font-size: 1.25rem;
  color: var(--muted);
  text-decoration: line-through;
}

/* Actions Section */
.product-detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-large {
  padding: 14px 32px;
  font-size: 1.125rem;
  font-weight: 600;
}

.btn-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon svg {
  flex-shrink: 0;
}

/* Social Sharing */
.product-detail-sharing {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #f9fafb;
  border-radius: var(--radius);
}

.sharing-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
}

/* Description & Specs */
.product-detail-description,
.product-detail-specs {
  padding: clamp(16px, 2vw, 24px);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.product-detail-description h3,
.product-detail-specs h3 {
  margin: 0 0 16px 0;
  font-size: clamp(1.125rem, 2vw, 1.375rem);
}

.product-detail-description p {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

.specs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.spec-item:last-child {
  border-bottom: none;
}

.spec-label {
  font-weight: 600;
  color: var(--text);
}

.spec-value {
  color: var(--muted);
  text-align: right;
}

/* Value insights: Market Pulse + Deal Quality - compact for density */
.product-value-insights {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0 0 1.25rem 0;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.product-value-insights .market-pulse {
  margin: 0;
  padding: 0;
  background: transparent;
}

.product-value-insights .deal-quality-score-container {
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

/* Value insights: secondary to buy box CTA (muted, smaller) */
.product-value-insights .market-pulse-label {
  color: var(--muted);
  font-size: 0.8125rem;
}

.product-value-insights .price-pill {
  font-size: 0.8125rem;
  opacity: 0.95;
}

/* Market Pulse - compact for density */
.market-pulse {
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
}

.market-pulse-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.market-pulse-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.price-pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.price-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.price-pill-low {
  background: #dcfce7;
  color: #166534;
}

.price-pill-avg {
  background: #dbeafe;
  color: #1e40af;
}

.price-pill-high {
  background: #fee2e2;
  color: #991b1b;
}

/* Deal Quality Score - compact for density; bar 8px, text 0.875rem */
/* Hidden/deprecated for now; re-enable by removing display: none */
.deal-quality-score-container {
  display: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border-radius: var(--radius);
  box-shadow: none;
  font-size: 0.875rem;
}

.deal-quality-score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.deal-quality-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.deal-quality-value {
  font-size: 0.875rem;
  font-weight: 700;
}

/* ======================================================================== */
/* Smart Pulse History Section */
/* ======================================================================== */
.smart-pulse-section {
  margin: 0;
  width: 100%;
  max-width: 100%;
  clear: both;
}

/* Smart Pulse container: hidden/deprecated for now; re-enable by removing display: none */
.smart-pulse-container {
  display: none;
  margin: 0;
  padding: clamp(16px, 2vw, 24px);
  background: var(--bg-secondary, #f9f9f9);
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  min-height: 300px;
  font-size: clamp(0.875rem, 1.1vw, 1rem);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.smart-pulse-wrapper {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.smart-pulse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.smart-pulse-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
  margin: 0;
}

.smart-pulse-chart-container {
  position: relative;
  height: 300px;
  min-height: 300px;
  max-height: 400px;
  margin: 16px 0;
  background: white;
  border-radius: 4px;
  padding: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .smart-pulse-section {
    margin: 0;
  }
  
  .smart-pulse-chart-container {
    height: 250px;
    min-height: 250px;
    padding: 4px;
  }
  
  .smart-pulse-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.smart-pulse-anchor {
  text-align: center;
  margin-top: 12px;
  color: var(--text-secondary, #6b7280);
  font-size: 0.875rem;
  font-weight: 500;
}

.smart-pulse-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-secondary, #6b7280);
}

/* Deal Quality Badge */
.deal-quality-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  margin-bottom: 1rem;
}

.deal-quality-great {
  background: #10b981;
  color: white;
}

.deal-quality-good {
  background: #3b82f6;
  color: white;
}

.deal-quality-fair {
  background: #f59e0b;
  color: white;
}

.deal-quality-high {
  background: #ef4444;
  color: white;
}

.deal-quality-very-high {
  background: #dc2626;
  color: white;
}

.deal-quality-label {
  display: block;
}

.deal-quality-percentile {
  display: block;
  font-size: 0.875rem;
  opacity: 0.95;
  margin-top: 0.25rem;
}

.deal-quality-disclaimer {
  display: block;
  font-size: 0.75rem;
  opacity: 0.9;
  margin-top: 0.25rem;
}

/* History Chart */
.history-chart-container {
  margin-top: 1.5rem;
}

.history-chart-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #333;
}

.history-chart {
  max-height: 400px;
  width: 100%;
}

/* Loading Skeleton */
.history-loading-skeleton {
  min-height: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.history-loading-skeleton:empty {
  display: none;
}

.skeleton-history {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.skeleton-line {
  height: 20px;
  width: 100%;
  max-width: 100%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
}

.skeleton-chart {
  height: 300px;
  min-height: 300px;
  width: 100%;
  max-width: 100%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.history-empty {
  text-align: center;
  padding: 2rem;
  color: #666;
}

.history-error {
  padding: 1rem;
  background: #fee;
  color: #c33;
  border-radius: 4px;
}

.quality-bar-container {
  position: relative;
}

.quality-bar {
  position: relative;
  height: 8px;
  background: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 6px;
  transition: height 200ms ease;
}

.quality-bar:hover {
  height: 10px;
}

.quality-bar-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to right, #ef4444 0%, #f59e0b 50%, #10b981 100%);
}

.quality-arrow {
  position: absolute;
  top: -6px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #1f2937;
  transform: translateX(-50%);
  z-index: 10;
}

.quality-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
}

/* Buy Box - fixed width from grid (350px); compact padding for density */
.buy-box {
  position: sticky;
  top: clamp(80px, 10vh, 100px);
  align-self: start;
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - clamp(100px, 12vh, 120px));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.buy-box .smart-pulse-container {
  margin: 0;
}

.buy-box-content {
  background: white;
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transition: box-shadow 200ms ease, transform 200ms ease;
}

.buy-box-content:hover {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.buy-box-price-section {
  margin-bottom: 12px;
}

.buy-box-price-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.buy-box-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #dc2626;
  line-height: 1.2;
}

.buy-box-availability {
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
  margin-top: 6px;
}
.buy-box-availability--in { color: #059669; }
.buy-box-availability--low { color: #d97706; }
.buy-box-availability--out { color: #dc2626; }

.best-price-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #10b981;
  color: white;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.best-price-badge svg {
  width: 14px;
  height: 14px;
}

.price-comparison-tooltip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #10b981;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 4px;
}

.price-comparison-tooltip svg {
  width: 14px;
  height: 14px;
}

.buy-box-savings {
  margin-top: 8px;
}

.savings-badge {
  display: inline-block;
  background: #10b981;
  color: white;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
}

.buy-box-attribution {
  margin-bottom: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.buy-box-marketplace {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.buy-box-finder {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--muted);
}

.finder-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.finder-name {
  color: var(--muted);
}

.buy-box-button {
  display: block;
  width: 100%;
  padding: 16px 24px;
  background: #0B1129;
  color: white;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.125rem;
  border-radius: var(--radius);
  transition: background 200ms ease, transform 200ms ease;
}

.buy-box-button:hover {
  background: #0A0F24;
  transform: translateY(-1px);
}

.buy-box-button:active {
  transform: translateY(0);
}

/* Condition Filter */
.related-listings-header {
  margin-bottom: 20px;
}

.condition-filter-container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.filter-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.condition-filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.condition-filter-pill {
  padding: 6px 16px;
  border: 2px solid var(--border);
  border-radius: 9999px;
  background: white;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 200ms ease;
}

.condition-filter-pill:hover {
  border-color: var(--accent);
  background: rgba(124, 252, 0, 0.05);
}

.condition-filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 600;
}

.filter-count {
  margin-left: auto;
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
}

/* Offers Table */
.offers-table-container {
  overflow-x: auto;
  margin-top: 24px;
}

.offers-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
}

.offers-table thead {
  background: #f9fafb;
  border-bottom: 2px solid var(--border);
}

.offers-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.offers-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 150ms ease, transform 100ms ease;
}

.offers-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

.offers-table tbody tr:hover {
  background: #f3f4f6;
  transform: scale(1.01);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.offers-table td {
  padding: 16px;
  vertical-align: middle;
}

.offer-source {
  font-weight: 600;
}

.marketplace-label {
  color: var(--text);
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.marketplace-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.marketplace-icon svg {
  width: 100%;
  height: 100%;
}

.current-offer {
  background: #fef3c7 !important;
  border-left: 3px solid var(--accent);
}

.best-deal {
  background: #dcfce7 !important;
  border-left: 3px solid #10b981;
  font-weight: 600;
}

.best-deal-badge {
  display: inline-block;
  background: #10b981;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 8px;
}

.offer-condition {
  min-width: 100px;
}

.condition-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.condition-new {
  background: #dcfce7;
  color: #166534;
}

.condition-like-new {
  background: #dbeafe;
  color: #1e40af;
}

.condition-very-good {
  background: #fef3c7;
  color: #92400e;
}

.condition-good {
  background: #fde68a;
  color: #78350f;
}

.condition-acceptable {
  background: #fee2e2;
  color: #991b1b;
}

.condition-n\/a {
  background: #e5e7eb;
  color: #374151;
}

.offer-finder {
  min-width: 150px;
}

.finder-credit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.finder-avatar-small {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.finder-name-small {
  font-size: 0.875rem;
  color: var(--muted);
}

.offer-price {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.offer-savings {
  min-width: 100px;
}

.savings-text {
  color: #10b981;
  font-weight: 600;
  font-size: 0.875rem;
}

.offer-action {
  text-align: right;
}

.view-deal-btn {
  display: inline-block;
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 200ms ease, transform 200ms ease;
  white-space: nowrap;
}

.view-deal-btn:hover {
  background: #e68900;
  transform: translateY(-1px);
}

.view-deal-btn:active {
  transform: translateY(0);
}

/* Related Listings Section */
.related-listings-section {
  margin-top: 48px;
  padding: 32px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.related-listings-section h2 {
  margin: 0 0 8px 0;
  font-size: 1.75rem;
}

.section-description {
  margin: 0 0 32px 0;
  color: var(--muted);
  font-size: 1rem;
}

/* Price Visualization */
.price-visualization {
  margin-bottom: 32px;
}

.price-viz-header {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.price-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: #f9fafb;
  border-radius: var(--radius-sm);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.price-chart {
  position: relative;
  height: 80px;
  background: linear-gradient(to right, #10b981 0%, #fbbf24 50%, #ef4444 100%);
  border-radius: var(--radius);
  padding: 0 8px;
}

.price-bar {
  position: absolute;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
  cursor: pointer;
  transition: transform 200ms ease;
}

.price-bar:hover {
  transform: translateX(-50%) translateY(-50%) scale(1.1);
  z-index: 10;
}

.price-bar.current .price-marker {
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

.price-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  min-width: 80px;
}

.price-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.condition-label {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Related Listings Grid */
.related-listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.listing-card {
  display: flex;
  flex-direction: column;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 200ms ease, box-shadow 200ms ease;
  position: relative;
}

.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.listing-card.current-listing {
  border-color: var(--accent);
  border-width: 2px;
}

.listing-card.highlight {
  animation: highlight-pulse 1s ease-in-out;
}

@keyframes highlight-pulse {
  0%, 100% {
    box-shadow: var(--shadow);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(124, 252, 0, 0.3), var(--shadow-hover);
  }
}

.current-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent);
  color: white;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 1;
}

.listing-image {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: #f9fafb;
}

.listing-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.listing-info {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.listing-marketplace {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.listing-condition {
  font-size: 0.875rem;
  color: var(--text);
}

.listing-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.listing-votes {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  color: var(--muted);
}

.listing-votes svg {
  color: #10b981;
}

.listing-buy-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: white;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: background 200ms ease;
}

.listing-buy-btn:hover {
  background: var(--accent-hover);
}

.view-details-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: transparent;
  color: #6b7280;
  border: 1px solid #e5e7eb;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  border-radius: 6px;
  transition: all 200ms ease;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  min-height: 40px;
}

.view-details-button:hover {
  background: rgba(0, 0, 0, 0.02);
  border-color: #e5e7eb;
  color: #374151;
}

.product-card-actions .buy-button {
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  text-align: center;
  letter-spacing: 0.75px;
  font-size: 13px;
  text-shadow: none;
  text-transform: none;
  border-radius: 12px;
  padding: 10px 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  background: var(--navy-deep);
  color: var(--lime-vibrant);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.product-card-actions .buy-button:hover {
  background: #0A0F24;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(31, 219, 0, 0.25);
}

@media (max-width: 768px) {
  .loading-skeleton {
    grid-template-columns: 1fr;
  }
  
  /* Product detail loading only — grid skeleton cards use 4:3 aspect-ratio */
  .loading-skeleton > .skeleton-image {
    height: 300px;
  }
  
  .product-detail-title {
    font-size: 1.5rem;
  }
  
  .price-value {
    font-size: 1.75rem;
  }
  
  .price-viz-header {
    grid-template-columns: 1fr;
  }
  
  .product-detail-actions-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .product-detail-voting {
    width: 100%;
    justify-content: center;
  }
  
  .product-share-buttons {
    width: 100%;
    justify-content: center;
  }
  
  .buy-box-price {
    font-size: 1.875rem;
  }
  
  .buy-box-button {
    font-size: 1rem;
    padding: 14px 20px;
  }
  
  .offers-table-container {
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
  }
  
  .offers-table {
    min-width: 600px;
  }
  
  .offers-table th,
  .offers-table td {
    padding: 12px 8px;
    font-size: 0.875rem;
  }
  
  .product-card-actions {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .breadcrumb {
    font-size: 0.75rem;
  }
  
  .product-detail-container {
    padding: 16px 12px;
  }
  
  .related-listings-section {
    padding: 16px;
  }
  
  .related-listings-section h2 {
    font-size: 1.5rem;
  }
  
  .product-detail-title {
    font-size: 1.25rem;
  }
  
  .buy-box-content {
    padding: 20px;
  }
  
  .buy-box-price {
    font-size: 1.5rem;
  }
  
  .deal-quality-score-container {
    padding: 16px;
  }
  
  .offers-table {
    min-width: 500px;
  }
  
  .offers-table th,
  .offers-table td {
    padding: 10px 6px;
    font-size: 0.8125rem;
  }
  
  .view-deal-btn {
    padding: 6px 12px;
    font-size: 0.8125rem;
  }
  
  .price-chart {
    height: 60px;
  }
}

.account-sidebar .sidebar-nav {
  padding: 0px 0 8px; /* Ensure top padding is 0 */
}

/* Suggestions Dropdown Styles */
.suggestions-dropdown {
  width: 100%;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: absolute;
  /* top will be set by JavaScript */
  left: 0;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 5; /* Above form background but below input */
  margin-top: 0; /* Remove margin, positioning handled by JS */
  display: none; /* Hidden by default, shown via JavaScript */
}

.suggestion-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.suggestion-item:hover, .suggestion-item.selected {
  background: #f0f8ff;
}

.suggestion-item:last-child {
  border-bottom: none;
}

/* Score indicator circles for admin product name review */
.score-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.score-indicator.score-green {
  background-color: #10b981; /* Green */
}

.score-indicator.score-yellow {
  background-color: #f59e0b; /* Yellow/Amber */
}

.score-indicator.score-orange {
  background-color: #f97316; /* Orange */
}

.score-indicator.score-red {
  background-color: #ef4444; /* Red */
}

/* ==================== PRODUCT NORMALIZATION STYLES ==================== */

.normalization-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}

.manual-merge-controls {
  margin-bottom: 24px;
}

.segmented-control {
  display: flex;
  gap: 0;
  background: var(--background-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px;
}

.segmented-control .tab-btn {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.segmented-control .tab-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.segmented-control .tab-btn.active {
  background: white;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.count-badge {
  background: var(--background-secondary);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.segmented-control .tab-btn.active .count-badge {
  background: var(--accent);
  color: white;
}

.normalization-tabs .tab-btn {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s;
  font-size: 1rem;
}

.normalization-tabs .tab-btn:hover {
  color: var(--text);
  background: var(--background-secondary);
}

.normalization-tabs .tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: block;
}

.suggestion-group-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
  background: white;
  transition: box-shadow 0.2s;
}

.suggestion-group-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.suggestion-product-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: var(--background-secondary);
  transition: transform 0.2s, box-shadow 0.2s;
}

.suggestion-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#mergeSearchResults {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 300px;
  overflow-y: auto;
}

#mergeSearchResults > div {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}

#mergeSearchResults > div:hover {
  background: var(--background-secondary);
}

#mergeSearchResults > div:last-child {
  border-bottom: none;
}

#sourceProductCard,
#targetProductCard {
  padding: 16px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: border-color 0.2s;
}

#sourceProductCard:hover,
#targetProductCard:hover {
  border-color: var(--accent);
}

#mergeProductsBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
}

#mergeProductsBtn:not(:disabled):hover {
  background: #059669 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

/* Merge Product Cards */
.merge-product-card {
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.merge-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--accent);
}

.merge-product-card.selected {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.merge-product-card.selected:hover {
  border-color: #059669;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.merge-product-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.merge-product-details {
  flex: 1;
  min-width: 0;
}

/* Floating Merge Button */
#floatingMergeButton {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#floatingMergeButton button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4) !important;
}

#floatingMergeButton button:active {
  transform: translateY(0);
}

/* Responsive adjustments for merge interface */
@media (max-width: 768px) {
  #mergeProductsList {
    grid-template-columns: 1fr !important;
  }
  
  #floatingMergeButton {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }
  
  #floatingMergeButton button {
    width: 100%;
  }
}

/* SEO: crawlable internal links (homepage) — compact list + condition shortcuts */
.homepage-condition-seo-links {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--redesign-ink-500, #5a6076);
}

.homepage-condition-seo-links .seo-condition-links-label {
  margin-right: 0.35rem;
}

.homepage-condition-seo-links a {
  color: var(--redesign-ink-700, #2b3142);
  text-decoration: underline;
}

.homepage-condition-seo-links .seo-condition-sep {
  margin: 0 0.35rem;
}

.seo-internal-product-links {
  margin: 1.25rem 0;
}

.seo-internal-product-links-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.35rem 1rem;
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  line-height: 1.35;
}

.seo-internal-product-links-list a {
  color: var(--redesign-ink-700, #2b3142);
  text-decoration: underline;
}

.seo-internal-product-links-list a:hover {
  color: var(--redesign-navy-800, #111a3a);
}
