/* =====================================================
   BIBLIOTECA DE BRUJ@S — Diseño Moderno Minimalista
   ===================================================== */

/* ===== RESET Y BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

:root {
  --bg-deep:        #0a0a0f;
  --bg-dark:        #12121a;
  --bg-card:        rgba(18, 18, 26, 0.95);
  --bg-panel:       rgba(15, 15, 22, 0.98);
  --bg-glass:       rgba(255, 255, 255, 0.03);
  --gold:           #d4af37;
  --gold-light:     #f4d03f;
  --gold-dim:       rgba(212, 175, 55, 0.25);
  --violet:         #8b5cf6;
  --violet-light:   #a78bfa;
  --violet-glow:    rgba(139, 92, 246, 0.3);
  --crimson:        #ef4444;
  --crimson-light:  #f87171;
  --text-primary:   #f5f5f5;
  --text-secondary: rgba(245, 245, 245, 0.7);
  --text-muted:     rgba(245, 245, 245, 0.4);
  --border:         rgba(255, 255, 255, 0.08);
  --border-strong:  rgba(255, 255, 255, 0.15);
  --shadow-deep:    0 25px 80px rgba(0, 0, 0, 0.8);
  --shadow-card:    0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-gold:    0 0 40px rgba(212, 175, 55, 0.15);
  --radius:         16px;
  --radius-sm:      10px;
  --radius-lg:      24px;
  --transition:     0.3s cubic-bezier(.4,0,.2,1);
  --font-display:   'Cinzel', 'Georgia', serif;
  --font-body:      'Crimson Pro', 'Georgia', serif;
  --font-ui:        'Inter', system-ui, sans-serif;
}

body {
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(139, 92, 246, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 50% 30% at 80% 90%, rgba(212, 175, 55, 0.03) 0%, transparent 60%);
}

.page, .biblioteca-container, .acceso-container,
.login-container, .main-content, .content-section,
.libros-scroll-container, .libros-scroll { max-width: 100%; }

a, button, input, [role="button"] {
  -webkit-tap-highlight-color: rgba(212, 175, 55, 0.08);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ===== PÁGINAS ===== */
.page { display: none; }
.page.active { display: block; }
#admin-page { width: 100%; height: 100vh; overflow: hidden; }
#admin-page.active { display: block; }

.loading-container {
  display: flex; justify-content: center; align-items: center;
  height: 100vh; background: var(--bg-deep);
}
.spinner {
  width: 40px; height: 40px;
  border: 2px solid rgba(212, 175, 55, 0.1);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== INTRO DE VIDEO ===== */
.intro-video-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
}

.intro-video-container.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  filter: brightness(0.6) saturate(0.8);
}

.intro-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.5) 50%,
    rgba(0, 0, 0, 0.8) 100%
  );
  pointer-events: none;
}

.intro-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2rem;
  animation: introContentFadeIn 1.5s ease-out 0.5s both;
}

.intro-logo {
  margin-bottom: 2rem;
}

.intro-logo-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 0 30px rgba(212, 175, 55, 0.5));
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 30px rgba(212, 175, 55, 0.5)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 50px rgba(212, 175, 55, 0.7)); }
}

.intro-title {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 4px;
  margin-bottom: 0.75rem;
  text-shadow: 0 0 40px rgba(212, 175, 55, 0.5);
  animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  from { text-shadow: 0 0 30px rgba(212, 175, 55, 0.4); }
  to { text-shadow: 0 0 60px rgba(212, 175, 55, 0.7); }
}

.intro-subtitle {
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--text-secondary);
  letter-spacing: 2px;
  margin-bottom: 3rem;
  font-style: italic;
}

.intro-enter-btn {
  background: transparent;
  border: 2px solid var(--gold);
  color: var(--gold);
  padding: 1rem 2.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.intro-enter-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
  transition: left 0.5s ease;
}

.intro-enter-btn:hover::before {
  left: 100%;
}

.intro-enter-btn:hover {
  background: var(--gold);
  color: var(--bg-deep);
  box-shadow: 0 0 40px rgba(212, 175, 55, 0.4);
  transform: translateY(-3px);
}

.intro-enter-btn .btn-icon {
  font-size: 1.2rem;
}

/* Formulario de login en intro */
.intro-content {
  position: relative;
}

.intro-identifiquese {
  transition: opacity 0.4s ease;
}

.intro-identifiquese.hidden {
  display: none;
}

.intro-login-form {
  display: none;
  max-width: 380px;
  margin: 0 auto;
}

.intro-login-form.visible {
  display: block;
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.intro-password-input {
  width: 100%;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-ui);
  text-align: center;
  letter-spacing: 1px;
  outline: none;
  transition: all var(--transition);
  margin-bottom: 1rem;
}

.intro-password-input:focus {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.intro-password-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.intro-error {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-align: center;
}

.intro-form-buttons {
  display: flex;
  gap: 0.75rem;
}

.intro-submit-btn {
  flex: 1;
  background: var(--gold);
  color: var(--bg-deep);
  padding: 1rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-display);
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all var(--transition);
}

.intro-submit-btn:hover {
  background: var(--gold-light);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
  transform: translateY(-2px);
}

.intro-back-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 1rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
}

.intro-back-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

@keyframes introContentFadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes introFadeOut {
  0% { opacity: 1; pointer-events: all; }
  80% { opacity: 1; pointer-events: all; }
  100% { opacity: 0; pointer-events: none; visibility: hidden; }
}

/* ===== PANTALLA DE ACCESO ===== */
.acceso-container {
  width: 100%;
  height: 100vh; height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(ellipse at center, #1a1030 0%, #0a0612 50%, #04060f 100%);
  overflow: hidden;
  position: relative;
}

.puerta-wrapper {
  position: relative;
  width: 100%; max-width: 1200px;
  height: 100%;
  display: flex; justify-content: center; align-items: center;
}

.puerta-imagen {
  width: 100%; max-width: 100%;
  height: 100%; min-height: 100%;
  object-fit: cover; object-position: center;
  filter: drop-shadow(0 10px 40px rgba(0,0,0,0.7));
}

.identificarse-area {
  position: absolute !important;
  top: 15% !important; left: 50% !important;
  transform: translate(-50%, -50%) !important;
  cursor: pointer;
  transition: all var(--transition);
  z-index: 10;
  display: flex !important; flex-direction: column !important; align-items: center !important;
  width: 100%; max-width: 450px;
}

.identificarse-area:hover { transform: translate(-50%, -50%) scale(1.02) !important; }

.identificarse-sign {
  background: rgba(10, 10, 15, 0.95) !important;
  border: 1px solid var(--gold) !important;
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.4), 0 0 60px rgba(212, 175, 55, 0.1), inset 0 0 20px rgba(212, 175, 55, 0.03) !important;
  color: var(--gold) !important;
  padding: 12px 28px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: 5px !important;
  text-align: center !important;
  border-radius: 6px !important;
  animation: goldGlow 2.5s ease-in-out infinite alternate;
  margin-bottom: 15px !important;
  width: fit-content !important;
  min-width: 280px !important; max-width: 320px !important;
  font-family: var(--font-display) !important;
  text-transform: uppercase !important;
  line-height: 1.3 !important;
}

@keyframes goldGlow {
  from { box-shadow: 0 0 20px rgba(212,175,55,0.3), inset 0 0 10px rgba(212,175,55,0.03); }
  to   { box-shadow: 0 0 40px rgba(212,175,55,0.6), inset 0 0 25px rgba(212,175,55,0.08); }
}

.keypad-area {
  width: min(200px, 70vw);
  height: auto; min-height: 180px;
  background: rgba(10, 10, 15, 0.85);
  border: 1px solid rgba(212,175,55,0.15);
  border-radius: 12px;
  margin: 0 auto;
}

