/* ==========================================================================
   Librería — hoja de estilos
   Paleta y tipografía heredadas de la app de estudio (navy / gold / parchment,
   Playfair Display + Source Sans 3). Ver README.md para el detalle de tokens.
   ========================================================================== */

:root {
  /* ---- Marca (extraída de la app) -------------------------------------- */
  --navy: oklch(0.31 0.05 258);
  --navy-deep: oklch(0.22 0.06 258);
  --gold: oklch(0.64 0.10 78);
  --gold-soft: oklch(0.86 0.05 82);
  --parchment: oklch(0.97 0.015 85);

  /* ---- Superficie de lectura (fondo blanco) ------------------------------ */
  --background: oklch(1 0 0);
  --foreground: oklch(0.29 0.03 70);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.29 0.03 70);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.5 0.03 78);
  --border: oklch(0.9 0.01 84);
  --accent: oklch(0.97 0 0);

  /* ---- Tipografía --------------------------------------------------------- */
  --font-serif: 'Playfair Display', 'Georgia', serif;
  --font-sans: 'Source Sans 3', 'Segoe UI', sans-serif;

  /* ---- Escala / ritmo ------------------------------------------------------ */
  --radius-sm: 0.4rem;
  --radius-md: 0.6rem;
  --radius-lg: 1rem;
  --radius-xl: 1.4rem;
  --container: 1240px;
  --shadow-card: 0 1px 2px oklch(0.29 0.03 70 / 0.06), 0 8px 24px oklch(0.29 0.03 70 / 0.07);
  --shadow-lift: 0 14px 34px oklch(0.22 0.06 258 / 0.16);
}

/* ---- Reset base ---------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--navy);
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.01em;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* Enlace "Saltar al contenido" — invisible hasta que se navega con teclado (Tab).
   Permite a usuarios de lector de pantalla o teclado saltarse el menú y el
   buscador del header en cada página, en vez de tener que recorrerlos siempre. */
.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  z-index: 10000;
  background: var(--navy-deep, #1f2b45);
  color: var(--parchment, #f7f2e7);
  padding: 12px 18px;
  border-radius: var(--radius-sm, 6px);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 12px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.eyebrow::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--gold);
}

/* ---- Filigrana (elemento de firma de marca) ------------------------------ */
.flourish { display: block; margin: 0 auto; color: var(--gold); opacity: 0.85; }
.flourish--light { color: var(--gold-soft); }

/* ---- Botones --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--navy);
  color: var(--parchment);
  box-shadow: var(--shadow-card);
}
.btn--primary:hover { background: var(--navy-deep); box-shadow: var(--shadow-lift); }

.btn--gold {
  background: var(--gold);
  color: var(--navy-deep);
}
.btn--gold:hover { background: var(--gold-soft); box-shadow: var(--shadow-lift); }

.btn--outline {
  background: transparent;
  border-color: var(--navy);
  color: var(--navy);
}
.btn--outline:hover { background: var(--navy); color: var(--parchment); }

.btn--sm { padding: 9px 16px; font-size: 0.85rem; }
.btn--block { width: 100%; }

/* ==========================================================================
   1. HEADER
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(1 0 0 / 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-top {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-block: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 1.1rem;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--navy);
  line-height: 1.1;
}
.brand-name span {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  font-weight: 600;
}

/* Sobre el footer (fondo oscuro) el acento de la marca necesita más contraste
   que el gris pensado para fondo claro; se aplica aquí en vez de repetirlo
   como estilo inline en cada una de las páginas. */
.footer-brand .brand-name span { color: oklch(0.97 0.015 85 / 0.55); }

/* Botón outline pensado para usarse sobre fondos oscuros (p. ej. el hero) */
.btn--outline-light {
  border-color: var(--parchment);
  color: var(--parchment);
}
.btn--outline-light:hover { background: var(--parchment); color: var(--navy-deep); }

.search-form {
  flex: 1;
  max-width: 520px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 8px 8px 18px;
}
.search-form:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px oklch(0.64 0.10 78 / 0.18);
}
.search-form svg { flex-shrink: 0; color: var(--muted-foreground); }
.search-form input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--foreground);
}
.search-form input::placeholder { color: var(--muted-foreground); }
.search-form button {
  background: var(--navy);
  color: var(--parchment);
  border: none;
  border-radius: 999px;
  padding: 9px 18px;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.search-form button:hover { background: var(--navy-deep); }

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  display: grid;
  place-items: center;
  color: var(--navy);
  transition: border-color 0.18s ease, background 0.18s ease;
}
.icon-btn:hover { border-color: var(--gold); background: var(--muted); }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  align-items: center;
  justify-content: center;
  color: var(--navy);
}

/* Menú de categorías */
.category-nav {
  border-top: 1px solid var(--border);
}
.category-list {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: visible;
  padding-block: 4px;
  scrollbar-width: none;
}
.category-list::-webkit-scrollbar { display: none; }

.category-list a {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--foreground);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease;
}
.category-list a:hover,
.category-list a.is-active {
  color: var(--navy);
  background: var(--muted);
}
.category-list a.is-featured { color: var(--gold-soft-text, var(--navy)); }
.category-list li:first-child a { color: var(--gold); }

