/* ==============================================================
   CODESIGN PROJECTS — productos.html migrado al sistema visual
   del index/servicios.html: mismo nav/footer, más modo claro/
   oscuro. La sección "Líneas de desarrollo" usa sus propias
   variables --n-* (ya existían) para no arriesgar su estilo;
   solo se sobreescriben en modo oscuro más abajo.
================================================================= */

* { 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;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

/* ==============================
   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); }

/* ==============================
   BOTONES
============================== */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  padding: 0.85rem 1.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.btn.primary { background: var(--text); color: var(--surface); }
.btn.primary:hover { background: var(--orange); color: #fff; }
.btn.ghost { border-color: var(--text); color: var(--text); }
.btn.ghost:hover { border-color: var(--orange); color: var(--orange); }

/* ==============================
   LÍNEAS DE DESARROLLO
   (variables propias --n-*, para no arriesgar el estilo ya
   probado; se sobreescriben en modo oscuro más abajo)
============================== */
.new-lines {
  --n-ink: #1c1a1f;
  --n-ink-soft: #57525c;
  --n-ink-faint: #8b8690;
  --n-paper: #ffffff;
  --n-paper-warm: #f6f3ec;
  --n-line: #e6e0d2;
  --n-orange: #e2531e;
  --n-khaki: #a4906a;

  font-family: "Inter", "Helvetica Neue", sans-serif;
  color: var(--n-ink);
  background: var(--n-paper);
  padding: 5rem 0 6rem;
  transition: background-color 0.25s ease;
}

:root[data-theme="dark"] .new-lines {
  --n-ink: #f2efe9;
  --n-ink-soft: #c7c2cb;
  --n-ink-faint: #948e9a;
  --n-paper: #17151b;
  --n-paper-warm: #221f27;
  --n-line: rgba(255, 255, 255, 0.12);
  --n-khaki: #bda87f;
}

.new-lines .wrap { max-width: 1200px; margin: auto; padding: 0 2rem; }

.new-lines .divider-label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--n-ink-faint);
  margin-bottom: 0.6rem;
}

.new-lines .eyebrow {
  display: inline-block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--n-orange);
  margin-bottom: 1rem;
}

.new-lines .section-head { max-width: 640px; margin-bottom: 1rem; }

.new-lines .section-head h2 {
  font-family: "Space Grotesk", "Helvetica Neue", sans-serif;
  font-weight: 600;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
}

.new-lines .section-head p { color: var(--n-ink-soft); font-size: 1rem; max-width: 54ch; }

/* LÍNEAS */
.new-lines .line-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: center;
  padding: 3.2rem 0;
  border-top: 1px solid var(--n-line);
}
.new-lines .line-row:last-child { border-bottom: 1px solid var(--n-line); }

.new-lines .line-row.reverse .line-media { order: 2; }
.new-lines .line-row.reverse .line-text { order: 1; }

.new-lines .line-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 3px;
  border: 1px solid var(--n-line);
  background: var(--n-paper-warm);
}

.new-lines .line-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: grayscale(85%) contrast(1.03);
  transition: filter 0.4s ease, transform 0.5s ease;
}
.new-lines .line-media img.pos-top { object-position: center top; }
.new-lines .line-row:hover .line-media img { filter: grayscale(0%) contrast(1); transform: scale(1.03); }

.new-lines .line-num {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--n-orange);
  margin-bottom: 0.8rem;
  display: block;
}

.new-lines .line-text h3 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1.55rem;
  margin-bottom: 0.7rem;
}

.new-lines .line-text > p { color: var(--n-ink-soft); margin-bottom: 1.6rem; max-width: 46ch; }

.new-lines .line-product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  border-top: 1px solid var(--n-line);
  padding-top: 1.2rem;
}

.new-lines .line-product-name {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1rem;
}

.new-lines .line-status {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--n-khaki);
}
.new-lines .line-status::before { content: "●"; color: var(--n-orange); margin-right: 0.4rem; font-size: 0.6rem; }

.new-lines .line-link {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  text-decoration: none;
  color: var(--n-ink);
  border-bottom: 1px solid var(--n-ink);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.new-lines .line-link:hover { color: var(--n-orange); border-color: var(--n-orange); }

/* ==============================
   FOOTER — siempre oscuro (no sigue el tema),
   igual que en las demás páginas del sitio.
============================== */
.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: 700px) {
  .new-lines .line-row,
  .new-lines .line-row.reverse { grid-template-columns: 1fr; gap: 1.6rem; }
  .new-lines .line-row.reverse .line-media,
  .new-lines .line-row.reverse .line-text { order: initial; }
}

@media (max-width: 768px) {
  body { padding-top: 68px; }

  .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; }
}