/* ===== MODAL OVERLAY ===== */
.modal-overlay {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center; align-items: center;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-overlay.active, .modal-overlay[style*="flex"] { display: flex; }

/* ===== MODAL ACCESO ===== */
.modal-libro-left, .modal-libro-right {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: center;
}

.libro-decorativo { width: 100px; height: auto; opacity: 0.8; }

.modal-puerta {
  position: relative;
  width: 90%; max-width: 500px; max-height: 90vh;
  background: linear-gradient(160deg, #151520 0%, #0a0a10 100%);
  border: 1px solid var(--gold);
  box-shadow: 0 0 80px rgba(212,175,55,0.2), var(--shadow-deep);
  border-radius: var(--radius);
  overflow: hidden;
  animation: modalAppear 0.35s cubic-bezier(.4,0,.2,1);
}

@keyframes modalAppear {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-puerta-content { padding: 2.5rem; color: var(--text-primary); }

.modal-puerta-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2rem; padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-puerta-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 700;
  letter-spacing: 3px;
  color: var(--gold);
  text-shadow: 0 0 25px rgba(212,175,55,0.4);
}

.close-modal-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted); font-size: 1.5rem;
  width: 40px; height: 40px;
  border-radius: 50%; cursor: pointer;
  display: flex; justify-content: center; align-items: center;
  transition: all var(--transition); line-height: 1; padding: 0;
}

.close-modal-btn:hover {
  background: var(--gold); color: var(--bg-deep);
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(212,175,55,0.4);
}

.modal-puerta-form { display: flex; flex-direction: column; gap: 1.5rem; }

.modal-password-input {
  width: 100%; padding: 1rem 1.25rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 1rem; font-family: var(--font-ui);
  transition: all var(--transition);
  outline: none;
}

.modal-password-input:focus {
  border-color: var(--gold);
  background: rgba(212,175,55,0.04);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.1);
}

.modal-submit-btn {
  background: var(--gold);
  color: var(--bg-deep);
  padding: 1rem; border: none; border-radius: var(--radius-sm);
  font-size: 1rem; font-weight: 700; cursor: pointer;
  font-family: var(--font-display); letter-spacing: 2px; text-transform: uppercase;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(212,175,55,0.3);
}

.modal-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(212,175,55,0.5);
  background: var(--gold-light);
}

/* ===== CABECERA BIBLIOTECA ===== */
.biblioteca-container { min-height: 100vh; min-height: 100dvh; width: 100%; overflow-x: hidden; }

.biblioteca-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex; justify-content: space-between; align-items: center; gap: 2rem;
  box-shadow: 0 4px 30px rgba(0,0,0,0.6);
}

.header-menu {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; gap: 2rem;
}

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

.logo {
  font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 700;
  color: var(--gold);
  margin: 0; white-space: nowrap;
  text-shadow: 0 0 25px rgba(212,175,55,0.3);
  letter-spacing: 1px;
}

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

.search-container { position: relative; }

.search-input {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.7rem 1.25rem 0.7rem 2.75rem;
  color: var(--text-primary);
  font-size: 0.9rem; font-family: var(--font-ui);
  width: 300px; transition: all var(--transition);
  outline: none;
}

.search-container::before {
  content: '⌕';
  position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 1rem; pointer-events: none;
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
  border-color: var(--gold-dim); width: 360px;
  background: rgba(212,175,55,0.03);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.06);
}

.header-actions { display: flex; align-items: center; gap: 0.75rem; }

.admin-link {
  background: var(--violet);
  color: #fff; padding: 0.65rem 1.25rem;
  border-radius: 50px; text-decoration: none;
  font-weight: 600; font-size: 0.85rem;
  transition: all var(--transition); white-space: nowrap;
  box-shadow: 0 4px 16px rgba(139,92,246,0.3);
}

.admin-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139,92,246,0.5);
  background: var(--violet-light);
}

.cerrar-sesion-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.65rem 1.25rem;
  border-radius: 50px; font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
}

.cerrar-sesion-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* ===== CONTENIDO PRINCIPAL ===== */
.main-content { padding: 2.5rem 2rem; max-width: 100%; }
.content-section { margin-bottom: 3rem; }
.section-header { margin-bottom: 2rem; padding-left: 0.25rem; }

/* ===== BANNER + PANELES ===== */
.banner-logo-container {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.5rem;
  margin: 0 auto 0;
  max-width: 2000px;
  flex-wrap: nowrap;
}

/* Panel izquierdo: bienvenida */
.welcome-panel-container {
  flex: 0 0 290px; min-width: 260px; max-width: 320px;
}

.welcome-panel {
  background: var(--bg-panel);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 1.25rem;
  height: 100%;
  position: relative; overflow: hidden;
}

.welcome-panel::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.welcome-text-scroll {
  flex: 1;
  overflow: hidden; position: relative;
  min-height: 200px; max-height: 320px;
  mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
}

.welcome-text-scroll p {
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 1rem; line-height: 1.7;
  margin: 0; padding: 0;
  animation: scroll-up 35s linear infinite;
  text-align: justify;
}

@keyframes scroll-up {
  0%   { transform: translateY(100%); }
  100% { transform: translateY(-100%); }
}

.buzon-comentarios-btn {
  background: var(--violet);
  color: #fff; border: none;
  padding: 0.9rem 1.25rem; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: all var(--transition); width: 100%;
  box-shadow: 0 4px 18px rgba(139,92,246,0.3);
}

.buzon-comentarios-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(139,92,246,0.5);
  background: var(--violet-light);
}

/* Banner central */
.banner-container {
  flex: 1 1 90%; min-width: 900px; max-width: 1600px;
  border-radius: var(--radius);
  overflow: visible;
  box-shadow: var(--shadow-deep), 0 0 0 1px var(--border);
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
}

.biblioteca-banner {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  display: block;
  flex-shrink: 0;
}

.banner-container::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
  pointer-events: none;
}

.biblioteca-banner {
  width: 100%; height: 100%;
  display: block; object-fit: cover; object-position: center;
  transition: transform 0.6s ease;
}

.banner-container:hover .biblioteca-banner {
  transform: scale(1.02);
}

/* Columna derecha: logo + libro del mes */
.banner-right-column {
  flex-shrink: 0;
  display: flex; flex-direction: column;
  align-items: center; gap: 1.25rem;
  width: 600px;
  margin-left: 0;
  padding: 1.5rem 1rem;
  background: var(--bg-panel);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  position: relative; overflow: hidden;
}

.banner-right-column::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.banner-right-column .logo-container {
  width: 160px; height: 160px; padding: 0.5rem;
  margin: 0 auto;
}

.logo-container {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.98);
  border-radius: 50%;
  box-shadow: 0 6px 30px rgba(0,0,0,0.5), 0 0 0 3px var(--gold-dim);
  width: 190px; height: 190px; padding: 1rem;
  transition: all var(--transition);
}

.logo-container:hover {
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 0 3px var(--gold);
  transform: scale(1.03);
}

.luminarum-logo { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ===== LIBRO DEL MES ===== */
.mes-tajetitas-row {
  display: flex;
  gap: 1rem;
  width: 100%;
}

.libro-del-mes-container {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: 0.85rem;
  min-width: 0;
}

.libro-del-mes-portada-wrapper {
  position: relative;
  width: 100%; height: 380px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(212,175,55,0.04);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--border);
  display: flex; align-items: center; justify-content: center;
}

.libro-del-mes-img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center; display: block;
  transition: transform 0.5s ease;
}

.libro-del-mes-portada-wrapper:hover .libro-del-mes-img {
  transform: scale(1.03);
}

.etiqueta-libro-mes {
  position: absolute;
  top: 14px; right: -38px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: var(--bg-deep);
  padding: 8px 42px;
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.5px;
  transform: rotate(45deg);
  box-shadow: 0 3px 12px rgba(0,0,0,0.35);
  z-index: 10; text-transform: uppercase; white-space: nowrap;
  border: 2px solid rgba(0,0,0,0.15);
  font-family: var(--font-display);
}

.libro-del-mes-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 0.85rem; text-align: center; padding: 1rem;
}

.cuestionario-container {
  display: none;
}

.btn-cuestionario-luminarum {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--violet);
  color: #fff; padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem; font-weight: 700; text-decoration: none;
  letter-spacing: 0.8px; text-transform: uppercase;
  box-shadow: 0 4px 18px rgba(139,92,246,0.3);
  transition: all var(--transition); width: 100%; text-align: center;
  font-family: var(--font-display);
}

.btn-cuestionario-luminarum:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(139,92,246,0.5); color: #fff;
  background: var(--violet-light);
}

.tajetitas-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

#tajetitas-categoria-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ===== BANNER CONTAINER ===== */
/* ===== CHAT — WhatsApp style ===== */
.chat-section {
  width: 100%;
  z-index: 10;
  border: 1px solid #1f2c34;
  border-radius: 0 0 var(--radius) var(--radius);
  background: #111b21;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.45);
  height: 420px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, 'Lucida Grande', Arial, sans-serif;
}

