/* =========================================================
   Pórtico Librería — estilos del sitio público
   ========================================================= */
:root {
  --ink: #3a2a1e;
  --brand: #4a2e22;
  --cream: #faf5ee;
  --cream-2: #f3ebe1;
  --sand: #d9c3af;
  --sand-deep: #c9ac93;
  --brass: #a37a41;
  --wine: #6f2c34;
  --wa: #25D366;
  --wa-hover: #1fb958;
  --wa-ink: #0b3d21;

  --linea: rgba(58, 42, 30, 0.14);
  --sombra: 0 18px 40px -22px rgba(58, 42, 30, 0.38);
  --sombra-libro: 0 14px 26px -16px rgba(58, 42, 30, 0.45);
  --ancho: 1220px;
  --alto-cabecera: 76px;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Work Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; margin: 0; color: var(--brand); letter-spacing: -0.01em; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input, select { font: inherit; color: inherit; }
svg { width: 1em; height: 1em; flex: 0 0 auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.contenedor { max-width: var(--ancho); margin: 0 auto; padding: 0 32px; }
section[id], main[id] { scroll-margin-top: calc(var(--alto-cabecera) + 12px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 26px; border-radius: 999px;
  font-size: 14.5px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap;
  transition: transform .25s ease, background-color .25s ease, color .25s ease, box-shadow .25s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn-wa { background: var(--wa); color: var(--wa-ink); }
.btn-wa:hover { background: var(--wa-hover); transform: translateY(-2px); }
.btn-oscuro { background: var(--brand); color: var(--cream); }
.btn-oscuro:hover { background: var(--ink); transform: translateY(-2px); }
.btn-contorno { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn-contorno:hover { background: var(--brand); color: var(--cream); }

/* ---------- Cabecera ---------- */
.cabecera {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 245, 238, 0.95);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linea);
}
.cabecera-barra {
  position: relative; max-width: var(--ancho); margin: 0 auto; padding: 0 32px;
  height: var(--alto-cabecera); display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.nav-principal { display: flex; gap: 34px; }
.nav-principal a {
  position: relative; padding: 4px 0;
  font-size: 13.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
}
.nav-principal a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1.5px;
  background: var(--brass); transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.nav-principal a:hover::after { transform: scaleX(1); }

.medallon {
  position: absolute; left: 50%; top: 100%; transform: translate(-50%, -62%);
  width: 168px; height: 168px; border-radius: 50%; background: var(--cream);
  box-shadow: 0 16px 30px -14px rgba(58, 42, 30, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 5;
}
.medallon img { width: 60%; height: auto; }

/* ---------- Barra inferior móvil ---------- */
.barra-movil {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(250, 245, 238, 0.9);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--linea); box-shadow: 0 -8px 20px -14px rgba(58, 42, 30, 0.35);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  justify-content: space-around; align-items: center;
}
.barra-movil a {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 0; font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--ink); opacity: .72;
  transition: opacity .2s ease, color .2s ease;
}
.barra-movil a:active, .barra-movil a.activo { opacity: 1; color: var(--brand); }
.barra-movil svg { width: 23px; height: 23px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 580px; display: flex; align-items: center; justify-content: center;
  text-align: center; overflow: hidden; background: #2a1c14;
}
.hero-fondo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(30, 19, 12, 0.4) 0%, rgba(30, 19, 12, 0.62) 100%);
}
.hero-contenido {
  position: relative; z-index: 2; max-width: 840px; padding: 110px 24px 120px;
  display: flex; flex-direction: column; align-items: center;
}
.hero h1 {
  color: #fbf3e8; font-weight: 600; font-size: clamp(34px, 5.2vw, 60px); line-height: 1.1;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35); text-wrap: balance;
}
.hero-sello {
  width: 96px; height: auto; margin-top: 18px; transform: rotate(-8deg);
  filter: drop-shadow(0 8px 14px rgba(20, 12, 6, 0.5));
}

/* ---------- Buscador ---------- */
.catalogo { background: var(--sand); padding-bottom: 96px; }
.buscador {
  position: relative; z-index: 5; margin-top: -64px;
  background: var(--cream); border-radius: 28px; box-shadow: var(--sombra);
  padding: 24px 26px; display: flex; flex-wrap: wrap; gap: 14px; align-items: stretch;
}
.campo { position: relative; display: block; }
.campo-texto { flex: 1 1 280px; }
.campo-select { flex: 0 1 210px; }
.campo input, .campo select {
  width: 100%; height: 52px; border-radius: 999px; border: 1.5px solid var(--linea);
  background: var(--cream-2); font-size: 15px; transition: border-color .2s ease;
}
.campo input { padding: 0 20px 0 48px; }
.campo input::placeholder { color: rgba(58, 42, 30, 0.5); }
.campo input::-webkit-search-cancel-button { cursor: pointer; }
.campo-texto svg {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 19px; height: 19px; color: var(--brand); opacity: .7; pointer-events: none;
}
.campo select {
  padding: 0 44px 0 20px; cursor: pointer; -webkit-appearance: none; appearance: none;
  background: var(--cream-2) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a2e22' stroke-width='2' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 18px center / 14px;
}
.campo input:focus, .campo select:focus { outline: none; border-color: var(--brand); }
.buscador .btn { height: 52px; padding: 0 28px; }

/* ---------- Catálogo ---------- */
.catalogo-cabeza {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin: 46px 0 26px;
}
.catalogo-cabeza h2 { font-size: clamp(28px, 3.2vw, 38px); }
.catalogo-cabeza .sub { margin-top: 4px; font-size: 15px; opacity: .72; }
.catalogo-acciones { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.conteo { font-size: 14px; font-weight: 600; color: var(--brand); }
.chip-filtro {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px 8px 16px; border-radius: 999px;
  background: var(--wine); color: var(--cream); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.chip-filtro svg { width: 14px; height: 14px; }
.flechas { display: flex; gap: 10px; }
.flecha {
  width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--brand); color: var(--brand);
  display: flex; align-items: center; justify-content: center; transition: background-color .2s ease, color .2s ease, opacity .2s ease;
}
.flecha svg { width: 18px; height: 18px; }
.flecha:hover:not(:disabled) { background: var(--brand); color: var(--cream); }
.flecha:disabled { opacity: .3; cursor: default; }
.estado { padding: 40px 0; text-align: center; font-family: var(--serif); font-style: italic; font-size: 18px; opacity: .7; }

.carrusel {
  display: flex; gap: 26px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 4px 4px 14px; margin: 0 -4px; scrollbar-width: none; overscroll-behavior-x: contain;
}
.carrusel::-webkit-scrollbar { display: none; }
.carrusel .libro { flex: 0 0 200px; scroll-snap-align: start; }
.grilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 34px 24px; }

/* Tarjeta de libro */
.libro { position: relative; display: flex; flex-direction: column; }
.libro-enlace { display: block; color: inherit; }
.libro-portada { position: relative; padding-top: 14px; }
.etiqueta-genero {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 3;
  background: var(--wine); color: var(--cream); white-space: nowrap;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  padding: 7px 14px; border-radius: 999px; box-shadow: 0 6px 14px -6px rgba(58, 42, 30, 0.6);
}
.arco {
  /* arco: radio horizontal = media anchura, vertical ≈ 0,4 de la anchura */
  aspect-ratio: 2 / 3; border-radius: 50% 50% 8px 8px / 27% 27% 8px 8px; overflow: hidden;
  background: var(--brand); border: 6px solid var(--cream); box-shadow: var(--sombra-libro);
  transition: transform .3s ease, box-shadow .3s ease;
}
.arco img { width: 100%; height: 100%; object-fit: cover; }
.libro-enlace:hover .arco, .libro-enlace:focus-visible .arco { transform: translateY(-6px); box-shadow: 0 24px 34px -16px rgba(58, 42, 30, 0.5); }
.libro-info { padding-top: 14px; }
.libro-titulo { font-family: var(--serif); font-weight: 600; font-size: 16px; line-height: 1.25; color: var(--brand); }
.libro-autor { font-size: 13px; opacity: .68; margin-top: 2px; }
.libro-precio { font-size: 15px; font-weight: 700; margin-top: 4px; }
.consultar {
  align-self: flex-start; margin-top: 10px;
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: #1d7a3f; border: 1.3px solid var(--wa-hover);
  transition: background-color .2s ease, color .2s ease;
}
.consultar svg { width: 14px; height: 14px; }
.consultar:hover { background: var(--wa-hover); color: var(--wa-ink); }

.vacio { text-align: center; padding: 56px 20px 20px; max-width: 520px; margin: 0 auto; }
.vacio h3 { font-size: 24px; margin-bottom: 8px; }
.vacio p { opacity: .75; margin-bottom: 22px; }

/* ---------- Secciones genéricas ---------- */
.seccion-cabeza { text-align: center; margin-bottom: 40px; }
.seccion-cabeza h2 { font-size: clamp(28px, 3.4vw, 40px); margin-bottom: 8px; }
.seccion-cabeza .sub { font-size: 15.5px; opacity: .7; }

/* ---------- Géneros ---------- */
.generos { background: var(--cream); padding: 100px 0; }
.generos-grilla { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.genero {
  position: relative; overflow: hidden; aspect-ratio: 3 / 3.8;
  border-radius: 50% 50% 14px 14px / 36% 36% 14px 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 0 16px 28px; text-align: center; background: var(--brand); box-shadow: var(--sombra-libro);
  transition: transform .3s ease;
}
.genero:hover, .genero:focus-visible { transform: translateY(-6px); }
.genero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.genero:hover img { transform: scale(1.05); }
.genero::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(58, 42, 30, 0) 38%, rgba(28, 18, 12, 0.78) 100%);
}
.genero-nombre { position: relative; z-index: 2; font-family: var(--serif); font-weight: 600; font-size: 22px; color: var(--cream); }
.genero-conteo { position: relative; z-index: 2; font-size: 12.5px; color: var(--cream); opacity: .82; margin-top: 2px; letter-spacing: .03em; }

