:root {
  --ink: #111827;
  --ink-soft: #4b5563;
  --muted: #6b7280;
  --paper: #fbfaf7;
  --paper-2: #f4f1ea;
  --accent: #0f766e;
  --accent-2: #f59e0b;
  --accent-3: #0ea5e9;
  --card: #ffffff;
  --border: #e5e7eb;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.versus-app {
  font-family: "Poppins", "Segoe UI", sans-serif;
  color: var(--ink);
  padding: 10px 0 40px;
}

.versus-hero {
  background: radial-gradient(1200px 600px at 10% -10%, #fff7ed 0%, rgba(255, 247, 237, 0) 60%),
    radial-gradient(800px 400px at 90% 10%, #ecfeff 0%, rgba(236, 254, 255, 0) 55%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px;
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  box-shadow: var(--shadow);
}

.versus-hero h1 {
  font-size: 34px;
  line-height: 1.15;
  margin: 6px 0 12px;
}

.versus-hero p {
  color: var(--ink-soft);
  font-size: 15px;
  margin-bottom: 16px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}

.versus-search {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.versus-search input {
  flex: 1 1 220px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
}

.button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button.secondary {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.button.ghost {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--ink-soft);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.18);
}

.hero-panels {
  display: grid;
  gap: 14px;
}

.hero-panel {
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--border);
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 600;
}

.section-title {
  margin: 34px 0 18px;
  font-size: 22px;
  font-weight: 600;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 18px;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.bc-sep {
  color: var(--border);
}

.bc-current {
  font-weight: 600;
  color: var(--ink);
}

.bc-count {
  color: var(--muted);
  font-size: 13px;
}

.category-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.filter-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 120px;
}

.filter-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 20px;
  align-items: start;
}

.filter-panel h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.filter-groups {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.filter-group {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: #f8fafc;
}

.filter-group h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--ink);
}

.filter-values a {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 10px;
}

.filter-values a:hover {
  background: #e2e8f0;
  color: var(--ink);
}

.filter-chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 12px;
  margin-right: 6px;
}

.filter-chip a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.category-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.category-card .meta {
  color: var(--muted);
  font-size: 12px;
}

.category-card-header {
  display: block;
  text-decoration: none;
  color: var(--ink);
}

.category-card-products {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category-card-products a {
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-card-products a:hover {
  color: var(--accent);
}

.card-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.product-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  transition: box-shadow .15s;
}

.product-card:hover {
  box-shadow: 0 4px 14px rgba(15,23,42,.12);
}

/* full-card link (homepage / filter pages — card IS the <a>) */
a.product-card.product-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  padding: 16px;
  gap: 10px;
}

/* inner link (category listing — card is <div>, link wraps content) */
.product-card .product-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  padding: 16px 16px 10px;
  gap: 10px;
}

.product-card h3 {
  font-size: 16px;
  margin: 0;
}

.product-card .tag {
  font-size: 12px;
  background: #e0f2fe;
  color: #0369a1;
  border-radius: 999px;
  padding: 4px 10px;
  display: inline-block;
}

.product-thumb {
  width: 100%;
  height: 170px;
  object-fit: contain;
  background: #f8fafc;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 8px;
}

/* per-category aspect ratio tweaks */
[data-category="phone"] .product-thumb            { height: 190px; }
[data-category="tv"] .product-thumb,
[data-category="monitor"] .product-thumb          { height: 130px; }
[data-category="laptop"] .product-thumb           { height: 140px; }
[data-category="car"] .product-thumb              { height: 140px; }
[data-category="tablet"] .product-thumb           { height: 150px; }
[data-category="smartwatch"] .product-thumb       { height: 140px; }