.chat-resize-bottom {
  height: 8px;
  cursor: ns-resize;
  background: transparent;
  border-radius: 0 0 var(--radius) var(--radius);
  position: relative;
  flex-shrink: 0;
}

.chat-resize-bottom::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: #00a884;
  border-radius: 2px;
  opacity: 0.4;
  transition: opacity 0.2s;
}

.chat-resize-bottom:hover::after { opacity: 0.8; }
.chat-resize-bottom:hover { background: rgba(0,168,132,0.12); }
.chat-section.chat-locked { width: 100%; }
.chat-resize-handle { display: none; }

/* Header WhatsApp */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.9rem;
  background: #202c33;
  border-bottom: 1px solid #222d34;
  user-select: none;
  min-height: 54px;
}

.wa-header-left {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.wa-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00a884, #075e54);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px #202c33;
}

.wa-header-info { min-width: 0; }

.chat-header h3 {
  font-family: inherit;
  color: #e9edef;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-status {
  display: block;
  font-size: 0.72rem;
  color: #8696a0;
  line-height: 1.2;
}

.wa-header-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.wa-header-btn,
.chat-toggle-btn {
  background: none;
  border: none;
  color: #8696a0;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.35rem 0.45rem;
  border-radius: 50%;
  line-height: 1;
  transition: background 0.15s;
}

.wa-header-btn:hover,
.chat-toggle-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #e9edef;
}

.chat-body {
  padding: 0;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #0b141a;
}

/* Fondo patrón WhatsApp (doodles sutiles) */
.chat-messages,
.chat-login-prompt,
.chat-register-form,
.chat-login-form {
  background-color: #0b141a;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0,168,132,0.03) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 60%, rgba(0,168,132,0.025) 0 2px, transparent 3px),
    radial-gradient(circle at 40% 80%, rgba(255,255,255,0.02) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 85% 20%, rgba(0,168,132,0.02) 0 1.5px, transparent 2.5px),
    url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.03' stroke-width='1'%3E%3Ccircle cx='12' cy='18' r='4'/%3E%3Cpath d='M40 10l3 5h-6zM60 40c4 0 7 3 7 7s-3 7-7 7-7-3-7-7 3-7 7-7z'/%3E%3Cpath d='M15 55h10M20 50v10'/%3E%3Crect x='55' y='60' width='8' height='8' rx='1'/%3E%3Cpath d='M30 35c2-3 6-3 8 0'/%3E%3C/g%3E%3C/svg%3E");
}

.chat-login-prompt, .chat-register-form, .chat-login-form {
  padding: 1.5rem 1rem;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.chat-messages-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: #0b141a;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.7rem 4% 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  scroll-behavior: smooth;
}

/* Scrollbar WhatsApp */
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(134,150,160,0.4); border-radius: 3px; }
.chat-messages::-webkit-scrollbar-thumb:hover { background: rgba(134,150,160,0.6); }

/* Separador de fecha */
.wa-date-sep {
  align-self: center;
  background: #182229;
  color: #8696a0;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  margin: 0.55rem 0 0.35rem;
  box-shadow: 0 1px 0.5px rgba(11,20,26,0.13);
  text-transform: capitalize;
  z-index: 1;
}

/* Fila de mensaje */
.wa-row {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  max-width: 85%;
  margin-top: 0.1rem;
  animation: waPop 0.15s ease-out;
}

.wa-row.wa-no-anim { animation: none; }

