/* =========================================================
   BORDADOS RAMÍREZ — ESTILOS BASE COMPARTIDOS
   (tokens, reset, header, nav, tipografía, botones, footer)
   ========================================================= */

:root {
  --black: #0A0A0A;
  --white: #FAFAF7;
  --gray: #6B6B68;
  --gray-50: #f7f7f7;
  --gray-100: #eeeeee;
  --gray-200: #e0e0e0;
  --gray-300: #d8d8d8;
  --gray-400: #999999;
  --gray-500: #777777;
  --gray-600: #666666;
  --cyan: #00B4D8;
  --magenta: #E5007F;
  --radius: 22px;
  --container: 1140px;

  --font-display: "Fraunces", serif;
  --font-body: "Libre Franklin", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

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

html {
  scroll-behavior: smooth;
}

/* Evita que el header fijo tape la sección al saltar con un ancla */
section[id] {
  scroll-margin-top: 90px;
}

body {
  font-family: var(--font-body);
  color: var(--black);
  background: var(--white);
  line-height: 1.45;
}

img {
  width: 100%;
  display: block;
}

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

/* HEADER */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-300);
  padding: 18px 0;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.logo {
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  width: 150px;
  height: auto;
  object-fit: contain;
  display: block;
}

nav {
  display: flex;
  gap: 32px;
  align-items: center;
}

nav a {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--black);
  transition: color 0.2s ease;
  position: relative;
}

nav a:hover {
  color: var(--cyan);
}

nav a.active {
  color: var(--magenta);
}

nav a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--cyan);
  transition: width 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  gap: 6px;
  padding: 8px;
}

.menu-toggle span {
  width: 25px;
  height: 2px;
  background: var(--black);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(10px, 10px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

/* El footer pasa a 2 columnas. Vivía repetido en index/servicio/productos,
   por eso en quiénes somos y contacto se veía distinto. */
@media (max-width: 980px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  /* Colgado del borde inferior del header. Con `top` fijo en px la altura
     real del header (~84px) no coincidía y el menú se abría montado encima. */
  nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    /* Plegado va sin borde ni sombra: `max-height: 0` recorta el contenido
       pero el borde se sigue dibujando y deja una línea suelta bajo el header. */
    border-bottom: 0 solid var(--gray-300);
    box-shadow: none;
  }

  /* Holgado a propósito: con 300px el último link (Contacto) quedaba
     recortado. El contenido real ronda los 250px. */
  nav.active {
    max-height: 480px;
    border-bottom-width: 1px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  nav a {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 15px;
  }

  /* Evita la línea doble contra el borde inferior del menú abierto */
  nav a:last-child {
    border-bottom: 0;
  }

  nav a::after {
    display: none;
  }

  nav a:hover {
    background: var(--gray-50);
    color: var(--black);
  }
}

/* LAYOUT */
.container {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
}

section {
  padding: 96px 0;
  position: relative;
}

/* TIPOGRAFÍA / COMPONENTES */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  color: var(--gray-500);
  margin-bottom: 16px;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 3px;
  background: var(--gray-400);
  border-radius: 999px;
}

.title-line {
  display: block;
}

.magenta-italic {
  color: var(--magenta);
  font-style: italic;
  font-weight: 400;
}

.cyan-italic {
  color: var(--cyan);
  font-style: italic;
  font-weight: 400;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(44px, 7vw, 85px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin-bottom: 28px;
  max-width: 780px;
  font-weight: 900;
  color: var(--black);
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.5vw, 60px);
  line-height: 1;
  letter-spacing: -0.025em;
  margin-bottom: 18px;
  font-weight: 800;
  color: var(--black);
}

h2 em {
  font-style: italic;
  font-weight: 400;
}

h3 {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
  color: var(--black);
}

p {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 16px;
  color: var(--gray);
}

.lead {
  font-family: var(--font-body);
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.55;
  margin-bottom: 32px;
  max-width: 620px;
  color: var(--gray);
  font-weight: 400;
}

/* BOTONES */
.btn-row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 2px solid var(--black);
  min-height: 52px;
}