/* compare button pinned to bottom-right of card */
.compare-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  z-index: 1;
  transition: background .15s;
}
.compare-btn:hover { background: #0a5e58; }

/* ── Product hero (category listing header) ── */
.product-hero {
  background: linear-gradient(140deg, #0f766e 0%, #0ea5e9 100%);
  color: #fff;
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: center;
}

.product-hero .hero-media {
  text-align: right;
}

.product-hero .hero-media img {
  width: 100%;
  max-width: 260px;
  border-radius: 18px;
  background: #ffffff;
  padding: 12px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.25);
}

/* ── Product detail hero: tall image on top, centered ── */
.product-detail-hero {
  grid-template-columns: 1fr !important;
  text-align: center;
}

.product-detail-hero .hero-media {
  text-align: center !important;
  order: -1;
}

.product-detail-hero .hero-media img {
  max-width: 160px !important;
  height: 380px;
  object-fit: contain;
  margin: 0 auto;
}

/* hero image: landscape categories get a wide, short box */
.product-detail-hero[data-category="tv"] .hero-media img,
.product-detail-hero[data-category="monitor"] .hero-media img {
  max-width: 340px !important;
  height: 220px;
}
/* laptop: slightly wider than phone */
.product-detail-hero[data-category="laptop"] .hero-media img {
  max-width: 280px !important;
  height: 260px;
}

/* similar-thumb: landscape categories get wider, shorter thumbnails */
[data-category="tv"] .similar-thumb,
[data-category="monitor"] .similar-thumb {
  width: 120px;
  height: 74px;
}
[data-category="laptop"] .similar-thumb {
  width: 100px;
  height: 90px;
}

.product-detail-hero .hero-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.product-detail-hero .hero-info h1 {
  font-size: 28px;
}

.product-detail-hero .eyebrow {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.product-detail-hero .eyebrow a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Stats row ── */
.stats-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.product-hero h1 {
  margin: 0 0 10px;
  font-size: 30px;
}

.product-hero .meta {
  font-size: 13px;
  opacity: 0.9;
}

/* ── Section cards ── */
.section-card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 18px;
  margin-bottom: 16px;
}

.section-card h2 {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 700;
}

/* ── Product-detail spec table ── */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.spec-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}

.spec-table td:first-child {
  color: var(--muted);
  width: 40%;
}

/* ── Tooltip info icon (ℹ) ── */
.spec-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  font-size: 10px;
  font-style: italic;
  cursor: pointer;
  margin-left: 5px;
  position: relative;
  vertical-align: middle;
  transition: background 0.15s;
}

.spec-info:hover {
  background: #d1d5db;
}

/* JS-positioned tooltip (appended to body) */
.tooltip-box {
  position: fixed;
  background: #1f2937;
  color: #fff;
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-style: normal;
  white-space: normal;
  width: 220px;
  max-width: 90vw;
  z-index: 9999;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

/* arrow: up (tooltip is above the icon) */
.tooltip-box[data-dir="up"]::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: var(--arrow-x, 50%);
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1f2937;
}

/* arrow: down (tooltip is below the icon) */
.tooltip-box[data-dir="down"]::after {
  content: "";
  position: absolute;
  top: -5px;
  left: var(--arrow-x, 50%);
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: #1f2937;
}

/* ── FAQ / Q&A section ── */
.faq-section {
  margin-top: 28px;
}
.faq-section > h2 {
  font-size: 17px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 12px;
}
.faq-item {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 15px 17px;
  margin-bottom: 8px;
}
.faq-item .faq-q {
  font-weight: 600;
  font-size: 14px;
  color: #1f2937;
  margin-bottom: 5px;
}
.faq-item .faq-a {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.55;
}

/* ── Link styling for FAQ and descriptions ── */
.faq-a a,
.product-description-generated a,
.product-description-section a {
  color: #0ea5e9;
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s ease;
}

.faq-a a:hover,
.product-description-generated a:hover,
.product-description-section a:hover {
  color: #0284c7;
  text-decoration: underline;
}

/* ── Filter description ── */
.filter-description {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.6;
}

.filter-description p {
  margin: 0 0 12px 0;
}

.filter-description p:last-child {
  margin-bottom: 0;
}

.filter-description a {
  color: #0284c7;
  text-decoration: none;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.filter-description a:hover {
  background-color: rgba(2, 132, 199, 0.1);
  text-decoration: underline;
}

/* ── Comparison page: product image row ── */
.compare-phones-header {
  display: flex;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.compare-phone-col {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.compare-phone-col img {
  width: 100%;
  max-width: 100px;
  height: 240px;
  object-fit: contain;
  background: #f8fafc;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 10px;
  display: block;
  margin: 0 auto;
}

.compare-phone-placeholder {
  width: 100px;
  height: 240px;
  background: #f0f4f8;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin: 0 auto;
}

.compare-phone-col h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 12px 0 0;
  color: var(--ink);
}

.compare-phone-col h3 a {
  color: var(--ink);
  text-decoration: none;
}

.compare-phone-col h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ── Comparison hero banner ── */
.compare-hero {
  background: #0f172a;
  color: #fff;
  border-radius: 24px;
  padding: 22px;
  margin-bottom: 20px;
}

/* ── Comparison table wrapper (enables horiz-scroll on mobile) ── */
.compare-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Comparison table ── */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 100%;
  table-layout: fixed;
}

/* Fixed first-column width so all section tables align */
.compare-table th:first-child,
.compare-table td.metric {
  width: 200px;
  min-width: 180px;
}

.compare-table th,
.compare-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  vertical-align: top;
  overflow-wrap: break-word;
  word-break: break-word;
}

