/* ============================================================
   Cazalibros — main.css
   Mobile-first. Diseño oscuro/violeta.
   ============================================================ */

/* ---- Reset & Variables ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

:root {
  --cream: #f5f0ff;
  --dark: #0f0a1e;
  --dark-mid: #2d1a5e;
  --dark-card: #1a1030;
  --dark-border: rgba(139, 92, 246, 0.2);
  --violet: #8b5cf6;
  --violet-light: #a78bfa;
  --muted: #7c6fa0;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #38bdf8;

  --font-serif: "Playfair Display", Georgia, serif;
  --font-sans: "Inter", system-ui, sans-serif;

  --radius: 6px;
  --radius-lg: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);

  --max-w: 1280px;
  --gutter: 1rem;

  --header-h: 60px;
  --nav-h: 48px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--dark);
  color: var(--cream);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Typography ---- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  line-height: 1.2;
}
a {
  color: var(--violet-light);
  text-decoration: none;
}
a:hover {
  color: var(--cream);
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}

.gradient-text {
  background: linear-gradient(135deg, var(--violet-light), var(--violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s,
    opacity 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn--primary {
  background: var(--violet);
  color: #fff;
  border-color: var(--violet);
}
.btn--primary:hover {
  background: var(--violet-light);
  border-color: var(--violet-light);
  color: var(--dark);
}
.btn--outline {
  background: transparent;
  color: var(--violet-light);
  border-color: var(--violet);
}
.btn--outline:hover {
  background: rgba(139, 92, 246, 0.15);
}
.btn--ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
.btn--ghost:hover {
  color: var(--cream);
}
.btn--danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn--success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.btn--secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn--secondary:hover {
  background: var(--color-primary);
  color: #fff;
}
.btn--full {
  width: 100%;
}
.btn--lg {
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
}
.btn--sm {
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
}
.btn--xs {
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(15, 10, 30, 0.95);
  border-bottom: 1px solid var(--dark-border);
  backdrop-filter: blur(10px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  align-content: center;
  gap: 0.4rem 0.75rem;
  min-height: var(--header-h);
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  text-decoration: none;
}

.site-logo__text {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--violet-light), var(--violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-logo--sm .site-logo__text {
  font-size: 1.1rem;
}

/* Search bar */
.search-bar {
  display: flex;
  flex: 0 0 100%;
  max-width: 100%;
  order: 10;
  padding-bottom: 0.35rem;
}
.search-bar__input {
  flex: 1;
  padding: 0.45rem 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--dark-border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  color: var(--cream);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s;
}
.search-bar__input::placeholder {
  color: var(--muted);
}
.search-bar__input:focus {
  border-color: var(--violet);
}
.search-bar__btn {
  padding: 0.45rem 0.75rem;
  background: var(--violet);
  border: 1px solid var(--violet);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 0.2s;
}
.search-bar__btn:hover {
  background: var(--violet-light);
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.header-action {
  color: var(--muted);
  display: flex;
  align-items: center;
  padding: 0.3rem;
  border-radius: var(--radius);
  position: relative;
  transition: color 0.2s;
}
.header-action:hover {
  color: var(--cream);
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--violet);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--muted);
  border-radius: 2px;
  transition:
    transform 0.2s,
    opacity 0.2s;
}
.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---- Navigation ---- */
.main-nav {
  background: rgba(15, 10, 30, 0.98);
  border-top: 1px solid var(--dark-border);
  display: none;
}
.main-nav.open {
  display: block;
}

