:root {
  --amazon-dark: #131921;
  --amazon-nav: #232f3e;
  --amazon-amber: #febd69;
  --amazon-amber-hover: #f3a847;
  --amazon-yellow: #ffd814;
  --amazon-yellow-hover: #f7ca00;
  --ali-orange: #ff4747;
  --ali-orange-hover: #e23636;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(17, 24, 39, 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header fijo compacto estilo Amazon */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--amazon-dark);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
}

.header-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  flex-shrink: 0;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  padding: 2px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-name strong { color: var(--amazon-amber); }

.brand-sub {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #d1d5db;
  font-weight: 600;
}

.search-form {
  flex: 1;
  display: flex;
  align-items: stretch;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.15s ease;
}
.search-form:focus-within { border-color: var(--amazon-amber); }

.search-input {
  flex: 1;
  border: 0;
  outline: none;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--text);
  min-width: 0;
}
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.search-clear {
  border: 0;
  background: transparent;
  color: #6b7280;
  font-size: 16px;
  padding: 0 10px;
  cursor: pointer;
}
.search-clear:hover { color: #111827; }

.search-submit {
  border: 0;
  background: var(--amazon-amber);
  color: #111827;
  padding: 0 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.search-submit:hover { background: var(--amazon-amber-hover); }

/* Barra de categorías: UNA sola fila horizontal deslizable */
.cat-nav {
  background: var(--amazon-nav);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cat-scroll {
  max-width: 1240px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-scroll::-webkit-scrollbar { display: none; }

.cat-btn {
  border: 0;
  background: transparent;
  color: #e5e7eb;
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.cat-btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.cat-btn.active {
  background: #ffffff;
  color: var(--amazon-dark);
}

/* Franja compacta de perfil */
.profile-strip {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.profile-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

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

.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  border: 2px solid var(--border);
  padding: 3px;
  flex-shrink: 0;
}

.profile-copy h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}
.profile-desc {
  margin: 2px 0 0;
  font-size: 13.5px;
  color: #374151;
}
.profile-note {
  margin: 2px 0 0;
  font-size: 12px;
  color: #6b7280;
}

.social-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.social-btn:hover { transform: translateY(-1px); opacity: 0.92; }
.social-ig { background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af); }
.social-yt { background: #ff0000; }
.social-tt { background: #0f0f0f; }
.social-fb { background: #1877f2; }

/* Main */
.main-content {
  padding-top: 16px;
  padding-bottom: 40px;
}

/* Sección destacada Último Video */
.latest-section {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 18px;
}

.latest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.latest-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.latest-pill {
  background: var(--amazon-dark);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 6px;
}

.latest-title-wrap h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.video-ext-link {
  color: #007185;
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: none;
}
.video-ext-link:hover { text-decoration: underline; }

/* Controles de filtro */
.controls-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.control-video {
  flex: 1 1 320px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-video label,
.control-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #374151;
}

.video-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  font-size: 14px;
  color: var(--text);
  outline: none;
  cursor: pointer;
}
.video-select:focus { border-color: var(--amazon-amber-hover); background: #fff; }

.control-store {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.store-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.store-pill {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.store-pill:hover { border-color: #9ca3af; }
.store-pill.active {
  background: var(--amazon-dark);
  color: #fff;
  border-color: var(--amazon-dark);
}

.results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.results-meta p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 600;
}

.reset-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.reset-btn:hover { background: #f3f4f6; }

/* Grid de productos */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.1);
}

.card-img-wrap {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid #f3f4f6;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}
.product-card:hover .card-img { transform: scale(1.03); }

.card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.store-badge {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border-radius: 5px;
  text-transform: uppercase;
}
.badge-amazon {
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #d1d5db;
}
.badge-aliexpress {
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
}

.card-title {
  margin: 0 0 8px;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-video-link {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 12px;
  color: #007185;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.card-video-link:hover { text-decoration: underline; }

.buy-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
  margin-top: auto;
}
.buy-btn:active { transform: scale(0.98); }

.buy-amazon {
  background: var(--amazon-yellow);
  color: #111827;
  border: 1px solid #fcd200;
}
.buy-amazon:hover { background: var(--amazon-yellow-hover); }

.buy-aliexpress {
  background: var(--ali-orange);
  color: #ffffff;
  border: 1px solid #e03131;
}
.buy-aliexpress:hover { background: var(--ali-orange-hover); }

/* Paginación */
.load-more-wrap {
  text-align: center;
  margin: 24px 0 8px;
}

.load-more-btn {
  background: var(--amazon-dark);
  color: #fff;
  border: 0;
  padding: 12px 28px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.load-more-btn:hover { background: #232f3e; }

.load-more-hint {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* Estado vacío */
.empty-state {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  margin: 12px 0;
}
.empty-title { margin: 0 0 6px; font-size: 17px; font-weight: 800; }
.empty-sub { margin: 0 0 16px; font-size: 14px; color: var(--muted); }

.btn-primary-amazon {
  display: inline-block;
  background: var(--amazon-yellow);
  color: #111827;
  border: 1px solid #fcd200;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary-amazon:hover { background: var(--amazon-yellow-hover); }

/* Banner YouTube */
.yt-banner {
  margin-top: 28px;
  background: var(--amazon-nav);
  color: #fff;
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.yt-banner h3 { margin: 0 0 4px; font-size: 17px; }
.yt-banner p { margin: 0; font-size: 13.5px; color: #d1d5db; }

/* FAQ */
.faq-section {
  margin-top: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}
.faq-section h2 { margin: 0 0 12px; font-size: 18px; }
.faq-section details {
  border-top: 1px solid var(--border);
  padding: 12px 0;
}
.faq-section details:first-of-type { border-top: 0; padding-top: 4px; }
.faq-section summary {
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  list-style: none;
}
.faq-section summary::after {
  content: "+";
  float: right;
  font-weight: 800;
  color: var(--muted);
}
.faq-section details[open] summary::after { content: "−"; }
.faq-section details p {
  margin: 8px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 18px 0 28px;
  font-size: 12.5px;
  color: #6b7280;
}
.disclosure { margin: 0 0 6px; }
.footer-meta { margin: 0; font-weight: 600; color: #4b5563; }

/* Botón flotante subir */
.scroll-top-btn {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 90;
  background: var(--amazon-dark);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.scroll-top-btn:hover { background: var(--amazon-nav); }

/* Responsive */
@media (max-width: 1024px) {
  .products-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .header-main {
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 8px;
  }
  .brand-logo { width: 30px; height: 30px; }
  .brand-name { font-size: 16px; }
  .brand-sub { font-size: 9px; }
  .search-form { flex-basis: 100%; }
  .search-input { padding: 8px 10px; font-size: 14px; }
  .cat-scroll { padding: 6px 12px; }
  .cat-btn { font-size: 13px; padding: 5px 10px; }

  .profile-strip { padding: 10px 0; }
  .profile-avatar { width: 44px; height: 44px; }
  .profile-copy h1 { font-size: 16px; }
  .profile-desc { font-size: 12.5px; }
  .social-btn { padding: 6px 10px; font-size: 12px; }

  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .product-card { padding: 9px; }
  .card-title { font-size: 13px; }
  .buy-btn { font-size: 12px; padding: 8px 8px; }
  .latest-section { padding: 11px; }
  .latest-title-wrap h2 { font-size: 14.5px; }
}
