:root {
  --primary: #6c4ba3;
  --primary-light: #8b6bb4;
  --primary-dark: #5a3d8a;
  --accent: #d4af37;
  --accent-light: #e5c158;
  --bg-light: #faf9ff;
  --bg-card: rgba(255, 255, 255, 0.95);
  --text-dark: #2d2a32;
  --text-muted: #6b7280;
  --shadow-soft: 0 4px 20px rgba(108, 75, 163, 0.08);
  --shadow-medium: 0 8px 30px rgba(108, 75, 163, 0.12);
  --shadow-strong: 0 20px 60px rgba(108, 75, 163, 0.15);
  --glass: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.5);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #f5f3ff 0%, #faf9ff 50%, #f0e6ff 100%);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

@keyframes float { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-10px); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(108, 75, 163, 0.4); } 50% { box-shadow: 0 0 0 15px rgba(108, 75, 163, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 1rem 2rem;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(10px);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left { display: flex; align-items: center; gap: 1rem; }

.logo {
  height: 50px;
  width: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
  transition: transform 0.3s;
}

.logo:hover { transform: scale(1.05) rotate(5deg); }

.brand-text h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: white;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand-text p { color: rgba(255,255,255,0.8); font-size: 0.9rem; font-weight: 300; }

.header-right { display: flex; align-items: center; gap: 1rem; }

.user-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.15);
  padding: 8px 16px;
  border-radius: 50px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
}

#nombreUsuario { color: white; font-weight: 500; font-size: 0.95rem; }

.btn-cerrar-sesion, .btn-historial {
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s;
  font-weight: 500;
}

.btn-cerrar-sesion:hover, .btn-historial:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

.btn-login {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: var(--primary-dark);
  border: none;
  padding: 12px 24px;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-login:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4); }

#btnAdminVelas {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(238, 90, 90, 0.3);
}

#btnAdminVelas:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(238, 90, 90, 0.4); }

/* Hero */
.hero {
  margin-top: 80px;
  padding: 4rem 2rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(108, 75, 163, 0.05) 0%, rgba(212, 175, 55, 0.05) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(108, 75, 163, 0.03) 0%, transparent 70%);
  animation: float 20s infinite ease-in-out;
}

.hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }

.hero h2 {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 1rem;
  animation: fadeInUp 0.8s ease;
}

.hero p { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 2rem; animation: fadeInUp 0.8s ease 0.2s both; }

/* Contenedor */
.contenedor { max-width: 1400px; margin: 0 auto; padding: 2rem; }

/* Loader */
#loader {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 400px;
  color: var(--primary);
}

.loader-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(108, 75, 163, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

/* Secciones de tipo */
.seccion-tipo {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-soft);
  animation: fadeInUp 0.6s ease;
}

.titulo-tipo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--primary);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(108, 75, 163, 0.1);
  font-family: 'Playfair Display', serif;
}

.contador-productos {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}

/* Grid productos */
.productos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2rem; }

/* Cards */
.producto-card {
  background: var(--bg-card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border: 1px solid rgba(108, 75, 163, 0.08);
}

.producto-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-strong); }
.producto-card.oferta { border: 2px solid var(--accent); }

.producto-imagen-container {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: linear-gradient(135deg, #f8f6ff 0%, #f0e6ff 100%);
}

.producto-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1rem;
  transition: transform 0.5s;
  cursor: pointer;
}

.producto-card:hover img { transform: scale(1.08); }

.badges-container {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.badge-nuevo { background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%); color: white; }
.badge-tipo { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: white; }
.badge-oferta { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%); color: var(--primary-dark); }

.producto-info { padding: 1.5rem; }
.producto-header { margin-bottom: 0.75rem; }

