:root,
[data-theme="light"] {
  /* ========================================================================= */
  /* MODO DIURNO (LIGHT GLASS & EDITORIAL REFINADO)                            */
  /* ========================================================================= */
  --bg-main: #edf2f7;
  --bg-surface: rgba(240, 244, 250, 0.88);
  --bg-card: rgba(235, 240, 248, 0.85);
  --bg-card-hover: rgba(245, 248, 253, 0.96);
  --bg-elevated: rgba(230, 236, 246, 0.92);
  --card-inner-bg: rgba(255, 255, 255, 0.8);
  --input-bg: #ffffff;
  --modal-bg: rgba(255, 255, 255, 0.94);
  --nav-pills-bg: rgba(241, 245, 249, 0.85);
  --nav-btn-active-bg: #ffffff;
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  --accent-gold: #d97706;
  --accent-gold-light: #b45309;
  --accent-gold-soft: rgba(217, 119, 6, 0.16);
  
  --accent-indigo: #4338ca;
  --accent-indigo-light: #4f46e5;
  --accent-indigo-soft: rgba(67, 56, 202, 0.15);
  
  --accent-emerald: #047857;
  --accent-emerald-soft: rgba(4, 120, 87, 0.15);
  
  --border-subtle: rgba(148, 163, 184, 0.35);
  --border-glass: rgba(255, 255, 255, 0.85);
  --border-highlight: rgba(217, 119, 6, 0.55);
  
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  /* Sombras y profundidad */
  --shadow-float: 0 16px 36px -10px rgba(15, 23, 42, 0.12), 0 0 1px 1.5px rgba(255, 255, 255, 0.8) inset;
  --shadow-hover: 0 24px 50px -10px rgba(67, 56, 202, 0.16), 0 0 24px rgba(217, 119, 6, 0.12);
  --shadow-glow-gold: 0 4px 18px rgba(217, 119, 6, 0.3);
  
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
}

[data-theme="dark"] {
  /* ========================================================================= */
  /* MODO OSCURO (DEEP MIDNIGHT & LUMINOUS GLASS)                              */
  /* ========================================================================= */
  --bg-main: #0c111d;
  --bg-surface: rgba(18, 26, 43, 0.88);
  --bg-card: rgba(23, 33, 54, 0.82);
  --bg-card-hover: rgba(30, 43, 70, 0.94);
  --bg-elevated: rgba(28, 39, 64, 0.92);
  --card-inner-bg: rgba(18, 26, 43, 0.75);
  --input-bg: rgba(14, 20, 34, 0.9);
  --modal-bg: rgba(18, 26, 43, 0.96);
  --nav-pills-bg: rgba(15, 23, 42, 0.82);
  --nav-btn-active-bg: rgba(30, 41, 59, 0.96);
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --accent-gold: #f59e0b;
  --accent-gold-light: #fbbf24;
  --accent-gold-soft: rgba(245, 158, 11, 0.2);
  
  --accent-indigo: #818cf8;
  --accent-indigo-light: #a5b4fc;
  --accent-indigo-soft: rgba(129, 140, 248, 0.22);
  
  --accent-emerald: #34d399;
  --accent-emerald-soft: rgba(52, 211, 153, 0.2);
  
  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-glass: rgba(255, 255, 255, 0.15);
  --border-highlight: rgba(245, 158, 11, 0.55);
  
  --shadow-float: 0 16px 36px -10px rgba(0, 0, 0, 0.55), 0 0 1px 1.5px rgba(255, 255, 255, 0.08) inset;
  --shadow-hover: 0 24px 50px -10px rgba(129, 140, 248, 0.25), 0 0 24px rgba(245, 158, 11, 0.2);
  --shadow-glow-gold: 0 4px 18px rgba(245, 158, 11, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.15s ease;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* CANVAS MATRIX DE LLUVIA DE LETRAS EN FONDO CLARO / OSCURO */
#matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 1;
}

/* Efecto Flotante Suave */
@keyframes floatSoft {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0px); }
}