@keyframes waPop {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.wa-row.wa-own {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.wa-row.wa-other { align-self: flex-start; }

.wa-row.wa-continuation { margin-top: 0; }

.wa-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #6a7175;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.wa-msg-avatar.wa-av-admin { background: #d4af37; color: #111; }
.wa-msg-avatar.wa-av-placeholder { visibility: hidden; }

/* Burbuja */
.wa-bubble {
  position: relative;
  padding: 0.4rem 0.55rem 0.35rem 0.65rem;
  border-radius: 7.5px;
  font-size: 0.86rem;
  line-height: 1.35;
  word-break: break-word;
  box-shadow: 0 1px 0.5px rgba(11,20,26,0.13);
  min-width: 60px;
}

.wa-own .wa-bubble {
  background: #005c4b;
  color: #e9edef;
  border-top-right-radius: 0;
}

.wa-other .wa-bubble {
  background: #202c33;
  color: #e9edef;
  border-top-left-radius: 0;
}

.wa-bubble.wa-admin-bubble {
  background: #2a2410;
  border: 1px solid rgba(212,175,55,0.35);
}

.wa-own .wa-bubble.wa-admin-bubble {
  background: #3d3415;
}

/* Cola de burbuja */
.wa-bubble::before {
  content: '';
  position: absolute;
  top: 0;
  width: 8px;
  height: 13px;
}

.wa-own .wa-bubble::before {
  right: -8px;
  background: #005c4b;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.wa-other .wa-bubble::before {
  left: -8px;
  background: #202c33;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.wa-own .wa-bubble.wa-admin-bubble::before { background: #3d3415; }
.wa-other .wa-bubble.wa-admin-bubble::before { background: #2a2410; }

/* Solo primera de grupo tiene cola */
.wa-row:not(.wa-first-in-group) .wa-bubble { border-radius: 7.5px; }
.wa-row:not(.wa-first-in-group) .wa-bubble::before { display: none; }

.wa-msg-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: #53bdeb;
  margin-bottom: 0.1rem;
  display: block;
}

.wa-msg-name.wa-name-admin { color: #facc15; }
.wa-msg-name.wa-name-self { color: #00d2b4; }

.wa-msg-text {
  color: inherit;
  word-break: break-word;
  white-space: pre-wrap;
}

.wa-msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  float: right;
  margin: 0.15rem 0 -0.15rem 0.5rem;
  margin-top: 0.35rem;
  position: relative;
  top: 4px;
}

.wa-msg-time {
  font-size: 0.68rem;
  color: rgba(233,237,239,0.6);
  line-height: 1;
}

/* Checks WhatsApp */
.wa-checks {
  display: inline-flex;
  align-items: center;
  color: rgba(233,237,239,0.6);
  font-size: 0.8rem;
  letter-spacing: -2px;
  line-height: 1;
}

.wa-checks.wa-check-read { color: #53bdeb; }
.wa-checks.wa-check-pending { letter-spacing: 0; font-size: 0.7rem; }

/* Mensaje del sistema centrado */
.wa-sysmsg {
  align-self: center;
  background: #182229;
  color: #8696a0;
  font-size: 0.75rem;
  text-align: center;
  padding: 0.4rem 0.8rem;
  border-radius: 7.5px;
  max-width: 80%;
  margin: 0.35rem 0;
  box-shadow: 0 1px 0.5px rgba(11,20,26,0.13);
}

.wa-sysmsg strong { color: #fbbf24; }

/* Acciones admin en hover */
.wa-msg-actions {
  display: none;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding-top: 0.3rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  justify-content: flex-end;
}

.wa-row:hover .wa-msg-actions { display: flex; }

.wa-msg-actions button {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
  color: #8696a0;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  cursor: pointer;
  font-weight: 600;
}

.wa-msg-actions button:hover { background: rgba(255,255,255,0.1); color: #e9edef; }
.wa-msg-actions button.wa-act-block { color: #fca5a5; border-color: rgba(239,68,68,0.35); }

/* Barra de entrada */
.chat-input-area {
  display: flex;
  gap: 0.4rem;
  padding: 0.45rem 0.55rem;
  border-top: none;
  align-items: center;
  flex-shrink: 0;
  background: #202c33;
  min-height: 52px;
}

.chat-emoji-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem;
  color: #8696a0;
  line-height: 1;
  transition: transform 0.15s;
}

.chat-emoji-btn:hover { transform: scale(1.12); }

.chat-input-area input {
  flex: 1;
  padding: 0.65rem 0.9rem;
  background: #2a3942;
  border: none;
  border-radius: 8px;
  color: #e9edef;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  color-scheme: dark;
  min-width: 0;
}

.chat-input-area input::placeholder { color: #8696a0; }

.chat-send-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  background: #00a884;
  color: #111b21;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}

.chat-send-btn:hover { background: #06cf9c; transform: scale(1.05); }
.chat-send-btn:active { transform: scale(0.95); }
.chat-send-btn svg { display: block; margin-left: 2px; }

/* Botones auth WhatsApp */
.wa-btn-primary {
  background: #00a884;
  color: #111b21;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.4rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.wa-btn-primary:hover { background: #06cf9c; }

.wa-btn-outline {
  background: transparent;
  color: #00a884;
  border: 1.5px solid #00a884;
  border-radius: 8px;
  padding: 0.6rem 1.4rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.wa-btn-outline:hover { background: rgba(0,168,132,0.12); }

.wa-lock-icon {
  font-size: 2.4rem;
  margin-bottom: 0.25rem;
  opacity: 0.85;
}

.chat-login-prompt p {
  margin: 0;
  font-size: 0.9rem;
  color: #8696a0;
}

.chat-auth-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.chat-register-form,
.chat-login-form {
  max-width: 340px;
  margin: 0 auto;
  width: 100%;
}

.chat-register-form h4,
.chat-login-form h4 {
  font-family: inherit;
  color: #00a884;
  text-align: center;
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.chat-register-form input,
.chat-login-form input {
  padding: 0.7rem 1rem;
  background: #2a3942;
  border: none;
  border-radius: 8px;
  color: #e9edef;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
}

.chat-register-form input:focus,
.chat-login-form input:focus {
  box-shadow: 0 0 0 2px rgba(0,168,132,0.4);
}

.chat-error {
  color: #f87171;
  font-size: 0.8rem;
  text-align: center;
  padding: 0.25rem;
}

/* Barra de usuario */
.chat-user-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.75rem;
  background: #182229;
  border-top: 1px solid #222d34;
  font-size: 0.78rem;
}

.chat-user-bar span {
  color: #00d2b4;
  font-weight: 600;
}

.chat-user-bar.admin-mode {
  background: rgba(212,175,55,0.1);
  border-color: rgba(212,175,55,0.3);
}

.chat-user-bar.admin-mode span { color: #facc15; }

.chat-logout-btn {
  background: none;
  border: 1px solid rgba(239,68,68,0.4);
  color: #fca5a5;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.72rem;
  cursor: pointer;
  font-family: inherit;
}

.chat-logout-btn:hover { background: rgba(239,68,68,0.15); }

/* Selector de emojis */
.chat-emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  padding: 0.5rem;
  border-top: 1px solid #222d34;
  background: #182229;
  max-height: 140px;
  overflow-y: auto;
}

.chat-emoji-picker span {
  font-size: 1.35rem;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 6px;
  transition: background 0.15s, transform 0.1s;
}

.chat-emoji-picker span:hover {
  background: rgba(0,168,132,0.2);
  transform: scale(1.2);
}

/* Modal fuerza contraseña */
.wa-force-pass-box {
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 10px;
  padding: 1rem;
}

.wa-force-pass-box input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.45rem;
  background: #2a3942;
  border: none;
  border-radius: 8px;
  color: #e9edef;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}

/* Typing indicator */
.wa-typing {
  display: inline-flex;
  gap: 4px;
  padding: 0.5rem 0.7rem;
  align-items: center;
}

.wa-typing i {
  width: 6px;
  height: 6px;
  background: #8696a0;
  border-radius: 50%;
  animation: waBounce 1.2s infinite;
}

.wa-typing i:nth-child(2) { animation-delay: 0.15s; }
.wa-typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes waBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ===== CHAT PÁGINA COMPLETA ===== */
.chat-fullpage {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  background: #0b141a;
  font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, 'Lucida Grande', Arial, sans-serif;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
}

.cfp-sidebar {
  width: 340px;
  min-width: 300px;
  background: #111b21;
  border-right: 1px solid #222d34;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.cfp-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #202c33;
  border-bottom: 1px solid #222d34;
}

.cfp-sidebar-title {
  color: #e9edef;
  font-weight: 600;
  font-size: 1rem;
}

.cfp-icon-btn {
  background: none;
  border: none;
  color: #8696a0;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: 50%;
  line-height: 1;
  transition: background 0.15s;
}

.cfp-icon-btn:hover { background: rgba(255,255,255,0.08); color: #e9edef; }

.cfp-search-wrap {
  padding: 0.5rem 0.75rem;
  background: #111b21;
  border-bottom: 1px solid #222d34;
}

.cfp-search-wrap input {
  width: 100%;
  padding: 0.5rem 0.85rem;
  background: #2a3942;
  border: none;
  border-radius: 8px;
  color: #e9edef;
  font-size: 0.88rem;
  outline: none;
  box-sizing: border-box;
}

.cfp-search-wrap input::placeholder { color: #8696a0; }

.cfp-nav-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.35rem 0;
}

.cfp-nav-list::-webkit-scrollbar { width: 6px; }
.cfp-nav-list::-webkit-scrollbar-thumb { background: rgba(134,150,160,0.4); border-radius: 3px; }

.cfp-section-label {
  padding: 0.65rem 1rem 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #00a884;
}

.cfp-contact {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: background 0.12s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.cfp-contact:hover { background: rgba(255,255,255,0.04); }
.cfp-contact.active { background: rgba(0,168,132,0.12); }

.cfp-contact-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00a884, #075e54);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  position: relative;
}

.cfp-contact-avatar.cfp-av-admin { background: linear-gradient(135deg, #d4af37, #a67c00); color: #111; }
.cfp-contact-avatar.cfp-av-community { background: linear-gradient(135deg, #6b73ff, #000dff); }

.cfp-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  background: #00d26a;
  border: 2px solid #111b21;
  border-radius: 50%;
}

.cfp-contact-meta { min-width: 0; flex: 1; }

.cfp-contact-name {
  color: #e9edef;
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cfp-contact-name.cfp-name-admin { color: #facc15; }

.cfp-admin-tag {
  display: inline-block;
  background: #d4af37;
  color: #111;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  margin-left: 0.3rem;
  vertical-align: middle;
  letter-spacing: 0.04em;
}

.cfp-contact-sub {
  color: #8696a0;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cfp-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #0b141a;
  position: relative;
}

.cfp-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  color: #8696a0;
  border-bottom: 6px solid #00a884;
}

.cfp-empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.cfp-empty h2 {
  color: #e9edef;
  font-weight: 300;
  font-size: 1.4rem;
  margin: 0 0 0.5rem;
}

.cfp-empty p { font-size: 0.9rem; max-width: 420px; margin: 0; line-height: 1.5; }

.cfp-convo {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.cfp-legend {
  background: #0b141a;
  color: #8696a0;
  font-size: 0.72rem;
  text-align: center;
  padding: 0.35rem 0.8rem;
  border-bottom: 1px solid #222d34;
  flex-shrink: 0;
  line-height: 1.4;
}

.cfp-convo-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1rem;
  background: #202c33;
  border-bottom: 1px solid #222d34;
  flex-shrink: 0;
}

.cfp-back-btn {
  background: none;
  border: none;
  color: #8696a0;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  line-height: 1;
}

.cfp-back-btn:hover { color: #e9edef; }

.cfp-convo-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00a884, #075e54);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.cfp-convo-info { flex: 1; min-width: 0; }

.cfp-convo-name {
  color: #e9edef;
  font-weight: 600;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cfp-convo-status {
  color: #8696a0;
  font-size: 0.75rem;
}

.cfp-convo-actions { display: flex; gap: 0.2rem; }

.cfp-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 6% 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background-color: #0b141a;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0,168,132,0.03) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 60%, rgba(0,168,132,0.025) 0 2px, transparent 3px),
    radial-gradient(circle at 40% 80%, rgba(255,255,255,0.02) 0 1.5px, transparent 2.5px),
    url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.03' stroke-width='1'%3E%3Ccircle cx='20' cy='18' r='4'/%3E%3Cpath d='M40 10l3 5h-6zM60 40c4 0 6 2 6 6s-2 6-6 6-6-2-6-6 2-6 6-6z'/%3E%3Cpath d='M15 55h10M20 50v10'/%3E%3Crect x='55' y='60' width='8' height='8' rx='1'/%3E%3Cpath d='M30 35c2-3 6-3 8 0'/%3E%3C/g%3E%3C/svg%3E");
  scroll-behavior: smooth;
}

.cfp-messages::-webkit-scrollbar { width: 6px; }
.cfp-messages::-webkit-scrollbar-thumb { background: rgba(134,150,160,0.4); border-radius: 3px; }

.cfp-input-area {
  display: flex;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  align-items: center;
  background: #202c33;
  flex-shrink: 0;
}

.cfp-emoji-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem;
  color: #8696a0;
  line-height: 1;
}

.cfp-emoji-btn:hover { transform: scale(1.12); }

.cfp-input-area input {
  flex: 1;
  padding: 0.7rem 1rem;
  background: #2a3942;
  border: none;
  border-radius: 8px;
  color: #e9edef;
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  min-width: 0;
  color-scheme: dark;
}

.cfp-input-area input::placeholder { color: #8696a0; }

.cfp-send-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  background: #00a884;
  color: #111b21;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}

.cfp-send-btn:hover { background: #06cf9c; transform: scale(1.05); }
.cfp-send-btn:active { transform: scale(0.95); }
.cfp-send-btn svg { display: block; margin-left: 2px; }

.cfp-emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  padding: 0.5rem;
  border-top: 1px solid #222d34;
  background: #182229;
  max-height: 140px;
  overflow-y: auto;
}

.cfp-emoji-picker span {
  font-size: 1.35rem;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 6px;
}

.cfp-emoji-picker span:hover { background: rgba(0,168,132,0.2); }

.cfp-login {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: #8696a0;
  text-align: center;
  padding: 2rem;
}

/* Reutiliza burbujas WA dentro de cfp-messages */
.cfp-messages .wa-row { max-width: 75%; }

@media (max-width: 768px) {
  .cfp-sidebar { width: 100%; min-width: 0; position: absolute; inset: 0; z-index: 2; }
  .cfp-sidebar.cfp-hidden { display: none; }
  .cfp-main { width: 100%; }
  .cfp-messages { padding: 0.8rem 4% 1rem; }
}

/* ===== TARJETITAS LIGHT ===== */
.tajetitas-container {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: 0.85rem;
  min-width: 0;
}

.tajetitas-portada-wrapper {
  position: relative;
  width: 100%; height: 380px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(139, 92, 246, 0.04);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--border);
  display: flex; align-items: center; justify-content: center;
}

.tajetitas-img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center; display: block;
  transition: transform 0.5s ease;
}

.tajetitas-portada-wrapper:hover .tajetitas-img {
  transform: scale(1.03);
}

.etiqueta-tajetitas {
  position: absolute;
  top: 14px; right: -38px;
  background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
  color: #fff;
  padding: 8px 42px;
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.5px;
  transform: rotate(45deg);
  box-shadow: 0 3px 12px rgba(139, 92, 246, 0.4);
  z-index: 10; text-transform: uppercase; white-space: nowrap;
  border: 2px solid rgba(255,255,255,0.2);
  font-family: var(--font-display);
}

.tajetitas-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 0.85rem; text-align: center; padding: 1rem;
}

.btn-tajetitas {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
  color: #fff; padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem; font-weight: 700; text-decoration: none;
  letter-spacing: 0.8px; text-transform: uppercase;
  box-shadow: 0 4px 18px rgba(139,92,246,0.3);
  transition: all var(--transition); width: 100%; text-align: center;
  font-family: var(--font-display);
}

.btn-tajetitas:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(139,92,246,0.5); color: #fff;
  background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
}

/* ===== TÍTULO DE SECCIÓN ===== */
.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 700;
  color: var(--gold); margin-bottom: 0;
  letter-spacing: 1px;
  text-shadow: 0 0 20px rgba(212,175,55,0.2);
}

.section-subtitle {
  font-size: 0.9rem; color: var(--text-muted); font-weight: 400;
  letter-spacing: 0.3px;
}

/* ===== TOOLBAR DE BIBLIOTECA ===== */
.biblioteca-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-panel);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

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

.libros-count-badge {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold);
  padding: 0.4rem 0.85rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--gold-dim);
}

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

.search-container-modern {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1rem;
  font-size: 0.9rem;
  pointer-events: none;
}

.search-input-modern {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.7rem 1.25rem 0.7rem 2.75rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-ui);
  width: 280px;
  transition: all var(--transition);
  outline: none;
}

.search-input-modern::placeholder {
  color: var(--text-muted);
}

.search-input-modern:focus {
  border-color: var(--gold-dim);
  width: 320px;
  background: rgba(212, 175, 55, 0.04);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.08);
}

.view-toggles {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.view-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 1rem;
}

.view-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.view-btn.active {
  background: var(--gold);
  color: var(--bg-deep);
}

.sort-select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: var(--font-ui);
  cursor: pointer;
  outline: none;
  transition: all var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.sort-select:focus {
  border-color: var(--gold-dim);
}

.sort-select option {
  background: var(--bg-dark);
  color: var(--text-primary);
}

/* ===== CATEGORÍAS ===== */
.categorias-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.5rem 0;
}

.categorias-container::-webkit-scrollbar {
  display: none;
}

.categoria-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: var(--font-ui);
}

.categoria-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-strong);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.categoria-btn.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  border-color: var(--gold);
  color: var(--bg-deep);
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.cat-icon {
  font-size: 1rem;
}

.cat-text {
  font-size: 0.85rem;
}

/* ===== GRID DE LIBROS ===== */
.libros-scroll-container { width: 100%; padding: 0.5rem 0 1rem; min-height: 280px; }

.libros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.75rem;
  padding: 0.25rem 0;
  margin-left: 0;
  visibility: visible; opacity: 1;
}

/* Vista lista */
.libros-grid.view-list {
  grid-template-columns: 1fr;
  gap: 1rem;
}

.libros-grid.view-list .libro-card {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.libros-grid.view-list .libro-portada {
  width: 80px;
  height: 110px;
  min-width: 80px;
  margin-bottom: 0;
  margin-right: 1.25rem;
  aspect-ratio: auto;
  border-radius: 6px;
}

.libros-grid.view-list .libro-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.libros-grid.view-list .libro-titulo {
  font-size: 1.05rem;
  -webkit-line-clamp: 1;
}

.libros-grid.view-list .libro-autor {
  font-size: 0.85rem;
}

.libros-grid.view-list .libro-overlay {
  display: none;
}

/* ===== TARJETA DE LIBRO ===== */
.libro-card {
  cursor: pointer;
  transition: all 0.4s cubic-bezier(.4,0,.2,1);
  position: relative;
  background: var(--bg-card);
  border-radius: 14px;
  padding: 10px;
  border: 1px solid transparent;
}

.libro-card:hover {
  transform: translateY(-12px) scale(1.02);
  border-color: var(--gold-dim);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(212, 175, 55, 0.1);
}

.libro-portada {
  position: relative;
  width: 100%; aspect-ratio: 2/3;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(145deg, #1a1a2e 0%, #0f0f1a 100%);
  margin-bottom: 0.85rem;
  box-shadow:
    0 8px 25px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.4s ease;
}

.libro-card:hover .libro-portada {
  box-shadow:
    0 12px 35px rgba(0,0,0,0.6),
    0 0 20px rgba(212, 175, 55, 0.15),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

/* Efecto de brillo en el borde */
.libro-portada::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 10px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(212,175,55,0.3) 0%, transparent 50%, rgba(139,92,246,0.3) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.libro-card:hover .libro-portada::before {
  opacity: 1;
}

/* Lomo del libro */
.libro-portada::after {
  content: '';
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 8px; z-index: 2;
  background: linear-gradient(90deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 40%, transparent 100%);
  border-radius: 10px 0 0 10px;
}

/* Viñeta "Reciente" */
.etiqueta-reciente {
  position: absolute; top: 12px; right: -35px;
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  color: #000;
  padding: 6px 45px;
  font-size: 0.6rem; font-weight: 800;
  letter-spacing: 1.5px; text-transform: uppercase;
  transform: rotate(45deg);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.5);
  z-index: 10; white-space: nowrap;
  font-family: var(--font-display);
  border: 1px solid rgba(255,255,255,0.2);
}

.libro-portada img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: transform 0.5s ease;
}

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

.libro-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,10,15,0.98) 0%, rgba(10,10,15,0.6) 40%, transparent 100%);
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 1.25rem;
  opacity: 0; transition: opacity 0.3s ease;
  border-radius: 10px;
}

.libro-card:hover .libro-overlay { opacity: 1; }

.libro-actions { display: flex; gap: 0.6rem; }

.action-btn {
  background: rgba(212,175,55,0.15);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 50%;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  color: var(--gold);
}

.action-btn:hover {
  background: var(--gold); color: var(--bg-deep);
  transform: scale(1.15);
  box-shadow: 0 6px 20px rgba(212,175,55,0.5);
}

.libro-info { padding: 0.3rem 0.2rem 0.1rem; }

.libro-titulo {
  font-family: var(--font-body);
  font-size: 0.95rem; font-weight: 600;
  color: var(--text-primary); margin-bottom: 0.25rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color 0.3s ease;
}

.libro-card:hover .libro-titulo {
  color: var(--gold);
}

.libro-autor {
  font-size: 0.78rem; color: var(--text-muted);
  font-style: italic; font-family: var(--font-body);
  display: -webkit-box;
  -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}

.empty-state {
  text-align: center; padding: 4rem 2rem;
  color: var(--text-muted); font-size: 1.05rem;
  font-family: var(--font-body);
  grid-column: 1 / -1;
}

/* ===== MODAL LIBRO ===== */
.modal-content {
  background: linear-gradient(160deg, #151520 0%, #0a0a10 100%);
  border-radius: var(--radius);
  max-width: 520px; width: 100%;
  max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-deep), 0 0 0 1px var(--gold-dim);
  animation: modalAppear 0.25s cubic-bezier(.4,0,.2,1);
  position: relative;
}

.modal-content::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.5rem 1.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-family: var(--font-display);
  color: var(--gold); font-size: 1.25rem;
  letter-spacing: 0.5px;
  margin: 0;
  text-shadow: 0 0 20px rgba(212,175,55,0.3);
}

