/* =========================================================
   CATÁLOGO LIBROS / TALONARIOS / ANILLADOS - PUNTO GRÁFICO
   ========================================================= */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --rojo: #c91414;
  --rojo-oscuro: #8f1010;
  --rojo-suave: #fff1f1;
  --grafito: #171a21;
  --grafito-2: #222733;
  --negro: #0f1115;
  --texto: #1b1f2a;
  --suave: #6b7280;
  --borde: #e5e7eb;
  --gris: #f7f8fa;
  --verde: #25d366;
  --sombra: 0 18px 50px rgba(15, 23, 42, 0.14);
  --sombra-suave: 0 10px 28px rgba(15, 23, 42, 0.08);
}

html { scroll-behavior: smooth; }

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--gris);
  color: var(--texto);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

.contenedor { width: min(1180px, 92%); margin: 0 auto; }

/* HEADER */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--borde);
}

.header-contenido {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo-box { display: flex; align-items: center; gap: 13px; }
.logo { width: 52px; height: 52px; object-fit: contain; }
.logo-texto { display: flex; flex-direction: column; line-height: 1.15; }
.logo-texto strong { color: var(--grafito); font-size: 1.08rem; font-weight: 900; }
.logo-texto span { color: var(--rojo); font-size: 0.82rem; font-weight: 800; }

.nav { display: flex; align-items: center; gap: 24px; font-weight: 800; font-size: 0.95rem; color: #2d3340; }
.nav a { transition: 0.2s ease; }
.nav a:hover { color: var(--rojo); }
.nav-destacado {
  background: var(--rojo);
  color: white !important;
  padding: 10px 17px;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(201, 20, 20, 0.22);
}

.menu-toggle {
  display: none;
  border: 0;
  background: var(--rojo);
  color: white;
  font-size: 1.4rem;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
}

/* BOTONES */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 0;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  transition: 0.22s ease;
  white-space: nowrap;
  font-size: 0.95rem;
}

.btn:hover { transform: translateY(-2px); }
.btn-principal { background: var(--rojo); color: white; box-shadow: 0 14px 28px rgba(201, 20, 20, 0.24); }
.btn-principal:hover { background: var(--rojo-oscuro); }
.btn-whatsapp { background: var(--verde); color: white; box-shadow: 0 14px 28px rgba(37, 211, 102, 0.22); }
.btn-blanco { background: white; color: var(--grafito); }

/* HERO */
.libros-main { overflow: hidden; background: var(--gris); }

.hero-libros {
  position: relative;
  overflow: hidden;
  padding: 94px 0 82px;
  color: white;
  background:
    radial-gradient(circle at 12% 12%, rgba(201, 20, 20, 0.42), transparent 30%),
    radial-gradient(circle at 90% 18%, rgba(255, 255, 255, 0.10), transparent 24%),
    linear-gradient(135deg, var(--negro), var(--grafito-2));
}

.hero-libros::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
  pointer-events: none;
}

.hero-libros-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  gap: 48px;
  align-items: center;
}

.etiqueta-roja {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ff5b5b;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  font-weight: 900;
  margin-bottom: 16px;
}

.etiqueta-roja::before {
  content: "";
  width: 34px;
  height: 3px;
  border-radius: 999px;
  background: #ff5b5b;
}