.producto-nombre {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.producto-calificacion { color: #ffc107; font-size: 0.9rem; letter-spacing: 2px; }
.producto-precio-container { margin: 1rem 0; }
.precio-original { text-decoration: line-through; color: var(--text-muted); font-size: 0.95rem; margin-right: 8px; }
.precio-oferta { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.precio-normal { font-size: 1.3rem; font-weight: 700; color: var(--primary); }

.stock-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.stock-alto { background: rgba(40, 167, 69, 0.1); color: #28a745; }
.stock-bajo { background: rgba(240, 173, 78, 0.1); color: #f0ad4e; }
.stock-agotado { background: rgba(220, 53, 69, 0.1); color: #dc3545; }

.btn-agregar {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-agregar:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(108, 75, 163, 0.3); }
.btn-agregar:disabled { background: #ccc; cursor: not-allowed; }

/* Acciones */
.acciones-container {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem;
  margin: 3rem auto;
  max-width: 600px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.acciones-container h3 { color: var(--primary); font-family: 'Playfair Display', serif; font-size: 1.5rem; margin-bottom: 1.5rem; }

.btn-accion {
  display: block;
  width: 100%;
  padding: 14px;
  margin: 10px 0;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s;
}

.btn-primario {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(108, 75, 163, 0.3);
}

.btn-primario:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(108, 75, 163, 0.4); }

.btn-secundario {
  background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.btn-secundario:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4); }

/* Modales */
.modal-carrito {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(5px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-contenido {
  background: var(--glass);
  backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2.5rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-strong);
  animation: fadeInUp 0.3s ease;
}

.modal-grande { max-width: 800px; width: 95%; }

.modal-cerrar {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(108, 75, 163, 0.1);
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--primary);
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-cerrar:hover { background: var(--primary); color: white; transform: rotate(90deg); }

.modal-titulo { font-family: 'Playfair Display', serif; font-size: 1.8rem; color: var(--primary); margin-bottom: 1.5rem; padding-right: 40px; }

/* Producto detalle */
.producto-detalle-img {
  width: 100%;
  max-width: 300px;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  margin: 0 auto 1.5rem;
  display: block;
  background: linear-gradient(135deg, #f8f6ff 0%, #f0e6ff 100%);
  padding: 1rem;
}

.producto-detalle-info { color: var(--text-muted); line-height: 1.6; margin-bottom: 1rem; }
.producto-detalle-precio { font-size: 2rem; font-weight: 700; color: var(--primary); margin: 1rem 0; text-align: center; }

.selector-variante {
  width: 100%;
  padding: 12px;
  border: 2px solid rgba(108, 75, 163, 0.2);
  border-radius: 12px;
  margin: 1rem 0;
  font-size: 1rem;
  background: white;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.3s;
}

.selector-variante:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108, 75, 163, 0.1); }

/* Carrito */
.lista-carrito { list-style: none; margin: 1.5rem 0; }

.item-carrito {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(108, 75, 163, 0.05);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(108, 75, 163, 0.1);
}

.item-carrito-info { flex: 1; }
.item-carrito-nombre { font-weight: 600; color: var(--text-dark); margin-bottom: 4px; }
.item-carrito-variante { font-size: 0.85rem; color: var(--text-muted); }
.item-carrito-precio { font-weight: 700; color: var(--primary); font-size: 1.1rem; }

.btn-eliminar {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s;
  margin-left: 10px;
}

.btn-eliminar:hover { background: #e74c3c; color: white; }

.carrito-total { font-size: 1.4rem; font-weight: 700; color: var(--primary); text-align: right; padding: 1rem 0; border-top: 2px solid rgba(108, 75, 163, 0.1); margin-top: 1rem; }

.input-codigo {
  width: 100%;
  padding: 12px;
  border: 2px solid rgba(108, 75, 163, 0.2);
  border-radius: 12px;
  margin: 1rem 0;
  font-size: 1rem;
  transition: all 0.3s;
}

.input-codigo:focus { outline: none; border-color: var(--primary); }

/* Login tabs */
.tabs-container { display: flex; gap: 10px; margin-bottom: 1.5rem; }

.btn-tab {
  flex: 1;
  padding: 12px;
  background: rgba(108, 75, 163, 0.1);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.3s;
}

.btn-tab.activo { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: white; }

.input-group { position: relative; margin-bottom: 1rem; }

.input-group input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid rgba(108, 75, 163, 0.2);
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s;
  background: white;
}

.input-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(108, 75, 163, 0.1); }

.input-status { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 1.2rem; }

.btn-submit {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 0.5rem;
}

.btn-submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(108, 75, 163, 0.3); }
.btn-submit:disabled { background: #ccc; cursor: not-allowed; }

.mensaje-error { color: #e74c3c; font-size: 0.9rem; text-align: center; margin-top: 1rem; min-height: 20px; }

/* Botón flotante carrito */
#botonCarrito {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  box-shadow: 0 8px 30px rgba(108, 75, 163, 0.4);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  animation: pulse-glow 2s infinite;
}

#botonCarrito:hover { transform: scale(1.1); box-shadow: 0 12px 40px rgba(108, 75, 163, 0.5); }

#contadorCarrito {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--accent);
  color: var(--primary-dark);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  border: 3px solid white;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--primary);
  color: white;
  padding: 16px 32px;
  border-radius: 50px;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(108, 75, 163, 0.3);
  z-index: 3000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.mostrar { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Tarjeta lealtad */
.lealtad-container { position: fixed; bottom: 120px; left: 30px; z-index: 998; }

.tarjeta-lealtad {
  background: var(--glass);
  backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 1.5rem;
  width: 320px;
  box-shadow: var(--shadow-strong);
  display: none;
  animation: fadeInUp 0.4s ease;
}

.tarjeta-lealtad-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.tarjeta-lealtad-header h3 { color: var(--primary); font-family: 'Playfair Display', serif; font-size: 1.3rem; }

.btn-cerrar-tarjeta {
  background: rgba(108, 75, 163, 0.1);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--primary);
  font-size: 1.2rem;
  transition: all 0.3s;
}

.btn-cerrar-tarjeta:hover { background: var(--primary); color: white; }

.cliente-info { background: rgba(108, 75, 163, 0.05); padding: 1rem; border-radius: 16px; margin-bottom: 1rem; }
.cliente-info p { margin: 0.25rem 0; font-size: 0.9rem; color: var(--text-muted); }
.cliente-info strong { color: var(--text-dark); }

.sellos-container { margin-top: 1rem; }
.sellos-titulo { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 1px; }
.sellos-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 1rem; }

.sello {
  aspect-ratio: 1;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s;
}

.sello.activo { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%); color: white; box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3); }
.sello.inactivo { background: rgba(108, 75, 163, 0.1); color: var(--text-muted); }

.progreso-lealtad { text-align: center; font-size: 0.9rem; color: var(--text-muted); padding: 0.75rem; background: rgba(108, 75, 163, 0.05); border-radius: 12px; }

.estado-premio {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: var(--primary-dark);
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
  margin-top: 1rem;
  animation: pulse-glow 2s infinite;
}

.caja-regalo-flotante {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(212, 175, 55, 0.4);
  animation: float 3s infinite ease-in-out;
  transition: all 0.3s;
}

.caja-regalo-flotante:hover { transform: scale(1.1); box-shadow: 0 12px 40px rgba(212, 175, 55, 0.5); }

/* Admin panel */
.glass-visitas {
  position: fixed;
  bottom: 200px;
  left: 30px;
  background: var(--glass);
  backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 1.5rem;
  width: 300px;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: var(--shadow-strong);
  z-index: 997;
}

.glass-visitas h3 { color: var(--primary); font-family: 'Playfair Display', serif; margin-bottom: 1rem; font-size: 1.2rem; }

.btn-toggle-visitas {
  position: fixed;
  bottom: 200px;
  left: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
  z-index: 996;
  transition: all 0.3s;
}

.btn-toggle-visitas:hover { transform: scale(1.1); }
.hidden { display: none !important; }

/* Admin sheet */
.admin-sheet-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);
  z-index: 3000;
  justify-content: center;
  align-items: flex-end;
}

