/* ─── VARIABLES ─────────────────────────────────────────── */
:root {
  --azul:       #1a3c5e;
  --azul-claro: #2563eb;
  --verde:      #2e7d32;
  --blanco:     #ffffff;
  --gris-claro: #f5f5f5;
  --gris:       #e0e0e0;
  --texto:      #212121;
  --texto-suave:#666666;
  --naranja:    #e65100;
  --sombra:     0 2px 8px rgba(0,0,0,0.1);
  --radio:      8px;
}

/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Arial, sans-serif; color: var(--texto); background: var(--gris-claro); }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; font-family: inherit; }

/* ─── NAVBAR ─────────────────────────────────────────────── */
.navbar {
  background: var(--azul);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--sombra);
}
.navbar-logo {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--blanco);
  white-space: nowrap;
}
.navbar-logo span { color: #60a5fa; }
.navbar-search {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.15);
  border-radius: 24px;
  padding: 0 1rem;
  gap: 0.5rem;
  max-width: 500px;
}
.navbar-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--blanco);
  font-size: 0.9rem;
  padding: 0.5rem 0;
}
.navbar-search input::placeholder { color: rgba(255,255,255,0.6); }
.navbar-actions { display: flex; gap: 0.5rem; margin-left: auto; }
.nav-btn {
  background: rgba(255,255,255,0.15);
  color: var(--blanco);
  border-radius: var(--radio);
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: background 0.2s;
}
.nav-btn:hover { background: rgba(255,255,255,0.25); }
.nav-btn.primary { background: var(--verde); }

/* ─── CATEGORÍAS ─────────────────────────────────────────── */
.cat-strip {
  background: var(--blanco);
  padding: 0.75rem 2rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--gris);
}
.cat-strip::-webkit-scrollbar { display: none; }
.cat-pill {
  padding: 0.3rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--gris);
  font-size: 0.85rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--blanco);
}
.cat-pill:hover, .cat-pill.active {
  background: var(--azul);
  color: var(--blanco);
  border-color: var(--azul);
}

/* ─── HERO ───────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--azul) 0%, #2563eb 100%);
  color: var(--blanco);
  padding: 3rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.hero-text h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.hero-text p { font-size: 1rem; opacity: 0.85; margin-bottom: 1.5rem; }
.hero-cta { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.btn-primary {
  background: var(--verde);
  color: var(--blanco);
  padding: 0.6rem 1.4rem;
  border-radius: var(--radio);
  font-size: 0.95rem;
  font-weight: bold;
  transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-secondary {
  background: transparent;
  color: var(--blanco);
  border: 2px solid var(--blanco);
  padding: 0.6rem 1.4rem;
  border-radius: var(--radio);
  font-size: 0.95rem;
  transition: all 0.2s;
}
.btn-secondary:hover { background: var(--blanco); color: var(--azul); }

/* ─── SECCIONES ──────────────────────────────────────────── */
.seccion { padding: 2rem; max-width: 1200px; margin: 0 auto; }
.seccion-titulo {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--azul);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ver-todo { font-size: 0.85rem; color: var(--azul-claro); font-weight: normal; }
.ver-todo:hover { text-decoration: underline; }

/* ─── GRID DE PRODUCTOS ──────────────────────────────────── */
.productos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.producto-card {
  background: var(--blanco);
  border-radius: var(--radio);
  overflow: hidden;
  box-shadow: var(--sombra);
  transition: transform 0.2s;
}
.producto-card:hover { transform: translateY(-3px); }
.producto-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--gris);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--texto-suave);
  font-size: 2rem;
}
.producto-info { padding: 0.75rem; }
.producto-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
  margin-bottom: 0.3rem;
}
.badge-vintage { background: #fff3e0; color: var(--naranja); }
.badge-temporada { background: #e8f5e9; color: var(--verde); }
.producto-nombre { font-weight: bold; font-size: 0.9rem; margin-bottom: 0.2rem; }
.producto-equipo { font-size: 0.8rem; color: var(--texto-suave); margin-bottom: 0.5rem; }
.producto-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.producto-precio { font-weight: bold; font-size: 1rem; color: var(--azul); }
.btn-carrito {
  background: var(--azul);
  color: var(--blanco);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
}
.btn-carrito:hover { background: var(--azul-claro); }

/* ─── SWAP CARDS ─────────────────────────────────────────── */
.swap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.swap-card {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  overflow: hidden;
}
.swap-card-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gris);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.swap-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gris);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
}
.swap-body {
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.swap-shirt {
  flex: 1;
  background: var(--gris-claro);
  border-radius: 6px;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.8rem;
}
.swap-shirt-label { color: var(--texto-suave); font-size: 0.7rem; margin-bottom: 0.2rem; }
.swap-arrow { font-size: 1.2rem; color: var(--texto-suave); }
.swap-footer {
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--gris);
  display: flex;
  gap: 0.5rem;
}
.btn-swap {
  flex: 1;
  padding: 0.4rem;
  border-radius: 6px;
  font-size: 0.8rem;
  text-align: center;
}
.btn-swap.outline {
  border: 1px solid var(--gris);
  background: var(--blanco);
}
.btn-swap.solid {
  background: var(--verde);
  color: var(--blanco);
}

/* ─── BADGE ESTADO ───────────────────────────────────────── */
.badge-estado {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
}
.estado-abierto { background: #e8f5e9; color: var(--verde); }
.estado-propuesta { background: #fff3e0; color: var(--naranja); }
.estado-aceptado { background: #e3f2fd; color: var(--azul-claro); }
.estado-cerrado { background: var(--gris); color: var(--texto-suave); }

/* ─── FORMULARIOS ────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; }
.form-label { font-size: 0.85rem; font-weight: bold; color: var(--texto); }
.form-input {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--gris);
  border-radius: var(--radio);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--azul-claro); }
.form-error { font-size: 0.8rem; color: #d32f2f; }

/* ─── CARDS GENERALES ────────────────────────────────────── */
.card {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 1.5rem;
}

/* ─── FOOTER ─────────────────────────────────────────────── */
footer {
  background: var(--azul);
  color: rgba(255,255,255,0.8);
  padding: 2rem;
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
}
footer h4 { color: var(--blanco); margin-bottom: 0.75rem; font-size: 0.95rem; }
footer a { display: block; font-size: 0.85rem; margin-bottom: 0.3rem; opacity: 0.8; }
footer a:hover { opacity: 1; }

/* ─── ALERTS ─────────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radio);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.alert-success { background: #e8f5e9; color: var(--verde); border: 1px solid #a5d6a7; }
.alert-error { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.alert-info { background: #e3f2fd; color: var(--azul); border: 1px solid #90caf9; }

/* ─── LOADING ────────────────────────────────────────────── */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--texto-suave);
  font-size: 0.9rem;
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--gris);
  border-top-color: var(--azul);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .navbar-search { display: none; }
  .hero { flex-direction: column; padding: 2rem 1rem; }
  .hero-text h1 { font-size: 1.5rem; }
  .seccion { padding: 1rem; }
  .productos-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .productos-grid { grid-template-columns: 1fr; }
}