.close-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  font-size: 1.2rem; color: var(--text-muted);
  cursor: pointer; padding: 0.35rem;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: all var(--transition);
}

.close-btn:hover {
  background: var(--gold-dim); color: var(--gold);
  border-color: var(--gold);
}

.modal-body { padding: 1.5rem 1.75rem; }

.modal-body p {
  margin-bottom: 0.85rem; color: var(--text-secondary);
  line-height: 1.7; font-family: var(--font-body); font-size: 1.05rem;
}

.modal-body strong { color: var(--text-primary); font-weight: 600; }

.modal-actions {
  display: flex; gap: 0.75rem;
  padding: 1.25rem 1.75rem 1.75rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.modal-actions button {
  flex: 1; min-width: 120px;
  padding: 0.9rem; border: none; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: all var(--transition); font-family: var(--font-ui);
}

.btn-visualizar {
  background: var(--violet);
  color: #fff;
  box-shadow: 0 4px 16px rgba(139,92,246,0.3);
}

.btn-visualizar:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139,92,246,0.5);
  background: var(--violet-light);
}

.btn-descargar {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  border: 1px solid var(--border) !important;
}

.btn-descargar:hover {
  background: rgba(255,255,255,0.08); transform: translateY(-2px);
}

.btn-ver-descargar {
  background: var(--gold);
  color: var(--bg-deep); font-weight: 700;
  box-shadow: 0 4px 16px rgba(212,175,55,0.3);
}