/* ---------- Redes ---------- */
.redes { background: var(--cream-2); padding: 100px 0; }
.redes-columnas { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; max-width: 1000px; margin: 0 auto; }
.red {
  background: var(--cream); border-radius: 28px; padding: 32px; box-shadow: var(--sombra);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.red h3 { display: flex; align-items: center; gap: 9px; font-size: 21px; margin-bottom: 18px; }
.red h3 svg { width: 22px; height: 22px; }
.red-vista {
  width: 100%; aspect-ratio: 1; border-radius: 20px; overflow: hidden; margin-bottom: 24px;
  border: 1px solid var(--linea); box-shadow: var(--sombra-libro); background: var(--sand);
}
.red-vista img, .red-vista video { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* ---------- Ficha de libro ---------- */
.ficha { padding: 120px 0 100px; min-height: 70vh; }
.volver { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; color: var(--brand); }
.volver svg { width: 18px; height: 18px; transition: transform .2s ease; }
.volver:hover svg { transform: translateX(-3px); }
.ficha-cuerpo {
  display: grid; grid-template-columns: minmax(0, 380px) 1fr; gap: 64px; align-items: start;
  max-width: 1020px; margin: 36px auto 0;
}
.marco { position: relative; aspect-ratio: 720 / 1080; filter: drop-shadow(0 24px 30px rgba(40, 24, 14, 0.4)); }
.marco-portada {
  /* ventana interior del marco (medida sobre img/marco.png), con un pequeño solape para que no se vean bordes */
  position: absolute; left: 18.3%; top: 17.7%; width: 63.4%; height: 64.3%;
  object-fit: contain; background: #2a1c14;
}
.marco-imagen { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ficha-portada { position: sticky; top: calc(var(--alto-cabecera) + 90px); }
.ficha-info .etiqueta-genero { position: static; transform: none; display: inline-block; margin-bottom: 18px; }
.ficha-titulo { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.08; }
.ficha-autor { font-size: 17px; margin-top: 10px; }
.ficha-autor strong { font-weight: 600; }
.ficha-serie { display: block; font-family: var(--serif); font-style: italic; opacity: .7; margin-top: 2px; }
.ficha-precio { display: block; font-family: var(--serif); font-weight: 600; font-size: 30px; color: var(--brand); margin: 20px 0 30px; }
.ficha-bloque { margin-bottom: 28px; }
.ficha-bloque h2 {
  font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--brass); margin-bottom: 10px;
}
.ficha-bloque p { font-size: 16px; line-height: 1.7; opacity: .9; max-width: 60ch; }
.pastillas { display: flex; flex-wrap: wrap; gap: 8px; }
.pastillas li { font-size: 13.5px; background: var(--cream-2); border: 1px solid var(--linea); padding: 6px 14px; border-radius: 999px; }
.ficha-cta { margin-top: 8px; padding: 16px 30px; font-size: 15.5px; }
.ficha-cta svg { width: 20px; height: 20px; }
.no-encontrado { grid-column: 1 / -1; text-align: center; padding: 40px 0; }
.no-encontrado h1 { font-size: 32px; margin-bottom: 10px; }
.no-encontrado p { opacity: .75; margin-bottom: 22px; }

/* ---------- Pie ---------- */
.pie { background: var(--ink); color: var(--cream); }
.pie h4 { color: var(--cream); }
.pie-arriba { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 50px; padding-top: 72px; padding-bottom: 48px; }
.pie-marca img { height: 54px; width: auto; }
.pie-marca p { font-size: 14.5px; line-height: 1.65; opacity: .72; margin-top: 18px; max-width: 360px; }
.pie-redes { display: flex; gap: 12px; margin-top: 22px; }
.pie-redes a {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(250, 245, 238, 0.3);
  display: flex; align-items: center; justify-content: center; transition: background-color .2s ease;
}
.pie-redes a:hover { background: rgba(250, 245, 238, 0.14); }
.pie-redes svg { width: 18px; height: 18px; }
.pie-col h4 { font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 18px; }
.pie-col li { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 14.5px; }
.pie-col li a { opacity: .82; transition: opacity .2s ease; }
.pie-col li a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.pie-col li svg { width: 17px; height: 17px; opacity: .75; }
.pie-contacto { margin-top: 8px; }
.pie-abajo {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid rgba(250, 245, 238, 0.14); padding-top: 22px; padding-bottom: 22px;
}
.pie-abajo p { font-size: 13px; opacity: .58; }

/* =========================================================
   Tablet / móvil
   ========================================================= */
@media (max-width: 980px) {
  :root { --alto-cabecera: 64px; }
  .nav-principal { display: none; }
  .barra-movil { display: flex; }
  /* espacio para la barra inferior: dentro del pie, para que el fondo oscuro llegue hasta abajo */
  .pie { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .cabecera-barra { justify-content: flex-end; }
  .medallon { width: 108px; height: 108px; transform: translate(-50%, -62%); }

  .generos-grilla { grid-template-columns: repeat(2, 1fr); }
  .ficha-cuerpo { gap: 44px; grid-template-columns: minmax(0, 300px) 1fr; }
}

@media (max-width: 760px) {
  .contenedor, .cabecera-barra { padding-left: 20px; padding-right: 20px; }
  /* en teléfono el medallón ocupa el centro: el botón queda como píldora solo con ícono */
  .cabecera-contacto { padding: 10px 18px; }
  .cabecera-contacto svg { width: 20px; height: 20px; }
  .cabecera-contacto .btn-texto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .hero { min-height: 470px; }
  .hero-contenido { padding: 84px 20px 104px; }
  .hero-sello { width: 78px; }

  /* Buscador apilado: cada campo a todo el ancho y con su altura natural (sin flex-basis heredado) */
  .buscador { flex-direction: column; flex-wrap: nowrap; gap: 12px; padding: 20px; border-radius: 24px; margin-top: -56px; }
  .buscador > * { flex: 0 0 auto; width: 100%; }

  .catalogo { padding-bottom: 72px; }
  .catalogo-cabeza { margin: 36px 0 20px; align-items: center; }
  .carrusel { gap: 18px; margin: 0 -20px; padding: 4px 20px 14px; scroll-padding: 0 20px; }
  .carrusel .libro { flex-basis: 158px; }
  .grilla { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
  .libro-titulo { font-size: 15px; }
  .arco { border-width: 5px; }

  .generos, .redes { padding: 72px 0; }
  .generos-grilla { gap: 14px; }
  .genero { padding-bottom: 20px; }
  .genero-nombre { font-size: 18px; }
  .redes-columnas { grid-template-columns: 1fr; gap: 24px; }
  .red { padding: 24px 20px; }
  .red .btn { width: 100%; }

  .ficha { padding: 92px 0 64px; }
  .ficha-cuerpo { grid-template-columns: 1fr; gap: 30px; margin-top: 26px; }
  .ficha-portada { position: static; width: min(72vw, 280px); margin: 0 auto; }
  .ficha-info { text-align: center; }
  .ficha-bloque { text-align: left; }
  .ficha-bloque h2 { text-align: center; }
  .pastillas { justify-content: center; }
  .ficha-cta { width: 100%; }

  .pie-arriba { grid-template-columns: 1fr; gap: 36px; text-align: center; padding-top: 56px; padding-bottom: 36px; }
  .pie-marca img { margin: 0 auto; }
  .pie-marca p { margin-left: auto; margin-right: auto; }
  .pie-redes { justify-content: center; }
  .pie-col ul { display: flex; flex-direction: column; align-items: center; }
  .pie-contacto { width: 100%; margin-top: 10px; }
  .pie-abajo { flex-direction: column; gap: 4px; text-align: center; padding-top: 18px; padding-bottom: 18px; }
  .pie-abajo p { font-size: 12.5px; }
}

@media (max-width: 380px) {
  .carrusel .libro { flex-basis: 146px; }
}
