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

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #22263a;
  --border: #2e3248;
  --text: #f1f3f9;
  --text2: #8b92a9;
  --text3: #555d7a;
  --accent: #4f8ef7;
  --accent-hover: #3b7af0;
  --accent-light: #1a2540;
  --success: #22c55e;
  --danger: #f87171;

  --brand-ugreen: #22d06e;
  --brand-xiaomi: #ff7a1a;
  --brand-hoco: #a78bfa;
  --brand-havit: #ff3b3b;
  --brand-cuktech: #00b4d8;
  --brand-transformers: #f59e0b;
  --brand-1hora: #10b981;
  --brand-maono: #8b5cf6;
  --brand-anker: #0ea5e9;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.5);
  --transition: 0.2s ease;
}

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

img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
a { text-decoration: none; color: inherit; }

/* ─── Header ─────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 29, 39, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 24px rgba(0,0,0,.3);
}

/* Franja de acento en la parte superior */
.header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #60a5fa, #a78bfa, #60a5fa);
  background-size: 200% 100%;
  animation: headerLine 4s linear infinite;
}

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

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 28px;
}

/* ─── Logo ───────────────────────────────────────────────────── */
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.25rem;
  font-weight: 900;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -.3px;
  text-decoration: none;
}

.logo svg { flex-shrink: 0; filter: drop-shadow(0 0 6px rgba(96,165,250,.5)); transition: filter .2s; }
.logo:hover svg { filter: drop-shadow(0 0 12px rgba(96,165,250,.9)); }

.logo-charger { color: var(--text); }

.logo-tech {
  background: linear-gradient(90deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo:hover .logo-tech {
  background: linear-gradient(90deg, #93c5fd, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ─── Nav desktop ────────────────────────────────────────────── */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-nav a {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
}

.header-nav a:hover  { color: var(--text); background: var(--surface2); }
.header-nav a.active { color: var(--accent); background: var(--accent-light); }

/* ─── Search ─────────────────────────────────────────────────── */
.header-search {
  flex: 1;
  max-width: 380px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 9px 16px 9px 38px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: .88rem;
  background: var(--surface2);
  color: var(--text);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  outline: none;
}

.header-search input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(79,142,247,.15);
}

.header-search input::placeholder { color: var(--text3); }

.header-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none;
  transition: color var(--transition);
}

.header-search:focus-within .search-icon { color: var(--accent); }

/* ─── Actions ────────────────────────────────────────────────── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px 9px 14px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  color: white;
  border-radius: 24px;
  font-size: .88rem;
  font-weight: 700;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 12px rgba(79,142,247,.35);
  letter-spacing: .2px;
}

.cart-btn:hover {
  opacity: .92;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(79,142,247,.5);
}

.cart-count {
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  font-size: .72rem;
  font-weight: 700;
}

.menu-toggle {
  display: none;
  padding: 8px;
  color: var(--text);
}

/* ─── Hero ───────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, #0d1b3e 0%, #1a2f6b 40%, #1e3fa8 70%, #2563eb 100%);
  color: white;
  padding: 88px 24px 72px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Malla de puntos de fondo */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* Orbes de luz */
.hero::after {
  content: '';
  position: absolute;
  top: -80px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,.25) 0%, transparent 70%);
  pointer-events: none;
}

/* ─── Partículas flotantes ───────────────────────────────────── */
.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-particles span {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  animation: floatUp linear infinite;
}

.hero-particles span:nth-child(1) { width:6px;  height:6px;  left:10%; bottom:-10px; animation-duration:8s;  animation-delay:0s; }
.hero-particles span:nth-child(2) { width:10px; height:10px; left:25%; bottom:-10px; animation-duration:11s; animation-delay:2s; }
.hero-particles span:nth-child(3) { width:4px;  height:4px;  left:40%; bottom:-10px; animation-duration:7s;  animation-delay:1s; }
.hero-particles span:nth-child(4) { width:8px;  height:8px;  left:55%; bottom:-10px; animation-duration:10s; animation-delay:3s; }
.hero-particles span:nth-child(5) { width:5px;  height:5px;  left:65%; bottom:-10px; animation-duration:9s;  animation-delay:.5s; }
.hero-particles span:nth-child(6) { width:12px; height:12px; left:75%; bottom:-10px; animation-duration:13s; animation-delay:4s; }
.hero-particles span:nth-child(7) { width:4px;  height:4px;  left:85%; bottom:-10px; animation-duration:6s;  animation-delay:1.5s; }
.hero-particles span:nth-child(8) { width:7px;  height:7px;  left:92%; bottom:-10px; animation-duration:12s; animation-delay:2.5s; }

