/* ===== Importar fuente moderna (Google Fonts) ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

:root {
  /* Paleta Moderna y Vibrante */
  --primary: #7c3aed;        /* Violeta base más brillante */
  --primary-dark: #6d28d9;
  --primary-light: #8b5cf6;
  
  --danger: #ef4444;
  --danger-hover: #dc2626;
  
  --success: #10b981;
  --success-hover: #059669;
  
  --bg-input: #f1f5f9;       /* Fondo gris muy suave para inputs */
  --gris-borde: #e2e8f0;
  --texto-principal: #1e293b;
  --texto-secundario: #64748b;
  
  /* Sombras Modernas (Colored Shadows) */
  --shadow-purple: 0 4px 14px 0 rgba(124, 58, 237, 0.39);
  --shadow-red: 0 4px 14px 0 rgba(239, 68, 68, 0.39);
  --shadow-green: 0 4px 14px 0 rgba(16, 185, 129, 0.39);
  
  --shadow-card: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.025);
}

* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
  font-family: 'Poppins', sans-serif; 
}

/* ===== Fondo y Estructura ===== */
body {
  background: linear-gradient(rgba(15, 23, 42, 0.6), rgba(15, 23, 42, 0.6)), 
              url('../img/fondo.png') no-repeat center center fixed;
  background-size: cover;
  display: flex; 
  flex-direction: column; 
  align-items: center;
  color: var(--texto-principal);
  min-height: 100vh;
}

.logo img { 
  width: 150px; 
  margin: 40px 0 20px; 
  filter: drop-shadow(0 10px 10px rgba(0,0,0,0.3)); /* Sombra más suave */
  transition: transform 0.3s ease;
}

.logo img:hover {
  transform: scale(1.05);
}

@media(max-width: 480px) { 
  .logo img { width: 120px; margin-top: 30px; } 
}

/* ===== Contenedores (Glassmorphism Pro) ===== */
.login-box, .login-box2 {
  width: min(92vw, 480px);
  margin: 20px auto;
  padding: 35px;
  border-radius: 24px; /* Bordes más curvos = más moderno */
  background: rgba(255, 255, 255, 0.96); 
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,1);
}

.wide-box { width: min(94vw, 900px); }

/* ===== Inputs y Textarea ===== */
input, select, textarea {
  width: 100%; 
  min-height: 50px;
  padding: 12px 18px; 
  margin-bottom: 18px;
  border: 1px solid transparent; /* Sin borde inicial */
  background-color: var(--bg-input); /* Fondo gris suave */
  border-radius: 12px;
  font-size: 15px;
  color: var(--texto-principal);
  transition: all 0.3s ease;
  outline: none;
  font-weight: 500;
}

input::placeholder, textarea::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

input:focus, select:focus, textarea:focus {
  background-color: #fff;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1); /* Anillo suave */
}

textarea { min-height: 100px; resize: none; }

/* ===== BOTONES REFINADOS ===== */
button {
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  width: 100%; 
  min-height: 50px;
  padding: 0 24px; 
  margin-bottom: 14px;
  border: none; 
  border-radius: 12px; 
  font-weight: 600; 
  font-size: 15px;
  cursor: pointer; 
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Animación fluida */
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
  /* Quitamos el uppercase para que sea menos tosco */
  text-transform: none; 
}

button:active { transform: scale(0.97); }