/* Desplegable "Libros" */
.category-list li.has-dropdown { position: relative; }
.dropdown-toggle { display: inline-flex; align-items: center; gap: 5px; }
.dropdown-toggle .chevron { transition: transform 0.18s ease; }
.has-dropdown:hover .dropdown-toggle .chevron,
.has-dropdown:focus-within .dropdown-toggle .chevron {
  transform: rotate(180deg);
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 230px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
  padding: 8px;
  z-index: 60;
}
.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu {
  display: block;
}
.dropdown-menu li a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
}
.dropdown-menu li a:hover {
  background: var(--muted);
  color: var(--navy);
}

@media (max-width: 860px) {
  .dropdown-toggle .chevron { display: none; }
  .dropdown-menu {
    display: block;
    position: static;
    box-shadow: none;
    border: none;
    padding: 0 0 0 14px;
    background: transparent;
  }
  .dropdown-menu li a { padding: 10px 4px; font-size: 0.85rem; color: var(--muted-foreground); }
} 

/* Mobile drawer */
.mobile-search { display: none; }

@media (max-width: 860px) {
  .header-top { padding-block: 12px; flex-wrap: wrap; }
  .search-form { order: 3; max-width: none; width: 100%; margin: 0; }
  .brand-name { font-size: 1.05rem; }
  .nav-toggle { display: grid; }
  .category-nav {
    display: none;
    position: absolute;
    inset: 100% 0 auto 0;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-card);
  }
  .category-nav.is-open { display: block; }
  .category-list { flex-direction: column; align-items: stretch; padding: 8px 20px 16px; }
  .category-list a { padding: 12px 4px; border-bottom: 1px solid var(--border); border-radius: 0; }
  .category-list li:last-child a { border-bottom: none; }
}

/* ==========================================================================
   2. HERO
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 82% -10%, oklch(0.64 0.10 78 / 0.16), transparent 55%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--parchment);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    180deg,
    oklch(1 0 0 / 0.025) 0px,
    oklch(1 0 0 / 0.025) 1px,
    transparent 1px,
    transparent 34px
  );
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.85fr;
  align-items: center;
  gap: 48px;
  padding-block: 76px 84px;
}

.hero-eyebrow {
  color: var(--gold-soft);
}
.hero-eyebrow::before { background: var(--gold-soft); }

.hero-title {
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  color: var(--parchment);
  line-height: 1.12;
  margin-top: 18px;
}
.hero-title em {
  font-style: italic;
  color: var(--gold-soft);
}

.hero-text {
  margin-top: 20px;
  max-width: 46ch;
  color: oklch(0.97 0.015 85 / 0.78);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 44px;
  flex-wrap: wrap;
}
.hero-stats div strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--gold-soft);
}
.hero-stats div span {
  font-size: 0.8rem;
  color: oklch(0.97 0.015 85 / 0.65);
  letter-spacing: 0.03em;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 100%;
  min-height: 320px;
}

.book-stack {
  position: relative;
  width: min(100%, 200px);
  margin-inline: auto;
}

.stack-book {
  height: 22px;
  border-radius: 4px 4px 2px 2px;
  box-shadow: 0 6px 14px oklch(0.22 0.06 258 / 0.35);
  position: relative;
}
.stack-book + .stack-book { margin-top: 6px; }
.stack-book::after {
  content: '';
  position: absolute;
  inset: 3px 10px auto auto;
  height: 2px;
  width: 40px;
  background: oklch(1 0 0 / 0.35);
}

.floating-book {
  position: absolute;
  bottom: 58px;
  left: 50%;
  transform: translateX(-50%) rotate(-4deg);
  width: 168px;
  aspect-ratio: 2 / 3;
  border-radius: 5px;
  background: linear-gradient(155deg, var(--gold-soft), var(--gold));
  box-shadow: 0 26px 50px oklch(0.22 0.06 258 / 0.45);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 14px;
  animation: float 6s ease-in-out infinite;
}
.floating-book .rule { width: 26px; height: 2px; background: var(--navy-deep); opacity: 0.55; }
.floating-book .fb-title {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  color: var(--navy-deep);
  line-height: 1.25;
}
.floating-book .fb-foot {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy-deep);
  opacity: 0.72;
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) rotate(-4deg) translateY(0); }
  50% { transform: translateX(-50%) rotate(-4deg) translateY(-10px); }
}

@media (prefers-reduced-motion: reduce) {
  .floating-book { animation: none; }
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; padding-block: 52px 40px; text-align: left; }
  .hero-visual { min-height: 240px; margin-top: 8px; }
  .floating-book { bottom: 70px; width: 138px; }
}

/* ==========================================================================
   3. CATEGORÍAS DESTACADAS
   ========================================================================== */
.section { padding-block: 72px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.section-title {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  margin-top: 12px;
}
.section-lede {
  color: var(--muted-foreground);
  max-width: 52ch;
  margin-top: 10px;
  font-size: 1rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.category-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: var(--gold);
}

.category-card .cat-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold-soft);
  display: grid;
  place-items: center;
}

.category-card h3 { font-size: 1.15rem; }
.category-card p { margin: 0; color: var(--muted-foreground); font-size: 0.88rem; }

.category-card .cat-count {
  margin-top: auto;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 980px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .category-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   4. GRID DE LIBROS DESTACADOS
   ========================================================================== */
.section--muted { background: var(--muted); }

.book-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.book-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.book-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); }