@keyframes floatUp {
  0%   { transform: translateY(0) rotate(0deg);   opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: .6; }
  100% { transform: translateY(-110vh) rotate(720deg); opacity: 0; }
}

/* ─── Inner ──────────────────────────────────────────────────── */
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
}

/* ─── Badge ──────────────────────────────────────────────────── */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 24px;
  padding: 6px 18px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .4px;
  margin-bottom: 28px;
  backdrop-filter: blur(8px);
}

.hero-badge-dot {
  width: 7px; height: 7px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 6px #4ade80;
  animation: pulseDot 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .6; transform: scale(.7); }
}

/* ─── Título ─────────────────────────────────────────────────── */
.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -.5px;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #7dd3fc, #a5b4fc, #f0abfc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Subtítulo ──────────────────────────────────────────────── */
.hero p {
  font-size: 1.05rem;
  opacity: .8;
  margin-bottom: 36px;
  line-height: 1.65;
}

.hero-br { display: none; }
@media (min-width: 520px) { .hero-br { display: inline; } }

/* ─── CTAs ───────────────────────────────────────────────────── */
.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.hero-cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: white;
  color: #1e3fa8;
  border-radius: 32px;
  font-weight: 800;
  font-size: 1rem;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 24px rgba(0,0,0,.25);
}
.hero-cta-primary:hover { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(0,0,0,.3); }

.hero-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  background: #25d366;
  color: white;
  border-radius: 32px;
  font-weight: 700;
  font-size: .95rem;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: 0 4px 20px rgba(37,211,102,.35);
}
.hero-cta-secondary:hover { background: #1db954; transform: translateY(-3px); box-shadow: 0 8px 28px rgba(37,211,102,.45); }

/* ─── Mini stats ─────────────────────────────────────────────── */
.hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 16px;
  padding: 16px 32px;
  backdrop-filter: blur(12px);
  flex-wrap: wrap;
  justify-content: center;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0 24px;
}

.hero-stat strong {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -.5px;
  background: linear-gradient(90deg, #fff, #bfdbfe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stat span {
  font-size: .72rem;
  opacity: .65;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .6px;
  white-space: nowrap;
}

.hero-stat-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,.2);
  flex-shrink: 0;
}

@media (max-width: 500px) {
  .hero-stat-divider { display: none; }
  .hero-stat { padding: 8px 16px; }
  .hero-stats { gap: 0; padding: 12px 16px; }
}

/* ─── Autocomplete ───────────────────────────────────────────── */
.autocomplete-list {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  list-style: none;
  z-index: 500;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.autocomplete-list.visible { display: block; }

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: .88rem;
  color: var(--text2);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), color var(--transition);
}

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

.autocomplete-item:hover,
.autocomplete-item.ac-selected {
  background: var(--accent-light);
  color: var(--text);
}

.autocomplete-item mark {
  background: none;
  color: var(--accent);
  font-weight: 700;
}

.ac-icon { color: var(--text3); flex-shrink: 0; }

/* ─── Brands bar ─────────────────────────────────────────────── */
.brands-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

.brands-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 4px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: center;
}
.brand-pill { white-space: nowrap; flex-shrink: 0; }
.brands-label { flex-shrink: 0; }

@media (max-width: 768px) {
  .brands-inner {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
  }
  .brands-inner::-webkit-scrollbar { display: none; }
}

.brands-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .8px;
  flex-shrink: 0;
  margin-right: 4px;
}

.brand-pill {
  padding: 6px 14px;
  border-radius: 24px;
  font-weight: 700;
  font-size: .8rem;
  border: 2px solid transparent;
  transition: all var(--transition);
  letter-spacing: .3px;
}

