/* ═══════════════════════════════════════════════════════════════
   Guru del Chollo — Estilos principales
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Tema oscuro (por defecto) */
:root, [data-theme="dark"] {
  --bg-body: #0a0a0a;
  --bg-card: #141414;
  --bg-card-hover: #1a1a1a;
  --bg-input: #1e1e1e;
  --bg-header: #111111;
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted: #555;
  --border: #222;
  --surface: #1a1a1a;
  --surface-light: #252525;
  --shadow-card: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-hover: 0 8px 32px rgba(0,0,0,0.5);
  --overlay-bg: rgba(0,0,0,0.7);
  --card-hover-border: #333;

  /* Shared (same in both themes) */
  --accent: #ff6b2c;
  --accent-hover: #ff8a55;
  --success: #00c853;
  --radius: 14px;
  --radius-sm: 8px;
  --max-width: 1280px;

  /* Deal level colors */
  --chollaco: #e53935;
  --chollazo: #ff9800;
  --buen-precio: #4caf50;
  --precio-minimo: #2196f3;
  --oferta: #9c27b0;
  --oferton: #ff5722;
}

/* Tema claro */
[data-theme="light"] {
  --bg-body: #f5f5f5;
  --bg-card: #ffffff;
  --bg-card-hover: #fafafa;
  --bg-input: #f0f0f0;
  --bg-header: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #555555;
  --text-muted: #999999;
  --border: #e0e0e0;
  --surface: #f8f8f8;
  --surface-light: #eeeeee;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
  --overlay-bg: rgba(0,0,0,0.4);
  --card-hover-border: #ccc;
}

[data-theme="light"] .header {
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ─── Header ──────────────────────────────────────────────────── */

.header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  height: 36px;
  width: auto;
  border-radius: 8px;
}

.logo-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent), #ffb74d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-tagline {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: -2px;
}

/* ─── Header Search ───────────────────────────────────────── */

.header-search {
  flex: 1;
  max-width: 420px;
  margin: 0 20px;
  position: relative;
  display: flex;
  align-items: center;
}
.header-search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}
.header-search input {
  width: 100%;
  padding: 10px 36px 10px 40px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.header-search input::placeholder { color: var(--text-muted); }
.header-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 44, 0.15);
}
.header-search-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}
.header-search-clear:hover { background: var(--surface-light); }

.header-nav { display: flex; gap: 12px; }

.nav-telegram {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #0088cc;
  color: #fff;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}
.nav-telegram:hover { background: #006daa; transform: translateY(-1px); }
.nav-telegram svg { flex-shrink: 0; }

/* ─── Filters Bar ─────────────────────────────────────────────── */

.filters-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.filters-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.filter-chips { display: flex; gap: 6px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}
.chip svg { flex-shrink: 0; }
.chip:hover { background: var(--surface-light); color: var(--text-primary); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.filter-select {
  padding: 6px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}
.filter-select option { background: var(--bg-input); }

/* ─── Stats Bar ───────────────────────────────────────────────── */

.stats-bar {
  border-bottom: 1px solid var(--border);
}

.stats-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px 24px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ─── Deals Grid ──────────────────────────────────────────────── */

.deals-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px;
  min-height: 60vh;
}

.deals-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ─── Deal Card ───────────────────────────────────────────────── */

.deal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.deal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--card-hover-border);
}

.deal-image-wrapper {
  position: relative;
  aspect-ratio: 1;
  background: #fff;
  overflow: hidden;
}

.deal-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  transition: transform 0.3s;
}
.deal-card:hover .deal-image { transform: scale(1.05); }

/* Badges en imagen */
.badge-discount {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
}
.badge-discount.chollaco  { background: var(--chollaco); }
.badge-discount.chollazo  { background: var(--chollazo); }
.badge-discount.buen-precio { background: var(--buen-precio); }
.badge-discount.precio-minimo { background: var(--precio-minimo); }
.badge-discount.oferta    { background: var(--oferta); }
.badge-discount.oferton   { background: var(--oferton); }

