@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,300&family=DM+Serif+Display:ital@0;1&display=swap');

:root {
  --bg: #0a0a0a;
  --bg2: #111111;
  --bg3: #1a1a1a;
  --border: rgba(255,255,255,0.08);
  --accent: #e8ff47;
  --accent-dim: rgba(232,255,71,0.10);
  --text: #f5f5f5;
  --text-muted: #888;
  --text-dim: #444;
  --radius: 16px;
  --transition: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 68px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* ══════════════════════════════════════
   HEADER
══════════════════════════════════════ */
header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(10,10,10,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logoBox img {
  height: 36px;
  width: auto;
}

.marca {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.3px;
}

/* ══════════════════════════════════════
   BACK BUTTON
══════════════════════════════════════ */
.back {
  position: fixed;
  top: calc(var(--header-h) + 16px);
  left: 20px;
  z-index: 190;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s var(--transition);
}

.back:hover {
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
  transform: translateX(-3px);
}

/* ══════════════════════════════════════
   CART ICON
══════════════════════════════════════ */
#iconoCarrito {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 100px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s var(--transition);
}

#iconoCarrito:hover {
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
}

#contador {
  background: var(--accent);
  color: #0a0a0a;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.3s var(--transition);
}

#iconoCarrito:hover #contador {
  background: #0a0a0a;
  color: var(--accent);
}

/* ══════════════════════════════════════
   CATEGORY HERO
══════════════════════════════════════ */
.category-hero {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 56px 40px 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.category-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 100% at 50% 0%, rgba(232,255,71,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.category-hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 400;
  letter-spacing: -1px;
  margin-bottom: 12px;
  position: relative;
}

.category-hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.category-hero p {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 300;
  position: relative;
}

/* ══════════════════════════════════════
   INFO BANNER
══════════════════════════════════════ */
.info-banner {
  background: var(--accent-dim);
  border-top: 1px solid rgba(232,255,71,0.15);
  border-bottom: 1px solid rgba(232,255,71,0.15);
  padding: 14px 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.2px;
}

/* ══════════════════════════════════════
   SEARCH BAR
══════════════════════════════════════ */
.search-wrap {
  padding: 32px 40px 24px;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.search-bar {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  font-size: 16px;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  transition: all 0.3s;
}

.search-input::placeholder { color: var(--text-dim); }

.search-input:focus {
  outline: none;
  border-color: rgba(232,255,71,0.4);
  background: var(--bg3);
  box-shadow: 0 0 0 3px rgba(232,255,71,0.06);
}

.product-count {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.product-count strong {
  color: var(--text);
  font-weight: 600;
}

/* ══════════════════════════════════════
   PRODUCT GRID
══════════════════════════════════════ */
.tienda {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  max-width: 1400px;
  margin: 0 auto;
}

.producto {
  background: var(--bg);
  padding: 20px;
  transition: background 0.3s;
  position: relative;
  overflow: hidden;
}

.producto:hover {
  background: var(--bg2);
  z-index: 1;
}

.producto-img-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: var(--bg2);
  aspect-ratio: 1;
  margin-bottom: 16px;
}

.producto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--transition);
}

.producto:hover img {
  transform: scale(1.06);
}

.producto-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: #0a0a0a;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 100px;
  z-index: 2;
}

.producto-actions-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s var(--transition);
  display: flex;
  justify-content: center;
}

.producto:hover .producto-actions-overlay {
  opacity: 1;
  transform: translateY(0);
}

.btn-overlay {
  background: var(--accent);
  color: #0a0a0a;
  border: none;
  padding: 9px 20px;
  border-radius: 100px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-overlay:hover {
  background: #f0ff60;
  transform: scale(1.04);
}

.producto h3 {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--text);
  letter-spacing: -0.1px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

.precio {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  color: var(--accent);
  letter-spacing: -0.5px;
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.precio-lista {
  font-size: 14px;
  color: var(--text-dim);
  text-decoration: line-through;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  letter-spacing: 0;
}

.btn {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 16px;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--transition);
  letter-spacing: -0.1px;
}

.btn:hover {
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
  width: 100%;
  grid-column: 1 / -1;
}

.empty-state .empty-icon {
  font-size: 56px;
  margin-bottom: 20px;
  display: block;
  opacity: 0.5;
}

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

.empty-state p {
  font-size: 14px;
  font-weight: 300;
}

/* ══════════════════════════════════════
   CARRITO (DRAWER)
══════════════════════════════════════ */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 298;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(4px);
}

.cart-overlay.show {
  opacity: 1;
  pointer-events: all;
}

#carrito {
  position: fixed;
  right: -420px;
  top: 0;
  width: 100%;
  max-width: 400px;
  height: 100%;
  background: var(--bg2);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: right 0.45s var(--transition);
  z-index: 299;
}

#carrito.show {
  right: 0;
}

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