.book-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  color: var(--parchment);
}
.cover--1 { background: linear-gradient(155deg, var(--navy) 0%, var(--navy-deep) 100%); }
.cover--2 { background: linear-gradient(155deg, oklch(0.4 0.06 258) 0%, var(--navy-deep) 100%); }
.cover--3 { background: linear-gradient(155deg, var(--gold) 0%, oklch(0.5 0.09 78) 100%); color: var(--navy-deep); }
.cover--3 .rule { background: var(--navy-deep); }
.cover--3 .cover-tag { background: oklch(0.22 0.06 258 / 0.14); color: var(--navy-deep); }
.cover--4 { background: linear-gradient(155deg, oklch(0.36 0.05 250) 0%, var(--navy) 100%); }
.cover--5 { background: linear-gradient(155deg, var(--navy-deep) 0%, oklch(0.18 0.05 258) 100%); }
.cover--6 { background: linear-gradient(155deg, oklch(0.55 0.06 90) 0%, var(--gold) 100%); color: var(--navy-deep); }
.cover--6 .rule { background: var(--navy-deep); }
.cover--6 .cover-tag { background: oklch(0.22 0.06 258 / 0.14); color: var(--navy-deep); }
.cover--7 { background: linear-gradient(155deg, oklch(0.44 0.05 255) 0%, var(--navy-deep) 100%); }
.cover--8 { background: linear-gradient(155deg, var(--navy) 0%, oklch(0.4 0.08 78) 130%); }
.book-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(200deg, oklch(1 0 0 / 0.08), transparent 55%);
}
.book-cover .rule { width: 30px; height: 2px; background: var(--gold-soft); position: relative; z-index: 1; }
.book-cover .cover-title {
  position: relative;
  z-index: 1;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.28;
}
.book-cover .cover-tag {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: oklch(1 0 0 / 0.14);
  padding: 4px 9px;
  border-radius: 999px;
}

.book-cover--photo {
  padding: 0;
  background: var(--muted);
}
.book-cover--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.book-cover--photo::after { display: none; }

.badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: var(--gold);
  color: var(--navy-deep);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 999px;
}

.book-info {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.book-category {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.book-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--navy);
  line-height: 1.3;
  margin-top: 2px;
}
.book-author {
  font-size: 0.86rem;
  color: var(--muted-foreground);
  margin-top: 2px;
}
.book-footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.book-price { font-family: var(--font-serif); font-size: 1.15rem; color: var(--navy); }
.book-price small {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  color: var(--muted-foreground);
  font-weight: 400;
}

.section-footer-cta { text-align: center; margin-top: 44px; }

@media (max-width: 980px) {
  .book-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .book-grid { grid-template-columns: 1fr; max-width: 340px; margin-inline: auto; }
}

/* ==========================================================================
   Banda de confianza / valores
   ========================================================================== */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding-block: 46px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.trust-item { display: flex; align-items: center; gap: 14px; }
.trust-item svg { flex-shrink: 0; color: var(--gold); }
.trust-item h4 { font-size: 0.95rem; }
.trust-item p { margin: 2px 0 0; font-size: 0.82rem; color: var(--muted-foreground); }

@media (max-width: 900px) { .trust-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .trust-strip { grid-template-columns: 1fr; } }

/* ==========================================================================
   5. FOOTER
   ========================================================================== */
.site-footer {
  background: var(--navy-deep);
  color: oklch(0.97 0.015 85 / 0.82);
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 40px;
  padding-block: 60px 40px;
}

.footer-brand .brand-name { color: var(--parchment); }
.footer-brand .brand-mark { background: var(--gold); color: var(--navy-deep); }
.footer-about {
  margin-top: 16px;
  font-size: 0.9rem;
  color: oklch(0.97 0.015 85 / 0.62);
  max-width: 34ch;
}

.footer-social { display: flex; gap: 10px; margin-top: 22px; }
.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid oklch(1 0 0 / 0.16);
  display: grid;
  place-items: center;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.footer-social a:hover { border-color: var(--gold); background: oklch(1 0 0 / 0.06); }

.footer-heading {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 16px;
}

.footer-links li { margin-bottom: 10px; }
.footer-links a {
  font-size: 0.9rem;
  color: oklch(0.97 0.015 85 / 0.72);
  transition: color 0.16s ease;
}
.footer-links a:hover { color: var(--gold-soft); }

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 0.88rem;
  color: oklch(0.97 0.015 85 / 0.75);
}
.footer-contact svg { flex-shrink: 0; margin-top: 2px; color: var(--gold); }

.footer-bottom {
  border-top: 1px solid oklch(1 0 0 / 0.1);
  padding-block: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.8rem;
  color: oklch(0.97 0.015 85 / 0.55);
  flex-wrap: wrap;
}
.footer-bottom .legal-links { display: flex; gap: 18px; }
.footer-bottom a:hover { color: var(--gold-soft); }

