/* ─── RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --yellow: #FFE600;
  --yellow-dark: #E6CF00;
  --black: #0A0A0A;
  --white: #FAFAF7;
  --gray-100: #F2F2EE;
  --gray-200: #E0E0DA;
  --gray-400: #9A9A94;
  --green: #00C853;
  --red: #FF3B30;
  --blue: #1A56FF;
  --card-shadow: 0 4px 24px rgba(0,0,0,0.08);
  --radius: 12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--black);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── HERO ─── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,230,0,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px 40px;
  position: relative;
  z-index: 1;
}

.badge {
  background: var(--yellow);
  color: var(--black);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 4px 10px;
  border-radius: 99px;
  margin-bottom: 20px;
}

.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(72px, 14vw, 140px);
  letter-spacing: -2px;
  line-height: 0.9;
  color: var(--white);
  text-align: center;
}

.logo span {
  color: var(--yellow);
}

.tagline {
  margin-top: 16px;
  font-size: clamp(14px, 2vw, 18px);
  color: var(--gray-400);
  text-align: center;
  line-height: 1.6;
}

/* ─── SEARCH BOX ─── */
.search-box {
  margin-top: 40px;
  background: var(--white);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 24px 64px rgba(0,0,0,0.5);
  animation: floatIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.input-row input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  color: var(--black);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.input-row input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255,230,0,0.2);
}

.input-row input::placeholder {
  color: var(--gray-400);
}

.delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 6px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
}

.delete-btn:hover {
  color: var(--red);
  background: rgba(255,59,48,0.08);
}

.search-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn-add {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  background: var(--gray-100);
  color: var(--black);
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add:hover {
  background: var(--gray-200);
  border-color: var(--gray-400);
}

.btn-search {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  background: var(--yellow);
  color: var(--black);
  border: 2px solid var(--yellow);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-search:hover {
  background: var(--yellow-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255,230,0,0.35);
}

.btn-search:active {
  transform: translateY(0);
}

.btn-search:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.error-msg {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(255,59,48,0.08);
  border: 1px solid rgba(255,59,48,0.2);
  border-radius: 8px;
  color: var(--red);
  font-size: 13px;
  display: none;
  text-align: center;
}

/* ─── TICKER ─── */
.ticker-wrap {
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  padding: 14px 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.ticker {
  display: flex;
  gap: 32px;
  white-space: nowrap;
  animation: ticker 20s linear infinite;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray-400);
}

.ticker span:nth-child(2n) { color: var(--yellow); }

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ─── LOADING ─── */
.loading-screen, .results-screen {
  display: none;
  min-height: 100vh;
}

.loading-screen {
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: var(--black);
}

.loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255,230,0,0.15);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
}

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 300px;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--gray-400);
  transition: color 0.3s;
}

.loading-step.done { color: var(--green); }
.loading-step.active { color: var(--white); }

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-400);
  flex-shrink: 0;
  transition: background 0.3s;
}

.loading-step.done .step-dot { background: var(--green); }
.loading-step.active .step-dot { background: var(--yellow); animation: pulse 1s ease infinite; }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

/* ─── RESULTS ─── */
.results-screen {
  flex-direction: column;
  background: var(--gray-100);
  padding: 0 0 60px;
}

.results-header {
  background: var(--black);
  padding: 24px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--white);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-back:hover {
  background: rgba(255,255,255,0.12);
}

.results-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 1px;
  color: var(--white);
  flex: 1;
}

.results-title span {
  color: var(--yellow);
  font-size: 20px;
}

.sort-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--gray-400);
}

.sort-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid transparent;
  color: var(--gray-400);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.sort-btn:hover { color: var(--white); border-color: rgba(255,255,255,0.15); }
.sort-btn.active { background: var(--yellow); color: var(--black); font-weight: 700; border-color: var(--yellow); }

.results-grid {
  max-width: 900px;
  margin: 32px auto 0;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

/* ─── SELLER CARD ─── */
.seller-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.seller-card:nth-child(1) { animation-delay: 0.05s; }
.seller-card:nth-child(2) { animation-delay: 0.1s; }
.seller-card:nth-child(3) { animation-delay: 0.15s; }
.seller-card:nth-child(4) { animation-delay: 0.2s; }
.seller-card:nth-child(5) { animation-delay: 0.25s; }

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

.seller-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--black);
  color: var(--white);
}

.rank-badge {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  color: var(--yellow);
  min-width: 36px;
  line-height: 1;
}

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