.main-nav__inner {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.main-nav__list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.main-nav__link {
  display: block;
  padding: 0.7rem 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s;
  border-bottom: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.main-nav__link:hover,
.main-nav__link.active {
  color: var(--cream);
}
.main-nav__link--admin {
  color: var(--warning);
}

/* Dropdown */
.dropdown {
  display: none;
}

/* En móvil, el dropdown se muestra siempre inline dentro del menú */
@media (max-width: 767px) {
  .has-dropdown > .main-nav__link {
    pointer-events: none; /* el link no es clicable en móvil */
    cursor: default;
    color: var(--muted);
  }
  .has-dropdown > .main-nav__link svg {
    display: none; /* ocultar la flecha del dropdown */
  }
  .has-dropdown .dropdown {
    display: flex;
    flex-direction: column;
    position: static;
    background: transparent;
    border: none;
    border-left: 2px solid var(--dark-border);
    border-radius: 0;
    padding: 0 0 0.25rem 0.75rem;
    box-shadow: none;
    gap: 0;
    margin-bottom: 0.25rem;
  }
  .has-dropdown .dropdown__link {
    color: var(--muted);
    font-size: 0.88rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(139, 92, 246, 0.08);
  }
  .has-dropdown .dropdown__link:hover {
    color: var(--violet-light);
    background: transparent;
  }
}

@media (min-width: 768px) {
  .hamburger {
    display: none;
  }

  .site-header__inner {
    flex-wrap: nowrap;
    min-height: 0;
    height: var(--header-h);
    padding: 0;
    gap: 0.75rem;
  }

  .search-bar {
    flex: 1;
    max-width: 480px;
    order: 0;
    padding-bottom: 0;
  }

  .main-nav {
    display: block !important;
    border-top: none;
  }
  .main-nav__inner {
    padding: 0;
  }
  .main-nav__list {
    flex-direction: row;
    gap: 0.25rem;
  }
  .main-nav__link {
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid transparent;
  }
  .main-nav__link:hover,
  .main-nav__link.active {
    color: var(--cream);
    border-bottom-color: var(--violet);
  }

  .has-dropdown {
    position: relative;
  }
  .has-dropdown:hover .dropdown {
    display: flex;
  }

  .dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    max-width: 280px;
    background: rgba(15, 10, 30, 0.98);
    border: 1px solid var(--dark-border);
    border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg);
    padding: 0.75rem 0;
    gap: 0;
    flex-direction: column;
    box-shadow: var(--shadow);
    z-index: 200;
  }
  .dropdown__col {
    min-width: 140px;
  }
  .dropdown__heading {
    display: block;
    font-weight: 600;
    color: var(--cream);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .dropdown__link {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
    padding: 0.45rem 1.25rem;
    transition:
      color 0.15s,
      background 0.15s;
  }
  .dropdown__link:hover {
    color: var(--violet-light);
    background: rgba(139, 92, 246, 0.08);
  }
}

/* ---- Flash Messages ---- */
.flash-messages {
  padding-top: 1rem;
}
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.flash--fading {
  opacity: 0;
  transition: opacity 0.5s;
}
.flash--success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
}
.flash--error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.flash--info {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
}
.flash--warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}
/* PayPal checkout */
.paypal-error-box {
  margin-top: 1rem;
}
.paypal-btn-wrap {
  margin-top: 1.5rem;
  background: #fff;
  border-radius: var(--radius);
  padding: 0.75rem;
  overflow: hidden;
}
/* Contenedores de los campos de tarjeta hospedados por PayPal */
.card-hosted-field {
  border: 1px solid #d1d5db;
  border-radius: var(--radius);
  height: 44px;
  padding: 0 0.75rem;
  background: #fff;
}