.badge-type {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-type.coupon { background: #fff3e0; color: #e65100; }
.badge-type.refurbished { background: #e8f5e9; color: #2e7d32; }
.badge-type.flash { background: #fff8e1; color: #f57f17; }

/* Card content */
.deal-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.deal-category {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.deal-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.deal-pricing {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.price-offer {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.price-original {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Coupon badge inline */
.deal-coupon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(255, 152, 0, 0.1);
  border: 1px dashed #ff9800;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #ff9800;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.deal-coupon:hover { background: rgba(255, 152, 0, 0.2); }
.deal-coupon .coupon-code {
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
}

.deal-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.btn-buy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, #ff9900, #e68a00);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-decoration: none;
}
.btn-buy:hover { background: linear-gradient(135deg, #ffad33, #ff9900); transform: translateY(-1px); }
.btn-buy svg { flex-shrink: 0; }

/* ─── Skeleton loader ─────────────────────────────────────────── */

.deal-card.skeleton {
  pointer-events: none;
}
.deal-card.skeleton .skeleton-img {
  aspect-ratio: 1;
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-light) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.deal-card.skeleton .skeleton-text {
  height: 14px;
  margin: 16px 16px 8px;
  border-radius: 4px;
  animation: shimmer 1.5s infinite;
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-light) 50%, var(--surface) 75%);
  background-size: 200% 100%;
}
.deal-card.skeleton .skeleton-text.short { width: 60%; }
.deal-card.skeleton .skeleton-price {
  height: 28px;
  margin: 8px 16px 16px;
  width: 40%;
  border-radius: 4px;
  animation: shimmer 1.5s infinite;
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-light) 50%, var(--surface) 75%);
  background-size: 200% 100%;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Empty state ─────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 80px 20px;
}
.empty-icon { font-size: 64px; display: block; margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); font-size: 15px; }

/* ─── Load more ───────────────────────────────────────────────── */

.load-more-wrapper {
  text-align: center;
  padding: 32px 0;
}

.btn-load-more {
  padding: 14px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-load-more:hover { background: var(--bg-card-hover); border-color: var(--card-hover-border); transform: translateY(-2px); }
.btn-load-more:disabled { opacity: 0.5; cursor: default; transform: none; }

/* ─── Footer ──────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-header);
  margin-top: 40px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px;
  text-align: center;
}

.footer-disclaimer {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.footer-links {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.footer-links a { color: var(--text-secondary); transition: color 0.2s; display: inline-flex; align-items: center; gap: 4px; }
.footer-links a svg { flex-shrink: 0; vertical-align: middle; }
.footer-links a:hover { color: var(--accent); }
.footer-sep { opacity: 0.3; }

/* ─── AGOTADO (Sold Out) ─────────────────────────────────────── */

.deal-card.sold-out { opacity: 0.85; }
.deal-image-wrapper.sold-out .deal-image {
  filter: grayscale(100%);
  opacity: 0.4;
}
.sold-out-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.sold-out-overlay span {
  background: rgba(0, 0, 0, 0.8);
  color: #ff4444;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 4px;
  padding: 10px 24px;
  border-radius: 8px;
  border: 2px solid #ff4444;
  text-transform: uppercase;
}
.btn-buy-disabled {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--surface-light) !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border);
  cursor: not-allowed;
  pointer-events: none;
}

/* ─── Responsive ──────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .deals-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .deals-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .deals-container { padding: 16px; }
  .header-inner { padding: 12px 16px; }
  .header-search { margin: 0 0 0 12px; max-width: none; }
  .header-search input { padding: 8px 36px 8px 36px; font-size: 13px; }
  .logo-text { display: none; }
  .filters-inner { padding: 10px 16px; gap: 16px; }
  .logo-img { height: 28px; width: auto; border-radius: 6px; }
  .logo-name { font-size: 18px; }
  .logo-tagline { display: none; }
  .price-offer { font-size: 18px; }
  .deal-content { padding: 12px; }
  .auth-modal { padding: 24px 20px; }
  .prefs-modal { padding: 24px 20px; }
}

@media (max-width: 480px) {
  .deals-grid { grid-template-columns: 1fr; gap: 16px; }
  .deal-image-wrapper { aspect-ratio: 4/3; }
  .filter-group:not(:first-child) .filter-label { display: none; }
}

/* ─── Scrollbar ───────────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── User Menu (Login / Avatar) ─────────────────────────────── */

.nav-login {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.nav-login:hover { background: var(--surface-light); color: var(--text-primary); border-color: var(--card-hover-border); }
.nav-login svg { flex-shrink: 0; }

.user-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
.user-avatar img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}
.avatar-initial {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  z-index: 200;
  overflow: hidden;
}
.user-dropdown.show { display: block; }

.dropdown-info {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.dropdown-info strong {
  display: block;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.dropdown-info small {
  font-size: 12px;
  color: var(--text-muted);
}
.dropdown-sep { height: 0; }

.user-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  background: none;
  border: none;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.user-dropdown button svg { flex-shrink: 0; }
.user-dropdown button:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

/* ─── Auth Modal ─────────────────────────────────────────────── */

.auth-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(4px);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.auth-overlay.show { display: flex; }

.auth-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 380px;
  max-width: 90vw;
  position: relative;
  box-shadow: var(--shadow-hover);
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.auth-close:hover { color: var(--text-primary); }

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: 10px 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.auth-tab:hover { color: var(--text-secondary); }
.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.auth-error {
  background: rgba(229, 57, 53, 0.1);
  border: 1px solid rgba(229, 57, 53, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: #ef5350;
  margin-bottom: 16px;
}

.auth-success {
  background: rgba(0, 200, 83, 0.1);
  border: 1px solid rgba(0, 200, 83, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: #00c853;
  margin-bottom: 16px;
}

.auth-modal form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-modal input[type="text"],
.auth-modal input[type="email"],
.auth-modal input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.auth-modal input:focus {
  border-color: var(--accent);
}
.auth-modal input::placeholder {
  color: var(--text-muted);
}

.auth-submit {
  padding: 12px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.auth-submit:hover { background: var(--accent-hover); }
.auth-submit:disabled { opacity: 0.6; cursor: default; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
  color: #3c4043;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.auth-google:hover { background: #f7f8f8; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.auth-google svg { flex-shrink: 0; }

.auth-forgot {
  text-align: right;
  margin: 14px 0 0;
}
.auth-forgot a {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s;
}
.auth-forgot a:hover { color: var(--accent); }

.auth-reset-info {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 16px;
}
.auth-back {
  text-align: center;
  margin-top: 16px;
}
.auth-back a {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s;
}
.auth-back a:hover { color: var(--accent); }

.auth-new-password-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-new-password-wrap h3 {
  color: var(--text-primary);
  font-size: 16px;
  margin: 0;
}

/* ─── Preferences Modal ──────────────────────────────────────── */

.prefs-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 440px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-hover);
}

.prefs-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
}

.prefs-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

.prefs-section {
  margin-bottom: 20px;
}

.prefs-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.prefs-push-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.prefs-push-status {
  font-size: 13px;
  font-weight: 600;
}
.prefs-push-status.off { color: var(--text-muted); }
.prefs-push-status.on { color: var(--success); }

.prefs-push-btn {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.prefs-push-btn:hover { background: var(--surface-light); color: var(--text-primary); }
.prefs-push-btn.active {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.prefs-push-btn.active:hover { background: #00a843; }

.prefs-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.prefs-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}
.prefs-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg-card);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.prefs-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg-card);
}

.prefs-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.prefs-input:focus { border-color: var(--accent); }
.prefs-input::placeholder { color: var(--text-muted); }

.prefs-save {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  margin-top: 8px;
}
.prefs-save:hover { background: var(--accent-hover); }
.prefs-save:disabled { opacity: 0.6; cursor: default; }

/* ─── Toast notification ──────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-hover);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1000;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ─── Bottom Navigation (mobile only) ────────────────────── */

.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-header);
  border-top: 1px solid var(--border);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item:active,
.bottom-nav-item.active {
  color: var(--accent);
}
.bottom-nav-item svg {
  flex-shrink: 0;
}

/* ─── Menu Bottom Sheet ──────────────────────────────────── */

.sheet-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 400;
  opacity: 0;
  transition: opacity 0.3s;
}
.sheet-overlay.show {
  display: block;
  opacity: 1;
}

.menu-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 401;
  background: var(--bg-card);
  border-radius: 16px 16px 0 0;
  max-height: 75vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.menu-sheet.show {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 2px;
  margin: 12px auto 8px;
  opacity: 0.4;
}

.sheet-content {
  padding: 8px 20px 16px;
}

.sheet-section {
  margin-bottom: 20px;
}

.sheet-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.sheet-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ─── Theme Switcher ─────────────────────────────────────── */

.theme-switcher {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.theme-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  background: none;
  border: none;
  border-right: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.theme-option:last-child {
  border-right: none;
}
.theme-option.active {
  background: var(--accent);
  color: #fff;
}

/* Desktop theme toggle (header) */
.nav-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
}
.nav-theme-toggle:hover {
  background: var(--surface-light);
  color: var(--text-primary);
}

/* Sheet links */
.sheet-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.sheet-link.telegram svg { color: #0088cc; flex-shrink: 0; }
.sheet-link:hover { background: var(--surface-light); }

/* ─── Profile Sheet ──────────────────────────────────────── */

.profile-sheet-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.profile-sheet-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.profile-sheet-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.profile-sheet-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.profile-sheet-info strong {
  font-size: 16px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-sheet-info small {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
  text-align: left;
}
.sheet-action:hover { background: var(--surface-light); }
.sheet-action svg { color: var(--text-secondary); flex-shrink: 0; }

/* ─── Mobile: show bottom nav, hide header nav ──────────── */

@media (max-width: 768px) {
  .bottom-nav { display: flex; }
  .header-nav { display: none; }
  body { padding-bottom: 60px; }
  .toast { bottom: 76px; }
}

/* ─── GDPR Banner ────────────────────────────────────────────── */

.gdpr-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  transform: translateY(100%);
  transition: transform 0.4s ease;
}
.gdpr-banner.show { transform: translateY(0); }

.gdpr-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.gdpr-banner-text {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}
.gdpr-banner-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.gdpr-banner-text p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.gdpr-banner-text strong { color: var(--text-primary); }
.gdpr-banner-text a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.gdpr-banner-text a:hover { text-decoration: underline; }

.gdpr-banner-btn {
  padding: 10px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  flex-shrink: 0;
}
.gdpr-banner-btn:hover { background: var(--accent-hover); }

@media (max-width: 600px) {
  .gdpr-banner-inner {
    flex-direction: column;
    padding: 16px;
    gap: 14px;
  }
  .gdpr-banner-btn { width: 100%; padding: 12px; }
}

/* ─── GDPR Modals ────────────────────────────────────────────── */

.gdpr-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px;
  overflow-y: auto;
}
.gdpr-overlay.show { display: flex; }

.gdpr-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 680px;
  max-width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: gdpr-slide-up 0.3s ease;
}

@keyframes gdpr-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.gdpr-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
}
.gdpr-modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.gdpr-modal-icon { font-size: 24px; }
.gdpr-modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-input);
  border-radius: 50%;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.gdpr-modal-close:hover {
  background: var(--border);
  color: var(--text-primary);
}

