/* ==============================================================
   CODESIGN PROJECTS — contacto.html adaptado al sistema visual
   del nuevo index. Mismo contenido real (email, WhatsApp,
   formulario), nuevo sistema: paleta naranja/caqui/carbón,
   Space Grotesk + Inter + mono, sin bordes redondeados de 6px.
================================================================= */

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

:root {
  --text: #1c1a1f;
  --text-soft: #57525c;
  --text-faint: #8b8690;
  --surface: #ffffff;
  --surface-alt: #f6f3ec;
  --line: #e6e0d2;
  --orange: #e2531e;
  --khaki: #a4906a;
  --header-bg: rgba(255, 255, 255, 0.9);

  --font-display: "Space Grotesk", "Helvetica Neue", sans-serif;
  --font-body: "Inter", "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

:root[data-theme="dark"] {
  --text: #f2efe9;
  --text-soft: #c7c2cb;
  --text-faint: #948e9a;
  --surface: #17151b;
  --surface-alt: #221f27;
  --line: rgba(255, 255, 255, 0.12);
  --khaki: #bda87f;
  --header-bg: rgba(23, 21, 27, 0.85);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--surface);
  background-image: radial-gradient(circle, rgba(226, 83, 30, 0.13) 1px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--text);
  line-height: 1.6;
  padding-top: 76px;
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1200px; margin: auto; padding: 0 2rem; }
img { max-width: 100%; display: block; }
a { color: inherit; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 1rem;
}

/* ==============================
   HEADER / NAV
============================== */
header {
  position: fixed;
  top: 0; width: 100%; z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.navbar { display: flex; justify-content: space-between; align-items: center; padding: 1.15rem 0; }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand-mark { height: 26px; width: auto; }
.brand-mark-dark { display: none; }
:root[data-theme="dark"] .brand-mark-dark { display: block; }
:root[data-theme="dark"] .brand-mark-light { display: none; }

.brand-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--text);
}

.brand-suffix {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--khaki);
  margin-left: 0.15rem;
}

.menu { display: flex; gap: 2.2rem; list-style: none; align-items: center; }

.menu > li > a {
  text-decoration: none;
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 500;
  position: relative;
  padding: 0.4rem 0;
}

.menu > li > a::after {
  content: "";
  position: absolute;
  bottom: -2px; left: 0;
  width: 0%; height: 1px;
  background: var(--orange);
  transition: width 0.25s ease;
}
.menu > li > a:hover { color: var(--text); }
.menu > li > a:hover::after { width: 100%; }

.menu > li > a.active { color: var(--orange); }
.menu > li > a.active::after { width: 100%; background: var(--orange); }

.menu .btn-nav {
  padding: 0.6rem 1.1rem;
  background: var(--text);
  color: var(--surface);
  border-radius: 2px;
  font-size: 0.8rem;
}
.menu .btn-nav::after { display: none; }
.menu .btn-nav:hover { background: var(--orange); color: #fff; }

.dropdown { position: relative; }

.dropdown-menu {
  list-style: none;
  position: absolute;
  top: 130%; left: 0;
  min-width: 220px;
  padding: 0.4rem 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 16px 32px rgba(28, 26, 31, 0.08);
  opacity: 0; visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s ease;
}
.dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown-menu li a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.82rem;
  color: var(--text-soft);
  text-decoration: none;
}
.dropdown-menu li a:hover { background: var(--surface-alt); color: var(--text); }
.dropdown-menu li a.active { color: var(--orange); background: var(--surface-alt); }
.dropdown-menu i { width: 16px; text-align: center; color: var(--text-faint); }
.dropdown-menu a:hover i { color: var(--orange); }

.menu-toggle { display: none; font-size: 1.4rem; cursor: pointer; color: var(--text); }

/* ==============================
   HERO
============================== */
.contact-hero { padding: 6.5rem 0 3rem; text-align: center; }

.contact-hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 4.4vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 auto 1rem;
}

.contact-hero p {
  font-size: 1.05rem;
  color: var(--text-soft);
  max-width: 54ch;
  margin: 0 auto;
}

/* ==============================
   LAYOUT — info + formulario
============================== */
.contact-section {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 4.5rem;
  padding: 3rem 0 6rem;
}

.contact-info h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  margin-bottom: 2rem;
}

.info-item { padding: 1.2rem 0; border-top: 1px solid var(--line); }
.info-item:first-of-type { border-top: none; }

.info-item h3 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 0.5rem;
}

.info-item p { font-size: 1.02rem; color: var(--text); }

/* FORM */
.contact-form { display: flex; flex-direction: column; gap: 1.4rem; }

.form-group { display: flex; flex-direction: column; gap: 0.5rem; }

/* honeypot anti-spam: fuera de pantalla, no display:none (algunos bots
   ignoran los campos display:none pero igual rellenan los demás) */