/* Header & Top Navigation (Glassmorphic) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.9rem 2.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.05);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  text-decoration: none;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.28);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand:hover .brand-icon {
  transform: rotate(-6deg) scale(1.06);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.nav-pills {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--nav-pills-bg);
  padding: 0.32rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
}

.nav-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.nav-btn:hover {
  color: var(--text-primary);
}

.nav-btn.active {
  background: var(--nav-btn-active-bg);
  color: var(--accent-indigo);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.15), 0 1px 3px rgba(0,0,0,0.05);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* BOTÓN TOGGLE TEMA (DIURNO / OSCURO) */
.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  user-select: none;
}

.theme-toggle-btn:hover {
  border-color: var(--accent-gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.18);
  background: var(--bg-card-hover);
}

.theme-toggle-icon {
  font-size: 1rem;
}

.bcv-pill {
  background: var(--accent-emerald-soft);
  border: 1px solid rgba(5, 150, 105, 0.25);
  color: var(--accent-emerald);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cart-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.48rem 1.05rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.cart-btn:hover {
  border-color: var(--accent-gold);
  background: var(--bg-card-hover);
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.12);
}

.cart-badge {
  background: var(--accent-gold);
  color: #ffffff;
  font-weight: 800;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
}

/* Layout Container */
.container {
  position: relative;
  z-index: 1; /* Sobre la lluvia matrix */
  max-width: 1220px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* Hero Section (Semitransparente Flotante) */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 2.75rem 2.6rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-float);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero:hover {
  box-shadow: var(--shadow-hover);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-gold-soft);
  color: var(--accent-gold-light);
  border: 1px solid rgba(217, 119, 6, 0.3);
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 3.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.85rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.hero p {
  color: var(--text-secondary);
  max-width: 820px;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.65;
}

/* WIZARD STEPPER INTERACTIVO */
.stepper-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.85rem;
  position: relative;
  padding: 0 0.5rem;
}

.stepper-progress-bar-bg {
  position: absolute;
  top: 50%;
  left: 20px;
  right: 20px;
  height: 5px;
  background: var(--border-subtle);
  transform: translateY(-50%);
  z-index: 1;
  border-radius: 999px;
}

.stepper-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-gold));
  width: 20%;
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-indicator {
  position: relative;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.step-indicator.active {
  border-color: var(--accent-gold);
  background: var(--accent-gold);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.35);
  transform: scale(1.12);
}

.step-indicator.completed {
  border-color: var(--accent-emerald);
  background: var(--accent-emerald);
  color: #ffffff;
}

/* WIZARD BOX (Libro Interactivo con Paso de Páginas 3D) */
.wizard-box {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-glass);
  border-radius: 6px 20px 20px 6px;
  padding: 2.5rem 2.4rem 2.5rem 3.1rem;
  box-shadow:
    /* Hojas apiladas en el borde derecho e inferior */
    4px 2px 0 -1px rgba(255, 255, 255, 0.08),
    4px 2px 0 0 rgba(15, 23, 42, 0.35),
    8px 4px 0 -1px rgba(255, 255, 255, 0.06),
    8px 4px 0 0 rgba(15, 23, 42, 0.35),
    12px 6px 0 -1px rgba(255, 255, 255, 0.04),
    12px 6px 0 0 rgba(15, 23, 42, 0.35),
    var(--shadow-float),
    inset 28px 0 36px -14px rgba(0, 0, 0, 0.35);
  position: relative;
  perspective: 2200px;
  transform-style: preserve-3d;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.wizard-box.is-turning::after {
  opacity: 0;
  transition: opacity 0.1s ease;
}

/* Lienzo HTML5 de física de hoja de papel curvada en tiempo real */
.page-curl-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 22;
  display: block;
}

