/* ============ COMPARIX — STYLE ============ */
:root {
  --red: #e63946;
  --red-dark: #c0303d;
  --green: #2a9d8f;
  --navy: #0a1628;
  --navy-light: #132240;
  --teal: #00b4d8;
  --gold: #f4a261;
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1a1a2e;
  --text-light: #636e72;
  --border: #e1e5ee;
  --shadow: 0 2px 12px rgba(10,22,40,0.06);
  --shadow-lg: 0 8px 32px rgba(10,22,40,0.1);
  --radius: 14px;
  --radius-sm: 10px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration: none; }
.container { max-width: 800px; margin: 0 auto; padding: 0 1rem; }
.text-red { color: var(--red); }

/* ============ HEADER ============ */
#header {
  background: var(--navy);
  padding: 1rem;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.2);
}
.header-inner { display: flex; align-items: center; justify-content: center; gap: 0.75rem; position: relative; }
.header-back {
  position: absolute;
  left: 0;
  color: rgba(255,255,255,0.5);
  font-size: 1rem;
  padding: 0.5rem;
  transition: color 0.2s;
  text-decoration: none;
}
.header-back:hover { color: #fff; }
.logo {
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
}
.logo-accent { color: var(--teal); }
.tagline { font-size: 0.75rem; color: rgba(255,255,255,0.5); font-weight: 500; }

/* ============ HERO STATS ============ */
#hero-stats {
  background: linear-gradient(135deg, var(--navy) 0%, #0e2a4a 100%);
  padding: 2.5rem 0 2rem;
  text-align: center;
}
#hero-stats h1 {
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.hero-sub {
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}
.kpi-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.kpi-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 1rem 0.75rem;
  backdrop-filter: blur(10px);
}
.kpi-card.kpi-red { border-color: rgba(230,57,70,0.4); background: rgba(230,57,70,0.1); }
.kpi-value {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--teal);
  line-height: 1;
  margin-bottom: 0.2rem;
}
.kpi-card.kpi-red .kpi-value { color: var(--red); }
.kpi-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.hero-share-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.btn-share {
  border: none;
  border-radius: 50px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-share:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn-whatsapp { background: #25D366; padding: 0.6rem 1.2rem; }
.btn-fb { background: #1877F2; padding: 0.6rem 0.8rem; }
.btn-insta { background: linear-gradient(45deg, #f09433, #dc2743, #bc1888); padding: 0.6rem 0.8rem; }
.btn-tiktok { background: #000; padding: 0.6rem 0.8rem; }
.btn-x { background: rgba(255,255,255,0.15); padding: 0.6rem 0.8rem; }

/* ============ SEARCH ============ */
#search-section {
  padding: 1.5rem 0 0.75rem;
  position: sticky;
  top: 52px;
  background: var(--bg);
  z-index: 50;
  border-bottom: 1px solid var(--border);
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 50px;
  padding: 0.6rem 1rem;
  transition: border-color var(--transition);
}
.search-bar:focus-within { border-color: var(--teal); }
.search-bar i { color: var(--text-light); font-size: 0.9rem; }
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.9rem;
  font-family: inherit;
  background: transparent;
  color: var(--text);
}
.search-bar input::placeholder { color: var(--text-light); }
.search-clear {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
}
.filter-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}
.filter-btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--card);
  color: var(--text-light);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.results-count {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.5rem;
  font-weight: 500;
}

/* ============ PRODUCTS LIST ============ */
#products-section { padding: 1rem 0 2rem; }
.products-list { display: flex; flex-direction: column; gap: 0.75rem; }

.product-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all var(--transition);
}
.product-card:hover { box-shadow: var(--shadow-lg); }

.product-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}
.product-diff-badge {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  line-height: 1;
}
.product-diff-badge .diff-value { font-size: 1.1rem; }
.product-diff-badge .diff-label { font-size: 0.55rem; font-weight: 600; margin-top: 0.15rem; }
.badge-expensive { background: rgba(230,57,70,0.1); color: var(--red); }
.badge-cheaper { background: rgba(42,157,143,0.1); color: var(--green); }
.badge-similar { background: rgba(99,110,114,0.08); color: var(--text-light); }