.admin-sheet {
  background: var(--glass);
  backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  border-radius: 24px 24px 0 0;
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  animation: slideUp 0.3s ease;
}

.admin-sheet-handle { width: 40px; height: 4px; background: rgba(108, 75, 163, 0.3); border-radius: 2px; margin: 0 auto 1.5rem; }
.admin-sheet-title { font-family: 'Playfair Display', serif; font-size: 1.5rem; color: var(--primary); margin-bottom: 0.5rem; }
.admin-sheet-desc { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.95rem; }

.admin-sheet-btn {
  width: 100%;
  padding: 16px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s;
}

.admin-sheet-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(108, 75, 163, 0.3); }

.admin-sheet-btn-secondary {
  width: 100%;
  padding: 16px;
  margin-bottom: 10px;
  background: rgba(108, 75, 163, 0.1);
  color: var(--primary);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s;
}

.admin-sheet-btn-secondary:hover { background: rgba(108, 75, 163, 0.2); }

/* ================================
   ESTILOS DEL HISTORIAL DE COMPRAS
   ================================ */

/* Resumen de compras */
.resumen-compras {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: linear-gradient(135deg, rgba(108, 75, 163, 0.1) 0%, rgba(212, 175, 55, 0.1) 100%);
  padding: 1.5rem;
  border-radius: 16px;
  text-align: center;
  border: 1px solid rgba(108, 75, 163, 0.1);
  transition: transform 0.3s;
}