/* ---- Hero ---- */
.hero {
  padding: 4rem 0 3rem;
  background:
    radial-gradient(
      ellipse at 20% 60%,
      rgba(45, 26, 94, 0.8) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse at 80% 20%,
      rgba(139, 92, 246, 0.1) 0%,
      transparent 60%
    );
}
.hero__inner {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
}
.hero__title {
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.15;
}
.hero__sub {
  font-size: 1.05rem;
  color: var(--muted);
  font-weight: 300;
  margin-bottom: 2rem;
  line-height: 1.7;
}
.hero__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- Sections ---- */
.section {
  padding: 3rem 0;
}
.section--alt {
  background: rgba(45, 26, 94, 0.15);
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.section-title {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 700;
}
.section-link {
  font-size: 0.88rem;
  color: var(--violet-light);
  white-space: nowrap;
}

/* ---- Books Grid ---- */
.books-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 480px) {
  .books-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 768px) {
  .books-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
  }
}
@media (min-width: 1024px) {
  .books-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ---- Book Card ---- */
.book-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    border-color 0.2s,
    transform 0.2s;
}
.book-card:hover {
  border-color: var(--violet);
  transform: translateY(-2px);
}

.book-card__img-link {
  display: block;
  position: relative;
  background: rgba(45, 26, 94, 0.3);
  aspect-ratio: 2/3;
  overflow: hidden;
}
.book-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.book-card:hover .book-card__img {
  transform: scale(1.03);
}

.book-card__badge {
  position: absolute;
  bottom: 0.4rem;
  right: 0.4rem;
  background: var(--violet);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius);
}

.book-card__info {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.25rem;
}
.book-card__title {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--cream);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}
.book-card__author {
  font-size: 0.77rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book-card__author:hover {
  color: var(--violet-light);
}
.book-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.5rem;
  gap: 0.5rem;
}
.book-card__price {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--violet-light);
}

/* ---- Category Grid ---- */
.cats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
@media (min-width: 480px) {
  .cats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 768px) {
  .cats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (min-width: 1024px) {
  .cats-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.cat-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 1.25rem 0.75rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.cat-card:hover {
  border-color: var(--violet);
  background: rgba(139, 92, 246, 0.08);
}
.cat-card__name {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--cream);
  font-weight: 600;
}
.cat-card__count {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ---- Category Tree ---- */
.cats-tree {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 640px) {
  .cats-tree {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .cats-tree {
    grid-template-columns: repeat(3, 1fr);
  }
}

.cats-tree__section {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.cats-tree__cat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}
.cats-tree__cat a {
  color: var(--cream);
}
.cats-tree__count {
  font-size: 0.75rem;
  color: var(--violet-light);
  font-family: var(--font-sans);
}
.cats-tree__subs {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.cats-tree__subs a {
  color: var(--muted);
  font-size: 0.85rem;
  transition: color 0.15s;
}
.cats-tree__subs a:hover {
  color: var(--violet-light);
}
.cats-tree__subcount {
  color: var(--dark-border);
  font-size: 0.78rem;
}
.cats-tree__subs-all a {
  color: var(--violet);
  font-size: 0.82rem;
  font-weight: 500;
}
.cats-tree__subs-all a:hover {
  color: var(--violet-light);
}

/* ---- Category Page Layout ---- */
.cat-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 768px) {
  .cat-layout {
    grid-template-columns: 220px 1fr;
    gap: 2rem;
  }
  .cat-layout--full {
    grid-template-columns: 1fr;
  }
}

/* ---- Sidebar: chip strip en móvil, columna en escritorio ---- */
.cat-sidebar {
  height: fit-content;
}

/* Móvil: strip horizontal compacto */
@media (max-width: 767px) {
  .cat-sidebar {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--dark-border);
    border-radius: 0;
    padding: 0 0 0.75rem 0;
    /* Impedir que el grid item desborde la pantalla */
    min-width: 0;
    max-width: 100%;
  }
  .cat-sidebar__title {
    font-size: 0.72rem;
    margin-bottom: 0.5rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-family: var(--font-sans);
    font-weight: 600;
  }
  .cat-sidebar__list {
    list-style: none;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.4rem;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 2px; /* evita cortar sombra del chip */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .cat-sidebar__list::-webkit-scrollbar {
    display: none;
  }
  .cat-sidebar__list li {
    flex-shrink: 0;
  }
  .cat-sidebar__list a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--muted);
    font-size: 0.82rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--dark-border);
    border-radius: 999px;
    background: var(--dark-card);
    white-space: nowrap;
    transition:
      color 0.15s,
      border-color 0.15s;
    text-decoration: none;
  }
  .cat-sidebar__list a:hover {
    color: var(--violet-light);
    border-color: var(--violet);
  }
  .cat-sidebar__count {
    font-size: 0.72rem;
    color: var(--dark-border);
  }

  /* Wrapper para las flechas de scroll */
  .cat-chips-wrap {
    position: relative;
  }

  .chips-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    border: 1px solid var(--dark-border);
    background: var(--dark-card);
    color: var(--violet-light);
    cursor: pointer;
    z-index: 2;
    padding: 0;
    line-height: 1;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
    transition:
      background 0.15s,
      border-color 0.15s;
  }
  .chips-arrow:active {
    background: var(--dark-mid);
    border-color: var(--violet);
  }
  .chips-arrow--left {
    left: -0.25rem;
  }
  .chips-arrow--right {
    right: -0.25rem;
  }

  /* Sangría dinámica para que los chips no queden debajo de las flechas */
  .cat-chips-wrap:has(.chips-arrow--left:not([hidden])) .cat-sidebar__list {
    padding-left: 2rem;
  }
  .cat-chips-wrap:has(.chips-arrow--right:not([hidden])) .cat-sidebar__list {
    padding-right: 2rem;
  }
}

