/* ==========================================================================
   LIBRERÍA DE COLECCIÓN - HOJA DE ESTILOS PREMIUM (TEMA OSCURO ELEGANTE)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700;900&family=Cinzel:wght@500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* TEMA OSCURO PRINCIPAL (OBSIDIANA & ORO) */
  --bg-primary: #070a12;
  --bg-secondary: #0f1626;
  --bg-card: #162035;
  --bg-glass: rgba(15, 22, 38, 0.85);
  --bg-input: #0b101c;
  
  --border-color: rgba(245, 158, 11, 0.15);
  --border-hover: rgba(245, 158, 11, 0.5);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  
  /* COLORES Y GRADIENTES DE LUJO */
  --gold: #f59e0b;
  --gold-light: #fcd34d;
  --gold-dark: #b45309;
  --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #78350f 100%);
  --gold-glow: rgba(245, 158, 11, 0.25);
  
  --accent-primary: #6366f1;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  
  --success: #10b981;
  --danger: #ef4444;
  --info: #3b82f6;
  
  /* BORDES Y SOMBRAS */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 45px -10px rgba(0, 0, 0, 0.8);
  --shadow-gold: 0 0 25px rgba(245, 158, 11, 0.25);

  /* TIPOGRAFÍAS DE COLECCIONISTA */
  --font-title: 'Cinzel Decorative', serif;
  --font-heading: 'Cinzel', serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* MODO CLARO OPCIONAL */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.9);
  --bg-input: #f1f5f9;
  
  --border-color: #e2e8f0;
  --border-hover: rgba(245, 158, 11, 0.6);
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #94a3b8;
  
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 16px 32px rgba(0,0,0,0.12);
}

/* REINICIO Y ESTILOS BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
  background: none;
}

/* ==========================================================================
   BARRA DE NAVEGACIÓN SUPERIOR (HEADER)
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 2rem;
  transition: var(--transition);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: var(--gold-gradient);
  color: #000;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.brand-icon {
  font-size: 1.75rem;
  color: var(--gold);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  font-size: 0.65rem;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* BUSCADOR */
.search-bar-header {
  flex: 1;
  max-width: 520px;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1.25rem;
  color: var(--gold);
  font-size: 1rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 3rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-main);
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

/* ACCIONES DE NAVEGACIÓN */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  position: relative;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--gold-gradient);
  color: #000;
  font-size: 0.75rem;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary);
}

.btn-primary {
  background: var(--gold-gradient);
  color: #000;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.btn-primary:hover {
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
  opacity: 0.95;
}

.btn-outline {
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-main);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ==========================================================================
   SECCIÓN HERO / BANNER PRINCIPAL
   ========================================================================== */
.hero {
  position: relative;
  padding: 3.5rem 2rem 2rem;
  background: radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.12), transparent 70%);
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.25rem;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--gold-light);
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 750px;
  margin: 0 auto 1.75rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
}

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

/* ==========================================================================
   DEPARTAMENTOS HERO GRID
   ========================================================================== */
.departments-section {
  max-width: 1400px;
  margin: 1.5rem auto 0;
  padding: 0 2rem;
}

.dept-grid-hero {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}