@media (max-width: 900px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-top { grid-template-columns: 1fr; padding-block: 44px 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   6. PÁGINA DE CATÁLOGO / CATEGORÍA (filtros, orden, resultados)
   ========================================================================== */
.shop-page { padding-block: 40px 80px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted-foreground);
  margin-bottom: 22px;
}
.breadcrumb a { transition: color 0.16s ease; }
.breadcrumb a:hover { color: var(--navy); }
.breadcrumb-current { color: var(--navy); font-weight: 600; }

.shop-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.shop-head .section-title { margin-top: 8px; }
.shop-count { margin-top: 6px; color: var(--muted-foreground); font-size: 0.9rem; }

.filter-toggle { display: none; }

.shop-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 36px;
  align-items: start;
}

.shop-filters {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: sticky;
  top: 96px;
}
.filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.filters-head h2 { font-size: 1.05rem; }
.filters-clear {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold);
  transition: color 0.16s ease;
}
.filters-clear:hover { color: var(--navy); text-decoration: underline; }

.filter-group { padding-block: 18px; border-bottom: 1px solid var(--border); }
.filter-group:first-of-type { padding-top: 0; }
.filter-group:last-of-type { border-bottom: none; padding-bottom: 4px; }
.filter-group h3 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 12px;
}

.filter-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 2px;
  font-size: 0.9rem;
  color: var(--foreground);
  cursor: pointer;
}
.filter-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--navy);
  cursor: pointer;
  flex-shrink: 0;
}
.filter-check span { transition: color 0.16s ease; }
.filter-check:hover span { color: var(--navy); }

.filters-apply-mobile { display: none; margin-top: 18px; }

.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.active-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--muted);
  border: 1px solid var(--border);
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 8px 7px 12px;
  border-radius: 999px;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.filter-chip:hover { background: var(--card); border-color: var(--gold); }
.filter-chip span { color: var(--muted-foreground); font-size: 0.95rem; line-height: 1; }

.shop-sort { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.shop-sort label { font-size: 0.85rem; color: var(--muted-foreground); white-space: nowrap; }
.shop-sort select {
  font: inherit;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--navy);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 34px 9px 14px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233b4665' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.shop-sort select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.empty-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted-foreground);
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 44px;
}
.page-link {
  min-width: 40px;
  height: 40px;
  padding-inline: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
  background: var(--card);
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}
.page-link:hover { border-color: var(--gold); background: var(--muted); }
.page-link.is-active { background: var(--navy); border-color: var(--navy); color: var(--parchment); }
.page-link.is-disabled { color: var(--muted-foreground); pointer-events: none; opacity: 0.5; }

body.no-scroll { overflow: hidden; }

@media (max-width: 980px) {
  .shop-layout { grid-template-columns: 1fr; }
  .filter-toggle { display: inline-flex; }
  .shop-filters {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    top: 0;
    border-radius: 0;
    overflow-y: auto;
    padding: 22px 22px 100px;
  }
  .shop-filters.is-open { display: block; }
  .filters-apply-mobile { display: flex; }
}

@media (max-width: 560px) {
  .shop-head { flex-direction: column; align-items: flex-start; }
  .shop-toolbar { flex-direction: column; align-items: stretch; }
  .shop-sort { margin-left: 0; }
}

/* ==========================================================================
   7. CUENTA, LOGIN Y PEDIDOS
   ========================================================================== */
.icon-btn.is-logged-in { position: relative; color: var(--navy); }
.icon-btn.is-logged-in::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--card);
}

.account-page { max-width: 480px; padding-block: 40px 80px; }
.account-intro { color: var(--muted-foreground); margin: -10px 0 26px; font-size: 0.95rem; }

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
}
.auth-tabs { display: flex; gap: 4px; background: var(--muted); border-radius: var(--radius-md); padding: 4px; margin-bottom: 22px; }
.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 10px;
  border-radius: calc(var(--radius-md) - 3px);
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.auth-tab.is-active { background: var(--card); color: var(--navy); box-shadow: var(--shadow-soft); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.83rem; font-weight: 600; color: var(--foreground); }
.auth-form input {
  font: inherit;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--foreground);
}
.auth-form input:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.auth-form button[type="submit"] { margin-top: 4px; }
.auth-error { color: #b3402a; font-size: 0.83rem; background: oklch(0.96 0.05 30); border-radius: var(--radius-sm); padding: 9px 11px; }
.auth-forgot-link { display: block; background: none; border: none; padding: 0; margin: -6px 0 14px; font-size: 0.83rem; color: var(--muted-foreground); text-decoration: underline; cursor: pointer; text-align: left; }
.auth-forgot-link:hover { color: var(--foreground); }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 16px; color: var(--muted-foreground); font-size: 0.8rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.auth-google { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.auth-google-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--parchment);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.78rem;
}

.account-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 30px; }
.account-email { color: var(--muted-foreground); font-size: 0.9rem; margin-top: 2px; }

.orders-heading { font-size: 1.1rem; margin-bottom: 14px; }
.orders-list { display: flex; flex-direction: column; gap: 12px; }
.orders-empty { color: var(--muted-foreground); font-size: 0.92rem; }

.order-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 18px; }
.order-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.order-number { font-weight: 700; color: var(--navy); font-size: 0.92rem; }
.order-status { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 10px; border-radius: 999px; background: var(--muted); color: var(--muted-foreground); }
.order-status--pendiente { background: oklch(0.95 0.06 85); color: oklch(0.42 0.09 75); }
.order-status--enviado { background: oklch(0.94 0.05 230); color: oklch(0.4 0.1 250); }
.order-status--entregado { background: oklch(0.93 0.06 150); color: oklch(0.38 0.1 150); }
.order-date { color: var(--muted-foreground); font-size: 0.8rem; margin-bottom: 8px; }
.order-items { list-style: none; padding: 0; margin: 0 0 8px; font-size: 0.86rem; color: var(--foreground); display: flex; flex-direction: column; gap: 3px; }
.order-total { font-weight: 700; color: var(--navy); font-size: 0.9rem; }