/* Escritorio: sidebar vertical clásico */
@media (min-width: 768px) {
  .cat-sidebar {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius);
    padding: 1.25rem;
  }
  .cat-sidebar__title {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-sans);
    font-weight: 600;
  }
  .cat-sidebar__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  .cat-sidebar__list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    font-size: 0.88rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(139, 92, 246, 0.08);
    transition: color 0.15s;
    text-decoration: none;
  }
  .cat-sidebar__list a:hover {
    color: var(--violet-light);
  }
  .cat-sidebar__count {
    font-size: 0.75rem;
    color: var(--dark-border);
  }
}

.cat-main__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.cat-main__count {
  font-size: 0.88rem;
  color: var(--muted);
}

/* ---- Work Detail ---- */
.work-detail {
  padding: 2rem 0;
}
.work-detail__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-top: 1.5rem;
}
@media (min-width: 768px) {
  .work-detail__layout {
    grid-template-columns: 340px 1fr;
  }
}

.work-cover img {
  width: 100%;
  max-width: 340px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--dark-border);
  margin-inline: auto;
  display: block;
  object-fit: cover;
}

.work-detail__title {
  font-size: clamp(1.4rem, 4vw, 2rem);
  margin-bottom: 0.5rem;
}
.work-detail__author {
  color: var(--violet-light);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.work-detail__saga {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.work-detail__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.tag {
  display: inline-block;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--violet-light);
  font-size: 0.77rem;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  transition: background 0.2s;
}
.tag:hover {
  background: rgba(139, 92, 246, 0.3);
}

.work-detail__desc {
  margin-bottom: 2rem;
}
.work-detail__desc-title {
  font-size: 1rem;
  font-family: var(--font-sans);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.work-detail__desc-text {
  font-size: 0.95rem;
  color: var(--cream);
  line-height: 1.75;
  opacity: 0.9;
}

.work-detail__copies-title {
  font-size: 1rem;
  font-family: var(--font-sans);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.copy-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}
.copy-card__thumb {
  flex-shrink: 0;
}
.copy-thumb {
  position: relative;
  display: block;
  border: 2px solid var(--dark-border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: none;
  padding: 0;
  transition: border-color 0.2s;
}
.copy-thumb:hover {
  border-color: var(--violet);
}
.copy-thumb img {
  width: 64px;
  height: 90px;
  object-fit: cover;
  display: block;
}
.copy-thumb__count {
  position: absolute;
  bottom: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.68rem;
  padding: 0.1rem 0.35rem;
  border-top-left-radius: var(--radius);
  line-height: 1.4;
}
.copy-thumb--empty {
  cursor: default;
}
.copy-thumb--empty:hover {
  border-color: var(--dark-border);
}
.copy-card__details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.83rem;
  color: var(--muted);
  flex: 1;
  min-width: 0;
}
.copy-card__buy {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.copy-card__price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cream);
}

/* Badge conditions */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
}
.badge--nuevo {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}
.badge--como-nuevo {
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
}
.badge--muy-bueno {
  background: rgba(139, 92, 246, 0.2);
  color: var(--violet-light);
}
.badge--bueno {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}
.badge--aceptable {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}
.badge--pack {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}
.pack-books-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.pack-books-list__item {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--dark-border);
}
.pack-books-list__item:last-child {
  border-bottom: none;
}
.pack-books-list__title {
  font-weight: 600;
  color: var(--cream);
}
.pack-books-list__title:hover {
  color: var(--violet-light);
}
.pack-books-list__author {
  color: var(--muted);
  font-size: 0.9rem;
}
.pack-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.copy-thumb--hero {
  display: block;
  width: 100%;
  border: none;
  background: none;
  padding: 0;
  cursor: zoom-in;
}
.copy-thumb--hero img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: contain;
  border-radius: var(--radius-lg);
  border: 1px solid var(--dark-border);
  display: block;
}
.badge--sm {
  font-size: 0.67rem;
}