@media (max-width: 1100px) {
  .dept-grid-hero {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 600px) {
  .dept-grid-hero {
    grid-template-columns: repeat(2, 1fr);
  }
}

.department-card-hero {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 0.85rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.department-card-hero:hover, .department-card-hero.active {
  border-color: var(--gold);
  background: rgba(245, 158, 11, 0.12);
  transform: translateY(-4px);
  box-shadow: var(--shadow-gold);
}

.dept-icon {
  font-size: 2.25rem;
}

.dept-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.dept-desc {
  font-size: 0.725rem;
  color: var(--text-muted);
  line-height: 1.2;
}

/* ==========================================================================
   MAIN CONTAINER (SIDEBAR & CATALOG GRID)
   ========================================================================== */
.main-container {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  flex: 1;
}

@media (max-width: 992px) {
  .main-container {
    grid-template-columns: 1fr;
  }
}

/* FILTROS LATERALES */
.filters-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  height: fit-content;
  position: sticky;
  top: 90px;
}

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

.filter-title {
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-reset-filter {
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
}

.btn-reset-filter:hover {
  text-decoration: underline;
}

.filter-group {
  margin-bottom: 1.75rem;
}

.filter-group-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.875rem;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
}

.category-item:hover, .category-item.active {
  background: rgba(245, 158, 11, 0.12);
  color: var(--gold-light);
  font-weight: 700;
}

.category-count {
  font-size: 0.75rem;
  background: var(--bg-input);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.condition-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.condition-chip {
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 0.775rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.condition-chip.active {
  background: var(--gold-gradient);
  color: #000;
  font-weight: 700;
  border-color: transparent;
}

.usps-box {
  background: var(--bg-input);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* ==========================================================================
   CATÁLOGO Y TARJETAS DE LIBROS
   ========================================================================== */
.catalog-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.catalog-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-count {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.results-count strong {
  color: var(--text-main);
}

.select-sort {
  padding: 0.5rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.75rem;
}

/* CARD INDIVIDUAL DEL LIBRO DE COLECCIÓN */
.book-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}

.book-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md), var(--shadow-gold);
}

.book-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  background: #0b101c;
  overflow: hidden;
}

.book-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.book-card:hover .book-cover {
  transform: scale(1.05);
}

.condition-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.675rem;
  font-weight: 800;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.badge-mint { background: rgba(16, 185, 129, 0.9); color: #fff; }
.badge-near-fine { background: rgba(59, 130, 246, 0.9); color: #fff; }
.badge-very-fine { background: rgba(139, 92, 246, 0.9); color: #fff; }
.badge-good { background: rgba(245, 158, 11, 0.9); color: #fff; }

.signed-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--gold-gradient);
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.quick-view-btn {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  background: rgba(7, 10, 18, 0.9);
  backdrop-filter: blur(8px);
  color: var(--gold);
  border: 1px solid var(--border-hover);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  transition: var(--transition);
  pointer-events: none;
  white-space: nowrap;
}

.book-card:hover .quick-view-btn {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.book-info {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.book-category {
  font-size: 0.725rem;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
}

.book-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-author {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.book-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.book-price-wrap {
  display: flex;
  flex-direction: column;
}

.book-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.book-stock {
  font-size: 0.75rem;
  color: var(--success);
  font-weight: 600;
}

.btn-add-cart {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
}

.btn-add-cart:hover {
  background: var(--gold-gradient);
  color: #000;
  border-color: transparent;
  transform: scale(1.1);
}

/* PAGINACIÓN */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 2.5rem 0 1rem;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.page-btn:hover, .page-btn.active {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
}

/* ==========================================================================
   CARRITO LATERAL (DRAWER)
   ========================================================================== */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cart-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
}

.cart-drawer-overlay.open .cart-drawer {
  transform: translateX(0);
}

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

.cart-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.free-shipping-bar {
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.shipping-progress-text {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
}

.progress-track {
  height: 8px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gold-gradient);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  position: relative;
}

.cart-item-img {
  width: 70px;
  height: 95px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
}

.cart-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cart-item-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.cart-item-author {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.cart-item-price {
  font-weight: 800;
  font-size: 1rem;
  color: var(--gold);
  margin-top: auto;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.5rem;
  width: fit-content;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.qty-btn:hover {
  background: var(--gold);
  color: #000;
}

.btn-remove-item {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--text-subtle);
  font-size: 0.9rem;
}

.btn-remove-item:hover {
  color: var(--danger);
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.summary-row.total {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-color);
}

/* ==========================================================================
   MODALES (FICHA INDIVIDUAL, STRIPE CHECKOUT Y ADMIN)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  max-width: 850px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-overlay.open .modal-content {
  transform: scale(1);
}

.btn-close-modal {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.btn-close-modal:hover {
  color: #000;
  background: var(--gold);
}

/* FICHA DETALLADA DEL LIBRO */
.book-modal-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  padding: 2.5rem;
}

@media (max-width: 768px) {
  .book-modal-grid {
    grid-template-columns: 1fr;
  }
}

.modal-book-cover {
  width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.modal-book-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-book-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
}

.modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin: 1rem 0;
}

.meta-item {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
}

.meta-label {
  color: var(--text-muted);
  font-weight: 500;
}

.meta-value {
  font-weight: 700;
  color: var(--text-main);
}

/* STRIPE CARD PREVIEW CONTAINER */
.stripe-card-container {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  color: #fff;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.2);
}

.stripe-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.stripe-chip {
  width: 45px;
  height: 32px;
  background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%);
  border-radius: 6px;
}

.stripe-logo {
  font-weight: 800;
  font-style: italic;
  font-size: 1.25rem;
  letter-spacing: 1px;
}

.stripe-number {
  font-family: monospace;
  font-size: 1.35rem;
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
}

.stripe-card-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group.full {
  grid-column: span 2;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-control {
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.payment-card {
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition);
}

.payment-card:hover, .payment-card.selected {
  border-color: var(--gold);
  background: rgba(245, 158, 11, 0.12);
}

.payment-icon {
  font-size: 1.5rem;
  color: var(--gold);
}

/* ADMIN PANEL & TABLA */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background: var(--bg-card);
}

.admin-table th {
  background: var(--bg-secondary);
  padding: 1rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.admin-table tr:hover {
  background: rgba(245, 158, 11, 0.05);
}

/* NOTIFICACIONES TOAST */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--gold);
  color: var(--text-main);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* FOOTER */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 2rem;
  margin-top: auto;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

@media (max-width: 768px) {
  .footer-container {
    grid-template-columns: repeat(2, 1fr);
  }
}