/* Botón Lila (Primary) - Con Gradiente */
.btn-lila { 
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-dark) 100%);
  color: #fff; 
  box-shadow: var(--shadow-purple);
}
.btn-lila:hover { 
  background: linear-gradient(135deg, #9061f9 0%, #7c3aed 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

/* Botón Rojo */
.btn-rojo { 
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  color: #fff; 
  box-shadow: var(--shadow-red);
}
.btn-rojo:hover { 
  background: linear-gradient(135deg, #fca5a5 0%, #f87171 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* Botón Verde */
.btn-verde { 
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  color: #fff; 
  box-shadow: var(--shadow-green);
}
.btn-verde:hover { 
  background: linear-gradient(135deg, #6ee7b7 0%, #34d399 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Botón Verde Alto (Principal en Admin) */
.btn-verde-alto { 
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff; 
  min-height: 64px; 
  font-size: 17px; 
  box-shadow: var(--shadow-green);
}
.btn-verde-alto:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

/* ===== Panel de Admin (Grid) ===== */
.admin-botones {
  display: grid; 
  gap: 20px; 
  grid-template-columns: 1fr;
  margin-top: 25px;
}
@media(min-width: 768px) {
  .admin-botones { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}
@media(min-width: 1100px) {
  .admin-botones { 
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    max-width: 950px; 
    margin: 25px auto; 
  }
}
.admin-botones a { text-decoration: none; }

/* ===== Mensajes de Alerta ===== */
.mensaje-exito, .mensaje-error {
  padding: 18px; 
  border-radius: 12px; 
  margin: 20px auto;
  width: 100%; 
  max-width: 480px; 
  text-align: center;
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  border: none;
}

.mensaje-exito {
  background: #ecfdf5; 
  color: #047857;
  border-left: 5px solid #10b981;
}
.mensaje-error {
  background: #fef2f2; 
  color: #b91c1c;
  border-left: 5px solid #ef4444;
}

/* ===== Tienda y Productos ===== */
.tienda-productos {
  display: grid; 
  gap: 24px; 
  margin: 30px auto;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  width: min(94vw, 1100px);
}

.producto-card {
  background: #fff;
  border-radius: 16px; 
  padding: 20px;
  display: flex; 
  flex-direction: column; 
  gap: 12px;
  box-shadow: var(--shadow-card);
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

.producto-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  border-color: var(--primary-light);
}

.producto-card img { 
  width: 100%; 
  aspect-ratio: 1 / 1; 
  object-fit: cover; 
  border-radius: 12px; 
  margin-bottom: 8px;
}

.producto-card h3 {
  font-size: 18px;
  color: var(--texto-principal);
  font-weight: 700;
  line-height: 1.3;
}
.producto-card p {
  font-size: 14px;
  color: var(--texto-secundario);
  line-height: 1.5;
}

.producto-card .acciones {
  margin-top: auto;
  padding-top: 15px;
}

/* ===== Autocompletar y Listas ===== */
.sugerencias-box {
  position: absolute; 
  left: 0; right: 0; 
  margin-top: 6px;
  background: #fff; 
  border: 1px solid var(--gris-borde); 
  border-radius: 12px;
  max-height: 300px; 
  overflow-y: auto;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 100;
}
.sugerencia { 
  padding: 14px 18px; 
  cursor: pointer; 
  font-size: 14px; 
  color: var(--texto-principal);
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.2s;
}
.sugerencia:hover, .sugerencia.activa { 
  background: #f8fafc; 
  color: var(--primary);
  font-weight: 600; 
  padding-left: 22px; /* Efecto de desplazamiento */
}

/* ===== Mini Forms y Utilidades ===== */
.mini-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mini-form input[type="number"] {
  width: auto;
  flex: 1;
  min-width: 80px;
  text-align: center;
  margin-bottom: 0;
  background: #fff;
  border: 1px solid var(--gris-borde);
}

.mini-form button {
  width: auto !important;
  margin-bottom: 0;
  padding: 0 20px;
}

.btn-eliminar {
  background: transparent !important; 
  color: var(--texto-secundario) !important;
  border: none !important; 
  font-size: 13px !important; 
  font-weight: 500 !important;
  text-decoration: none;
  box-shadow: none !important;
  justify-content: flex-start;
  padding: 8px 0 !important;
  opacity: 0.8;
}
.btn-eliminar:hover { 
  color: var(--danger) !important; 
  opacity: 1;
  text-decoration: underline;
}

/* Historial */
.mov-item {
  display: flex; 
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--gris-borde);
  transition: transform 0.2s;
}
.mov-item:hover {
  border-color: var(--primary-light);
}

.mov-puntos {
  color: var(--primary);
  font-weight: 700;
  font-size: 16px;
}

/* Admin Header */
.admin-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gris-borde);
}
.admin-header h2 {
  color: var(--primary);
  font-weight: 700;
  font-size: 24px;
  margin-bottom: 5px;
}
.subtitulo {
  color: var(--texto-secundario);
  font-size: 14px;
}

/* Utilidades Grid */
.admin-botones a[style*="grid-column: 1 / -1"] { width: 100%; }

@media(max-width: 480px){
    body { padding-bottom: 60px; }
    .login-box, .login-box2 { padding: 25px 20px; }
}