/* ---- Cart ---- */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}
@media (min-width: 768px) {
  .cart-layout {
    grid-template-columns: 1fr 300px;
    align-items: start;
  }
}

.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.cart-item--unavailable {
  opacity: 0.6;
  border-color: var(--danger);
}
.cart-item__img {
  width: 60px;
  height: 85px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.cart-item__info {
  flex: 1;
}
.cart-item__title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--cream);
}
.cart-item__author {
  font-size: 0.82rem;
  color: var(--muted);
}
.cart-item__unavail {
  color: var(--danger);
  font-size: 0.82rem;
  margin-top: 0.25rem;
}
.cart-item__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}
.cart-item__price {
  font-size: 1rem;
  font-weight: 600;
  color: var(--cream);
}
.cart-clear {
  margin-top: 0.5rem;
  text-align: right;
}

.cart-summary {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.cart-summary__title {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}
.cart-summary__line {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}
.cart-summary__line--muted {
  color: var(--muted);
}
.cart-summary__total {
  display: flex;
  justify-content: space-between;
  font-size: 1.05rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--dark-border);
}

.empty-cart {
  text-align: center;
  padding: 4rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}
.empty-cart svg {
  opacity: 0.3;
}

/* ---- Auth ---- */
.auth-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 3rem 1rem;
  min-height: calc(100vh - var(--header-h) - var(--nav-h));
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}
.auth-card__logo {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-card__title {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-card__link {
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: 1rem;
}
.form-label {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  color: var(--cream);
  font-size: 0.92rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s;
}
.form-select {
  background: var(--dark-card);
  color-scheme: dark;
}
.form-select option {
  background: var(--dark-card);
  color: var(--cream);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--violet);
}
.form-textarea {
  min-height: 100px;
  resize: vertical;
}
.form-hint {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 400;
}

/* ---- User Panel ---- */
.user-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-top: 2rem;
  padding-bottom: 3rem;
}
@media (min-width: 768px) {
  .user-layout {
    grid-template-columns: 220px 1fr;
  }
}

.user-sidebar {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  height: fit-content;
}
.user-sidebar__title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.75rem;
  font-family: var(--font-sans);
  font-weight: 600;
}
.user-sidebar__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.user-sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.9rem;
  transition:
    background 0.15s,
    color 0.15s;
}
.user-sidebar__link:hover,
.user-sidebar__link.active {
  background: rgba(139, 92, 246, 0.12);
  color: var(--cream);
}

