/* ============================================
   Tipografía
   ============================================
   Figtree (SIL Open Font License) se carga desde Google Fonts en cada HTML.
   Sustituye a Airbnb Cereal, que es la fuente corporativa privada de Airbnb y
   no está licenciada para uso de terceros. */

/* ============================================
   Creaciones el Cordón — Design Tokens
   ============================================ */

:root {
  /* Brand — coral/red */
  --brand-50:  #FFF1F2;
  --brand-100: #FFE0E2;
  --brand-200: #FEC4C8;
  --brand-300: #FB9DA3;
  --brand-400: #F56872;
  --brand-500: #E63946;
  --brand-600: #CB2231;
  --brand-700: #A91B28;
  --brand-800: #841823;
  --brand-900: #5E1119;

  --primary: var(--brand-500);
  --primary-hover: var(--brand-600);
  --primary-soft: var(--brand-50);
  --primary-soft-2: var(--brand-100);

  /* Neutrals */
  --bg: #FFFFFF;
  --bg-soft: #FAFAF7;
  --bg-muted: #F4F2EC;
  --surface: #FFFFFF;
  --surface-2: #F8F6F0;
  --border: #EAE7DD;
  --border-strong: #D8D3C4;

  --text: #1A1816;
  --text-muted: #5E5A52;
  --text-subtle: #908A7E;

  /* Accents */
  --whatsapp: #25D366;
  --whatsapp-hover: #1FB855;

  /* Typography */
  --font-display: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;
  --s-24: 96px;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(20, 16, 12, 0.04);
  --shadow-sm: 0 2px 8px rgba(20, 16, 12, 0.05), 0 1px 2px rgba(20, 16, 12, 0.04);
  --shadow-md: 0 8px 24px rgba(20, 16, 12, 0.06), 0 2px 4px rgba(20, 16, 12, 0.04);
  --shadow-lg: 0 24px 48px -12px rgba(20, 16, 12, 0.12);
  --shadow-brand: 0 8px 24px -8px rgba(230, 57, 70, 0.35);

  /* Layout */
  --max-w: 1240px;
  --gutter: clamp(20px, 5vw, 56px);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg: #1A1A1A;
  --bg-soft: #212121;
  --bg-muted: #2A2A2A;
  --surface: #1E1E1E;
  --surface-2: #282828;
  --border: #2A2620;
  --border-strong: #3A352C;

  --text: #F4F1E8;
  --text-muted: #B8B2A2;
  --text-subtle: #837C6E;

  --primary-soft: #2A1518;
  --primary-soft-2: #3A1A1F;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.6);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scrollbar-color: var(--border-strong) transparent;
  accent-color: var(--primary);
}

/* Browser surfaces carry the palette too */
::selection {
  background: color-mix(in oklab, var(--primary) 24%, transparent);
}
input, textarea, select { caret-color: var(--primary); }
a { text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
/* Form fields already show focus with border + ring; skip the outline there */
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.4s var(--ease), color 0.3s var(--ease);
  text-wrap: pretty;
}

img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

/* Container */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: 0.01em;
  transition: transform 0.16s var(--ease-out), background 0.2s var(--ease), box-shadow 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn--primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-brand);
}
.btn--primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -8px color-mix(in oklab, var(--primary) 50%, transparent);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover {
  background: var(--surface-2);
  border-color: var(--text);
}