.seller-name {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seller-meta {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 2px;
}

.seller-total {
  text-align: right;
  flex-shrink: 0;
}

.total-label {
  font-size: 11px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.total-price {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  color: var(--green);
  line-height: 1.1;
}

.product-list {
  list-style: none;
}

.product-item {
  border-bottom: 1px solid var(--gray-100);
}

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

.product-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.product-link:hover {
  background: var(--gray-100);
}

.product-thumb {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--gray-100);
  flex-shrink: 0;
}

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

.product-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--black);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.product-domain {
  font-size: 11px;
  color: var(--blue);
  margin-top: 4px;
}

.product-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.product-price {
  font-weight: 700;
  font-size: 16px;
  color: var(--black);
}

.product-cta {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  background: rgba(59,130,246,0.08);
  border-radius: 6px;
  padding: 3px 10px;
  transition: background 0.15s;
}

.product-link:hover .product-cta {
  background: rgba(59,130,246,0.18);
}

.affiliate-tag {
  display: none;
}

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 8px;
}

/* ─── PAGINATION ─── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  padding: 0 24px;
}

.page-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid var(--gray-200);
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--black);
}

.page-btn:hover { border-color: var(--yellow); }
.page-btn.active { background: var(--yellow); border-color: var(--yellow); }

/* ─── FOOTER ─── */
.footer {
  padding: 20px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--gray-400);
  background: var(--black);
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 600px) {
  .results-header { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
  .sort-bar { width: 100%; }
  .seller-header { flex-wrap: wrap; }
  .search-actions { flex-direction: column; }
}

/* ─── TOPBAR ─── */
.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  z-index: 10;
}

.topbar-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--white);
}
.topbar-logo span { color: var(--yellow); }

/* ─── AUTH OCULTO (lógica preservada, UI hidden) ─── */
.topbar-auth,
.login-banner,
.btn-ml-login,
.btn-logout {
  display: none !important;
}

.topbar-auth-UNUSED {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--gray-400);
}

#userInfo {
  font-weight: 600;
  color: var(--white);
  font-size: 13px;
}

.btn-logout {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--gray-400);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-logout:hover { color: var(--white); background: rgba(255,255,255,0.14); }

/* ─── LOGIN BANNER ─── */
.login-banner {
  width: 100%;
  max-width: 560px;
  margin-bottom: 16px;
  background: rgba(255,230,0,0.08);
  border: 1.5px solid rgba(255,230,0,0.3);
  border-radius: 12px;
  padding: 14px 18px;
  transition: box-shadow 0.3s;
}

.login-banner.highlight {
  box-shadow: 0 0 0 3px rgba(255,230,0,0.4);
}

.login-banner-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-icon { font-size: 22px; flex-shrink: 0; }

.login-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.login-text strong {
  font-size: 13px;
  color: var(--white);
  font-weight: 600;
}

.login-text span {
  font-size: 12px;
  color: var(--gray-400);
}

.btn-ml-login {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--yellow);
  color: var(--black);
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-ml-login:hover {
  background: var(--yellow-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255,230,0,0.3);
}

@media (max-width: 520px) {
  .login-banner-inner { flex-wrap: wrap; }
  .btn-ml-login { width: 100%; justify-content: center; }
}

/* ── FAQ Link ────────────────────────────────────────────────── */
.faq-link {
  color: rgba(255,255,255,0.5);
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s;
}
.faq-link:hover { color: #f0c800; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 2rem;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}

.modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  color: #f0c800;
  margin-bottom: 1.5rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s;
}
.modal-close:hover { color: #fff; }

.faq-item {
  margin-bottom: 1.5rem;
}
.faq-item h3 {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 0.4rem;
}
.faq-item p {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
  margin: 0;
}

/* ── Topbar FAQ link ─────────────────────────────────────────── */
.topbar-faq {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  transition: color 0.2s;
}
.topbar-faq:hover { color: #f0c800; border-color: #f0c800; }

/* ── SEO Section ─────────────────────────────────────────────── */
.seo-section {
  background: #111;
  padding: 4rem 1.5rem;
  display: none;
}
.seo-section.visible { display: block; }
.seo-inner {
  max-width: 860px;
  margin: 0 auto;
}
.seo-inner h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  color: #f0c800;
  margin-bottom: 1rem;
}
.seo-inner p {
  font-family: 'DM Sans', sans-serif;
  color: rgba(255,255,255,0.7);
  line-height: 1.7;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.seo-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.seo-card {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 1.5rem;
}
.seo-icon { font-size: 1.5rem; display: block; margin-bottom: 0.5rem; }
.seo-card h3 {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}
.seo-card p {
  font-size: 0.85rem;
  margin: 0;
}