/* ---- Orders Table ---- */
.orders-table-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
}
.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.orders-table th,
.orders-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--dark-border);
}
.orders-table th {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}
.orders-table tr:hover td {
  background: rgba(139, 92, 246, 0.05);
}

.status-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  text-transform: capitalize;
}
.status-badge--pending {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}
.status-badge--paid {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}
.status-badge--processing {
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
}
.status-badge--shipped {
  background: rgba(139, 92, 246, 0.2);
  color: var(--violet-light);
}
.status-badge--delivered {
  background: rgba(34, 197, 94, 0.3);
  color: #4ade80;
}
.status-badge--cancelled {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}
.status-badge--refunded {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

/* ---- Stat Card ---- */
.dashboard-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.stat-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.75rem;
  text-align: center;
}
.stat-card__num {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-serif);
  color: var(--violet-light);
}
.stat-card__label {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---- Pagination ---- */
.pagination {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 2rem;
}
.pagination__btn {
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.88rem;
  transition: all 0.2s;
}
.pagination__btn:hover {
  border-color: var(--violet);
  color: var(--cream);
}
.pagination__info {
  display: flex;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0 0.5rem;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  margin-bottom: 1.25rem;
}
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
}
.breadcrumb li + li::before {
  content: "›";
  margin-right: 0.35rem;
  opacity: 0.5;
}
.breadcrumb a {
  color: var(--muted);
  transition: color 0.15s;
}
.breadcrumb a:hover {
  color: var(--violet-light);
}

/* ---- Page header ---- */
.page-header {
  margin-bottom: 2rem;
  padding-top: 1.5rem;
}
.page-title {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  margin-bottom: 0.35rem;
}
.page-sub {
  color: var(--muted);
  font-size: 1rem;
}

/* ---- Empty states ---- */
.empty-state {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 2rem 0;
}
.empty-state a {
  color: var(--violet-light);
}

/* ---- Search results ---- */
.search-form {
  display: flex;
  gap: 0.5rem;
  max-width: 560px;
  margin-bottom: 2rem;
}
.search-form .form-input {
  flex: 1;
}

/* ---- Footer ---- */
.site-footer {
  background: rgba(45, 26, 94, 0.2);
  border-top: 1px solid var(--dark-border);
  margin-top: 4rem;
}
.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-top: 2.5rem;
  padding-bottom: 2rem;
}
@media (min-width: 640px) {
  .site-footer__inner {
    grid-template-columns: auto 1fr;
  }
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.site-footer__tagline {
  font-size: 0.82rem;
  color: var(--muted);
}
.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-col__title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-family: var(--font-sans);
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.footer-col a {
  color: var(--muted);
  font-size: 0.88rem;
  transition: color 0.15s;
}
.footer-col a:hover {
  color: var(--cream);
}

.site-footer__bottom {
  border-top: 1px solid var(--dark-border);
}
.site-footer__bottom .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.site-footer__bottom a {
  color: var(--muted);
}
.site-footer__bottom a:hover {
  color: var(--cream);
}

/* ---- Checkout ---- */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-top: 2rem;
}
@media (min-width: 768px) {
  .checkout-layout {
    grid-template-columns: 1fr 340px;
  }
}