.hero-libros h1 {
  font-size: clamp(2.55rem, 5.2vw, 4.65rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
  margin-bottom: 20px;
}

.hero-libros p {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.12rem;
  line-height: 1.75;
}

.hero-acciones { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 30px; }

.hero-libros-visual { position: relative; min-height: 430px; }
.hero-foto-principal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 34px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.hero-foto-principal img { width: min(420px, 100%); filter: drop-shadow(0 24px 35px rgba(0,0,0,.25)); }

.hero-pill {
  position: absolute;
  z-index: 2;
  color: var(--grafito);
  background: white;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 900;
  box-shadow: var(--sombra);
}

.pill-uno { left: -18px; bottom: 58px; }
.pill-dos { right: -10px; top: 55px; color: white; background: var(--rojo); }

/* RESUMEN */
.resumen-cotizador { position: relative; z-index: 3; margin-top: -34px; padding-bottom: 38px; }
.resumen-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.resumen-grid article {
  background: white;
  border: 1px solid var(--borde);
  border-radius: 26px;
  padding: 26px;
  box-shadow: var(--sombra);
}
.resumen-grid strong {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--rojo);
  color: white;
  margin-bottom: 16px;
}
.resumen-grid h2 { font-size: 1.13rem; line-height: 1.2; color: var(--grafito); margin-bottom: 8px; }
.resumen-grid p { color: var(--suave); font-size: 0.95rem; }

/* PRODUCTOS */
.productos { padding: 66px 0 84px; }
.titulo-seccion { text-align: center; max-width: 760px; margin: 0 auto 38px; }
.titulo-seccion span {
  display: inline-block;
  color: var(--rojo);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
  margin-bottom: 12px;
}
.titulo-seccion h2 {
  color: var(--grafito);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin-bottom: 14px;
}
.titulo-seccion p { color: var(--suave); }

.productos-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.producto-card {
  overflow: hidden;
  background: white;
  border: 1px solid var(--borde);
  border-radius: 30px;
  box-shadow: var(--sombra-suave);
  transition: 0.24s ease;
}
.producto-card:hover { transform: translateY(-6px); box-shadow: var(--sombra); }

.producto-media {
  position: relative;
  height: 195px;
  display: grid;
  place-items: center;
  padding: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 35% 20%, rgba(255,255,255,.45), transparent 30%),
    linear-gradient(135deg, #c91414, #5f0909);
}
.producto-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: .45;
}
.producto-media img { position: relative; z-index: 2; height: 145px; width: auto; filter: drop-shadow(0 18px 22px rgba(0,0,0,.25)); transition: .25s ease; }
.producto-card:hover .producto-media img { transform: scale(1.05) rotate(-1deg); }
.producto-media span {
  position: absolute;
  z-index: 3;
  left: 16px;
  top: 16px;
  color: white;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.24);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.producto-body { padding: 24px; }
.producto-body h3 { color: var(--grafito); font-size: 1.35rem; margin-bottom: 10px; }
.producto-body p { color: var(--suave); font-size: 0.95rem; margin-bottom: 14px; }
.producto-body ul { list-style: none; display: grid; gap: 7px; margin-bottom: 22px; color: #384152; font-weight: 700; font-size: 0.9rem; }
.producto-body li::before { content: "✓"; color: var(--rojo); font-weight: 900; margin-right: 8px; }
.producto-body .btn { width: 100%; }

/* DETALLE PRODUCCIÓN */
.detalle-produccion-seccion { padding: 76px 0; background: white; }
.detalle-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 38px; align-items: center; }
.detalle-grid h2 { color: var(--grafito); font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.08; letter-spacing: -0.035em; }
.detalle-lista { display: grid; gap: 16px; }
.detalle-lista article { border: 1px solid var(--borde); border-radius: 22px; padding: 22px; box-shadow: var(--sombra-suave); }
.detalle-lista strong { color: var(--grafito); display: block; margin-bottom: 6px; }
.detalle-lista p { color: var(--suave); }