.product-info { flex: 1; min-width: 0; }
.product-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 0.2rem;
}
.product-brand {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.product-weight {
  font-size: 0.7rem;
  color: var(--text-light);
}

.product-prices {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  text-align: right;
}
.price-mq {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--red);
}
.price-vs { font-size: 0.65rem; color: var(--text-light); }
.price-metro {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: rgba(0,0,0,0.015);
  border-top: 1px solid var(--border);
}
.confidence {
  font-size: 0.65rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.confidence-bar {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}
.confidence-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--teal);
}
.product-share-btn {
  border: none;
  background: none;
  color: var(--text-light);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  border-radius: 50px;
  transition: all var(--transition);
}
.product-share-btn:hover {
  background: #25D366;
  color: #fff;
}

/* ============ NO RESULTS ============ */
.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
}
.no-results i { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.3; }
.no-results p { font-size: 0.9rem; }

/* ============ TOP CHART ============ */
#top-section {
  padding: 2rem 0;
  background: var(--card);
  border-top: 1px solid var(--border);
}
#top-section h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 1.5rem;
}
#top-section h2 i { color: var(--red); margin-right: 0.3rem; }
.top-chart { display: flex; flex-direction: column; gap: 0.6rem; }
.top-bar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.top-bar-rank {
  width: 24px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-light);
  text-align: center;
  flex-shrink: 0;
}
.top-bar-info { flex: 1; min-width: 0; }
.top-bar-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-bar-track {
  height: 24px;
  background: rgba(230,57,70,0.06);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 0.2rem;
  position: relative;
}
.top-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--red), #ff6b7a);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.5rem;
  min-width: 40px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.top-bar-value {
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}
.top-bar-prices {
  font-size: 0.65rem;
  color: var(--text-light);
  flex-shrink: 0;
  text-align: right;
  min-width: 90px;
}

/* ============ METHODOLOGY ============ */
#method-section {
  padding: 2rem 0;
  background: var(--bg);
}
#method-section h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 1.5rem;
}
#method-section h2 i { color: var(--teal); margin-right: 0.3rem; }
.method-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.method-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  border: 1px solid var(--border);
}
.method-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(0,180,216,0.1);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}
.method-card h3 { font-size: 0.85rem; font-weight: 700; color: var(--navy); margin-bottom: 0.3rem; }
.method-card p { font-size: 0.75rem; color: var(--text-light); line-height: 1.5; }
.method-card strong { color: var(--text); }

/* ============ FOOTER ============ */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.8rem;
}
footer strong { color: #fff; }
.footer-small { font-size: 0.7rem; margin-top: 0.25rem; }

/* ============ SHARE POPUP ============ */
.share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,22,40,0.5);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.share-overlay.open { opacity: 1; pointer-events: auto; }
.share-sheet {
  background: #fff;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 1.25rem;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.share-overlay.open .share-sheet { transform: translateY(0); }
.share-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 1rem; }
.share-sheet h3 { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 0.5rem; }
.share-sheet h3 i { margin-right: 0.3rem; }
.share-preview {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.5;
  padding: 0.6rem;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 1rem;
  max-height: 80px;
  overflow-y: auto;
}
.share-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}
.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem;
  border: none;
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  transition: all var(--transition);
}
.share-btn:hover { background: var(--border); }
.share-btn i { font-size: 1.3rem; }
.share-btn span { font-size: 0.6rem; font-weight: 600; color: var(--text-light); }
.share-btn[data-network="whatsapp"] i { color: #25D366; }
.share-btn[data-network="facebook"] i { color: #1877F2; }
.share-btn[data-network="instagram"] i { background: linear-gradient(45deg, #f09433, #dc2743, #bc1888); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.share-btn[data-network="tiktok"] i { color: #000; }
.share-btn[data-network="twitter"] i { color: #000; }
.share-btn[data-network="telegram"] i { color: #0088cc; }
.share-btn[data-network="native"] i { color: var(--teal); }
.share-btn[data-network="copy"] i { color: var(--navy); }

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ RESPONSIVE ============ */
@media (max-width: 480px) {
  .kpi-row { gap: 0.5rem; }
  .kpi-value { font-size: 1.5rem; }
  .product-diff-badge { width: 54px; height: 54px; }
  .product-diff-badge .diff-value { font-size: 0.95rem; }
  .price-mq { font-size: 1rem; }
  .method-grid { grid-template-columns: 1fr; }
  .top-bar-prices { min-width: 70px; }
}
@media (min-width: 600px) {
  #hero-stats h1 { font-size: 2rem; }
  .kpi-row { grid-template-columns: repeat(4, 1fr); }
}