/* Lomo encuadernado izquierdo del libro */
.wizard-box::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 24px;
  border-radius: 6px 0 0 6px;
  background: linear-gradient(
    90deg,
    rgba(245, 158, 11, 0.28) 0%,
    rgba(15, 23, 42, 0.55) 38%,
    rgba(255, 255, 255, 0.14) 70%,
    rgba(0, 0, 0, 0.22) 92%,
    transparent 100%
  );
  border-right: 1px solid rgba(245, 158, 11, 0.22);
  pointer-events: none;
  z-index: 25;
}

/* Esquina inferior derecha con pliegue de página ("Page Curl") */
.wizard-box::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 34px;
  height: 34px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(245, 158, 11, 0.25) 48%,
    transparent 52%
  );
  border-top-left-radius: 10px;
  border-bottom-right-radius: 20px;
  box-shadow: -3px -3px 8px rgba(0, 0, 0, 0.22);
  pointer-events: none;
  z-index: 25;
  transition: width 0.3s ease, height 0.3s ease;
}

.wizard-box:hover::after {
  width: 44px;
  height: 44px;
}

.wizard-box:hover {
  box-shadow:
    5px 2px 0 -1px rgba(255, 255, 255, 0.1),
    5px 2px 0 0 rgba(15, 23, 42, 0.4),
    10px 4px 0 -1px rgba(255, 255, 255, 0.08),
    10px 4px 0 0 rgba(15, 23, 42, 0.4),
    15px 6px 0 -1px rgba(255, 255, 255, 0.05),
    15px 6px 0 0 rgba(15, 23, 42, 0.4),
    var(--shadow-hover),
    inset 28px 0 36px -14px rgba(0, 0, 0, 0.38);
}

.wizard-step {
  display: none;
  transform-origin: left center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: clip-path, transform, filter;
}

.wizard-step.active {
  display: block;
  position: relative;
  z-index: 5;
}

/* Estado superpuesto durante el pliegue orgánico de la hoja de papel */
.wizard-step.turning-overlay {
  display: block !important;
  position: absolute;
  inset: 0;
  padding: inherit;
  background: var(--bg-card);
  border-radius: inherit;
  pointer-events: none;
  box-sizing: border-box;
  z-index: 15;
  overflow: hidden;
}

.wizard-header {
  margin-bottom: 1.6rem;
}

.wizard-step-tag {
  font-size: 0.78rem;
  color: var(--accent-gold);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}

.wizard-question {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.wizard-hint {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

/* Limit Selector (3, 5, 7) */
.limit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.limit-card {
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.45rem 1.35rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.limit-card:hover {
  border-color: rgba(217, 119, 6, 0.45);
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  box-shadow: 0 14px 28px -8px rgba(217, 119, 6, 0.15);
}

.limit-card.selected {
  border-color: var(--accent-gold);
  background: var(--bg-card-hover);
  box-shadow: 0 10px 26px -6px rgba(217, 119, 6, 0.22);
}

.limit-card .num-badge {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--accent-gold);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.limit-card .card-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
}

.limit-card .card-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-top: 0.45rem;
  line-height: 1.5;
}

/* Interactive Chips (Glass) */
.chips-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.chip {
  background: var(--card-inner-bg);
  backdrop-filter: blur(10px);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.chip:hover {
  border-color: var(--accent-indigo);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.12);
}

.chip.selected {
  background: var(--accent-indigo-soft);
  border-color: var(--accent-indigo);
  color: var(--accent-indigo);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.18);
  font-weight: 700;
}

/* Step Navigation Footer */
.wizard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 1rem;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  border: none;
  padding: 0.85rem 1.65rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(217, 119, 6, 0.38);
}

.btn-secondary {
  background: var(--card-inner-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.btn-secondary:hover {
  border-color: var(--accent-indigo);
  background: var(--bg-card-hover);
  color: var(--accent-indigo);
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.1);
}

/* Diagnosis Banner (Semitransparente) */
.diagnosis-banner {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-xl);
  padding: 1.85rem 2.2rem;
  margin-bottom: 2.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-float);
}