.hp-field { position: absolute; left: -9999px; top: -9999px; }

.form-group label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

input,
textarea,
select {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
  background: var(--surface);
}

select {
  padding-right: 2.5rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
}

/* Flecha propia como pseudo-elemento (no background-image) para
   poder animarla con transform — un cambio de background-image no
   se puede transicionar suavemente entre dos SVGs distintos. */
.select-wrap { position: relative; }

.select-wrap::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  width: 10px;
  height: 6px;
  background-color: var(--text-faint);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-size: contain;
  transform: translateY(-50%) rotate(0deg);
  transition: transform 0.2s ease, background-color 0.2s ease;
  pointer-events: none;
}

/* .open la controla JS (contact-form.js) en focus/change/blur del
   select — :focus solo no basta porque el select se queda enfocado
   incluso después de que la lista ya se cerró al elegir una opción. */
.select-wrap.open::after {
  transform: translateY(-50%) rotate(180deg);
  background-color: var(--orange);
}

input:focus,
textarea:focus,
select:focus { border-color: var(--orange); }

textarea { min-height: 140px; resize: vertical; }

input.invalid,
textarea.invalid,
select.invalid { border-color: #dc2626; }

.field-error {
  min-height: 1em;
  font-size: 0.78rem;
  color: #dc2626;
}

.field-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.field-footer .field-error { flex: 1; }

.char-counter {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  white-space: nowrap;
  transition: color 0.2s ease;
}
.char-counter.warning { color: var(--orange); }
.char-counter.limit { color: #dc2626; }

.form-status {
  font-size: 0.86rem;
  color: var(--text-soft);
}
.form-status.error { color: #dc2626; }
.form-status:empty { display: none; }

.contact-form button {
  align-self: flex-start;
  font-family: var(--font-display);
  padding: 0.85rem 1.6rem;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid var(--text);
  border-radius: 2px;
  background: var(--text);
  color: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
}
.contact-form button:hover { background: var(--orange); border-color: var(--orange); }

/* ==============================
   FOOTER
============================== */
.footer { background: var(--surface-alt); color: var(--text-soft); padding: 4.5rem 0 2rem; transition: background-color 0.25s ease, color 0.25s ease; }
.footer-grid { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr 1fr 1fr; gap: 2rem; }

.footer-brand h3 {
  font-family: var(--font-display);
  color: var(--text);
  font-size: 1rem;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
}
.footer-brand p { font-size: 0.85rem; max-width: 30ch; line-height: 1.6; }

.footer-column h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1rem;
}
.footer-column ul { list-style: none; }
.footer-column li { margin-bottom: 0.7rem; }
.footer-column a {
  text-decoration: none;
  color: var(--text-soft);
  font-size: 0.85rem;
  transition: color 0.2s ease;
}
.footer-column a:hover { color: var(--orange); }

.footer-bottom {
  max-width: 1200px;
  margin: 3rem auto 0;
  padding: 0 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.footer-bottom p { font-size: 0.75rem; color: var(--text-faint); }

/* ==============================
   BOTONES FLOTANTES — volver arriba y tema
============================== */
.fab-top,
.fab-theme {
  position: fixed;
  z-index: 500;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface);
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(28, 26, 31, 0.14);
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.2s ease, color 0.2s ease, visibility 0.25s, background-color 0.25s ease;
}
.fab-top:hover,
.fab-theme:hover { border-color: var(--orange); color: var(--orange); }

.fab-top {
  right: 2rem;
  bottom: 2rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
}
.fab-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }

.fab-theme {
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
}

.theme-icon-dark, .theme-icon-light { display: none; }
:root:not([data-theme="dark"]) .theme-icon-dark { display: block; }
:root[data-theme="dark"] .theme-icon-light { display: block; }

@media (max-width: 768px) {
  .fab-top { right: 1.2rem; bottom: 1.2rem; width: 40px; height: 40px; }
  .fab-theme { left: 1.2rem; width: 40px; height: 40px; }
}


/* ==============================
   RESPONSIVE
============================== */
@media (max-width: 900px) {
  .contact-section { grid-template-columns: 1fr; gap: 2.5rem; }
}

@media (max-width: 768px) {
  body { padding-top: 68px; }
  .contact-hero { padding: 4.5rem 0 2.5rem; }

  .menu {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    position: absolute;
    top: 68px; left: 0; width: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 2rem 1.5rem;
  }
  .menu.active { display: flex; }
  .menu > li { width: 100%; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
  .menu .dropdown-menu { position: static; opacity: 1; visibility: visible; transform: none; border: none; box-shadow: none; padding-left: 1rem; display: none; }
  .menu .dropdown:hover .dropdown-menu { display: block; }
  .menu-toggle { display: block; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: span 2; }
}