.gdpr-modal-body {
  padding: 20px 28px;
  max-height: 65vh;
  overflow-y: auto;
}
.gdpr-modal-body p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0 0 14px;
}
.gdpr-modal-body h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 24px 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gdpr-modal-body h3:first-child { margin-top: 8px; }

.gdpr-section-icon { font-size: 16px; }
.gdpr-green { color: #22c55e; }
.gdpr-purple { color: #a78bfa; }
.gdpr-orange { color: var(--accent); }

/* Tables */
.gdpr-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 8px;
  font-size: 13px;
}
.gdpr-table thead th {
  background: var(--bg-input);
  color: var(--text-primary);
  font-weight: 700;
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.gdpr-table tbody td {
  padding: 12px 14px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}
.gdpr-cookie-name {
  color: var(--accent) !important;
  font-weight: 700;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  white-space: nowrap;
}

/* Info boxes */
.gdpr-infobox {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 10px 0 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
}
.gdpr-infobox a {
  color: var(--accent);
  text-decoration: none;
}
.gdpr-infobox a:hover { text-decoration: underline; }
.gdpr-infobox ul {
  margin: 0;
  padding-left: 18px;
}
.gdpr-infobox li {
  margin-bottom: 8px;
}
.gdpr-infobox li:last-child { margin-bottom: 0; }
.gdpr-infobox strong { color: var(--text-primary); }

.gdpr-note {
  background: rgba(255,107,44,0.08);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 16px 0;
}
.gdpr-note strong { color: var(--text-primary); }

.gdpr-updated {
  font-size: 12px !important;
  color: var(--text-muted) !important;
  font-style: italic;
  margin-top: 20px !important;
}

.gdpr-modal-body a {
  color: var(--accent);
  text-decoration: none;
}
.gdpr-modal-body a:hover { text-decoration: underline; }

/* Footer */
.gdpr-modal-footer {
  padding: 16px 28px 24px;
  display: flex;
  justify-content: center;
}
.gdpr-modal-footer .gdpr-modal-btn {
  padding: 12px 40px;
  background: #1a1a2e !important;
  color: #fff !important;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
}
.gdpr-modal-btn:hover { opacity: 0.85; }

@media (max-width: 600px) {
  .gdpr-modal-header { padding: 20px 20px 0; }
  .gdpr-modal-body { padding: 16px 20px; }
  .gdpr-modal-footer { padding: 12px 20px 20px; }
  .gdpr-modal-title { font-size: 17px; }
}

/* ═══════════════════════════════════════════════════════════════
   MEJORAS v2 — Badge Nuevo, Fade-in, Share, Countdown, Skeletons
   ═══════════════════════════════════════════════════════════════ */

/* ─── Fade-in cards ───────────────────────────────────────────── */
.deal-card:not(.skeleton) {
  opacity: 0;
  transform: translateY(16px);
  animation: cardFadeIn 0.4s ease-out forwards;
}
.deal-card:not(.skeleton):nth-child(1) { animation-delay: 0.03s; }
.deal-card:not(.skeleton):nth-child(2) { animation-delay: 0.06s; }
.deal-card:not(.skeleton):nth-child(3) { animation-delay: 0.09s; }
.deal-card:not(.skeleton):nth-child(4) { animation-delay: 0.12s; }
.deal-card:not(.skeleton):nth-child(5) { animation-delay: 0.15s; }
.deal-card:not(.skeleton):nth-child(6) { animation-delay: 0.18s; }
.deal-card:not(.skeleton):nth-child(7) { animation-delay: 0.21s; }
.deal-card:not(.skeleton):nth-child(8) { animation-delay: 0.24s; }

@keyframes cardFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Share button ────────────────────────────────────────────── */
.btn-share {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}
.deal-card:hover .btn-share { opacity: 1; }
.btn-share:hover { background: rgba(0,0,0,0.7); }

/* Share dropdown */
.share-menu {
  display: none;
  position: absolute;
  top: 40px;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  overflow: hidden;
  z-index: 10;
  min-width: 160px;
}
.share-menu.show { display: block; }
.share-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.share-menu button:hover { background: var(--surface); }

/* ─── Flash countdown timer ──────────────────────────────────── */
.flash-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,107,44,0.12);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.flash-timer svg { flex-shrink: 0; }
.flash-timer.expired { color: var(--text-muted); opacity: 0.5; }

/* ─── Enhanced skeleton ───────────────────────────────────────── */
.deal-card.skeleton .skeleton-btn {
  height: 42px;
  margin: auto 16px 16px;
  border-radius: 8px;
  animation: shimmer 1.5s infinite;
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-light) 50%, var(--surface) 75%);
  background-size: 200% 100%;
}
.deal-card.skeleton .skeleton-category {
  height: 10px;
  width: 30%;
  margin: 14px 16px 4px;
  border-radius: 3px;
  animation: shimmer 1.5s infinite;
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-light) 50%, var(--surface) 75%);
  background-size: 200% 100%;
}

/* ─── Deal footer (time + favorite) ──────────────────────────── */
.deal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  margin-top: auto;
  margin-bottom: 4px;
}

/* ─── Favorite button ────────────────────────────────────────── */
.btn-favorite {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.btn-favorite:hover {
  color: #ef4444;
  transform: scale(1.15);
}
.btn-favorite.active {
  color: #ef4444;
}
.btn-favorite.animating {
  animation: favBounce 0.4s ease;
}
@keyframes favBounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.35); }
  60% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* Favorites chip */
#favoritesChip {
  display: none;
}
#favoritesChip.active {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

/* ─── Scroll sentinel ────────────────────────────────────────── */
#scrollSentinel {
  height: 1px;
  width: 100%;
}