.diagnosis-banner-tag {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  font-weight: 800;
  margin-bottom: 0.45rem;
}

.diagnosis-banner p {
  font-size: 1.05rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.matched-profiles-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.matched-profile-pill {
  background: var(--card-inner-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.15rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text-primary);
}

/* REFINED BOOK CARDS (FICHAS FLOTANTES Y SEMITRANSPARENTES) */
.recs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.book-card {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-float);
  position: relative;
}

.book-card:hover {
  transform: translateY(-8px);
  background: var(--bg-card-hover);
  border-color: rgba(217, 119, 6, 0.45);
  box-shadow: var(--shadow-hover);
}

.book-card-top {
  display: flex;
  gap: 1.25rem;
  padding: 1.6rem;
  background: linear-gradient(180deg, var(--bg-card-hover), transparent);
}

.book-cover-wrap {
  position: relative;
  flex-shrink: 0;
  perspective: 800px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.95));
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.45);
}

.book-cover {
  width: 112px;
  height: 168px;
  object-fit: contain;
  border-radius: 3px 6px 6px 3px;
  box-shadow: 
    -6px 8px 20px rgba(0, 0, 0, 0.5),
    -1px 0 2px rgba(255, 255, 255, 0.35);
  transform: rotateY(-5deg);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.book-card:hover .book-cover {
  transform: rotateY(0deg) translateY(-3px) scale(1.05);
  box-shadow: 
    -8px 12px 26px rgba(0, 0, 0, 0.65),
    0 0 2px rgba(255, 255, 255, 0.5);
}

.book-meta-right {
  display: flex;
  flex-direction: column;
}

.rank-pill {
  background: var(--accent-gold);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.74rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  margin-right: 0.4rem;
}

.match-gauge-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
  border: 1px solid rgba(5, 150, 105, 0.3);
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.book-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.book-author {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
}

.book-price-row {
  margin-top: auto;
}

.book-price-tag {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.book-price-bs {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.ai-curator-box {
  margin: 0 1.6rem 1rem;
  padding: 1rem 1.15rem;
  background: var(--accent-indigo-soft);
  border-left: 3px solid var(--accent-indigo);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.55;
}

.objection-alert-box {
  margin: 0 1.6rem 1rem;
  padding: 0.85rem 1.15rem;
  background: var(--accent-gold-soft);
  border-left: 3px solid var(--accent-gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.84rem;
  color: var(--accent-gold-light);
  line-height: 1.5;
}

.book-reviews-preview {
  margin: 0 1.6rem 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.book-actions {
  margin-top: auto;
  padding: 1.15rem 1.6rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

/* Modals (Glassmorphic) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-backdrop.open {
  display: flex;
}

.modal-content {
  background: var(--modal-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.2rem;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.35);
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-primary);
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.form-control {
  width: 100%;
  background: var(--input-bg);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.input-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

/* Pipeline steps in Checkout */
.pipeline-steps {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 1.25rem 0;
}

.pipeline-step {
  background: var(--card-inner-bg);
  border: 1px solid rgba(5, 150, 105, 0.35);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.pipeline-step.pickup-step {
  border-color: var(--accent-gold);
  background: var(--accent-gold-soft);
}

.step-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-emerald);
  color: #ffffff;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* KPI Dashboard (Admin) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.45rem;
  box-shadow: var(--shadow-float);
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}

.kpi-val {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
}

.po-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-float);
}

.quiz-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-float);
  transition: all 0.25s ease;
}

.quiz-card:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-hover);
}

.status-pill {
  display: inline-block;
  padding: 0.28rem 0.8rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}

.status-pill.paid {
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
}

.status-pill.pickup {
  background: var(--accent-gold-soft);
  color: var(--accent-gold-light);
}

.hidden {
  display: none !important;
}

