:root {
  --brand: #ff2f92;
  --brand-dark: #d61277;
  --cyan: #22e5ff;
  --ink: #121214;
  --ink-soft: #1c1c22;
  --bg: #f3f4f6;
  --card-bg: #ffffff;
  --text: #18181b;
  --muted: #6b7280;
  --border: #e5e7eb;
  --link: #1656d6;
  --green: #16a34a;
  --orange: #d97706;
  --whatsapp: #25d366;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.container { max-width: 1600px; margin: 0 auto; padding: 0 28px; }

/* Header */
.site-header {
  background: var(--ink);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo {
  font-size: 25px; font-weight: 800; color: #fff; text-decoration: none;
  letter-spacing: -0.01em; text-transform: uppercase; display: inline-block;
  transform: skewX(-8deg); font-style: normal;
}
.logo span { color: var(--brand); text-shadow: 0 0 14px rgba(255,47,146,.55); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.cart-btn {
  position: relative; background: rgba(255,255,255,.08); color: #fff; border: none;
  width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s ease;
}
.cart-btn:hover { background: rgba(255,255,255,.18); }
.cart-count {
  position: absolute; top: -6px; right: -6px; background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.cart-count.bump { animation: cartBump .3s ease; }
@keyframes cartBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); }
  100% { transform: scale(1); }
}
.header-cta {
  display: flex; align-items: center; gap: 8px;
  background: var(--whatsapp); color: #fff; font-weight: 600; font-size: 14px;
  padding: 9px 16px; border-radius: 999px; text-decoration: none;
  transition: transform .15s ease, opacity .15s ease;
}
.header-cta:hover { opacity: .92; transform: translateY(-1px); }

/* Carrusel de ofertas */
.ofertas-carousel {
  position: relative; overflow: hidden; height: 380px;
  background:
    radial-gradient(circle at 14% 22%, rgba(255,47,146,.35), transparent 42%),
    radial-gradient(circle at 86% 78%, rgba(34,229,255,.28), transparent 42%),
    var(--ink);
}
.ofertas-carousel[hidden] { display: none; }
.carousel-viewport { width: 100%; height: 100%; overflow: hidden; }
.carousel-track { display: flex; height: 100%; transition: transform .6s cubic-bezier(.4,0,.2,1); }
.carousel-slide {
  flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 40px; padding: 0 80px; max-width: 1600px; margin: 0 auto; box-sizing: border-box;
  overflow: hidden; min-width: 0;
}
.slide-text { max-width: 480px; min-width: 0; color: #fff; overflow: hidden; }
.slide-marca { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--cyan); font-weight: 700; }
.slide-title {
  font-size: clamp(22px, 3vw, 34px); line-height: 1.2; margin: 8px 0 12px; font-weight: 800;
  text-shadow: 0 0 20px rgba(255,47,146,.3); overflow-wrap: anywhere; word-break: break-word;
}
.slide-badge {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px;
  background: rgba(217,119,6,.18); color: #ffb454; border: 1px solid rgba(217,119,6,.4);
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.slide-price { font-size: 28px; font-weight: 800; margin: 0 0 20px; }
.slide-cta {
  display: inline-flex; background: var(--brand); color: #fff; font-weight: 700; font-size: 14px;
  border: none; cursor: pointer; padding: 12px 26px; border-radius: 999px;
  box-shadow: 0 8px 20px rgba(255,47,146,.35); transition: transform .15s ease, box-shadow .15s ease;
}
.slide-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(255,47,146,.5); }
.slide-image { flex-shrink: 0; width: 280px; height: 280px; display: flex; align-items: center; justify-content: center; }
.slide-image img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 20px 40px rgba(0,0,0,.5)); }

.carousel-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.1); color: #fff; font-size: 16px; display: flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.carousel-nav:hover { background: rgba(255,255,255,.22); }
.carousel-prev { left: 18px; }
.carousel-next { right: 18px; }