.compare-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
}

.compare-table td.value {
  font-weight: 600;
  color: var(--ink);
  text-align: left;
}

.compare-table td.value.value-bool {
  text-align: center;
}

.compare-table .metric {
  color: var(--muted);
  font-size: 13px;
}

/* ── Winner highlighting ── */
.compare-table td.value.winner {
  background: #f0fdf4;
  border-radius: 6px;
}

.compare-table td.value.winner-strong {
  background: #dcfce7;
}

/* "Best" badge */
.badge-best {
  display: inline-block;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #16a34a;
  color: #fff;
  padding: 1px 5px;
  border-radius: 999px;
  margin-left: 5px;
  vertical-align: middle;
}

/* Diff label e.g. "⬆ 34% better" — same line as badge */
.diff-label {
  display: inline-block;
  font-size: 11px;
  color: #16a34a;
  font-weight: 600;
  margin-left: 4px;
  vertical-align: middle;
  white-space: nowrap;
}

/* ── Progress bar ── */
.progress-bar {
  height: 5px;
  background: #e5e7eb;
  border-radius: 3px;
  margin-top: 7px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  min-width: 4px;
}

.compare-table td.value.winner .progress-bar-fill {
  background: #16a34a;
}

/* ── Ranking stats summary ── */
.ranking-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin: 24px 0;
  padding: 20px;
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.stat-item {
  text-align: center;
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
}

@media (max-width: 480px) {
  .ranking-stats {
    gap: 12px;
    padding: 16px;
  }
  .stat-value {
    font-size: 18px;
  }
}

/* ── Ranking table ── */
.ranking-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 24px;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 480px;
}

.ranking-table th,
.ranking-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  vertical-align: middle;
}

.ranking-table thead th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--paper-2);
  position: sticky;
  top: 0;
  z-index: 1;
}

.ranking-table tbody tr:nth-child(even) {
  background: #fafafa;
}

.ranking-table tbody tr:hover {
  background: #f0fdf4;
}

.ranking-table .rank-col {
  width: 56px;
  text-align: center;
  font-weight: 700;
  color: var(--muted);
  font-size: 15px;
}

/* Gold / silver / bronze for top 3 */
.ranking-table tbody tr:nth-child(1) .rank-col { color: #b8860b; }
.ranking-table tbody tr:nth-child(2) .rank-col { color: #71706e; }
.ranking-table tbody tr:nth-child(3) .rank-col { color: #cd7f32; }

.ranking-table .name-col {
  font-weight: 600;
  color: var(--ink);
}

.ranking-table .name-col a {
  color: var(--ink);
  text-decoration: none;
}

.ranking-table .name-col a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.ranking-table .value-col {
  text-align: right;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ── Compare bar (fixed bottom) ── */
.compare-bar {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 24px;
  background: #111827;
  color: #fff;
  border-radius: 18px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
  z-index: 50;
}

.compare-bar-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compare-bar-label {
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.compare-bar .slots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 22px;
}

.compare-chip {
  background: rgba(255, 255, 255, 0.12);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.compare-chip--locked {
  background: rgba(255, 255, 255, 0.22);
  font-weight: 600;
}

.chip-remove {
  cursor: pointer;
  opacity: 0.6;
  font-size: 15px;
  line-height: 1;
}

.chip-remove:hover {
  opacity: 1;
}

/* Search input inside compare bar */
.compare-search-wrap {
  flex: 1;
  position: relative;
  min-width: 0;
}

.compare-search-wrap input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  outline: none;
}

.compare-search-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.compare-search-wrap input:focus {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
}

/* Dropdown opens ABOVE the input */
.compare-search-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  top: auto;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.24);
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
}

.compare-search-item {
  padding: 9px 14px;
  font-size: 13px;
  color: #111827;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
}

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

.compare-search-item:hover {
  background: #f0fdf4;
  color: var(--accent);
}

.compare-search-item.no-results {
  color: #6b7280;
  font-style: italic;
  cursor: default;
}

/* Compare-bar action buttons */
.compare-bar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.compare-bar-actions button {
  border: none;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.compare-bar-actions #compareGo {
  background: #f59e0b;
  color: #111827;
}

.compare-bar-actions #compareClear {
  background: #374151;
  color: #fff;
}

/* Notification toast */
.compare-notify {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  padding: 10px 22px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.compare-notify.show {
  opacity: 1;
}

/* ── Similar-products scroll strip ── */
.similar-strip-outer {
  display: flex;
  align-items: center;
  gap: 4px;
}

.similar-strip-wrap {
  flex: 1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 4px 12px;
  scroll-behavior: smooth;
}

.similar-strip-wrap::-webkit-scrollbar {
  height: 4px;
}

.similar-strip-wrap::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 3px;
}

.similar-strip {
  display: flex;
  gap: 12px;
  width: max-content;
}

.similar-item {
  width: 120px;
  text-align: center;
  flex-shrink: 0;
  position: relative;
}

.similar-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: opacity .15s;
}
.similar-link:hover { opacity: .8; }