.priority-card-glow {
  border-color: rgba(245, 158, 11, 0.4) !important;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.14), var(--shadow-float) !important;
}

/* Responsive adjustments moved to comprehensive mobile section at bottom */

/* ==========================================================================
   VISTA DE CATÁLOGO TRADICIONAL
   ========================================================================== */
.catalog-hero {
  margin-bottom: 1.5rem;
}

.catalog-toolbar {
  display: flex;
  gap: 1rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.catalog-search-wrap {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.catalog-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  opacity: 0.6;
}

.catalog-search-field {
  width: 100%;
  padding: 11px 40px 11px 42px;
  background: var(--input-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
}

.catalog-search-field:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.catalog-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 50%;
}

.catalog-clear-btn:hover {
  color: var(--text-primary);
  background: var(--card-inner-bg);
}

.catalog-sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.catalog-sort-wrap label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.catalog-select {
  padding: 9px 12px;
  font-size: 0.85rem;
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}

.catalog-categories-row {
  display: flex;
  gap: 8px;
  margin-top: 1.2rem;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.cat-pill {
  padding: 7px 15px;
  background: var(--card-inner-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cat-pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--accent-indigo);
  transform: translateY(-1px);
}

.cat-pill.active {
  background: linear-gradient(135deg, var(--accent-indigo), #3730a3);
  color: #fff;
  border-color: var(--accent-indigo);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.catalog-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 0.4rem 0.6rem;
  color: var(--text-muted);
  font-size: 0.86rem;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.catalog-count-info strong {
  color: var(--text-primary);
}

.catalog-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--text-secondary);
  user-select: none;
}

/* MALLA DE LIBROS TRADICIONAL */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.catalog-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-float);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
}

.catalog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-gold);
}

.catalog-card-img-wrap {
  position: relative;
  width: 100%;
  height: 265px;
  background: radial-gradient(circle at 50% 45%, #1e293b 0%, #0f172a 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 20px 26px;
  perspective: 900px;
}

.catalog-card-bg-blur {
  position: absolute;
  inset: -25px;
  background-size: cover;
  background-position: center;
  filter: blur(22px) saturate(1.45) brightness(0.42);
  transform: scale(1.2);
  opacity: 0.85;
  pointer-events: none;
  z-index: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.catalog-card:hover .catalog-card-bg-blur {
  transform: scale(1.3);
  opacity: 1;
}

.catalog-book-3d-frame {
  position: relative;
  z-index: 1;
  height: 100%;
  max-width: 82%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px 7px 7px 3px;
  box-shadow:
    -10px 14px 28px rgba(0, 0, 0, 0.65),
    0 2px 6px rgba(0, 0, 0, 0.4),
    -1px 0 2px rgba(255, 255, 255, 0.3);
  transform: rotateY(-4deg);
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.38s ease;
}

.catalog-book-3d-frame::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 10px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.32) 0%,
    rgba(0, 0, 0, 0.25) 45%,
    rgba(255, 255, 255, 0.14) 75%,
    transparent 100%
  );
  border-radius: 3px 0 0 3px;
  pointer-events: none;
}

.catalog-card-img {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 3px 7px 7px 3px;
  display: block;
}

.catalog-card:hover .catalog-book-3d-frame {
  transform: rotateY(0deg) translateY(-6px) scale(1.05);
  box-shadow:
    -14px 20px 34px rgba(0, 0, 0, 0.75),
    0 4px 10px rgba(0, 0, 0, 0.45),
    0 0 2px rgba(255, 255, 255, 0.45);
}

.catalog-card-rating {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(8px);
  color: #fbbf24;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.catalog-card-stock {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 2;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.stock-in {
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
}

.stock-low {
  background: rgba(245, 158, 11, 0.9);
  color: #fff;
}