.btn-ver-descargar:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212,175,55,0.5);
  background: var(--gold-light);
}

/* ===== COMENTARIOS MODAL ===== */
.comentarios-modal { max-width: 650px; width: 90%; }
.comentarios-form-container { padding: 0; }
.comentarios-form { padding: 1.75rem; display: flex; flex-direction: column; }
.comentarios-form .form-group {
  margin-bottom: 1.5rem; position: relative;
}
.comentarios-form label {
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--text-secondary); font-size: 0.85rem; font-weight: 500;
  margin-bottom: 0.5rem; letter-spacing: 0.3px;
}
.label-icon { font-size: 1rem; }
.comentarios-form input,
.comentarios-form textarea {
  width: 100%; padding: 0.9rem 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 0.95rem; font-family: var(--font-ui);
  transition: all var(--transition); resize: vertical; outline: none;
}
.comentarios-form input:focus,
.comentarios-form textarea:focus {
  border-color: var(--gold-dim);
  background: rgba(212,175,55,0.03);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.06);
}
.comentarios-form input::placeholder,
.comentarios-form textarea::placeholder { color: var(--text-muted); }
.char-counter { text-align: right; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.35rem; }
.form-info {
  background: rgba(212,175,55,0.04); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.75rem 1rem; margin-bottom: 1.25rem;
}
.form-info p { color: var(--text-muted); font-size: 0.85rem; margin: 0 !important; }
.btn-submit {
  background: var(--violet);
  color: #fff; padding: 1rem; border: none; border-radius: var(--radius-sm);
  font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 18px rgba(139,92,246,0.3);
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(139,92,246,0.5);
  background: var(--violet-light);
}
.btn-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-icon { font-size: 1rem; }
.btn-cancel {
  background: rgba(255,255,255,0.04); color: var(--text-secondary);
  padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 500; cursor: pointer;
  transition: all var(--transition);
}
.btn-cancel:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.form-actions {
  display: flex; align-items: center; gap: 1rem;
}

/* ===== LOGIN ===== */
.login-container {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
  background: radial-gradient(ellipse at center, #151520 0%, #0a0a10 70%);
}

.login-card {
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  padding: 2.5rem; width: 100%; max-width: 420px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-deep), var(--shadow-gold);
  position: relative; overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.login-header { text-align: center; margin-bottom: 2rem; }
.login-header h1 {
  font-family: var(--font-display);
  font-size: 1.5rem; color: var(--gold); margin-bottom: 0.5rem;
  letter-spacing: 1px;
}
.login-header p { color: var(--text-muted); font-size: 0.9rem; }
.login-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label {
  color: var(--text-secondary); font-size: 0.85rem; font-weight: 500; letter-spacing: 0.3px;
}
.form-group input, .form-group textarea, .form-group select {
  padding: 0.9rem 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 0.95rem; font-family: var(--font-ui);
  transition: all var(--transition); outline: none; width: 100%;
}
.form-group input:focus, .form-group textarea:focus {
  border-color: var(--gold-dim);
  background: rgba(212,175,55,0.03);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.06);
}
.form-group input::placeholder { color: var(--text-muted); }
.login-btn {
  background: var(--gold);
  color: var(--bg-deep); padding: 1rem;
  border: none; border-radius: var(--radius-sm);
  font-size: 1rem; font-weight: 700; cursor: pointer;
  font-family: var(--font-display); letter-spacing: 1.5px; text-transform: uppercase;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(212,175,55,0.3);
}
.login-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(212,175,55,0.5);
  background: var(--gold-light);
}
.login-footer { text-align: center; margin-top: 1.5rem; }
.back-link { color: var(--text-muted); font-size: 0.9rem; text-decoration: none; transition: color var(--transition); }
.back-link:hover { color: var(--gold); }
.error-message {
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25);
  color: #fca5a5; padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

/* ===== PANEL ADMIN ===== */
.admin-panel {
  width: 100%; height: 100vh;
  display: none; flex-direction: row;
  background: var(--bg-deep);
}
#admin-page.active .admin-panel,
#admin-page[style*="block"] .admin-panel { display: flex !important; }

.admin-sidebar {
  width: 280px; background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0; display: flex; flex-direction: column;
  flex-shrink: 0; overflow-y: auto;
}

.admin-logo {
  text-align: center; padding: 0 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.admin-logo img { margin-bottom: 0.5rem; }
.admin-logo h2 {
  font-family: var(--font-display); color: var(--gold);
  font-size: 1.3rem; margin-bottom: 0.25rem;
}
.admin-logo p { color: var(--text-secondary); font-size: 0.8rem; }

.admin-menu { flex: 1; padding: 1rem 0; }

.admin-menu-item {
  display: flex; padding: 0.85rem 1.5rem; color: var(--text-secondary);
  cursor: pointer; transition: all 0.3s; gap: 0.75rem;
  border-left: 3px solid transparent; align-items: center;
}
.admin-menu-item:hover {
  background: rgba(212,175,55,0.05); color: var(--text-primary);
}
.admin-menu-item.active {
  background: rgba(212,175,55,0.1); color: var(--gold);
  border-left-color: var(--gold);
}
.admin-menu-item span { font-size: 1.2rem; }
.admin-menu-item p {
  font-family: var(--font-ui); font-size: 0.85rem; margin: 0;
}

.admin-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
}
.admin-logout-btn {
  width: 100%; padding: 0.75rem;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2); border-radius: var(--radius-sm);
  color: #fca5a5; font-family: var(--font-ui); font-size: 0.85rem;
  cursor: pointer; transition: all 0.3s;
}
.admin-logout-btn:hover { background: rgba(239,68,68,0.2); }