.similar-thumb {
  width: 82px;
  height: 100px;
  object-fit: contain;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 6px;
  display: block;
  margin: 0 auto;
}

.similar-name {
  font-size: 12px;
  color: #4b5563;
  margin: 6px 0 6px;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.similar-add {
  background: var(--accent);
  color: #fff;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 17px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background .15s;
}

.similar-add:hover {
  background: #0a5e58;
}

/* scroll arrows */
.similar-arrow {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--ink-soft);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.similar-arrow:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #f0fdfc;
}

/* Stat-card progress bar */
.stat-card .progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  margin-top: 8px;
  overflow: hidden;
}

.stat-card .progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #14b8a6);
  border-radius: 4px;
}

.stat-bar-label {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  text-decoration: none;
  transition: color .15s;
}
a.stat-bar-label:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 28px;
}

.pagination a,
.pagination .pg-nav,
.pagination .pg-current,
.pagination .pg-dots,
.pagination .pg-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--ink-soft);
  background: #fff;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #f0fdfc;
}

.pg-current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff !important;
  font-weight: 600;
  cursor: default;
}

.pg-dots {
  border: none;
  background: transparent;
  min-width: 20px;
  color: var(--muted);
  cursor: default;
}

.pg-nav {
  font-weight: 500;
  gap: 4px;
}

.pg-disabled {
  opacity: .38;
  cursor: default;
  pointer-events: none;
}

/* ── Notice ── */
.notice {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #92400e;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
}

/* ─────────────── RESPONSIVE ─────────────── */
@media (max-width: 768px) {
  .versus-hero {
    padding: 22px;
  }

  .product-hero h1 {
    font-size: 24px;
  }

  .product-hero {
    grid-template-columns: 1fr;
  }

  .product-hero .hero-media {
    text-align: left;
  }

  .product-detail-hero .hero-media {
    text-align: center;
  }

  .product-detail-hero .hero-media img {
    height: 260px;
  }

  .filter-layout {
    grid-template-columns: 1fr;
  }

  /* Phone image row: 2-up grid on mobile */
  .compare-phones-header {
    flex-wrap: wrap;
    justify-content: center;
  }

  .compare-phone-col {
    flex: 1 1 calc(50% - 16px);
    max-width: calc(50% - 16px);
  }

  .compare-phone-col img,
  .compare-phone-placeholder {
    max-width: 80px;
    height: 160px;
  }

  /* Comparison table: force min-width so it scrolls horizontally */
  .compare-table {
    min-width: 380px;
  }

  .compare-table th:first-child,
  .compare-table td.metric {
    width: 130px;
    min-width: 110px;
  }

  .section-card h2 {
    font-size: 18px;
  }

  /* Compare bar */
  .compare-bar {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 10px 12px;
  }

  .compare-bar-top {
    flex-wrap: wrap;
  }

  .compare-bar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .ranking-table {
    font-size: 13px;
    min-width: 400px;
  }

  .ranking-table th,
  .ranking-table td {
    padding: 8px 10px;
  }

  /* Product grid: 2 columns on tablet */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  /* Category grid: 2 columns on tablet */
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* FAQ section */
  .faq-q {
    font-size: 16px;
  }

  .faq-a {
    font-size: 15px;
  }

  /* Hero sections */
  .versus-hero h1 {
    font-size: 28px;
  }

  /* Hide filter toggle on tablet (sidebar visible) */
  .filter-toggle {
    display: none;
  }
}