.stat-card:hover { transform: translateY(-3px); }

.stat-numero {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  font-family: 'Playfair Display', serif;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Lista de historial */
.lista-historial {
  max-height: 500px;
  overflow-y: auto;
  padding-right: 10px;
}

.loading-historial {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Card de compra */
.compra-card {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(108, 75, 163, 0.15);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s;
  animation: fadeInUp 0.4s ease;
}

.compra-card:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(5px);
  box-shadow: var(--shadow-soft);
}

.compra-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(108, 75, 163, 0.1);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.compra-fecha {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.compra-fecha-icono { font-size: 1.2rem; }

.compra-estado {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.estado-pendiente {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 160, 0, 0.2) 100%);
  color: #f57c00;
}

.estado-proceso {
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.2) 0%, rgba(25, 118, 210, 0.2) 100%);
  color: #1976d2;
}

.estado-entregado {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.2) 0%, rgba(56, 142, 60, 0.2) 100%);
  color: #388e3c;
}

.estado-cancelado {
  background: linear-gradient(135deg, rgba(244, 67, 54, 0.2) 0%, rgba(211, 47, 47, 0.2) 100%);
  color: #d32f2f;
}

/* Productos en historial */
.compra-productos { margin-bottom: 1rem; }

.producto-historial {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px dashed rgba(108, 75, 163, 0.15);
  gap: 1rem;
}

.producto-historial:last-child { border-bottom: none; }

.producto-historial-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.producto-historial-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
  background: white;
  border: 1px solid rgba(108, 75, 163, 0.1);
  padding: 2px;
}

.producto-historial-nombre {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.95rem;
}

.producto-historial-variante {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.producto-historial-precio {
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
  white-space: nowrap;
}

/* Footer de compra */
.compra-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 2px solid rgba(108, 75, 163, 0.1);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.compra-total-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.compra-total-valor {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  font-family: 'Playfair Display', serif;
}

.compra-id {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
  background: rgba(108, 75, 163, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

/* Descuento en historial */
.compra-descuento {
  text-align: right;
  color: #4caf50;
  font-size: 0.9rem;
  margin: 0.5rem 0;
  font-weight: 500;
}

/* Sin compras */
.sin-compras {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  background: rgba(108, 75, 163, 0.03);
  border-radius: 20px;
  border: 2px dashed rgba(108, 75, 163, 0.15);
}

.sin-compras-icono {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.sin-compras-texto {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.sin-compras-subtexto {
  font-size: 0.95rem;
  opacity: 0.8;
  margin-bottom: 1.5rem;
}

/* Responsive historial */
@media (max-width: 768px) {
  .resumen-compras { grid-template-columns: 1fr; }
  .stat-card { padding: 1rem; }
  .stat-numero { font-size: 1.5rem; }

  .compra-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .producto-historial {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .producto-historial-precio {
    align-self: flex-end;
  }

  .compra-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .compra-total-valor {
    font-size: 1.2rem;
  }
}

/* Scrollbar del historial */
.lista-historial::-webkit-scrollbar { width: 6px; }
.lista-historial::-webkit-scrollbar-track { background: rgba(108, 75, 163, 0.05); border-radius: 3px; }
.lista-historial::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; }
.lista-historial::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Responsive general */
@media (max-width: 768px) {
  .header-content { flex-direction: column; gap: 1rem; padding: 0.5rem; }
  .hero h2 { font-size: 2rem; }
  .productos-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.5rem; }
  .lealtad-container { left: 15px; bottom: 100px; }
  .tarjeta-lealtad { width: calc(100vw - 30px); max-width: 350px; }
  #botonCarrito { right: 15px; bottom: 15px; width: 60px; height: 60px; font-size: 1.3rem; }
  .glass-visitas { left: 15px; width: calc(100vw - 30px); }
  .modal-contenido { padding: 1.5rem; }
  .modal-titulo { font-size: 1.5rem; }
}

/* Scrollbar general */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(108, 75, 163, 0.05); }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