.btn.primary {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.btn.primary:hover {
  background: transparent;
  color: var(--black);
  transform: translateX(2px);
}

.btn.secondary {
  background: transparent;
  color: var(--black);
  border: 2px solid var(--black);
}

.btn.secondary:hover {
  background: var(--black);
  color: var(--white);
  transform: translateX(2px);
}

.btn-cyan {
  background: var(--cyan);
  color: var(--white);
  border-color: var(--cyan);
}

.btn-cyan:hover {
  background: transparent;
  color: var(--cyan);
  transform: translateX(2px);
}

.btn-magenta {
  background: var(--magenta);
  color: var(--white);
  border-color: var(--magenta);
}

.btn-magenta:hover {
  background: transparent;
  color: var(--magenta);
  transform: translateX(2px);
}

/* WHATSAPP FLOAT */
.whatsapp-float {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 1000;
}

.whatsapp-button {
  width: 64px;
  height: 64px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.whatsapp-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.6);
}

.whatsapp-button svg {
  width: 36px;
  height: 36px;
  fill: var(--white);
}

/* FOOTER */
footer {
  background: var(--black);
  padding: 64px 0 32px;
  color: var(--white);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 60px;
}

.footer-brand {
  max-width: 280px;
}

.footer-logo {
  margin-bottom: 20px;
}

.footer-logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.02em;
}

.footer-logo-text em {
  font-style: italic;
  font-weight: 400;
  color: var(--magenta);
}

.footer-brand p {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-400);
  margin: 0;
}

.footer-column h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 16px;
  color: var(--cyan);
}

.footer-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-info p {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-400);
  margin: 0;
}

.footer-info a {
  color: var(--gray-400);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-info a:hover {
  color: var(--white);
}

.footer-instagram {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer-instagram svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

@media (max-width: 620px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .whatsapp-float {
    bottom: 20px;
    right: 20px;
  }

  .whatsapp-button {
    width: 56px;
    height: 56px;
  }

  .whatsapp-button svg {
    width: 32px;
    height: 32px;
  }
}

/* =========================================================
   MODAL PARA AMPLIAR IMÁGENES DE CARRUSEL
   Compartido: lo usan inicio y servicio vía partials/image-modal.njk.
   La lógica está en main.js.
   ========================================================= */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* Mismo tratamiento que las flechas: círculo magenta con ícono blanco.
   Antes era una × de texto sin fondo y se perdía sobre fotos oscuras. */
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(229, 0, 127, 0.8);
  color: var(--white);
  cursor: pointer;
  transition: background 0.3s ease;
  z-index: 1003;
}

.modal-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.modal-close:hover {
  background: var(--magenta);
}

.modal-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(229, 0, 127, 0.8);
  color: var(--white);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1002;
}

/* Flechas en SVG: los caracteres Unicode de flecha no existen en la mayoría
   de las tipografías y el navegador los sustituía por un glifo de reserva. */
.modal-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal-btn:hover {
  background: var(--magenta);
}

/* `display: flex` de arriba le gana al [hidden] del navegador, así que
   hay que anularlo a mano para que main.js pueda ocultar las flechas
   cuando el carrusel tiene una sola foto. */
.modal-btn[hidden] {
  display: none;
}

.modal-prev { left: 20px; }
.modal-next { right: 20px; }

/* En pantallas chicas las flechas se apoyan por dentro */
@media (max-width: 620px) {
  .modal-close   { top: 8px; right: 8px; width: 34px; height: 34px; }
  .modal-btn     { width: 40px; height: 40px; }
  .modal-btn svg { width: 18px; height: 18px; }
  .modal-prev    { left: 6px; }
  .modal-next    { right: 6px; }
}