.carrito-header h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  font-weight: 400;
}

.carrito-close {
  width: 36px;
  height: 36px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s;
}

.carrito-close:hover {
  background: #ef4444;
  border-color: #ef4444;
}

.carrito-contenido {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg3) transparent;
}

.carrito-vacio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: var(--text-muted);
}

.carrito-vacio .icon {
  font-size: 52px;
  opacity: 0.3;
}

.carrito-vacio p {
  font-size: 15px;
  font-weight: 300;
}

.item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

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

.item b {
  font-size: 13px;
  font-weight: 500;
  display: block;
  margin-bottom: 4px;
  line-height: 1.4;
}

.item-price {
  font-size: 13px;
  color: var(--text-muted);
}

.quitar {
  width: 30px;
  height: 30px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.quitar:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: white;
}

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

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

.total-label {
  font-size: 14px;
  color: var(--text-muted);
}

.total-amount {
  font-family: 'DM Serif Display', serif;
  font-size: 26px;
  color: var(--accent);
}

.whatsapp {
  width: 100%;
  background: #25d366;
  border: none;
  padding: 14px;
  border-radius: 12px;
  color: #0a2e0f;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 10px;
  transition: all 0.3s var(--transition);
  letter-spacing: -0.2px;
}

.whatsapp:hover {
  background: #20ba5a;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37,211,102,0.3);
}

.vaciar {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 12px;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.vaciar:hover {
  background: rgba(239,68,68,0.1);
  border-color: #ef4444;
  color: #ef4444;
}

/* ══════════════════════════════════════
   MODAL
══════════════════════════════════════ */
#modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
  backdrop-filter: blur(8px);
}

#modal.show {
  display: flex;
}

.modal-content {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 32px;
  border-radius: 20px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  animation: modalIn 0.4s var(--transition);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 20px;
  line-height: 1.3;
}

.modal-qty-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.qty-btn {
  width: 40px;
  height: 40px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.qty-btn:hover {
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
}

#cantidad {
  width: 70px;
  padding: 10px;
  text-align: center;
  font-family: 'DM Serif Display', serif;
  font-size: 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg3);
  color: var(--text);
}

.modal-subtotal {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  letter-spacing: 0.1px;
}

.modal-subtotal span {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  color: var(--accent);
  margin-left: 6px;
}

.modal-btns {
  display: flex;
  gap: 10px;
}

.modal-btns .btn-confirm {
  flex: 1;
  background: var(--accent);
  border: none;
  padding: 13px;
  border-radius: 12px;
  color: #0a0a0a;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-btns .btn-confirm:hover {
  background: #f0ff60;
  transform: translateY(-1px);
}

.modal-btns .btn-cancel {
  padding: 13px 20px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-btns .btn-cancel:hover {
  border-color: rgba(255,255,255,0.2);
  color: var(--text);
}

/* ══════════════════════════════════════
   WHATSAPP FLOAT
══════════════════════════════════════ */
.whatsapp-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #25d366;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 30px rgba(37,211,102,0.35);
  z-index: 200;
  transition: all 0.3s var(--transition);
}

.whatsapp-float:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 14px 40px rgba(37,211,102,0.5);
}

.whatsapp-float svg {
  width: 26px;
  height: 26px;
  color: white;
}

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 40px;
  text-align: center;
  margin-top: 60px;
}

footer .footer-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 12px;
}

footer .footer-info {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: 300;
}

footer .footer-copy {
  font-size: 12px;
  color: var(--text-dim);
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ══════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--transition), transform 0.6s var(--transition);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 1200px) {
  .tienda { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  header { padding: 0 20px; }
  .tienda { grid-template-columns: repeat(2, 1fr); }
  .search-wrap { padding: 24px 20px 16px; }
  .category-hero { padding: 40px 20px 32px; }
}

@media (max-width: 640px) {
  :root { --header-h: 60px; }
  header { padding: 0 16px; }
  .marca { font-size: 16px; }
  .logoBox img { height: 30px; }
  .back { top: calc(var(--header-h) + 12px); left: 14px; padding: 8px 14px; font-size: 12px; }
  #iconoCarrito { padding: 8px 14px; font-size: 13px; }

  .tienda { grid-template-columns: repeat(2, 1fr); gap: 1px; }
  .producto { padding: 14px; }
  .producto h3 { font-size: 13px; }
  .precio { font-size: 18px; }

  .search-wrap { flex-direction: column; align-items: flex-start; gap: 10px; }
  .search-bar { max-width: 100%; width: 100%; }

  #carrito { max-width: 100%; width: 100%; }
  .carrito-header { padding: 18px; }
  .carrito-footer { padding: 16px 18px; }

  footer { padding: 28px 20px; margin-top: 40px; }
}

@media (max-width: 380px) {
  .tienda { grid-template-columns: 1fr; }
  .producto { padding: 16px; }
  .producto img { height: 200px; }
}