/* MODALES */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 16, 0.72);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.activo { display: flex; }
.modal {
  width: min(1080px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: white;
  border-radius: 32px;
  position: relative;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}
.modal-cerrar {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: white;
  color: var(--grafito);
  font-size: 1.8rem;
  font-weight: 900;
  box-shadow: var(--sombra-suave);
  cursor: pointer;
}
.modal-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; }
.modal-info {
  padding: 42px;
  color: white;
  background: linear-gradient(135deg, var(--grafito), var(--negro));
  position: relative;
  overflow: hidden;
}
.modal-info::before {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -90px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.modal-info span { display: inline-block; color: #ff7777; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.76rem; font-weight: 900; margin-bottom: 14px; }
.modal-info h2 { font-size: clamp(1.9rem, 3vw, 3rem); line-height: 1.08; margin-bottom: 16px; }
.modal-info p { color: rgba(255, 255, 255, 0.78); position: relative; z-index: 2; }
.modal-talonarios, .modal-libros, .modal-anillados, .modal-revistas { background: radial-gradient(circle at 20% 10%, rgba(201,20,20,.52), transparent 33%), linear-gradient(135deg, var(--grafito), var(--negro)); }

.form-cotizador { padding: 42px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.campo { display: grid; gap: 8px; }
.campo.full { grid-column: 1 / -1; }
.campo label { font-weight: 900; color: var(--grafito); font-size: 0.92rem; }
.campo input, .campo select, .campo textarea {
  width: 100%;
  border: 1px solid var(--borde);
  border-radius: 16px;
  padding: 13px 14px;
  font: inherit;
  background: white;
  outline: none;
}
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: rgba(201, 20, 20, 0.35); box-shadow: 0 0 0 4px rgba(201, 20, 20, 0.1); }

.resultado {
  grid-column: 1 / -1;
  border: 1px solid var(--borde);
  border-radius: 26px;
  background: #fafafa;
  padding: 22px;
  margin-top: 6px;
}
.resultado-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 20px; align-items: start; }
.unitario { background: linear-gradient(135deg, var(--rojo-oscuro), var(--rojo)); color: white; border-radius: 24px; padding: 24px; }
.unitario span { display: block; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.74rem; font-weight: 900; opacity: 0.8; }
.unitario strong { display: block; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1; margin: 10px 0; }
.unitario small { display: block; opacity: 0.86; font-weight: 800; }
.detalle-precio { display: grid; gap: 10px; }
.linea { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px dashed #d6d9df; padding-bottom: 8px; }
.linea strong { color: var(--grafito); }
.nota { font-size: 0.88rem; color: var(--suave); margin-top: 10px; }
.detalle-produccion { font-size: 0.9rem; color: #4b5563; margin-top: 10px; line-height: 1.7; }
.resultado .btn { margin-top: 16px; }
.alerta { border-left: 5px solid var(--rojo); background: #fff3f3; padding: 14px; border-radius: 16px; color: #5f0909; font-weight: 800; }
.ok { border-left: 5px solid #24a148; background: #ecfdf3; padding: 14px; border-radius: 16px; color: #14532d; font-weight: 800; }

#footer-placeholder { background: var(--negro); }

/* RESPONSIVE */
@media (max-width: 1080px) {
  .hero-libros-grid, .detalle-grid, .modal-grid, .resultado-grid { grid-template-columns: 1fr; }
  .hero-libros-visual { min-height: 360px; }
  .productos-grid { grid-template-columns: repeat(2, 1fr); }
  .resumen-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .menu-toggle { display: block; }
  .nav {
    position: absolute;
    top: 82px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 22px 6%;
    background: white;
    border-bottom: 1px solid var(--borde);
    box-shadow: var(--sombra-suave);
  }
  .nav.activo { display: flex; }
  .nav-destacado { width: 100%; text-align: center; }
}

@media (max-width: 680px) {
  .hero-libros { padding: 70px 0 64px; }
  .hero-libros h1 { font-size: 2.35rem; }
  .hero-acciones { flex-direction: column; }
  .hero-acciones .btn, .btn { width: 100%; }
  .hero-libros-visual { min-height: 300px; margin-top: 10px; }
  .hero-pill { display: none; }
  .productos-grid { grid-template-columns: 1fr; }
  .producto-media { height: 185px; }
  .producto-media img { height: 135px; }
  .detalle-produccion-seccion, .productos { padding: 56px 0; }
  .modal-overlay { padding: 10px; }
  .modal { border-radius: 24px; }
  .modal-info, .form-cotizador { padding: 28px; }
  .form-cotizador { grid-template-columns: 1fr; }
  .logo-texto span { display: none; }
}

/* =========================================================
   AJUSTE RESULTADO MODAL - COTIZADOR LIBROS / TALONARIOS
   ========================================================= */

.resultado-cotizador,
.resultado-libros,
.libro-resultado,
.cotizador-resultado {
  width: 100%;
  margin-top: 20px;
  padding: 22px;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.resultado-grid,
.resultado-precio-grid,
.libro-resultado-grid,
.cotizador-resultado-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.1fr);
  gap: 20px;
  align-items: stretch;
}

.precio-unitario-box,
.precio-destacado,
.resultado-unitario {
  width: 100%;
  min-height: 150px;
  border-radius: 22px;
  background: linear-gradient(135deg, #c91414, #a70f0f);
  color: #ffffff;
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.precio-unitario-box span,
.precio-destacado span,
.resultado-unitario span {
  display: block;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
  opacity: 0.95;
}

.precio-unitario-box strong,
.precio-destacado strong,
.resultado-unitario strong {
  display: block;
  font-size: clamp(2.2rem, 4vw, 3rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.precio-unitario-box small,
.precio-destacado small,
.resultado-unitario small {
  display: block;
  margin-top: 10px;
  font-size: 0.88rem;
  font-weight: 900;
}

.resumen-precio,
.resultado-detalle,
.resultado-totales {
  width: 100%;
  min-width: 0;
}

.resumen-precio-row,
.resultado-linea,
.total-linea {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed #d7dce4;
  font-size: 0.95rem;
}

.resumen-precio-row span,
.resultado-linea span,
.total-linea span {
  color: #374151;
}

.resumen-precio-row strong,
.resultado-linea strong,
.total-linea strong {
  color: #111827;
  font-weight: 900;
  white-space: nowrap;
}

.detalle-produccion,
.resultado-aclaracion,
.resultado-nota {
  margin-top: 16px;
  color: #4b5563;
  font-size: 0.88rem;
  line-height: 1.55;
}

.detalle-produccion p,
.resultado-aclaracion p,
.resultado-nota p {
  margin-bottom: 10px;
}

/* Botón WhatsApp dentro del resultado */

.resultado-cotizador .btn-whatsapp,
.resultado-libros .btn-whatsapp,
.libro-resultado .btn-whatsapp,
.cotizador-resultado .btn-whatsapp {
  width: 100%;
  margin-top: 18px;
  justify-content: center;
}

/* Ajuste general del modal para que respire mejor */

.modal-cotizador,
.libro-modal,
.modal-contenido {
  max-width: 980px;
}

.modal-form,
.libro-modal-form,
.cotizador-form {
  min-width: 0;
}

/* Responsive */

@media (max-width: 860px) {
  .resultado-grid,
  .resultado-precio-grid,
  .libro-resultado-grid,
  .cotizador-resultado-grid {
    grid-template-columns: 1fr;
  }

  .precio-unitario-box,
  .precio-destacado,
  .resultado-unitario {
    min-height: auto;
    padding: 24px;
  }

  .precio-unitario-box strong,
  .precio-destacado strong,
  .resultado-unitario strong {
    font-size: 2.4rem;
  }
}

@media (max-width: 560px) {
  .resultado-cotizador,
  .resultado-libros,
  .libro-resultado,
  .cotizador-resultado {
    padding: 16px;
    border-radius: 20px;
  }

  .precio-unitario-box,
  .precio-destacado,
  .resultado-unitario {
    border-radius: 18px;
    padding: 22px 20px;
  }

  .precio-unitario-box strong,
  .precio-destacado strong,
  .resultado-unitario strong {
    font-size: 2.1rem;
  }

  .resumen-precio-row,
  .resultado-linea,
  .total-linea {
    font-size: 0.9rem;
  }
}