.admin-main {
  flex: 1; overflow-y: auto; padding: 2rem;
}

.admin-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2rem; padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.admin-header h1 {
  font-family: var(--font-display); color: var(--gold);
  font-size: 1.5rem; font-weight: 700; letter-spacing: 1px; margin: 0;
}

.admin-content { display: none; }
.admin-content.active { display: block; }

.admin-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.admin-card h3 {
  font-family: var(--font-display); color: var(--gold);
  font-size: 1.1rem; display: flex; align-items: center;
  gap: 0.5rem; margin-bottom: 1.25rem;
}

.admin-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem; margin-bottom: 2rem;
}
.admin-stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.admin-stat-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.admin-stat-number {
  font-family: var(--font-display); font-size: 2rem;
  color: var(--gold); display: block; margin-bottom: 0.25rem;
}
.admin-stat-label { color: var(--text-secondary); font-size: 0.85rem; }

.upload-form {
  display: flex; flex-direction: column; gap: 1.25rem;
}
.upload-form h2 { color: var(--gold); margin-bottom: 0.5rem; }

.form-group { margin-bottom: 0; }
.form-group label {
  display: block; color: var(--text-secondary); margin-bottom: 0.5rem;
  font-size: 0.85rem; font-weight: 500;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-primary); font-family: var(--font-ui);
  font-size: 0.9rem; transition: all 0.3s;
}
.form-group input:focus, .form-group textarea:focus {
  border-color: var(--gold-dim); outline: none;
  background: rgba(212,175,55,0.03);
}
.form-group textarea { min-height: 100px; resize: vertical; }
.form-group select { cursor: pointer; }
.form-group select option { background: var(--bg-dark); color: var(--text-primary); }
.form-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }

.banner-preview-container {
  margin-top: 0.5rem;
}
.banner-preview {
  width: 100%; max-width: 400px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.cover-preview img, #portada-preview img {
  width: 160px; height: 240px;
  object-fit: cover; object-position: center;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--border);
  display: block;
}

/* Banner preview */
.banner-preview-container {
  margin-top: 1rem;
  display: flex; justify-content: center;
}

.banner-preview {
  width: 100%;
  max-width: 500px;
  height: 180px;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--border);
  display: block;
}

/* Libros admin grid */
.libros-admin-container { margin-top: 2rem; }
.libros-admin-container h2 {
  font-family: var(--font-display);
  color: var(--text-primary); font-size: 1.2rem; font-weight: 600;
}

#libros-total-count {
  background: rgba(139,92,246,0.1) !important;
  border: 1px solid rgba(139,92,246,0.25) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--violet-light);
}

.libros-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem; margin-top: 1.25rem;
}

.libro-admin-card {
  background: rgba(18,18,26,0.95);
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
  position: relative; overflow: hidden;
}

.libro-admin-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card), var(--shadow-gold);
}

.libro-admin-card img {
  width: 100%; height: 240px;
  object-fit: cover; object-position: center;
  border-radius: var(--radius-sm);
  background: rgba(212,175,55,0.03);
  margin-bottom: 0.75rem; display: block;
}

.libro-admin-card h3 {
  color: var(--text-primary); font-size: 0.88rem;
  font-family: var(--font-body); margin-bottom: 0.75rem; line-height: 1.4;
}

.libro-admin-card .action-buttons { display: flex; gap: 0.5rem; }

.btn-edit {
  background: rgba(34,197,94,0.1); color: #86efac;
  padding: 0.5rem 0.75rem; border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--radius-sm); font-weight: 600; font-size: 0.8rem;
  cursor: pointer; transition: all var(--transition); flex: 1;
}
.btn-edit:hover { background: rgba(34,197,94,0.2); border-color: rgba(34,197,94,0.4); transform: translateY(-1px); }

.btn-delete {
  background: rgba(239,68,68,0.1); color: #fca5a5;
  padding: 0.5rem 0.75rem; border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm); font-weight: 600; font-size: 0.8rem;
  cursor: pointer; transition: all var(--transition); flex: 1;
}
.btn-delete:hover { background: rgba(239,68,68,0.2); border-color: rgba(239,68,68,0.4); transform: translateY(-1px); }

/* ===== VISUALIZADOR ===== */
.visualizador-container { display: flex; flex-direction: column; height: 100vh; background: var(--bg-deep); }
.visualizador-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 2rem; background: rgba(10,10,15,0.98);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px); flex-shrink: 0;
}
.visualizador-header .header-info h1 {
  font-family: var(--font-display);
  font-size: 1.2rem; color: var(--gold); margin: 0;
}
.visualizador-header .header-info .autor { color: var(--text-muted); font-size: 0.85rem; margin: 0; }
.visualizador-content { flex: 1; overflow: hidden; }
.pdf-viewer { width: 100%; height: 100%; border: none; background: #1a1a1a; }
.unsupported-format {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: 1rem; color: var(--text-secondary);
}
.download-btn {
  background: var(--violet);
  color: #fff; padding: 0.9rem 1.75rem;
  border-radius: var(--radius-sm); text-decoration: none;
  font-weight: 600; font-size: 0.95rem;
  box-shadow: 0 4px 18px rgba(139,92,246,0.3);
  transition: all var(--transition);
}
.download-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(139,92,246,0.5); background: var(--violet-light); }

/* ===== COMENTARIOS ADMIN ===== */
.comentarios-admin-modal { max-width: 700px; width: 95%; }
.comentarios-list { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.comentario-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 1.25rem;
  transition: border-color var(--transition);
}
.comentario-card:hover { border-color: var(--gold-dim); }
.comentario-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 0.75rem; gap: 1rem; flex-wrap: wrap;
}
.comentario-nombre { font-weight: 600; color: var(--text-primary); font-size: 0.95rem; }
.comentario-correo { color: var(--text-muted); font-size: 0.85rem; }
.comentario-fecha { color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; }
.comentario-body p { color: var(--text-secondary); line-height: 1.6; font-family: var(--font-body); font-size: 1rem; }
.btn-eliminar-comentario {
  background: rgba(239,68,68,0.08); color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.15); padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm); font-size: 0.8rem; cursor: pointer;
  transition: all var(--transition);
}
.btn-eliminar-comentario:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3); }
.no-comentarios { text-align: center; color: var(--text-muted); padding: 2.5rem; font-family: var(--font-body); font-size: 1.05rem; }

/* Password form */
#password-form-container h2 { color: var(--gold); }
#password-error.error-message { display: block; }

/* Bloqueo */
.btn-bloqueo-activo, .btn-warning.activo {
  background: rgba(239,68,68,0.12) !important;
  color: #fca5a5 !important;
  border-color: rgba(239,68,68,0.35) !important;
}

/* Estado de éxito/error inline */
.success-msg {
  background: rgba(34,197,94,0.06); border: 1px solid rgba(34,197,94,0.2);
  color: #86efac; padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-size: 0.9rem;
}
.warning-msg {
  background: rgba(234,179,8,0.06); border: 1px solid rgba(234,179,8,0.2);
  color: #fde047; padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-size: 0.9rem;
}

/* ===== RESPONSIVE: TABLET (≤1024px) ===== */
@media (hover: none) {
  .libro-card:hover { transform: none; }
  .libro-card:active { transform: scale(0.98); }
  .action-btn, .admin-link, .cerrar-sesion-btn,
  .btn-edit, .btn-delete, .btn-primary, .file-input-label, .close-btn {
    min-height: 44px; min-width: 44px;
  }
}

@media (max-width: 1024px) {
  .libros-scroll { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 1.5rem; }
  .biblioteca-header { padding: 0.9rem 1.5rem; }
  .search-input { width: 200px; }
  .search-input:focus { width: 250px; }
  .main-content { padding: 2rem 1.5rem; }
  .banner-container { min-width: 280px; height: 340px; }
  .banner-right-column { min-width: 200px; max-width: 240px; }
  .banner-right-column .logo-container { width: 130px; height: 130px; }
  .libros-admin-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .modal-content, .modal-puerta { max-width: 95%; margin: 1rem; }
  .modal-puerta-content { padding: 1.5rem; }
  .upload-form-container { padding: 1.5rem; }
}