.checkout-login-notice {
  margin-top: 26px;
  background: oklch(0.96 0.05 85);
  border: 1px solid oklch(0.85 0.07 80);
  color: oklch(0.4 0.08 75);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.9rem;
}
.checkout-login-notice a { font-weight: 700; text-decoration: underline; }

.checkout-shipping {
  margin-top: 30px;
  max-width: 480px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
}
.checkout-shipping h2 { font-size: 1.1rem; margin-bottom: 16px; }
.shipping-form { display: flex; flex-direction: column; gap: 14px; }
.shipping-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.83rem; font-weight: 600; }
.shipping-form input {
  font: inherit;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
}
.shipping-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkout-note { font-size: 0.78rem; color: var(--muted-foreground); margin-top: 2px; }

.order-confirmation {
  margin-top: 30px;
  max-width: 480px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  color: var(--navy);
}
.order-confirmation svg { color: var(--gold); margin-bottom: 14px; }
.order-confirmation h2 { font-size: 1.3rem; margin-bottom: 10px; }
.order-confirmation p { color: var(--muted-foreground); font-size: 0.92rem; margin-bottom: 6px; }
.order-confirmation .btn { margin-top: 16px; }

@media (max-width: 560px) {
  .shipping-form-row { grid-template-columns: 1fr; }
  .account-head { flex-direction: column; }
}

.account-page--dashboard { max-width: var(--container); }

.account-dashboard { display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: start; }

.account-sidebar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: sticky;
  top: 20px;
}
.account-sidebar-user { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.account-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--navy); color: var(--parchment);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-weight: 700; font-size: 1.05rem;
}
.account-sidebar-name { font-weight: 700; color: var(--navy); font-size: 0.95rem; margin: 0; }
.account-sidebar-email { color: var(--muted-foreground); font-size: 0.78rem; margin: 2px 0 0; word-break: break-all; }

.account-nav { display: flex; flex-direction: column; gap: 3px; margin-bottom: 16px; }
.account-nav-btn {
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left;
  padding: 10px 12px; border-radius: var(--radius-md);
  background: transparent; border: 1px solid transparent;
  color: var(--foreground); font-family: var(--font-sans); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: background 0.16s ease, color 0.16s ease;
}
.account-nav-btn svg { flex-shrink: 0; color: var(--muted-foreground); transition: color 0.16s ease; }
.account-nav-btn:hover { background: var(--muted); }
.account-nav-btn.is-active { background: var(--navy); color: var(--parchment); }
.account-nav-btn.is-active svg { color: var(--gold); }
.account-logout { margin-top: 4px; }
.admin-dashboard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-dashboard-head .account-logout { margin-top: 6px; flex: 0 0 auto; }

.account-content { min-width: 0; }
.account-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.account-subheading { font-size: 1rem; font-weight: 700; color: var(--navy); margin: 26px 0 12px; }

.account-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 30px; }
.account-stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px 18px; text-align: center;
}
.account-stat-value { display: block; font-family: var(--font-serif); font-size: 1.5rem; font-weight: 700; color: var(--navy); }
.account-stat-label { display: block; font-size: 0.78rem; color: var(--muted-foreground); margin-top: 4px; }

.account-form { max-width: 420px; }
.account-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.83rem; font-weight: 600; }
.account-form input {
  font: inherit;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--foreground);
}
.account-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.account-form-actions { display: flex; gap: 10px; margin-top: 4px; }
/* Especificidad igual a ".account-form label"/".auth-form label"/".shipping-form label"
   (dos clases) y declarada después en el archivo, así gana la cascada sin necesitar
   !important — antes anulaba esas reglas "a la fuerza" en vez de por especificidad real. */
.account-form .checkbox-label,
.auth-form .checkbox-label,
.shipping-form .checkbox-label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.checkbox-label input { width: auto; }
.auth-success { color: oklch(0.42 0.09 150); font-size: 0.83rem; background: oklch(0.95 0.05 150); border-radius: var(--radius-sm); padding: 9px 11px; }