.carousel-dots { position: absolute; bottom: 16px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; z-index: 2; }
.carousel-dot {
  width: 8px; height: 8px; border-radius: 50%; border: none; background: rgba(255,255,255,.3); cursor: pointer; padding: 0;
  transition: background .15s ease, transform .15s ease;
}
.carousel-dot.activo { background: var(--brand); transform: scale(1.3); }

@media (max-width: 900px) {
  .carousel-slide { padding: 0 40px; gap: 24px; }
  .slide-image { width: 200px; height: 200px; }
}

@media (max-width: 720px) {
  .ofertas-carousel { height: auto; }
  .carousel-slide { flex-direction: column; padding: 32px 24px 44px; gap: 20px; text-align: center; }
  .slide-text { max-width: 100%; }
  .slide-image { width: 180px; height: 180px; }
  .carousel-nav { width: 34px; height: 34px; font-size: 13px; }
}

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 12% 20%, rgba(255,47,146,.32), transparent 45%),
    radial-gradient(circle at 88% 85%, rgba(34,229,255,.26), transparent 45%),
    var(--ink);
  padding: 64px 0 52px;
}
.hero-inner { max-width: 640px; }
.hero-meta {
  display: inline-flex; align-items: center; gap: 9px; margin: 0 0 18px; font-size: 13px; color: #d7d9e2;
  background: rgba(255,255,255,.07); padding: 8px 18px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14);
}
.hero-meta::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 8px var(--green); flex-shrink: 0;
}
.hero h1 {
  color: #fff; font-size: clamp(28px, 4vw, 40px); line-height: 1.18; font-weight: 800; margin: 0 0 16px;
}
.hero h1 .hero-highlight { color: var(--brand); text-shadow: 0 0 24px rgba(255,47,146,.5); }
.hero-sub { color: #c7c8d1; font-size: 15px; line-height: 1.55; margin: 0 0 28px; max-width: 480px; }
.hero-search { max-width: 520px; }
.hero-search input {
  width: 100%; padding: 14px 20px; border-radius: 999px; border: none; font-size: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.hero-search input:focus { outline: 3px solid var(--brand); }
.hero-badges { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.hero-badges span {
  display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
  color: #d7d9e2; font-size: 12.5px; padding: 6px 14px; border-radius: 999px;
}
.hero-badges span::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); flex-shrink: 0;
}

/* Layout */
.layout { display: grid; grid-template-columns: 230px 1fr; gap: 36px; margin: 36px 0 60px; align-items: start; }
.sidebar { position: sticky; top: 84px; }
.sidebar h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; padding-left: 10px; border-left: 3px solid var(--brand); }
.sidebar h2:not(:first-child) { margin-top: 24px; }
.categoria-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.categoria-list button {
  width: 100%; text-align: left; background: none; border: none; padding: 9px 12px;
  border-radius: 8px; font-size: 14px; color: var(--text); cursor: pointer;
}
.categoria-list button:hover { background: #ececf1; }
.categoria-list button.activa { background: var(--brand); color: #fff; font-weight: 600; }

.marca-list { max-height: 260px; overflow-y: auto; padding-right: 4px; }
.marca-list::-webkit-scrollbar { width: 6px; }
.marca-list::-webkit-scrollbar-track { background: transparent; }
.marca-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

.ofertas-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 22px;
  background: #fff1e6; color: var(--orange); border: 1px solid #ffd9b3;
  padding: 11px 14px; border-radius: 10px; font-weight: 700; font-size: 13.5px;
  cursor: pointer; transition: background .15s ease, color .15s ease;
}
.ofertas-toggle svg { width: 17px; height: 17px; flex-shrink: 0; }
.ofertas-toggle:hover { background: #ffe4c7; }
.ofertas-toggle.activo { background: var(--orange); color: #fff; border-color: var(--orange); }

.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.resultados-info { color: var(--muted); margin: 0; font-size: 14px; }
.toolbar-right select {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fff;
}

.active-filter {
  display: flex; align-items: center; gap: 10px; background: #ffe9f4; border: 1px solid #ffbfe0;
  color: var(--brand-dark); padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px;
}
.active-filter[hidden] { display: none; }
.empty-state[hidden] { display: none; }
.active-filter button {
  margin-left: auto; background: none; border: 1px solid var(--brand-dark); color: var(--brand-dark);
  border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}

/* Grid & cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-bottom: 28px; }
.card {
  background: var(--card-bg); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 1px 3px rgba(16,18,24,.06); border: 1px solid var(--border);
  display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease;
  position: relative;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(16,18,24,.1); border-color: var(--brand); }
.card-media { position: relative; background: #fbfbfc; }
.card img { width: 100%; height: 170px; object-fit: contain; padding: 18px; display: block; }
.badge {
  position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  padding: 4px 9px; border-radius: 999px; text-transform: uppercase;
}
.badge.urgente { background: #fff1e6; color: var(--orange); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.marca { font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; font-weight: 600; }
.card h3 { font-size: 14.5px; margin: 0; line-height: 1.35; font-weight: 600; min-height: 39px; }
.product-link { color: var(--link); text-decoration: none; }
.product-link:hover { text-decoration: underline; }
.stock-line { font-size: 12px; font-weight: 600; }
.stock-line.alto { color: var(--green); }
.stock-line.urgente { color: var(--orange); }
.card-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.precio { font-size: 20px; font-weight: 800; margin: 2px 0 0; letter-spacing: -0.01em; }
.btn-cart {
  flex-shrink: 0; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--whatsapp); border-radius: 8px; text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
.btn-cart:hover { background: var(--brand); color: #fff; transform: translateY(-1px); }
.btn-cart svg { width: 19px; height: 19px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state button {
  margin-top: 12px; background: var(--ink); color: #fff; border: none; padding: 10px 18px;
  border-radius: 999px; cursor: pointer; font-weight: 600;
}

.paginacion { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 8px 0 28px; }
.paginacion button {
  min-width: 38px; height: 38px; padding: 0 10px; border: 1px solid var(--border); background: #fff;
  border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text);
  transition: border-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.paginacion button:hover:not([disabled]):not(.activa) { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.paginacion button.activa { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 4px 12px rgba(255,47,146,.35); }
.paginacion button[disabled] { opacity: .35; cursor: default; }
.paginacion .pag-dots { color: var(--muted); font-size: 13px; padding: 0 4px; user-select: none; }

/* Footer */
.site-footer {
  background:
    radial-gradient(circle at 10% 10%, rgba(255,47,146,.16), transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(34,229,255,.14), transparent 40%),
    linear-gradient(180deg, var(--ink) 0%, #08080a 100%);
  color: #9a9ca8; margin-top: 20px;
  position: relative; overflow: hidden;
  border-top: 1px solid rgba(34,229,255,.2);
}
.site-footer::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand), var(--cyan), var(--brand), transparent);
  background-size: 200% 100%; animation: footerScan 6s linear infinite;
}
.site-footer::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, black 0%, transparent 90%);
  -webkit-mask-image: linear-gradient(180deg, black 0%, transparent 90%);
}
@keyframes footerScan {
  0% { background-position: 0% 0; }
  100% { background-position: -200% 0; }
}
.footer-main {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between;
  padding: 48px 0 32px;
}
.footer-brand { display: flex; flex-direction: column; gap: 10px; max-width: 280px; }
.footer-logo { font-size: 26px; }
.footer-logo span { animation: footerPulse 2.6s ease-in-out infinite; }
@keyframes footerPulse {
  0%, 100% { text-shadow: 0 0 14px rgba(255,47,146,.55); }
  50% { text-shadow: 0 0 24px rgba(255,47,146,.95), 0 0 40px rgba(34,229,255,.45); }
}
.footer-desc { margin: 0; font-size: 13px; color: #8a8c98; line-height: 1.5; }
.footer-col h4 {
  margin: 0 0 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .1em;
  color: #fff; font-weight: 700; padding-left: 10px; border-left: 2px solid var(--brand);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: #9a9ca8; text-decoration: none; font-size: 13.5px; transition: color .15s ease; }
.footer-col a:hover { color: var(--cyan); }
.footer-bottom {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 18px 0 26px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12.5px; color: #6d6f7a;
}
.footer-bottom a { color: var(--cyan); text-decoration: none; font-weight: 700; }
.footer-bottom a:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .footer-main { padding: 40px 0 24px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* WhatsApp flotante */
.whatsapp-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--whatsapp); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(37,211,102,.45), 0 0 0 1px rgba(255,255,255,.08);
  text-decoration: none; animation: floatPulse 2.4s ease-in-out infinite;
  transition: transform .15s ease;
}
.whatsapp-float:hover { transform: scale(1.06); }
@keyframes floatPulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(37,211,102,.45), 0 0 0 1px rgba(255,255,255,.08); }
  50% { box-shadow: 0 6px 26px rgba(37,211,102,.7), 0 0 0 6px rgba(37,211,102,.12); }
}
@media (max-width: 480px) {
  .whatsapp-float { right: 14px; bottom: 14px; width: 50px; height: 50px; }
}

