/* ============================================================
   NITROX 21 · MAIN CSS
   Globals only. Layout/component styles live inline on each page
   to mirror the design source 1:1 — easier for non-CSS editors
   to tweak in WordPress block editor or Elementor.
   ============================================================ */

/* Fuentes autoalojadas (sin transferencia a Google — RGPD). Ver assets/fonts/fonts.css */
@import url('../fonts/fonts.css');

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: #3a3a3a;
  color: #f5f5f4;
  font-family: 'Inter Tight', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: #ffe31a; color: #222; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* technical grid background, fixed */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 80%);
          mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 80%);
  opacity: 0.5;
}
main, header, footer { position: relative; z-index: 1; }

/* keyframes */
@keyframes nx-fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes nx-fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes nx-tickerSlide { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes nx-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

@media (prefers-reduced-motion: no-preference) {
  main { animation: nx-fadeUp 380ms ease-out both; }
}

/* hover utilities (since inline can't do :hover) */
.nx-link:hover { color: #f4b73d !important; }
.nx-cta:hover { background: #ffe31a !important; transform: translateX(2px); }
.nx-card:hover { border-color: #f4b73d !important; transform: translateY(-4px); }
.nx-card-flat:hover { border-color: #f4b73d !important; transform: translateY(-3px); }
.nx-card-static:hover { border-color: #f4b73d !important; }
.nx-row:hover { background: rgba(244,183,61,0.04); }
.nx-btn-ghost:hover { border-color: #f4b73d !important; color: #f4b73d !important; }
.nx-btn-ghost-yellow:hover { background: rgba(244,183,61,0.12) !important; color: #ffe31a !important; }
.nx-input:focus { border-color: #f4b73d !important; outline: none; }
.nx-h-yellow:hover { color: #f4b73d !important; }

/* ── Formularios (clases base; usadas por el form estático y por Contact Form 7) ── */
.nx-input,
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"],
.wpcf7 textarea, .wpcf7 select {
  background: transparent; border: 0; border-bottom: 1px solid rgba(255,255,255,0.28);
  padding: 12px 0; color: #f5f5f4; font-family: 'Inter Tight', sans-serif; font-size: 16px;
  outline: none; width: 100%; box-sizing: border-box;
}
.nx-input::placeholder, .wpcf7 ::placeholder { color: #6f6d68; }
textarea.nx-input, .wpcf7 textarea { border: 1px solid rgba(255,255,255,0.28); padding: 14px; resize: vertical; min-height: 130px; }
select.nx-input, .wpcf7 select { background: #3a3a3a; border: 1px solid rgba(255,255,255,0.28); padding: 14px 16px; font-size: 15px; appearance: none; cursor: pointer; }
.wpcf7 input:focus, .wpcf7 textarea:focus, .wpcf7 select:focus { border-color: #f4b73d !important; }

/* ── Contact Form 7: maquetación dentro de la tarjeta del tema ── */
.wpcf7 form { display: flex; flex-direction: column; gap: 22px; }
.wpcf7 .hidden-fields-container { display: none; }
/* cada campo (label envolvente) ocupa una fila */
.wpcf7 form > label,
.wpcf7 form > .wpcf7-form-control-wrap { display: block; }
/* texto de la etiqueta */
.wpcf7 label {
  display: block; color: #9c9a94; font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
}
.wpcf7-form-control-wrap { display: block; margin-top: 8px; }
/* fila de dos columnas (nombre/empresa, email/teléfono) — el grid viene en el contenido del form */
.wpcf7 form > div { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 640px) { .wpcf7 form > div { grid-template-columns: 1fr; } }
.wpcf7 form > div > label { margin: 0; }

/* RGPD / aceptación */
.wpcf7-acceptance .wpcf7-list-item { margin: 0; }
.wpcf7-acceptance label { display: flex; align-items: flex-start; gap: 10px; text-transform: none; color: #9c9a94; font-family: 'Inter Tight', sans-serif; font-size: 13px; letter-spacing: 0; }
.wpcf7-acceptance input[type="checkbox"] { width: auto; margin-top: 3px; accent-color: #f4b73d; }

/* Botón enviar */
.wpcf7 input[type="submit"], .wpcf7 button[type="submit"] {
  align-self: flex-start; background: #f4b73d; color: #1f1f1f; border: 0; padding: 18px 28px; cursor: pointer;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: 0.18em;
  text-transform: uppercase; font-weight: 600; transition: background 160ms ease;
}
.wpcf7 input[type="submit"]:hover, .wpcf7 button[type="submit"]:hover { background: #ffe31a; }

/* Avisos / validación */
.wpcf7 .wpcf7-response-output { border-color: rgba(255,255,255,0.28) !important; color: #f5f5f4; margin: 8px 0 0 !important; padding: 12px 16px; font-family: 'Inter Tight', sans-serif; font-size: 14px; }
.wpcf7 .wpcf7-not-valid-tip { color: #ff9c9c; font-family: 'JetBrains Mono', monospace; font-size: 11px; text-transform: none; letter-spacing: 0; margin-top: 6px; }
.wpcf7-spinner { background-color: #f4b73d; }

/* Primera capa RGPD bajo el formulario */
.nx-firstlayer { font-family: 'Inter Tight', sans-serif; font-size: 12px; line-height: 1.5; color: #9c9a94; margin: 16px 0 0; max-width: 640px; }
.nx-firstlayer strong { color: #dcdad5; font-weight: 600; }
.nx-firstlayer a { color: #f4b73d; }

/* ── Cuerpo de artículo (the_content) ── */
.nx-article-body { font-family: 'Inter Tight', sans-serif; font-size: 17px; line-height: 1.65; color: #dcdad5; max-width: 780px; }
.nx-article-body > *:first-child { margin-top: 0; }
.nx-article-body p { margin: 0 0 24px; }
.nx-article-body h2 { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 40px; line-height: 1; text-transform: uppercase; color: #f5f5f4; margin: 48px 0 20px; }
.nx-article-body h3 { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 28px; line-height: 1.05; text-transform: uppercase; color: #f5f5f4; margin: 36px 0 16px; }
.nx-article-body a { color: #f4b73d; text-decoration: underline; }
.nx-article-body strong { color: #f5f5f4; font-weight: 600; }
.nx-article-body ul, .nx-article-body ol { margin: 0 0 24px; padding-left: 22px; }
.nx-article-body li { margin: 0 0 10px; }
.nx-article-body blockquote { border-left: 2px solid #f4b73d; margin: 0 0 24px; padding: 6px 0 6px 22px; color: #f5f5f4; }
.nx-article-body img { max-width: 100%; height: auto; display: block; margin: 0 0 24px; border: 1px solid rgba(255,255,255,0.14); }
.nx-article-body figure { margin: 0 0 24px; }
.nx-article-body figcaption { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: #9c9a94; margin-top: 8px; }

/* ── Esquinas redondeadas (botones y cajas) ──
   Los estilos del diseño son inline; aquí se redondea de forma global por clase,
   por etiqueta (formularios/CF7), por id (banner de cookies) y por color de fondo
   inline de las cajas. No requiere tocar las plantillas. */
:root { --nx-radius: 12px; --nx-radius-btn: 8px; }

/* Botones y CTAs (tema + Contact Form 7 + banner de cookies) */
.nx-cta, .nx-btn-ghost, .nx-btn-ghost-yellow, .nx-map-load,
#nx-cc-reject, #nx-cc-config, #nx-cc-accept, #nx-cc-save,
.wpcf7 input[type="submit"], .wpcf7 button {
  border-radius: var(--nx-radius-btn);
}

/* Campos de formulario con caja completa */
.nx-input, .wpcf7 input[type="text"], .wpcf7 input[type="email"],
.wpcf7 input[type="tel"], .wpcf7 input[type="url"], .wpcf7 textarea {
  border-radius: var(--nx-radius-btn);
}

/* Tarjetas con relleno (sin corchetes decorativos): se recortan al redondear */
.nx-card, .nx-card-flat, .nx-card-static,
main [style*="background:#484848"] {
  border-radius: var(--nx-radius);
  overflow: hidden;
}

/* Píldoras de destacado en amarillo (Servicios) */
main [style*="rgba(244,183,61,0.06)"] { border-radius: var(--nx-radius-btn); }

/* Marcos de imagen y mapa (llevan corchetes en las esquinas): se redondea el
   marco y la imagen/iframe interior, sin recortar, para no cortar los corchetes */
main [style*="background:#505050"] { border-radius: var(--nx-radius); }
main [style*="background:#505050"] > img,
.nx-map iframe { border-radius: var(--nx-radius); }

/* Imágenes dentro del cuerpo de artículo */
.nx-article-body img { border-radius: var(--nx-radius-btn); }

/* ── Menú: desplegable de "Servicios" ── */
.nx-has-sub { position: relative; display: inline-flex; align-items: center; }
.nx-has-sub > .nx-link::after { content: '▾'; font-size: 9px; color: #f4b73d; margin-left: 6px; }
.nx-sub {
  display: none; position: absolute; top: 100%; left: 0; min-width: 280px;
  flex-direction: column; gap: 2px; padding: 8px; z-index: 70;
  background: rgba(42,42,42,0.98); backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.14); border-radius: var(--nx-radius-btn);
  box-shadow: 0 18px 40px rgba(0,0,0,0.42);
}
.nx-has-sub:hover .nx-sub, .nx-has-sub:focus-within .nx-sub { display: flex; }
.nx-sub a {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: #dcdad5; text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}
.nx-sub a:hover, .nx-sub a:focus { background: rgba(244,183,61,0.12); color: #f5f5f4; }
.nx-sub a .nx-sub-arrow { color: #f4b73d; }

/* Hamburguesa (oculta en escritorio) */
.nx-navtoggle, .nx-burger { display: none; }
.nx-burger { flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; cursor: pointer; }
.nx-burger span { display: block; width: 24px; height: 2px; background: #f5f5f4; transition: transform 200ms ease, opacity 200ms ease; }

/* =====================================================================
   RESPONSIVE — el tema usa estilos inline (escritorio); aquí se
   sobreescriben con !important para tablet/móvil. Sin tocar plantillas.
   ===================================================================== */
@media (max-width: 900px) {
  html, body { overflow-x: hidden; max-width: 100%; }
  main, main *, footer, footer * { box-sizing: border-box; }

  /* Padding horizontal de las secciones de contenido (la sección ya lleva el padding) */
  main > section { padding-left: 32px !important; padding-right: 32px !important; padding-top: 40px !important; padding-bottom: 40px !important; }
  footer > div { padding-left: 24px !important; padding-right: 24px !important; }

  /* Rejillas multicolumna -> una columna */
  main [style*="grid-template-columns"], footer [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  /* Tarjetas flex con ancho calc() (áreas de la home) -> ancho completo */
  main [style*="calc(33.333%"] { flex-basis: 100% !important; max-width: 100% !important; }
  main [style*="gap:64px"] { gap: 28px !important; }
  main [style*="gap:48px"] { gap: 24px !important; }

  /* Titulares y textos grandes (por valor inline) */
  main [style*="font-size:148px"], main [style*="font-size:132px"],
  main [style*="font-size:128px"], main [style*="font-size:112px"],
  main [style*="font-size:96px"]  { font-size: 56px !important; line-height: 0.95 !important; }
  main [style*="font-size:86px"], main [style*="font-size:72px"],
  main [style*="font-size:60px"]  { font-size: 38px !important; line-height: 1 !important; }
  main [style*="font-size:48px"], main [style*="font-size:44px"] { font-size: 30px !important; line-height: 1.02 !important; }

  /* Marcos de imagen / mapa con alto fijo */
  main [style*="height:480px"], main [style*="height:420px"] { height: 320px !important; }

  /* Fila de specs (4 columnas con divisores verticales) -> apilada */
  main [style*="repeat(4, 1fr)"] > div { border-right: 0 !important; border-top: 1px solid rgba(255,255,255,0.14) !important; padding-left: 0 !important; }

  /* ── Cabecera móvil ── */
  .nx-topbar { flex-wrap: wrap; gap: 4px 14px; padding: 8px 20px !important; font-size: 9px !important; }
  .nx-headrow { position: relative; padding: 14px 20px !important; }
  .nx-burger { display: inline-flex; }
  .nx-nav { display: none !important; position: absolute; top: 100%; left: 0; right: 0;
            flex-direction: column; align-items: stretch; gap: 2px;
            background: rgba(42,42,42,0.99); backdrop-filter: blur(14px);
            border-top: 1px solid rgba(255,255,255,0.14); border-bottom: 1px solid rgba(255,255,255,0.14);
            padding: 12px 20px 18px; }
  .nx-navtoggle:checked ~ .nx-nav { display: flex !important; }
  .nx-nav .nx-link { width: 100%; padding: 14px 6px !important; }
  .nx-nav .nx-cta { margin-left: 0 !important; margin-top: 8px; justify-content: center; }
  /* Submenú "Servicios" abierto en línea dentro del panel móvil */
  .nx-has-sub { flex-direction: column; align-items: stretch; width: 100%; }
  .nx-sub { position: static !important; display: flex !important; min-width: 0; padding: 0 0 0 16px;
            background: transparent; border: 0; box-shadow: none; }
}

@media (max-width: 560px) {
  main > section { padding-left: 20px !important; padding-right: 20px !important; }
  footer > div { padding-left: 18px !important; padding-right: 18px !important; }
  main [style*="font-size:148px"], main [style*="font-size:132px"],
  main [style*="font-size:128px"], main [style*="font-size:112px"],
  main [style*="font-size:96px"]  { font-size: 42px !important; }
  main [style*="font-size:86px"], main [style*="font-size:72px"],
  main [style*="font-size:60px"]  { font-size: 30px !important; }
  main [style*="height:480px"], main [style*="height:420px"] { height: 220px !important; }
  .nx-headrow { padding: 12px 20px !important; }
}
