/* ------------------------------
   VARIABLES
------------------------------ */
:root {
  --font-serif: "DM Serif Display", serif;
  --font-sans: "Inter", sans-serif;

  --text: #1a1a1a;
  --muted: #666;
  --bg: #ffffff;
  --accent: #0a0a0a;

  --radius: 8px;
}

/* ------------------------------
   RESET
------------------------------ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ------------------------------
   LOADER
------------------------------ */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loader {
  width: 40px;
  height: 40px;
  border: 4px solid #ddd;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ------------------------------
   HEADER
------------------------------ */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid #eee;
}

.header-inner {
  max-width: 1200px;
  margin: auto;
  padding: 1rem 0;
  display: flex;
  align-items: center;
}

/* LOGO */
.logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* ------------------------------
   CONTENEDOR GENERAL
------------------------------ */
.container {
  max-width: 1200px;
  margin: auto;
  padding: 2rem 1rem;
}

/* ------------------------------
   CATÁLOGO
------------------------------ */
.page-title {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--muted);
  margin-bottom: 2rem;
}

.catalogo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
}

.card {
  border: 1px solid #eee;
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: 0.2s ease;
  background: #fff;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.card img {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

/* ------------------------------
   PANEL DESLIZANTE
------------------------------ */
.panel-detalle {
  position: fixed;
  top: 0;
  right: -100%;
  width: 420px;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  padding: 2rem;
  overflow-y: auto;
  transition: 0.3s ease;
  z-index: 999;
}

.panel-detalle.activo {
  right: 0;
}

.cerrar-panel {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
}

.detalle-imagen {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.detalle-categoria {
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.detalle-descripcion {
  margin-bottom: 1rem;
}

.detalle-caracteristicas {
  margin-bottom: 1rem;
  padding-left: 1.2rem;
}

.detalle-precio {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

/* ------------------------------
   BOTONES Y CÓDIGO
------------------------------ */
.detalle-botones {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-outline,
.btn-primary {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  font-weight: 500;
  display: block;
}

.btn-outline {
  border: 1px solid #000;
  background: none;
  color: #000;
}

.btn-primary {
  background: #000;
  color: #fff;
  border: none;
}

/* BLOQUE DE CÓDIGO */
.bloque-codigo {
  margin-top: 1rem;
}

.bloque-codigo input {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  border: 1px solid #ccc;
  margin-bottom: 0.7rem;
}

.mensaje-codigo {
  margin-top: 0.3rem;
  color: var(--accent);
  font-size: 0.9rem;
}

/* ------------------------------
   MODAL QR
------------------------------ */
.modal-qr {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-qr.activo {
  display: flex;
}

.modal-content {
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--radius);
  position: relative;
}

.cerrar-modal {
  position: absolute;
  top: 0.5rem;
  right: 0.7rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
}

.qr-imagen {
  width: 260px;
  height: auto;
}

/* ------------------------------
   RESPONSIVE
------------------------------ */
@media (max-width: 480px) {
  .panel-detalle {
    width: 100%;
  }
}