@media (max-width: 480px) {
  .footer-panel { padding: 30px 28px; }
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .categoria-list { flex-direction: row; flex-wrap: wrap; }
  .categoria-list button { width: auto; border: 1px solid var(--border); }
  .marca-list { max-height: none; }
}
@media (max-width: 480px) {
  .card h3 { min-height: unset; }
  .hero { padding: 44px 0 36px; }
  .hero h1 { font-size: 26px; }
  .hero-badges { display: none; }
}

/* Carrito */
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; }
.cart-overlay[hidden] { display: none; }
.cart-drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 400px; max-width: 92vw;
  background: #fff; z-index: 50; box-shadow: -8px 0 30px rgba(0,0,0,.2);
  display: flex; flex-direction: column;
}
.cart-drawer[hidden] { display: none; }
.cart-drawer-header {
  display: flex; align-items: center; justify-content: space-between; padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.cart-drawer-header h2 { font-size: 18px; margin: 0; }
#cart-close { background: none; border: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
#cart-close:hover { color: var(--brand-dark); }
.cart-items { flex: 1; overflow-y: auto; padding: 14px 20px; display: flex; flex-direction: column; gap: 16px; }
.cart-items[hidden] { display: none; }
.cart-item { display: flex; gap: 12px; align-items: center; }
.cart-item img {
  width: 56px; height: 56px; object-fit: contain; background: #fbfbfc; border-radius: 8px;
  border: 1px solid var(--border); padding: 4px; flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: 13px; font-weight: 600; margin: 0 0 4px; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.cart-item-price { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.cart-item-qty { display: flex; align-items: center; gap: 8px; }
.cart-item-qty button {
  width: 24px; height: 24px; border: 1px solid var(--border); background: #fff; border-radius: 6px;
  cursor: pointer; font-size: 14px; line-height: 1;
}
.cart-item-qty button:hover { border-color: var(--brand); color: var(--brand); }
.cart-item-qty span { font-size: 13px; font-weight: 600; min-width: 16px; text-align: center; }
.cart-item-remove { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 20px; padding: 0 4px; flex-shrink: 0; }
.cart-item-remove:hover { color: var(--brand); }
.cart-empty { padding: 50px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.cart-empty[hidden] { display: none; }
.cart-footer { border-top: 1px solid var(--border); padding: 16px 20px 20px; }
.cart-footer[hidden] { display: none; }
.cart-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 15px; }
.cart-total strong { font-size: 21px; }
.cart-checkout-btn {
  width: 100%; background: var(--whatsapp); color: #fff; border: none; padding: 13px;
  border-radius: 999px; font-weight: 700; font-size: 14.5px; cursor: pointer; margin-bottom: 8px;
}
.cart-checkout-btn:hover { opacity: .92; }
.cart-clear-btn {
  width: 100%; background: none; border: 1px solid var(--border); color: var(--muted); padding: 9px;
  border-radius: 999px; font-size: 13px; cursor: pointer;
}
.cart-clear-btn:hover { border-color: var(--brand-dark); color: var(--brand-dark); }

@media (max-width: 480px) {
  .cart-drawer { width: 100vw; max-width: 100vw; }
}