/* ===== RESPONSIVE: MÓVIL (≤768px) ===== */
@media (max-width: 768px) {
  .page { width: 100%; overflow-x: hidden; }
  .biblioteca-container { min-height: 100vh; min-height: 100dvh; width: 100%; overflow-x: hidden; }
  .main-content { padding: 1rem 0.75rem 1.5rem; width: 100%; }
  .content-section { margin-bottom: 2rem; }
  .section-header { margin-bottom: 1.25rem; padding-left: 0; }
  .section-title { font-size: 1.3rem; }
  .libros-scroll-container { padding: 0.5rem 0 1rem; }
  .libros-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0 0.25rem;
  }
  .libro-card { max-width: none; min-width: 0; padding: 8px; border-radius: 12px; }
  .libro-portada { aspect-ratio: auto; height: 200px; border-radius: 8px; }
  .libro-titulo { font-size: 0.82rem; }
  .libro-autor { font-size: 0.72rem; }
  .biblioteca-header {
    flex-direction: column; gap: 0.85rem;
    padding: 0.85rem 0.75rem 1rem;
    border-bottom: 1px solid var(--border); width: 100%;
  }
  .header-menu { flex-direction: column; align-items: stretch; gap: 0.85rem; width: 100%; max-width: 100%; }
  .header-left { justify-content: center; max-width: 100%; }
  .logo { font-size: 1.15rem; text-align: center; white-space: normal; line-height: 1.35; word-break: break-word; }
  .header-right { flex-direction: column; gap: 0.85rem; }
  .header-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: stretch; }
  .admin-link, .cerrar-sesion-btn { padding: 0.85rem 1.25rem; flex: 1; min-width: 0; border-radius: 50px; font-size: 0.9rem; }
  
  /* Toolbar responsive */
  .biblioteca-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem;
  }
  .toolbar-left {
    justify-content: center;
    flex-wrap: wrap;
  }
  .toolbar-right {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  .search-container-modern { width: 100%; }
  .search-input-modern { width: 100%; }
  .search-input-modern:focus { width: 100%; }
  .sort-select { width: 100%; }
  
  /* Categorías responsive */
  .categorias-container {
    flex-wrap: wrap;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    gap: 0.4rem;
  }
  .categoria-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.72rem;
    border-radius: 50px;
  }
  .cat-icon { font-size: 0.85rem; }
  .cat-text { font-size: 0.72rem; }
  
  /* Vista lista responsive */
  .libros-grid.view-list .libro-card {
    padding: 8px;
  }
  .libros-grid.view-list .libro-portada {
    width: 70px;
    height: 95px;
    min-width: 70px;
  }
  
  .banner-logo-container { flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; align-items: center; width: 100%; max-width: 100%; }
  .welcome-panel-container { flex: 1 1 100% !important; max-width: 100% !important; min-width: 0; width: 100%; }
  .welcome-panel { height: auto !important; max-height: none !important; padding: 1.25rem; width: 100%; max-width: 100%; overflow: visible !important; }
  .welcome-text-scroll { min-height: auto; max-height: 160px; }
  .welcome-text-scroll p { font-size: 0.9rem; }
  .banner-container { min-width: 0; width: 100%; max-width: 100%; height: 220px; border-radius: var(--radius); }
  .biblioteca-banner { width: 100%; height: 100%; object-fit: cover; }
  .banner-right-column { width: 100%; max-width: 100%; min-width: 0; margin: 0 auto; }
  .logo-container, .banner-right-column .logo-container { width: 100px; height: 100px; }
  .mes-tajetitas-row {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  .mes-tajetitas-row > * {
    width: 100%;
    max-width: 200px;
  }
  .libro-del-mes-portada-wrapper { height: 280px; }
  .tajetitas-portada-wrapper { height: 280px; }
  .btn-cuestionario-luminarum { width: 100%; padding: 0.8rem 1rem; font-size: 0.8rem; }
  .form-columns { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-sidebar { width: 60px; }
  .admin-menu-item p { display: none; }
  .admin-menu-item { justify-content: center; padding: 0.85rem; }
  .admin-logo img { display: none; }
  .admin-logo h2 { font-size: 0.9rem; }
  .admin-logo p { display: none; }
  .acceso-container { height: 100vh; height: 100dvh; width: 100%; }
  .puerta-wrapper { max-width: 100%; }
  .puerta-imagen { max-width: 100%; width: 100%; height: auto; min-height: 100%; object-fit: cover; }
  .identificarse-area { top: 33% !important; left: 50% !important; transform: translate(-50%,-50%) !important; width: 90% !important; max-width: min(320px, 92vw) !important; }
  .identificarse-sign { font-size: 0.85rem !important; padding: 0.6rem 1rem !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; border-radius: 8px !important; }
  .keypad-area { width: min(200px, 70vw); height: auto; min-height: 180px; }
  .modal-overlay { min-height: 100dvh; padding: max(0.5rem, env(safe-area-inset-top)) env(safe-area-inset-right) max(1rem, env(safe-area-inset-bottom)) env(safe-area-inset-left); align-items: flex-start; overflow-y: auto; }
  .modal-content { max-width: calc(100% - 1rem); max-height: 85vh; margin: 0.5rem auto 1.5rem; border-radius: var(--radius); }
  .modal-puerta { width: calc(100% - 1rem); max-width: none; max-height: 88vh; margin: 0.5rem; border-radius: var(--radius); }
  .modal-puerta-content { padding: 1.25rem; }
  .modal-puerta-header h2 { font-size: 1.2rem; }
  .modal-header, .modal-body { padding: 1.25rem; }
  .modal-actions { padding: 1rem 1.25rem 1.25rem; flex-direction: column; gap: 0.75rem; }
  .modal-actions button { width: 100%; padding: 1rem; border-radius: var(--radius-sm); }
  .close-btn { width: 44px; height: 44px; font-size: 1.4rem; border-radius: 50%; }
  .upload-form-container { padding: 1.25rem; margin-bottom: 1.5rem; border-radius: var(--radius); }
  .comentarios-modal { width: calc(100% - 1rem); max-height: 88vh; border-radius: var(--radius); }
  .comentarios-form { padding: 1.25rem; }
  .login-container { padding: 1rem; }
  .login-card { padding: 1.5rem; }
  .form-actions { flex-direction: column; gap: 0.75rem; }
  .form-actions .btn-primary, .form-actions .btn-secondary, .form-actions .btn-cancel { width: 100%; }
  #portada-preview img, .cover-preview img { width: 160px; height: 240px; }
  
  /* Intro responsive */
  .intro-title { font-size: 2rem; letter-spacing: 2px; }
  .intro-subtitle { font-size: 1rem; }
  .intro-enter-btn { padding: 0.85rem 2rem; font-size: 0.9rem; }
  .intro-logo-img { width: 90px; height: 90px; }
}

/* Móviles grandes (380px–768px) */
@media (min-width: 380px) and (max-width: 768px) {
  .libros-scroll { gap: 1rem; padding: 0 0.6rem; }
  .libro-portada { height: 240px; }
  .libro-titulo { font-size: 0.9rem; }
  .section-title { font-size: 1.35rem; }
  .welcome-panel { height: auto !important; max-height: none !important; overflow: visible !important; }
  .welcome-text-scroll { max-height: 160px; }
  .banner-container { height: 240px; }
  .logo-container, .banner-right-column .logo-container { width: 95px; height: 95px; }
}

/* Móvil muy pequeño (< 380px) */
@media (max-width: 379px) {
  .libros-scroll { grid-template-columns: 1fr; max-width: 260px; margin: 0 auto; gap: 1.25rem; }
  .libro-portada { height: 320px; }
  .logo { font-size: 1.05rem; }
  .section-title { font-size: 1.2rem; }
  .libros-admin-grid { grid-template-columns: 1fr; gap: 1rem; }
  .libro-admin-card img { height: 240px; }
  .modal-puerta-header h2 { font-size: 1.1rem; }
  .intro-title { font-size: 1.6rem; }
}

/* YouTube icon responsive */
.youtube-link { text-align: center; margin-top: 0.5rem; }
.youtube-link img { width: 175px; height: 175px; }
@media (max-width: 768px) {
  .youtube-link img { width: 80px; height: 80px; }
}
@media (max-width: 379px) {
  .youtube-link img { width: 60px; height: 60px; }
}

@media (min-width: 1400px) {
  .libros-scroll { grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 2rem; }
}