.checkout-form {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.checkout-form h2 {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* ---- Author Index ---- */
.authors-index {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-bottom: 2rem;
}
.authors-letter-group {
}
.authors-letter {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--violet-light);
  border-bottom: 1px solid var(--dark-border);
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
}
.authors-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.authors-list a {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: all 0.15s;
}
.authors-list a:hover {
  color: var(--cream);
  border-color: var(--dark-border);
}

/* ---- Banner construcción ---- */
.site-banner--construction {
  background: #7c3aed;
  color: #fff;
  text-align: center;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── Modal de fotos por ejemplar ─────────────────────────────────────── */
.bpm {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bpm[hidden] {
  display: none;
}
.bpm__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
}
.bpm__box {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 92vw;
}
.bpm__img {
  max-width: 78vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  display: block;
}
.bpm__close {
  position: absolute;
  top: -2.25rem;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.bpm__close:hover {
  opacity: 1;
}

/* ---- Cookie Consent Banner ---- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  background: var(--dark-card);
  border-top: 1px solid var(--dark-border);
  padding: 1rem 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.6);
  animation: cookieSlideUp 0.3s ease;
}
.cookie-banner[hidden] {
  display: none;
}
@keyframes cookieSlideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}
.cookie-banner__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}
.cookie-banner__text {
  flex: 1;
  min-width: 200px;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}
.cookie-banner__text a {
  color: var(--violet-light);
  text-decoration: underline;
}
.cookie-banner__actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ---- Legal pages ---- */
.legal-content {
  line-height: 1.8;
  font-size: 0.95rem;
  color: var(--cream);
}
.legal-content h2 {
  font-size: 1.2rem;
  margin-top: 2.5rem;
  margin-bottom: 0.6rem;
  color: var(--violet-light);
}
.legal-content h3 {
  font-size: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--cream);
  font-family: var(--font-sans);
  font-weight: 600;
}
.legal-content p {
  margin-bottom: 0.85rem;
  color: rgba(245, 240, 255, 0.85);
}
.legal-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.legal-content li {
  margin-bottom: 0.35rem;
}
.legal-content code {
  background: rgba(139, 92, 246, 0.15);
  color: var(--violet-light);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: monospace;
}

.cookie-table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
}
.cookie-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.cookie-table th,
.cookie-table td {
  padding: 0.6rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--dark-border);
}
.cookie-table th {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.cookie-table tr:hover td {
  background: rgba(139, 92, 246, 0.05);
}

/* ---- About / Nosotros ---- */
.about-lead {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  line-height: 1.7;
  color: var(--cream);
  border-left: 3px solid var(--violet);
  padding: 1rem 1.5rem;
  margin: 0 0 2.5rem;
  background: rgba(139, 92, 246, 0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}

.about-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.about-card {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color 0.2s;
}
.about-card:hover {
  border-color: rgba(139, 92, 246, 0.45);
}
.about-card__icon {
  font-size: 1.75rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 0.1rem;
}
.about-card p {
  margin: 0;
  color: rgba(245, 240, 255, 0.85);
  line-height: 1.75;
  font-size: 0.975rem;
}

.about-closing {
  text-align: center;
  padding: 2.5rem 1rem;
  border-top: 1px solid var(--dark-border);
}
.about-closing p {
  font-size: 1.05rem;
  color: var(--cream);
  line-height: 1.75;
  max-width: 520px;
  margin-inline: auto;
}
.about-closing .btn {
  margin-inline: 0.4rem;
}

/* ---- Contact form ---- */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  tab-size: 0;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 1rem;
}
@media (min-width: 600px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}
.bpm__nav {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 2.25rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  transition: background 0.2s;
  padding: 0;
}
.bpm__nav:hover {
  background: rgba(255, 255, 255, 0.25);
}
.bpm__counter {
  position: absolute;
  bottom: -1.75rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  white-space: nowrap;
}
.bpm__img {
  transition: opacity 0.15s;
}
.bpm__box--loading .bpm__img {
  opacity: 0.1;
}
.bpm__spinner {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}
.bpm__box--loading .bpm__spinner {
  display: flex;
}
.bpm__spinner::after {
  content: "";
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: bpm-spin 0.75s linear infinite;
}
@keyframes bpm-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- Página de error (404 / 500) ---- */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
}
.error-page__code {
  font-size: clamp(6rem, 20vw, 12rem);
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--violet), var(--violet-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  letter-spacing: -4px;
}
.error-page__title {
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--cream);
  margin-bottom: 0.75rem;
}
.error-page__msg {
  color: var(--muted);
  font-size: 1rem;
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
}