.catalog-card-body {
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.catalog-card-genre {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-gold);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.catalog-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.18rem;
  color: var(--text-primary);
  margin: 0 0 4px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.catalog-card-author {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.catalog-card-synopsis {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.catalog-card-price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border-subtle);
  margin-bottom: 0.9rem;
}

.catalog-price-usd {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.catalog-price-ves {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-emerald);
}

.catalog-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-catalog-details {
  background: var(--card-inner-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-catalog-details:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-indigo);
}

.btn-catalog-buy {
  background: linear-gradient(135deg, var(--accent-gold), #d97706);
  color: #fff;
  border: none;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-catalog-buy:hover {
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
  transform: translateY(-1px);
}

/* MODAL DETALLES LIBRO */
.modal-book-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.5rem;
}

.modal-book-cover {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.45);
}

.modal-book-meta {
  display: flex;
  flex-direction: column;
}

.modal-book-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem;
  color: var(--text-primary);
  margin: 0 0 4px;
  line-height: 1.25;
}

.modal-book-author {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.modal-book-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.modal-tag {
  background: var(--card-inner-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.modal-book-synopsis {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.modal-book-ideal {
  background: var(--card-inner-bg);
  border-left: 3px solid var(--accent-gold);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  font-size: 0.84rem;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.modal-book-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

/* ==========================================================================
   VISOR DE LECTURA DE 2 PÁGINAS (HOJEAR LIBRO CON PLIEGUE DE PAPEL REAL)
   ========================================================================== */
.book-reader-box {
  background: linear-gradient(135deg, #fbf9f3 0%, #f3efe4 100%) !important;
  color: #1e293b !important;
  border: 1px solid rgba(180, 168, 142, 0.55) !important;
  padding: 2.1rem 2.2rem 1.8rem 2.9rem !important;
  min-height: 440px;
}

[data-theme="dark"] .book-reader-box {
  background: linear-gradient(135deg, #162032 0%, #0f172a 100%) !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(251, 191, 36, 0.25) !important;
}

.book-reader-box .wizard-step.turning-overlay {
  background: linear-gradient(135deg, #fbf9f3 0%, #f3efe4 100%) !important;
}

[data-theme="dark"] .book-reader-box .wizard-step.turning-overlay {
  background: linear-gradient(135deg, #162032 0%, #0f172a 100%) !important;
}

.reader-page-running-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  padding-bottom: 0.55rem;
  margin-bottom: 1.25rem;
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.reader-chapter-tag {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 0.25rem;
}

.reader-chapter-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 1.1rem;
  line-height: 1.28;
}

.reader-prose {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.01rem;
  line-height: 1.78;
  color: var(--text-primary);
  text-align: justify;
}

.reader-prose p {
  margin: 0 0 0.95rem;
}

.reader-dropcap {
  float: left;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 3.1rem;
  line-height: 0.84;
  padding-top: 4px;
  padding-right: 10px;
  padding-bottom: 2px;
  font-weight: 800;
  color: var(--accent-gold);
}

.reader-quote-box {
  margin: 1.05rem 0;
  padding: 0.85rem 1.1rem;
  border-left: 3px solid var(--accent-gold);
  background: rgba(245, 158, 11, 0.09);
  border-radius: 0 10px 10px 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.reader-page-footer {
  margin-top: 1.35rem;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.reader-page-number {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.86rem;
  font-style: italic;
  color: var(--text-muted);
}

/* ==========================================================================
   OPTIMIZACIÓN INTEGRAL PARA CELULARES Y DISPOSITIVOS TÁCTILES
   ========================================================================== */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
  }

  /* 1. Barra Superior Compacta + Pestañas Deslizables (Touch Scroll) */
  .topbar {
    padding: 0.55rem 0.75rem;
    gap: 0.45rem;
    flex-direction: column;
    align-items: stretch;
  }

  .brand {
    justify-content: space-between;
    width: 100%;
  }

  .brand-icon {
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
    border-radius: 9px;
    flex-shrink: 0;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .brand-subtitle {
    font-size: 0.68rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .nav-pills {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.25rem;
    gap: 0.25rem;
    border-radius: 12px;
  }

  .nav-pills::-webkit-scrollbar {
    display: none;
  }

  .nav-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.45rem 0.78rem;
    font-size: 0.78rem;
    border-radius: 9px;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
    gap: 0.35rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .topbar-right::-webkit-scrollbar {
    display: none;
  }

  .topbar-right > * {
    flex-shrink: 0;
  }

  .bcv-pill, .theme-toggle-btn, .cart-btn, .topbar-right a.btn-secondary {
    padding: 0.36rem 0.65rem !important;
    font-size: 0.74rem !important;
  }

  /* 2. Contenedor Principal y Hero */
  .container {
    padding: 0.85rem 0.75rem 3.5rem;
  }

  .hero {
    padding: 1.25rem 1rem;
    margin-bottom: 1.15rem;
    border-radius: 16px;
  }

  .hero-badge {
    font-size: 0.68rem;
    padding: 0.25rem 0.65rem;
    margin-bottom: 0.6rem;
  }

  .hero h1 {
    font-size: 1.38rem;
    line-height: 1.22;
    margin-bottom: 0.5rem;
  }

  .hero p {
    font-size: 0.84rem;
    line-height: 1.48;
  }

  /* 3. Barra de Pasos (Stepper) */
  .stepper-progress {
    max-width: 100%;
    margin: 0 auto 1rem;
    padding: 0 0.35rem;
  }

  .step-indicator {
    width: 32px;
    height: 32px;
    font-size: 0.82rem;
  }

  /* 4. Libro 3D del Recomendador IA en Celular */
  .wizard-box {
    padding: 1.25rem 1rem 1.25rem 1.4rem !important;
    border-radius: 5px 16px 16px 5px;
    box-shadow:
      var(--shadow-float),
      3px 3px 0 var(--bg-surface),
      4px 4px 0 var(--border-subtle),
      6px 6px 0 var(--bg-surface),
      7px 7px 0 var(--border-subtle);
  }

  .wizard-box::before {
    width: 11px;
  }

  .wizard-box::after {
    width: 24px;
    height: 24px;
  }

  .wizard-step.turning-overlay {
    inset: 0;
    padding: 1.25rem 1rem 1.25rem 1.4rem !important;
  }

  .wizard-header {
    margin-bottom: 1rem;
  }

  .wizard-step-tag {
    font-size: 0.7rem;
  }

  .wizard-question {
    font-size: 1.15rem;
    line-height: 1.28;
  }

  .wizard-hint {
    font-size: 0.8rem;
  }

  /* Tarjetas 3, 5, 7 compactas tipo fila táctil en móvil */
  .limit-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    margin-bottom: 1rem;
  }

  .limit-card {
    padding: 0.85rem 1rem;
    text-align: left;
    display: grid;
    grid-template-columns: 44px 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.85rem;
    align-items: center;
  }

  .limit-card .num-badge {
    grid-row: 1 / 3;
    font-size: 1.9rem;
    margin-bottom: 0;
    text-align: center;
  }

  .limit-card .card-title {
    font-size: 0.94rem;
    margin-bottom: 0.15rem;
  }

  .limit-card .card-desc {
    font-size: 0.78rem;
    line-height: 1.35;
  }

  /* Píldoras táctiles (Chips) */
  .chips-flex {
    gap: 0.48rem;
  }

  .chip {
    padding: 0.55rem 0.85rem;
    font-size: 0.82rem;
    width: 100%;
    justify-content: flex-start;
    border-radius: 12px;
  }

  #theme-chips .chip {
    width: auto;
    flex: 1 1 calc(50% - 0.48rem);
    justify-content: center;
    text-align: center;
    padding: 0.5rem 0.65rem;
    font-size: 0.78rem;
  }

  /* Pie de página del libro (Botones Anterior / Siguiente) */
  .wizard-footer {
    margin-top: 1.25rem;
    padding-top: 0.95rem;
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 0.6rem;
  }

  .wizard-footer > span {
    text-align: center;
    font-size: 0.78rem !important;
  }

  .wizard-footer .btn-primary,
  .wizard-footer .btn-secondary {
    width: 100%;
    justify-content: center;
    padding: 0.82rem 1rem !important;
    font-size: 0.92rem !important;
  }

  /* Evitar auto-zoom en iOS Safari al tocar inputs (mínimo 16px) */
  .form-control,
  .catalog-search-field,
  .catalog-select,
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }

  .input-row {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  /* 5. Tarjetas de Resultados de Recomendación IA */
  .recs-grid {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .book-card-top {
    padding: 1rem;
    gap: 0.9rem;
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
  }

  .book-cover-wrap {
    width: 96px;
    height: 144px;
    padding: 6px;
  }

  .book-title {
    font-size: 1.05rem;
  }

  .book-price-tag {
    font-size: 1.15rem;
  }

  .ai-curator-box,
  .book-reviews-preview {
    margin: 0 0.9rem 0.8rem;
    padding: 0.75rem 0.85rem;
    font-size: 0.8rem;
  }

  .book-actions {
    padding: 0.8rem 0.9rem;
    gap: 0.45rem;
  }

  /* 6. Catálogo Tradicional: Cuadrícula de 2 Columnas estilo App Librería */
  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .catalog-search-wrap {
    min-width: 100%;
  }

  .catalog-sort-wrap {
    width: 100%;
    justify-content: space-between;
  }

  .catalog-select {
    flex: 1;
  }

  .catalog-categories-row {
    margin-top: 0.85rem;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .catalog-categories-row::-webkit-scrollbar {
    display: none;
  }

  .cat-pill {
    padding: 6px 12px;
    font-size: 0.76rem;
  }

  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .catalog-card {
    border-radius: 12px;
  }

  .catalog-card-img-wrap {
    height: 175px;
    padding: 12px 10px 16px;
  }

  .catalog-card-rating {
    top: 6px;
    right: 6px;
    font-size: 0.68rem;
    padding: 2px 6px;
  }

  .catalog-card-stock {
    bottom: 6px;
    left: 6px;
    font-size: 0.62rem;
    padding: 2px 6px;
  }

  .catalog-card-body {
    padding: 0.75rem 0.7rem 0.7rem;
  }

  .catalog-card-genre {
    font-size: 0.64rem;
    margin-bottom: 2px;
  }

  .catalog-card-title {
    font-size: 0.9rem;
    line-height: 1.25;
    margin-bottom: 2px;
  }

  .catalog-card-author {
    font-size: 0.72rem;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .catalog-card-synopsis {
    display: none;
  }

  .catalog-card-price-row {
    padding-top: 0.45rem;
    margin-bottom: 0.55rem;
    flex-direction: column;
    gap: 1px;
  }

  .catalog-price-usd {
    font-size: 1.05rem;
  }

  .catalog-price-ves {
    font-size: 0.68rem;
  }

  .catalog-card-actions {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .btn-catalog-details,
  .btn-catalog-buy {
    padding: 7px 8px;
    font-size: 0.74rem;
    border-radius: 7px;
  }

  /* 7. Modales Adaptados a Pantalla Móvil */
  .modal-backdrop {
    padding: 0.5rem;
    align-items: flex-end;
  }

  .modal-content {
    padding: 1.15rem 1rem;
    border-radius: 18px 18px 12px 12px;
    max-height: 92vh;
    width: 100%;
  }

  .modal-book-layout {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1rem;
  }

  .modal-book-cover {
    width: 135px;
    max-height: 195px;
    margin: 0 auto;
  }

  .modal-book-tags {
    justify-content: center;
  }

  .modal-book-actions-bar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .modal-book-actions-bar button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 380px) {
  .book-card-top {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .book-meta-right {
    align-items: center;
  }

  .catalog-card-img-wrap {
    height: 155px;
  }
}