.btn--soft {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn--soft:hover {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
}

.btn--whatsapp {
  background: var(--whatsapp);
  color: white;
}
.btn--whatsapp:hover {
  background: var(--whatsapp-hover);
  transform: translateY(-1px);
}

/* Press feedback — declared after the hover variants so it wins while hovered */
.btn:active { transform: scale(0.97); }

.btn--lg {
  padding: 14px 28px;
  font-size: 15.5px;
}

.btn--sm {
  padding: 9px 16px;
  font-size: 13px;
}

/* ============================================
   Header
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  /* La barra se apoya sobre secciones blancas, así que necesita tono propio:
     --bg-soft la separa del fondo, el borde completo la delimita y la sombra
     corta le da profundidad sin que parezca una barra pesada. */
  background: color-mix(in oklab, var(--bg-soft) 92%, transparent);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: 0 4px 16px -12px rgba(20, 16, 12, 0.35);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: var(--s-8);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand__logo {
  height: 32px;
  width: auto;
  display: block;
}
[data-theme="dark"] .brand__logo {
  content: url("assets/logo-dark.svg");
}
.brand__mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: white;
  border-radius: 12px;
  flex-shrink: 0;
}
.brand__name {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.brand__name span {
  display: block;
  color: var(--primary);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav a {
  padding: 9px 16px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--r-pill);
  transition: color 0.2s, background 0.2s;
}
/* Sobre el header (--bg-soft), --surface-2 quedaba casi invisible;
   --bg-muted recupera el contraste que tenían contra el fondo blanco */
.nav a:hover { color: var(--text); background: var(--bg-muted); }
.nav a.active { color: var(--text); background: var(--bg-muted); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
}
.theme-toggle:hover { background: var(--bg-muted); color: var(--text); }

.menu-toggle {
  display: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

/* Mobile nav */
@media (max-width: 880px) {
  /* display no es animable por sí solo: allow-discrete lo mantiene en `flex`
     durante la salida, y @starting-style da el estado inicial de la entrada */
  .nav {
    display: none;
    opacity: 0;
    transform: translateY(-8px);
    transition:
      opacity 0.2s var(--ease-out),
      transform 0.2s var(--ease-out),
      display 0.2s allow-discrete;
  }
  .menu-toggle { display: grid; }
  .nav.open {
    opacity: 1;
    transform: translateY(0);
    display: flex;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    /* Cuelga del header: mismo tono para que se lean como una sola pieza */
    background: var(--bg-soft);
    padding: 12px var(--gutter) 20px;
    border-bottom: 1px solid var(--border-strong);
    align-items: stretch;
    gap: 2px;
  }
  @starting-style {
    .nav.open { opacity: 0; transform: translateY(-8px); }
  }
  .nav.open a { padding: 14px 16px; }
  .header-actions .btn--primary { display: none; }
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background: var(--bg-muted);
  border-top: 1px solid var(--border);
  padding: var(--s-16) 0 var(--s-8);
  margin-top: var(--s-24);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1.1fr;
  gap: var(--s-12);
}
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-col a { color: var(--text-muted); font-size: 14.5px; transition: color 0.2s; }
.footer-col a:hover { color: var(--primary); }
.footer-col p { color: var(--text-muted); font-size: 14.5px; max-width: 320px; }
/* El botón de preferencias de cookies vive en la lista del footer y debe leerse
   como un enlace más, no como un botón */
.footer-link-btn {
  padding: 0;
  font-size: 14.5px;
  color: var(--text-muted);
  text-align: left;
  transition: color 0.2s;
}
.footer-link-btn:hover { color: var(--primary); }
.footer-credit { color: var(--text-muted); text-decoration: underline; transition: color 0.2s; }
.footer-credit:hover { color: var(--primary); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--s-12);
  padding-top: var(--s-6);
  border-top: 1px solid var(--border);
  color: var(--text-subtle);
  font-size: 13px;
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-8); }
  .footer-col:first-child { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

/* ============================================
   WhatsApp floating button
   ============================================ */
.fab-whatsapp {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 80;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--whatsapp);
  color: white;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 28px -6px rgba(37, 211, 102, 0.5);
  transition: transform 0.2s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .fab-whatsapp:hover { transform: scale(1.08); }
}
.fab-whatsapp:active { transform: scale(0.95); }
.fab-whatsapp::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--whatsapp);
  opacity: 0;
  animation: ping 2s ease-out infinite;
}
@keyframes ping {
  0% { transform: scale(0.95); opacity: 0.6; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* ============================================
   Badges & chips
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge--hot { background: var(--primary); color: white; }
.badge--new { background: #1A1816; color: white; }
.badge--design { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }

[data-theme="dark"] .badge--new { background: var(--text); color: var(--bg); }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ============================================
   Section eyebrow
   ============================================ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--primary);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

/* Utility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ── Service info chips ── */
.chip--clickable {
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.chip--clickable:hover {
  background: var(--primary-soft-2);
  color: var(--primary);
  transform: translateY(-1px);
}

/* ── Service modal overlay ── */
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn   { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }

.service-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(26, 24, 22, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: overlayIn 0.2s ease;
}
.service-modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 36px 36px 32px;
  position: relative;
  animation: modalIn 0.25s var(--ease);
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
}
.service-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-muted);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  transition: background 0.15s, color 0.15s;
}
.service-modal__close:hover { background: var(--border-strong); color: var(--text); }

.service-modal__title {
  font-family: var(--font-display);
  font-size: clamp(26px, 5vw, 36px);
  font-style: italic;
  font-weight: 600;
  display: block;
  margin-bottom: 14px;
  color: var(--text);
  line-height: 1.1;
}
.service-modal__desc {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 22px;
}
.service-modal__aspects {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.service-modal__aspects li {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  padding-left: 16px;
  position: relative;
}
.service-modal__aspects li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.38em;
  width: 9px;
  height: 9px;
  background: var(--primary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9 5 7 7-7 7' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9 5 7 7-7 7' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.service-modal__aspects li strong {
  color: var(--text);
  font-weight: 600;
}
.service-modal__examples-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 6px;
}
.service-modal__examples {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}
/* Igual que en la página de servicios: una foto apaisada a lo ancho */
.service-modal__photos img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--r-sm);
}
@media (max-width: 480px) {
  .service-modal { padding: 24px 20px 20px; }
}

/* ============================================
   Reduced motion — fewer and gentler, not zero:
   fades stay, movement and loops go
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fab-whatsapp::after,
  .typewriter-cursor { animation: none; }
  .service-overlay { animation-duration: 0.15s; }
  .service-modal { animation: overlayIn 0.15s ease; }
  .btn, .btn:hover, .btn:active,
  .fab-whatsapp, .fab-whatsapp:hover, .fab-whatsapp:active { transform: none; }
  /* El fade se queda (ayuda a entender que algo llegó); el desplazamiento se va */
  [data-reveal],
  [data-reveal] .featured-grid > *,
  [data-reveal] .about__features > *,
  .quote-preview,
  .sheet .sheet__page,
  .nav { transform: none !important; }
  [data-reveal].is-in .featured-grid > *,
  [data-reveal].is-in .about__features > * { transition-delay: 0s !important; }
}

/* ============================================
   Banner de cookies
   ============================================ */
.cookie-banner {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 300;
  /* Angosto a propósito: a 560px invadía el CTA "Ver catálogo" del hero */
  width: min(420px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  opacity: 1;
  transform: none;
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
@starting-style {
  .cookie-banner { opacity: 0; transform: translateY(12px); }
}
.cookie-banner__text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  margin-bottom: 4px;
}
.cookie-banner__text p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}
.cookie-banner__text a { color: var(--primary); text-decoration: underline; }
.cookie-banner__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
/* En móvil el FAB de WhatsApp vive abajo a la derecha: el banner ocupa el ancho
   completo y los botones bajan, para no encimarse con él */
@media (max-width: 640px) {
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }
  .cookie-banner__actions > .btn { flex: 1; }
}