.address-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 18px 0; }
.address-card { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 18px; }
.address-card.is-default { border-color: var(--gold); }
.address-badge { display: inline-block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gold); background: oklch(0.96 0.05 82); padding: 3px 9px; border-radius: 999px; margin-bottom: 8px; }
.address-label { font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.address-details { color: var(--muted-foreground); font-size: 0.86rem; line-height: 1.5; margin-bottom: 10px; }
.address-actions { display: flex; gap: 14px; }
.address-actions button { background: none; border: none; padding: 0; font-size: 0.8rem; font-weight: 700; color: var(--navy); cursor: pointer; }
.address-actions button:hover { color: var(--gold); text-decoration: underline; }
.address-actions button.address-delete { color: #b3402a; }

.account-danger-zone { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); max-width: 420px; }
.btn--danger { border-color: #b3402a; color: #b3402a; }
.btn--danger:hover { background: #b3402a; color: #fff; }

@media (max-width: 860px) {
  .account-dashboard { grid-template-columns: 1fr; }
  .account-sidebar { position: static; }
  .account-nav { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .account-nav-btn { white-space: nowrap; width: auto; }
  .account-stats { grid-template-columns: 1fr; }
  .account-form-row { grid-template-columns: 1fr; }
}

/* ==========================================================================
/* ==========================================================================
   Panel de administración (admin.html)
   ========================================================================== */
.admin-page { padding-top: 10px; }
.admin-guard { text-align: center; padding: 80px 20px; }
.admin-denied { font-size: 1rem; color: var(--muted-foreground); }
.admin-denied a { color: var(--navy); font-weight: 700; text-decoration: underline; }

.admin-stats { margin-top: 20px; }

.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 28px 0 18px; }
.admin-filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-filter-btn {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--foreground); font-size: 0.83rem; font-weight: 600;
  cursor: pointer; transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.admin-filter-btn:hover { border-color: var(--gold); }
.admin-filter-btn.is-active { background: var(--navy); border-color: var(--navy); color: var(--parchment); }
.admin-search {
  flex: 1 1 260px; max-width: 340px; padding: 9px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: 0.88rem; background: var(--card); color: var(--foreground);
}

.admin-orders-list { display: flex; flex-direction: column; gap: 10px; }
.admin-order-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.admin-order-card summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 90px 1.6fr 1fr 100px 110px; align-items: center; gap: 14px;
  padding: 14px 18px;
}
.admin-order-card summary::-webkit-details-marker { display: none; }
.admin-order-card summary::before {
  content: '›'; justify-self: end; order: 99; font-size: 1.2rem; color: var(--muted-foreground);
  transition: transform 0.15s ease;
}
.admin-order-card[open] summary::before { transform: rotate(90deg); }
.admin-order-numero { font-weight: 700; color: var(--navy); font-size: 0.88rem; }
.admin-order-cliente { display: flex; flex-direction: column; font-size: 0.87rem; font-weight: 600; }
.admin-order-cliente small { font-weight: 400; color: var(--muted-foreground); font-size: 0.78rem; }
.admin-order-fecha { font-size: 0.8rem; color: var(--muted-foreground); }
.admin-order-total { font-weight: 700; color: var(--navy); font-size: 0.88rem; }

.admin-order-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding: 4px 18px 22px; border-top: 1px solid var(--border); }
.admin-order-col h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); margin-bottom: 8px; }
.admin-order-col p, .admin-order-col ul { font-size: 0.87rem; line-height: 1.6; color: var(--foreground); }
.admin-order-line { margin: 0; color: var(--muted-foreground); }
.admin-order-line--total { color: var(--navy); font-weight: 700; margin-top: 4px; }
.admin-order-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.admin-order-actions select {
  padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  font-family: var(--font-sans); font-size: 0.85rem; background: var(--background); color: var(--foreground);
}
.admin-save-flash { color: oklch(0.42 0.09 150); font-size: 0.8rem; font-weight: 600; }

@media (max-width: 720px) {
  .admin-order-card summary { grid-template-columns: 1fr auto; grid-template-areas: "numero estado" "cliente cliente" "fecha total"; row-gap: 4px; }
  .admin-order-body { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Rediseño moderno para la página del Carrito
   ========================================================================== */

.cart-page,
main > .container,
.cart-container {
  display: block;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem 1.5rem;
}

.cart-page h1,
.cart-page > h2:first-child,
h2.cart-title,
.cart-container > h2:first-child {
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy, #111827);
  margin-bottom: 1.5rem;
  width: 100%;
}

.cart-layout,
.cart-grid,
.cart-page form,
#cartList {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2.5rem;
  align-items: start;
}

.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto auto;
  gap: 1.25rem;
  align-items: center;
  background: #ffffff;
  padding: 1.25rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  margin-bottom: 1rem;
}

.cart-item-img {
  width: 80px;
  height: 110px;
  object-fit: cover;
  border-radius: 6px;
  background: #f3f4f6;
}

.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cart-item-price {
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
}

