/* Variables de color y tipografía */
:root {
  --color-bg: #2d014f;
  --color-accent: #5a0dad;
  --color-text: #ffffff;
  --color-muted: #bbbbbb;
  --radius: 0.75rem;
  --shadow: 0 4px 8px rgba(0,0,0,0.3);
  --font-main: 'Orbitron';
}

* {
  box-sizing: border-box;
  margin: 0; padding: 0;
}

body {
  font-family: var(--font-main);
  background: #2d014f;
  color: var(--color-text);
  line-height: 1.5;
}

/* ===== NAVBAR ===== */
header.nav {
  position: sticky; top: 0;
  background: var(--color-bg);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  box-shadow: var(--shadow);
  z-index: 1000;
}
header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1.5rem;
}
header .brand {
  display: flex; align-items: center;
  font-size: 1.25rem; font-weight: bold;
  color: var(--color-text); text-decoration: none;
}
header .brand img {
  height: 60px; margin-right: 0.5rem;
}
header .actions {
  display: flex; align-items: center; gap: 0.75rem;
}

/* ===== BOTONES ===== */
.btn {
  background: var(--color-accent);
  border: none; border-radius: var(--radius);
  color: var(--color-text);
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}
.btn:hover {
  background: #7b2fd4;
}
.btn.secondary {
  background: transparent;
  border: 1px solid var(--color-accent);
}
.btn.secondary:hover {
  background: rgba(255,255,255,0.1);
}

/* Animación para botón "Agregar" */
.btn.added {
  animation: btnAdded 0.4s;
  background: #43e97b !important;
  color: #222 !important;
}
@keyframes btnAdded {
  0%   { transform: scale(1);   }
  20%  { transform: scale(1.15);}
  60%  { transform: scale(0.95);}
  100% { transform: scale(1);   }
}

/* ===== HERO ===== */
.hero {
  padding: 2rem 1.5rem;
}
.hero .inner {
  display: grid; gap: 2rem;
  align-items: center;
}
.hero .hero-card {
  max-width: 500px;
}
.hero .title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.hero .subtitle {
  font-size: 1rem;
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}
.hero img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-cta {
  display: flex; gap: 1rem;
}

/* ===== PRODUCTOS ===== */
main.container {
  padding: 2rem 1.5rem;
}
.filters {
  display: flex; flex-wrap: wrap; gap: 1rem;
  margin-bottom: 2rem;
}
.filters input, .filters select {
  padding: 0.5rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
  color: var(--color-text);
}
.filters input[type=range] {
  width: 150px;
}
.filters select, .filters option {
  background: rgba(45,1,79,0.95); /* mismo color que el fondo */
  color: var(--color-text);
  border: 1px solid var(--color-accent);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--color-text);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: center;
  min-height: 370px; /* Ajusta este valor según tu diseño */
}
.card img {
  width: 100%;
  height: 200px;      /* Puedes ajustar la altura según tu diseño */
  object-fit: contain; /* Usa 'cover' si quieres que recorte, 'contain' si quieres que todo se vea */
  display: block;
  background: #fff;   /* Opcional: fondo blanco para imágenes transparentes */
}
.card h3 {
  color: var(--color-bg);
  font-size: 1rem;
  min-height: 2.5em; /* Fuerza altura mínima para títulos cortos */
  display: flex;
  justify-content: center;
  margin-bottom: auto;
}
.card .price {
  font-weight: bold; 
  color: var(--color-bg);
  margin-top: auto;
  margin-bottom: 0.5rem;
  order: 10;
}
.card button.btn {
  color: #fff;
  background: var(--color-bg);
  margin-top: auto;
  order: 11;
}
/* ===== CARRITO ===== */
.cart {
  position: fixed;
  top: 0; right: -400px;
  width: 350px; height: 100%;
  background: #1a002c;
  box-shadow: var(--shadow);
  transition: right 0.3s ease;
  display: flex; flex-direction: column;
  z-index: 2000;
}
.cart.open { right: 0; }
.cart header, .cart .footer {
  padding: 1rem; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.cart .footer { border-top: 1px solid rgba(255,255,255,0.1); margin-top: auto; }
.cart .items {
  flex: 1; overflow-y: auto;
  padding: 1rem;
}
.cart-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  z-index: 1500;
}
.cart.open ~ .cart-backdrop { display: block; }

/* ===== MODAL ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 3000;
  display: none;
}
.modal-producto {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: #fff;
  color: #222;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 3100;
  min-width: 320px;
  max-width: 95vw;
  max-height: 90vh;
  display: none;
  flex-direction: column;
  align-items: center;
  animation: modalIn 0.2s;
}
@keyframes modalIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.8);}
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1);}
}
.modal-producto.open,
.modal-backdrop.open {
  display: flex;
}
.modal-content {
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.modal-content img {
  width: 180px;
  max-width: 90vw;
  margin-bottom: 1rem;
}
.modal-content h2 {
  color: var(--color-bg);
  margin-bottom: 0.5rem;
}
.modal-content .price {
  color: var(--color-bg);
  font-weight: bold;
  margin-bottom: 1rem;
}
.modal-content p {
  margin-bottom: 1.5rem;
  color: #333;
  text-align: center;
}
.modal-content .btn {
  background: #2d014f;
  color: #fff;
}
.modal-content .btn:hover {
  background: #5a0dad;
}
.modal-content .close-modal {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #333;
  cursor: pointer;
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: var(--color-muted);
}
.no-results {
  text-align: center;
  color: var(--color-muted);
  padding: 2rem 0;
  font-size: 1.2rem;
}
.btn-inbox {
  font-size: 1.1rem;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75em;
  background-color: #ffffff;
  --color-text: var(--color-bg);
}
.btn-inbox span {
  font-size: 2em;
}