/* ── Extra-small screens ── */
@media (max-width: 480px) {
  .versus-hero {
    padding: 16px;
  }

  .product-detail-hero .hero-media img {
    height: 200px !important;
  }

  /* comparison image row: stack vertically */
  .compare-phone-col {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .compare-phone-col img,
  .compare-phone-placeholder {
    max-width: 70px !important;
    height: 120px !important;
  }

  /* shrink the metric column so more room for values */
  .compare-table th:first-child,
  .compare-table td.metric {
    width: 100px !important;
    min-width: 90px !important;
  }

  .compare-table {
    min-width: 300px !important;
  }

  .section-card {
    padding: 12px;
  }

  .compare-bar {
    left: 6px;
    right: 6px;
    bottom: 6px;
  }

  .compare-bar-label {
    font-size: 12px;
  }

  .ranking-table {
    font-size: 13px;
    min-width: 320px;
  }

  .versus-hero h1 {
    font-size: 26px;
  }

  .product-hero h1 {
    font-size: 22px;
  }

  /* Product grid: single column on very small screens */
  .product-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  /* FAQ section: better spacing */
  .faq-section {
    padding: 16px 0;
  }

  .faq-item {
    padding: 12px 0;
  }

  .faq-q {
    font-size: 15px;
    padding-right: 10px;
  }

  .faq-a {
    font-size: 14px;
    line-height: 1.6;
  }

  /* Category cards: single column */
  .category-grid {
    grid-template-columns: 1fr !important;
  }

  .category-card {
    padding: 14px;
  }

  /* Sidebar: hide on mobile, show as overlay when toggled */
  .filter-sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    width: 85%;
    max-width: 320px;
    background: var(--card);
    z-index: 999;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 4px 0 12px rgba(0,0,0,0.1);
  }

  .filter-sidebar.open {
    left: 0;
  }

  /* Filter toggle button */
  .filter-toggle {
    display: block !important;
    position: fixed;
    bottom: 80px;
    right: 16px;
    z-index: 998;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  }

  /* Overlay for sidebar */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
  }

  .sidebar-overlay.active {
    display: block;
  }
}

  .ranking-table .rank-col {
    width: 40px;
  }

  .ranking-table th,
  .ranking-table td {
    padding: 7px 6px;
  }
}

/* Product Description Section */
.product-description-section {
  max-width: 900px;
  margin: 40px auto;
  padding: 30px;
  background: var(--paper);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.product-description-generated p {
  margin: 0 0 16px 0;
  line-height: 1.7;
  color: var(--ink-soft);
  font-size: 15px;
}

.product-description-generated p:last-child {
  margin-bottom: 0;
}

.product-description-generated strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.product-description-generated a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.product-description-generated a:hover {
  border-bottom-color: var(--accent);
}

@media (max-width: 768px) {
  .product-description-section {
    margin: 30px 20px;
    padding: 20px;
  }
  
  .product-description-generated p {
    font-size: 14px;
  }
}

/* ===== MOBILE FILTERS FIX ===== */

/* Mobile filter toggle button */
.mobile-filter-toggle {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 90;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    transition: transform 0.2s;
}

.mobile-filter-toggle:active {
    transform: scale(0.95);
}

.mobile-filter-toggle .count {
    background: #ef4444;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    margin-left: 6px;
    font-weight: 700;
}

/* Mobile filter overlay */
.filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 95;
}

.filter-overlay.active {
    display: block;
}

/* Filter panel mobile state */
@media (max-width: 768px) {
    .mobile-filter-toggle {
        display: block;
    }

    .filter-layout {
        display: block !important;
    }

    .filter-panel {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 400px;
        height: 100vh;
        background: white;
        z-index: 100;
        transition: right 0.3s ease;
        overflow-y: auto;
        box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
        padding: 20px;
    }

    .filter-panel.active {
        right: 0;
    }

    .filter-panel-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 16px;
        border-bottom: 2px solid #e5e7eb;
    }

    .filter-panel-header h3 {
        margin: 0;
        font-size: 20px;
    }

    .filter-close {
        background: none;
        border: none;
        font-size: 28px;
        color: #6b7280;
        cursor: pointer;
        padding: 0;
        line-height: 1;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .filter-close:hover {
        color: #1f2937;
    }

    /* Make filter groups collapsible on mobile */
    .filter-group {
        border-bottom: 1px solid #e5e7eb;
        margin-bottom: 0 !important;
    }

    .filter-group h4 {
        padding: 16px 0;
        margin: 0;
        cursor: pointer;
        user-select: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .filter-group h4::after {
        content: '▼';
        font-size: 12px;
        color: #6b7280;
        transition: transform 0.2s;
    }

    .filter-group.collapsed h4::after {
        transform: rotate(-90deg);
    }

    .filter-group.collapsed .filter-values {
        display: none;
    }

    .filter-values {
        padding-bottom: 12px;
    }

    /* Product grid takes full width on mobile */
    .product-list {
        width: 100% !important;
        margin-left: 0 !important;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .filter-panel {
        width: 240px;
    }
}