.brand-pill[data-filter-brand="all"] {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}
.brand-pill[data-filter-brand="all"]:not(.active) {
  background: var(--surface2);
  color: var(--text2);
  border-color: var(--border);
}
.brand-pill[data-filter-brand="ugreen"]       { background: #0d2a1a; color: var(--brand-ugreen);       border-color: #1a5c35; }
.brand-pill[data-filter-brand="xiaomi"]       { background: #2a1500; color: var(--brand-xiaomi);       border-color: #5c2d00; }
.brand-pill[data-filter-brand="hoco"]         { background: #1e1040; color: var(--brand-hoco);         border-color: #3d2080; }
.brand-pill[data-filter-brand="havit"]        { background: #2a0d0d; color: var(--brand-havit);        border-color: #5c1a1a; }
.brand-pill[data-filter-brand="cuktech"]      { background: #0d1e2a; color: var(--brand-cuktech);      border-color: #1a4a5c; }
.brand-pill[data-filter-brand="transformers"] { background: #2a1f00; color: var(--brand-transformers); border-color: #5c4000; }
.brand-pill[data-filter-brand="1hora"]        { background: #0d2218; color: var(--brand-1hora);        border-color: #1a5c40; }
.brand-pill[data-filter-brand="maono"]        { background: #1a0d2a; color: var(--brand-maono);        border-color: #3d1a5c; }
.brand-pill[data-filter-brand="anker"]        { background: #0d1a2a; color: var(--brand-anker);        border-color: #1a3d5c; }

/* Pills con logo */
.brand-pill-logo {
  padding: 5px 10px !important;
  border-color: var(--border) !important;
  background: var(--surface) !important;
  display: flex;
  align-items: center;
  gap: 6px;
}
.brand-pill-logo:hover { border-color: var(--accent) !important; }
.brand-logo-img {
  height: 18px;
  width: auto;
  display: block;
  filter: grayscale(30%);
  transition: filter var(--transition);
}
.brand-pill-logo:hover .brand-logo-img,
.brand-pill-logo.active .brand-logo-img { filter: none; }

/* Xiaomi logo oscuro → aclarar en dark theme */
.brand-pill-logo[data-filter-brand="xiaomi"] .brand-logo-img { filter: grayscale(30%) brightness(1.8); }
.brand-pill-logo[data-filter-brand="xiaomi"]:hover .brand-logo-img,
.brand-pill-logo[data-filter-brand="xiaomi"].active .brand-logo-img { filter: brightness(1.8); }

.brand-pill-name {
  font-size: .76rem;
  font-weight: 700;
  color: var(--text2);
  letter-spacing: .3px;
  transition: color var(--transition);
}
.brand-pill-logo:hover .brand-pill-name,
.brand-pill-logo.active .brand-pill-name { color: var(--text); }


.brand-pill.active,
.brand-pill[data-filter-brand="all"].active {
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transform: translateY(-1px);
}
.brand-pill[data-filter-brand="all"].active          { background: var(--accent);            color: white; border-color: var(--accent); }
.brand-pill[data-filter-brand="ugreen"].active       { background: var(--brand-ugreen);       color: white; border-color: var(--brand-ugreen); }
.brand-pill[data-filter-brand="xiaomi"].active       { background: var(--brand-xiaomi);       color: white; border-color: var(--brand-xiaomi); }
.brand-pill[data-filter-brand="hoco"].active         { background: var(--brand-hoco);         color: white; border-color: var(--brand-hoco); }
.brand-pill[data-filter-brand="havit"].active        { background: var(--brand-havit);        color: white; border-color: var(--brand-havit); }
.brand-pill[data-filter-brand="cuktech"].active      { background: var(--brand-cuktech);      color: white; border-color: var(--brand-cuktech); }
.brand-pill[data-filter-brand="transformers"].active { background: var(--brand-transformers); color: white; border-color: var(--brand-transformers); }
.brand-pill[data-filter-brand="1hora"].active        { background: var(--brand-1hora);        color: white; border-color: var(--brand-1hora); }
.brand-pill[data-filter-brand="maono"].active        { background: var(--brand-maono);        color: white; border-color: var(--brand-maono); }
.brand-pill[data-filter-brand="anker"].active        { background: var(--brand-anker);        color: white; border-color: var(--brand-anker); }

/* ─── Main content ───────────────────────────────────────────── */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ─── Category tabs ─────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.section-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.results-count {
  font-size: .88rem;
  color: var(--text3);
  white-space: nowrap;
}

/* ─── View toggle ────────────────────────────────────────────── */
.view-toggle {
  display: flex;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.view-btn {
  padding: 6px 10px;
  color: var(--text3);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all var(--transition);
}
.view-btn:hover { color: var(--text); background: var(--border); }
.view-btn.active { color: var(--accent); background: var(--accent-light); }

/* ─── Lista view ─────────────────────────────────────────────── */
#products-grid.list-view {
  grid-template-columns: 1fr !important;
  gap: 12px;
}
#products-grid.list-view .product-card {
  flex-direction: row;
  align-items: center;
  gap: 0;
}
#products-grid.list-view .product-img-wrap {
  width: 140px;
  min-width: 140px;
  aspect-ratio: 1;
  border-radius: var(--radius) 0 0 var(--radius);
}
#products-grid.list-view .product-body {
  flex: 1;
  padding: 16px 20px;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}
#products-grid.list-view .product-brand { width: 100%; margin-bottom: 0; }
#products-grid.list-view .product-name  { flex: 1; min-width: 160px; font-size: .95rem; }
#products-grid.list-view .product-rating { flex-shrink: 0; }
#products-grid.list-view .product-price-row { flex-shrink: 0; text-align: right; }
#products-grid.list-view .btn-add-cart {
  flex-shrink: 0;
  width: auto;
  padding: 10px 18px;
  white-space: nowrap;
}
#products-grid.list-view .product-card:hover { transform: translateY(-2px); }

/* ─── Back to top ────────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(79,142,247,.4);
  z-index: 90;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#back-to-top:hover { background: var(--accent-hover); transform: translateY(-2px); }

.sort-select {
  padding: 7px 32px 7px 12px;
  background: var(--surface2);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: .85rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b92a9' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color var(--transition);
}

.sort-select:focus,
.sort-select:hover { border-color: var(--accent); }

#category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.cat-tab {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 500;
  background: var(--surface);
  color: var(--text2);
  border: 1.5px solid var(--border);
  transition: all var(--transition);
}

.cat-tab:hover { border-color: var(--accent); color: var(--accent); }

.cat-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ─── Destacados ─────────────────────────────────────────────── */
#featured-section {
  margin-bottom: 40px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(245,158,11,.06), rgba(251,191,36,.04));
  border: 1px solid rgba(245,158,11,.2);
  border-radius: var(--radius);
}

.featured-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.featured-star { font-size: 1.2rem; }

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

/* ─── Products grid ─────────────────────────────────────────── */
#products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-badge, .product-discount {
  position: absolute;
  top: 12px;
  font-size: .75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  z-index: 1;
}

.product-badge {
  left: 12px;
  background: var(--accent);
  color: white;
}

.product-discount {
  right: 12px;
  background: #ef4444;
  color: white;
}

.product-img-wrap {
  background: #13161f;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.35s ease;
}

.product-card:hover .product-img-wrap img { transform: scale(1.06); }

.product-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.product-brand {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 4px;
  align-self: flex-start;
}

.brand-ugreen       { background: #0d2a1a; color: var(--brand-ugreen); }
.brand-xiaomi       { background: #2a1500; color: var(--brand-xiaomi); }
.brand-hoco         { background: #1e1040; color: var(--brand-hoco); }
.brand-havit        { background: #2a0d0d; color: var(--brand-havit); }
.brand-cuktech      { background: #0d1e2a; color: var(--brand-cuktech); }
.brand-transformers { background: #2a1f00; color: var(--brand-transformers); }
.brand-1hora        { background: #0d2218; color: var(--brand-1hora); }
.brand-maono        { background: #1a0d2a; color: var(--brand-maono); }
.brand-anker        { background: #0d1a2a; color: var(--brand-anker); }

.product-name-link { text-decoration: none; color: inherit; }
.product-name-link:hover .product-name { color: var(--accent); }

.product-name {
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  flex: 1;
  transition: color var(--transition);
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 4px;
}

.star { width: 14px; height: 14px; }
.star polygon { stroke: #f59e0b; fill: none; stroke-width: 2; }
.star.filled polygon { fill: #f59e0b; stroke: #f59e0b; }
.star.half polygon { stroke: #f59e0b; stroke-width: 2; }

.reviews-count {
  font-size: .78rem;
  color: var(--text3);
  margin-left: 2px;
}

.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.product-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
}

.product-original {
  font-size: .85rem;
  color: var(--text3);
  text-decoration: line-through;
}

.btn-add-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  transition: background var(--transition), transform var(--transition);
  margin-top: 4px;
}

.btn-add-cart:hover { background: var(--accent-hover); transform: translateY(-1px); }

.no-results {
  grid-column: 1/-1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 64px 24px;
  color: var(--text3);
  text-align: center;
}


/* ─── Stats section ─────────────────────────────────────────── */
#stats {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: white;
  border-radius: var(--radius);
  padding: 48px 32px;
  margin: 48px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 32px;
  text-align: center;
}

.stat-item .stat-num {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -1px;
}

.stat-item .stat-label {
  font-size: .88rem;
  opacity: .75;
  margin-top: 4px;
}

/* ─── Cart Drawer ───────────────────────────────────────────── */
.cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  backdrop-filter: blur(2px);
}

.cart-overlay.visible { display: block; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: min(420px, 100vw);
  height: 100vh;
  background: var(--surface);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-lg);
}

.cart-drawer.open { right: 0; }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.cart-header h2 { font-size: 1.1rem; font-weight: 700; }

.cart-close {
  padding: 6px;
  border-radius: 8px;
  color: var(--text2);
  transition: background var(--transition);
}

.cart-close:hover { background: var(--surface2); }

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 0;
  color: var(--text3);
  text-align: center;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.cart-item img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  padding: 4px;
  flex-shrink: 0;
}

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

.cart-item-brand {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .8px;
  color: var(--text3);
}

.cart-item-name {
  font-size: .88rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 2px 0;
}

.cart-item-price {
  font-weight: 700;
  font-size: .9rem;
  color: var(--accent);
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cart-item-controls button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.cart-item-controls button:hover { background: var(--border); }

.cart-item-controls span { font-weight: 700; min-width: 20px; text-align: center; }

.cart-item-remove {
  padding: 4px;
  color: var(--text3);
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}

.cart-item-remove:hover { color: var(--danger); background: #2d1414; }

.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.cart-total-row span:first-child { font-size: .9rem; color: var(--text2); }
.cart-total-row span:last-child { font-size: 1.3rem; font-weight: 800; }

.btn-checkout {
  width: 100%;
  padding: 14px;
  background: #2AABEE;
  color: white;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background var(--transition), transform var(--transition);
}

.btn-checkout:hover { background: #1a96d4; transform: translateY(-1px); }

.btn-cart-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  margin-top: 8px;
  background: #1a2e1a;
  color: #25d366;
  border: 1.5px solid #25d366;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.btn-cart-whatsapp:hover {
  background: #25d366;
  color: white;
  transform: translateY(-1px);
}

/* ─── Skeleton cards (grid principal) ───────────────────────── */
.skeleton-card {
  pointer-events: none;
  cursor: default;
}
.skel-prod-img {
  aspect-ratio: 1;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  animation: skelShimmer 1.4s ease-in-out infinite;
}
.skel-prod-body {
  padding: 14px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skel-prod-line, .skel-prod-btn {
  background: var(--surface2);
  border-radius: 6px;
  animation: skelShimmer 1.4s ease-in-out infinite;
}
.skel-prod-line.short { height: 12px; width: 40%; }
.skel-prod-line.long  { height: 16px; width: 90%; }
.skel-prod-line.mid   { height: 14px; width: 55%; }
.skel-prod-btn        { height: 38px; border-radius: 8px; margin-top: 4px; }

@keyframes skelShimmer {
  0%,100% { opacity: .45; }
  50%      { opacity: .9; }
}

/* ─── Fly-to-cart animation ──────────────────────────────────── */
@keyframes cartBounce {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.35); }
  60%  { transform: scale(.9); }
  80%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.cart-bounce { animation: cartBounce .4s ease forwards; }

/* ─── Toast ─────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #2e3248;
  color: white;
  padding: 12px 24px;
  border-radius: 32px;
  font-size: .9rem;
  font-weight: 500;
  z-index: 300;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1), opacity 0.3s;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ─── Footer ─────────────────────────────────────────────────── */
footer {
  background: #0a0c12;
  color: #6b7280;
  padding: 40px 24px 24px;
  margin-top: 48px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand .logo { color: var(--accent); margin-bottom: 12px; }
.footer-brand p { font-size: .88rem; line-height: 1.6; }

.footer-col h4 {
  font-size: .88rem;
  font-weight: 700;
  color: #f9fafb;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col ul li a { font-size: .88rem; transition: color var(--transition); }
.footer-col ul li a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid #16181f;
  padding-top: 20px;
  font-size: .82rem;
  text-align: center;
}

/* ─── Mobile nav ────────────────────────────────────────────── */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 150;
  backdrop-filter: blur(2px);
}
.mobile-nav-overlay.visible { display: block; }

.mobile-nav {
  position: fixed;
  top: 0; left: -280px;
  width: 280px;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 151;
  display: flex;
  flex-direction: column;
  padding: 24px 0 32px;
  transition: left 0.3s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}
.mobile-nav.open { left: 0; }

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  font-size: .95rem;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  background: none;
  border: none;
  text-align: left;
  width: 100%;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.mobile-nav-link:hover,
.mobile-nav-link.active { background: var(--surface2); color: var(--text); }

.mobile-nav-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 24px;
}

.mobile-nav-label {
  padding: 6px 24px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .8px;
}

/* ─── Vaciar carrito ────────────────────────────────────────── */
.cart-clear {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text3);
  margin-right: auto;
  transition: color var(--transition), background var(--transition);
}
.cart-clear:hover { color: var(--danger); background: #2d1414; }

/* ─── WhatsApp button ───────────────────────────────────────── */
.whatsapp-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 250;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 12px 16px;
  background: #25d366;
  color: white;
  border-radius: 32px;
  font-weight: 700;
  font-size: .9rem;
  box-shadow: 0 4px 20px rgba(37,211,102,.4);
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}

.whatsapp-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(37,211,102,.5);
}

/* ─── Mobile search bar ─────────────────────────────────────── */
.search-toggle {
  display: none;
  padding: 8px;
  color: var(--text2);
  border-radius: 8px;
  transition: color var(--transition);
}

.search-toggle:hover { color: var(--text); }

.mobile-search-bar {
  display: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
}

.mobile-search-bar.open { display: block; }

.mobile-search-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 8px 14px;
}

.mobile-search-inner svg { color: var(--text3); flex-shrink: 0; }

.mobile-search-inner input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: .92rem;
  font-family: inherit;
}

.mobile-search-inner input::placeholder { color: var(--text3); }

#mobile-search-close {
  color: var(--text3);
  padding: 2px;
  flex-shrink: 0;
  transition: color var(--transition);
}

#mobile-search-close:hover { color: var(--text); }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .header-search { display: none; }
  .header-nav    { display: none; }
  .search-toggle { display: flex; }
  .menu-toggle { display: flex; }
  .whatsapp-btn .whatsapp-label { display: none; }
  .whatsapp-btn { padding: 14px; border-radius: 50%; }

  .hero { padding: 48px 20px; }
  .hero h1 { font-size: 2rem; }

  #products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }

  .footer-grid { grid-template-columns: 1fr; gap: 24px; }

  #stats { padding: 32px 20px; gap: 24px; }
  .stat-item .stat-num { font-size: 1.8rem; }
}

@media (max-width: 480px) {
  #products-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .product-body { padding: 12px; }
  .product-name { font-size: .85rem; }
  .product-price { font-size: 1rem; }
  .btn-add-cart { font-size: .8rem; padding: 8px; }
}