/* Selector de cantidad / Stepper modernizado en píldora limpia */
.qty-stepper,
.quantity-selector {
  display: inline-flex;
  align-items: center;
  background: var(--muted, #f9fafb);
  border: 1px solid var(--border, #d1d5db);
  border-radius: 9999px;
  padding: 2px 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.qty-btn,
.quantity-selector button {
  background: transparent;
  border: none;
  font-size: 1rem;
  color: var(--foreground, #374151);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.qty-btn:hover,
.quantity-selector button:hover {
  background-color: var(--border, #e5e7eb);
  color: var(--navy, #111827);
}

.qty-input,
.quantity-selector input {
  border: none;
  background: transparent;
  width: 2.5rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--foreground, #1f2937);
  outline: none;
  padding: 0;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button,
.quantity-selector input::-webkit-outer-spin-button,
.quantity-selector input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.qty-input[type=number],

.cart-item-remove {
  background: transparent;
  border: none;
  color: var(--navy, #1e293b);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
  margin-left: 1rem;
  transition: opacity 0.15s ease;
}

.cart-item-remove:hover {
  opacity: 0.75;
  background: transparent;
}

.cart-summary {
  background: var(--card, #ffffff);
  border: 1px solid var(--border, #e5e7eb);
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  position: sticky;
  top: 2rem;
}

.cart-summary h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border, #f3f4f6);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
  color: var(--muted-foreground, #4b5563);
}

.cart-summary-row.total {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--foreground, #111827);
  border-top: 1px solid var(--border, #e5e7eb);
  padding-top: 1rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.promo-form {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

.promo-form input,
.promo-form input[type="text"] {
  flex: 1;
  width: auto;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;
  font-size: 0.875rem;
  background: var(--background, #ffffff);
  color: var(--foreground, #111827);
}

.promo-form button,
.promo-form .btn {
  flex: 0 0 auto;
  width: auto;
  min-width: unset;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border, #d1d5db);
  background: #f3f4f6;
  color: var(--foreground, #111827);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  white-space: nowrap;
}

.promo-form button:hover {
  background: #e5e7eb;
}

.cart-summary .btn--primary,
.checkout-btn {
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  text-align: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .cart-layout,
  .cart-grid,
  .cart-page form,
  #cartList,
  .cart-page,
  main > .container,
  .cart-container {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Corazón de "Lista de deseos" sobre las portadas del catálogo/home
   ========================================================================== */
.book-fav {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: oklch(1 0 0 / 0.85);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.book-fav:hover { transform: scale(1.08); }
.book-fav.is-active { color: #c0392b; }
.book-fav.is-active svg { fill: currentColor; }
.book-card { position: relative; }

.product-fav { display: inline-flex; align-items: center; gap: 8px; }
.product-fav.is-active { border-color: #c0392b; color: #c0392b; }
.product-fav.is-active svg { fill: currentColor; }

/* ==========================================================================
   Ficha de producto (producto.html)
   ========================================================================== */
.product-page { padding-block: 24px 70px; }

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 420px) 1fr;
  gap: 40px;
  align-items: start;
  margin-top: 18px;
}

.product-gallery { position: sticky; top: 20px; }
.product-cover-photo {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--muted);
  border: 1px solid var(--border);
}
.product-cover-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.product-info-block { min-width: 0; }
.product-title { font-family: var(--font-serif); font-size: 1.7rem; color: var(--navy); margin: 6px 0 4px; line-height: 1.25; }
.product-author { color: var(--muted-foreground); font-size: 0.96rem; margin-bottom: 10px; }

.product-rating { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.product-rating .stars, .review-summary .stars, .review-card .stars { color: var(--gold); letter-spacing: 1px; }
.rating-count { font-size: 0.84rem; color: var(--muted-foreground); }

.product-price { font-family: var(--font-serif); font-size: 1.6rem; color: var(--navy); margin-bottom: 14px; }
.product-price small { font-family: var(--font-sans); font-size: 0.75rem; color: var(--muted-foreground); font-weight: 400; }
.product-desc { color: var(--foreground); line-height: 1.6; margin-bottom: 20px; }

.product-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 22px; }

.product-trust { display: flex; flex-direction: column; gap: 10px; margin-bottom: 30px; }
.product-trust li { display: flex; align-items: center; gap: 10px; font-size: 0.86rem; color: var(--muted-foreground); }
.product-trust svg { flex-shrink: 0; color: var(--gold); }

.product-tabs { border-top: 1px solid var(--border); padding-top: 24px; }
.tab-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
.tab-btn {
  background: none; border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 16px; font-size: 0.86rem; font-weight: 600; color: var(--muted-foreground);
  cursor: pointer; transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.tab-btn:hover { border-color: var(--gold); color: var(--navy); }
.tab-btn.is-active { background: var(--navy); border-color: var(--navy); color: var(--parchment); }
.tab-panel { display: none; font-size: 1rem; line-height: 1.8; color: var(--foreground); max-width: 640px; }
.tab-panel.is-active { display: block; }
.tab-panel p { margin: 0 0 14px; }
.tab-panel p:last-child { margin-bottom: 0; }

.spec-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0; }
.spec-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.spec-list li span:first-child { color: var(--muted-foreground); }
.spec-list li span:last-child { font-weight: 600; color: var(--navy); text-align: right; }

.related-products { margin-top: 60px; }

@media (max-width: 900px) {
  .product-layout { grid-template-columns: 1fr; }
  .product-gallery { position: static; max-width: 360px; margin-inline: auto; }
}

/* ==========================================================================
   Opiniones / reseñas (pestaña "Opiniones" de la ficha de producto)
   ========================================================================== */
.review-summary { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.review-summary-value { font-family: var(--font-serif); font-size: 2.2rem; color: var(--navy); font-weight: 700; }

.reviews-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.review-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; }
.review-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.review-author { font-weight: 700; color: var(--navy); font-size: 0.9rem; }
.review-date { font-size: 0.76rem; color: var(--muted-foreground); margin: 2px 0 8px; }
.review-comment { font-size: 0.92rem; line-height: 1.55; margin: 0; }
.reviews-empty { color: var(--muted-foreground); font-size: 0.9rem; margin-bottom: 18px; }

.review-login-notice { background: var(--muted); border-radius: var(--radius-md); padding: 14px 16px; font-size: 0.9rem; }
.review-login-notice a { color: var(--navy); font-weight: 700; text-decoration: underline; }

.review-form { max-width: 480px; display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.review-form textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 10px 12px; font-family: var(--font-sans); font-size: 0.92rem; resize: vertical;
}
.review-stars-input { display: flex; gap: 4px; }
.review-star-btn {
  background: none; border: none; font-size: 1.6rem; line-height: 1; cursor: pointer;
  color: var(--border); padding: 0;
}
.review-star-btn.is-active { color: var(--gold); }

@media (max-width: 560px) {
  .product-actions { flex-direction: column; align-items: stretch; }
  .product-actions .btn { width: 100%; text-align: center; justify-content: center; }
}

/* ==========================================================================
   Buscador con autocompletado (header)
   ========================================================================== */
.search-form { position: relative; }
.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
  padding: 6px;
  max-height: 420px;
  overflow-y: auto;
  z-index: 60;
}
.search-suggestion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--foreground);
}
.search-suggestion:hover, .search-suggestion.is-active { background: var(--muted); }
.search-suggestion img { width: 34px; height: 46px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.search-suggestion-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.search-suggestion-info strong { font-size: 0.88rem; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-suggestion-info small { font-size: 0.76rem; color: var(--muted-foreground); }
.search-suggestion-price { font-size: 0.82rem; font-weight: 700; color: var(--navy); white-space: nowrap; }
.search-suggestion--all {
  justify-content: center; font-weight: 700; font-size: 0.85rem; color: var(--navy);
  border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px; border-radius: 0;
}
.search-suggestions-empty { padding: 10px 8px 4px; font-size: 0.85rem; color: var(--muted-foreground); }

@media (max-width: 640px) {
  .search-suggestions { left: -8px; right: -8px; }
}

/* ==========================================================================
   Mini-carrito lateral (drawer) — se crea dinámicamente desde js/cart.js,
   así funciona en todas las páginas sin tocar el HTML de cada una.
   ========================================================================== */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0.22 0.06 258 / 0.45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.cart-drawer-overlay.is-open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 100%);
  background: var(--card);
  box-shadow: var(--shadow-lift);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s ease;
}
.cart-drawer-overlay.is-open .cart-drawer { transform: translateX(0); }

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-drawer-header h2 {
  font-size: 1.1rem;
  margin: 0;
}
.cart-drawer-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--foreground);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.cart-drawer-close:hover { background: var(--muted); }

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.cart-drawer-item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cart-drawer-item:last-child { border-bottom: none; }
.cart-drawer-item img {
  width: 52px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--muted);
}
.cart-drawer-item-info h3 {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 2px;
  line-height: 1.3;
}
.cart-drawer-item-info p {
  margin: 0 0 6px;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}
.cart-drawer-item-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cart-drawer-item .qty-stepper { transform: scale(0.9); transform-origin: left center; }
.cart-drawer-item-remove {
  background: none;
  border: none;
  color: var(--muted-foreground);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.cart-drawer-item-remove:hover { color: var(--navy); }
.cart-drawer-item-price {
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
  text-align: right;
}

.cart-drawer-empty {
  text-align: center;
  padding: 48px 12px;
  color: var(--muted-foreground);
}
.cart-drawer-empty svg { margin: 0 auto 12px; opacity: 0.4; }

.cart-drawer-footer {
  border-top: 1px solid var(--border);
  padding: 18px 20px 20px;
  flex-shrink: 0;
}
.cart-drawer-subtotal {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 14px;
  color: var(--navy);
}
.cart-drawer-footer .btn { width: 100%; margin-bottom: 8px; text-align: center; justify-content: center; }
.cart-drawer-footer .btn:last-child { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  .cart-drawer, .cart-drawer-overlay { transition: none; }
}

/* ==========================================================================
   Páginas de contenido (institucional / legal / ayuda)
   Clases reutilizables para no repetir estilos inline en cada página
   (preguntas-frecuentes, privacidad, términos, envíos, devoluciones...).
   ========================================================================== */
.pt-lg { padding-top: 2rem; }
.pb-lg { padding-bottom: 2rem; }
.mt-lg { margin-top: 1.5rem; }
.mb-lg { margin-bottom: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.text-align-left { text-align: left; }

.content-lede {
  max-width: 800px;
  margin-bottom: 3rem;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--foreground);
}

.content-narrow-left { max-width: 800px; margin: 0 auto; text-align: left; }
.content-narrow-section { max-width: 800px; margin: 0 auto 3rem auto; }
.content-narrow-grid { max-width: 800px; margin-bottom: 3rem; display: grid; gap: 2rem; }

.content-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 2rem;
  border-radius: var(--radius-lg);
}
.content-card--lg { padding: 2.5rem; }

.card-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--foreground);
  margin-bottom: 1rem;
}
.card-title--tight { margin-bottom: 0.75rem; }

.text-block { color: var(--foreground); line-height: 1.7; margin-bottom: 1.25rem; }
.text-block--end { margin: 0; }
.text-block--loose { line-height: 1.9; padding-left: 1.2rem; }

.link-inline { color: var(--navy); text-decoration: underline; }
.link-inline--strong { font-weight: 600; }
.link-plain { text-decoration: none; color: inherit; }

.inline-cta-link { margin-top: 1rem; display: inline-flex; align-items: center; gap: 0.3rem; }
.auto-grid-300 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 3rem; }
