:root {
  --navy: #1d3261;
  --navy-dark: #152442;
  --navy-soft: #45557c;
  --red: #dc1d44;
  --red-dark: #b81939;
  --text-muted: #5c6b82;
  --bg-alt: #f3f5f8;
  --border: #e2e6ee;
  --font-heading: 'Raleway', sans-serif;
  --font-body: 'Karla', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* el header queda fijo: los destinos de ancla se detienen más abajo */
section[id], article[id], div[id] { scroll-margin-top: 96px; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-muted);
  line-height: 1.65;
  background: #fff;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--navy);
  margin: 0 0 0.6em;
  line-height: 1.25;
}

p { margin: 0 0 1em; }

a {
  color: var(--navy);
  text-decoration: none;
}

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

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Top bar */
#top-bar {
  background: var(--navy-dark);
  color: #cfd6e4;
  font-size: 0.85rem;
}

.top-bar-inner {
  display: flex;
  justify-content: flex-end;
  gap: 32px;
  padding: 8px 24px;
}

.top-bar-item .icon { margin-right: 6px; }

/* Header */
#site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}

.brand img { height: 48px; }

#main-nav > ul {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
}

#main-nav > ul > li { position: relative; }

#main-nav a {
  display: block;
  padding: 12px 14px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--navy);
}

#main-nav > ul > li > a:hover,
#main-nav > ul > li > a.active {
  color: var(--red);
}

.caret { font-size: 0.7em; }

#main-nav .dropdown {
  list-style: none;
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 260px;
  margin: 0;
  box-shadow: 0 12px 24px rgba(20, 30, 60, 0.12);
  border-radius: 4px;
  padding: 8px 0;
  border: 1px solid var(--border);
}

#main-nav .has-dropdown:hover .dropdown { display: block; }

.dropdown li a {
  padding: 10px 20px;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  font-size: 0.9rem;
  white-space: nowrap;
}

.dropdown li a:hover {
  background: var(--bg-alt);
  color: var(--red);
}

#nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
}

#nav-toggle span {
  display: block;
  height: 2px;
  background: var(--navy);
}

/* Hero */
#hero {
  position: relative;
  color: #fff;
  overflow: hidden;
}

.hero-media img {
  width: 100%;
  height: 480px;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(20,32,64,0.88) 0%, rgba(20,32,64,0.55) 55%, rgba(20,32,64,0.25) 100%);
}

.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 640px;
}

.hero-content h1 {
  color: #fff;
  font-size: 2.4rem;
  font-weight: 800;
}

.hero-content p {
  color: #e3e7f0;
  font-size: 1.05rem;
  max-width: 520px;
}

/* Banner de páginas internas */
#page-hero {
  position: relative;
  color: #fff;
  background: var(--navy);
  overflow: hidden;
}

.page-hero-media {
  position: absolute;
  inset: 0;
}

.page-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(20,32,64,0.92) 0%, rgba(20,32,64,0.72) 60%, rgba(20,32,64,0.5) 100%);
}

.page-hero-content {
  position: relative;
  padding-top: 84px;
  padding-bottom: 84px;
}

.page-hero-content h1 {
  color: #fff;
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0;
}

/* Bloque de texto + imagen */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.feature-reverse .feature-text { order: 2; }

.feature-text .section-title { margin-bottom: 20px; }

/* marco de proporción fija: la foto se recorta al centro, entre cualquier tamaño */
.feature-media {
  aspect-ratio: 4 / 3;
  border-radius: 6px;
}

/* bloque de categoría dentro de una sección */
.cat { margin-bottom: 72px; }
.cat:last-child { margin-bottom: 0; }

.cat h3 {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

/* galería: con 3 fotos, la primera va ancha arriba */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.gallery .media {
  aspect-ratio: 4 / 3;
  border-radius: 6px;
}

.gallery .media:only-child,
.gallery .media:first-child:nth-last-child(3) {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 9;
}

/* texto que todavía tiene que enviar el cliente */
.pending {
  border: 2px dashed #c3cbd9;
  border-radius: 6px;
  padding: 18px 20px;
  font-size: 0.9rem;
  color: #7b8aa3;
  background: repeating-linear-gradient(45deg, #eef1f6, #eef1f6 12px, #e7ebf2 12px, #e7ebf2 24px);
}

/* listado con flecha, al estilo del sitio de referencia */
.check-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.check-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
}

.check-list li::before {
  content: "\203A";
  position: absolute;
  left: 4px;
  color: var(--red);
  font-weight: 700;
}

/* Contenedor de imagen: si el archivo no está, muestra el nombre esperado */
.media {
  position: relative;
  background: var(--bg-alt);
  overflow: hidden;
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* foto de producto: se muestra entera sobre blanco, sin recortar */
.media-contain {
  background: #fff;
  border: 1px solid var(--border);
}

.media-contain img {
  object-fit: contain;
  padding: 16px;
}

/* tarjeta blanca que envuelve texto + imagen juntos (p. ej. Sobre TS Pharma) */
.feature-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 40px;
}

/* imagen dentro de una feature-card: sin caja ni borde propios, ya está sobre blanco */
.media-plain {
  background: transparent;
}

.media-plain img {
  object-fit: contain;
  padding: 8px;
}

.media.is-missing img { display: none; }

/* variante sin cartel: si falta la imagen queda sólo el fondo de la sección */
.media-quiet { background: transparent; }
.media-quiet.is-missing::after { content: none; }

.media.is-missing::after {
  content: "Imagen pendiente · " attr(data-file);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  font-size: 0.85rem;
  color: #7b8aa3;
  border: 2px dashed #c3cbd9;
  border-radius: 6px;
  background: repeating-linear-gradient(45deg, #eef1f6, #eef1f6 12px, #e7ebf2 12px, #e7ebf2 24px);
}

/* Contacto */
.contact-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: start;
}

.field { margin-bottom: 20px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.field label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--navy);
  margin-bottom: 6px;
}

.field .req { color: var(--red); }

.field input,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--navy);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(29, 50, 97, 0.13);
}

.field textarea {
  min-height: 150px;
  resize: vertical;
}

/* acuse de recibo en pantalla, con la consulta que escribió el usuario */
.form-ok {
  border-left: 4px solid var(--red);
  background: var(--bg-alt);
  border-radius: 6px;
  padding: 28px 32px;
}

.form-ok h3 { margin-bottom: 12px; }

.form-ok blockquote {
  margin: 0 0 16px;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  white-space: pre-wrap;
}

.form-ok p:last-child { margin-bottom: 0; }

.contact-data {
  background: var(--bg-alt);
  border-radius: 6px;
  padding: 32px;
}

.contact-company {
  font-weight: 700;
  color: var(--navy);
}

.contact-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin: 20px 0 2px;
}

.contact-data a:hover { color: var(--red); }

/* Sección sobre fondo azul */
.section-navy {
  background: var(--navy);
  color: #c2cade;
}

.section-navy h2,
.section-navy h3 { color: #fff; }

.eyebrow-light { color: #8fa3c9; }

.closing {
  text-align: center;
  max-width: 640px;
}

.closing h2 { font-size: 1.6rem; }

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  padding: 14px 28px;
  border-radius: 3px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--red);
  color: #fff;
}

.btn-primary:hover { background: var(--red-dark); }

.btn-outline-light {
  border: 2px solid rgba(255,255,255,0.6);
  color: #fff;
}

.btn-outline-light:hover { background: rgba(255,255,255,0.12); }

.btn-outline-dark {
  border: 2px solid var(--navy);
  color: var(--navy);
}

.btn-outline-dark:hover { background: var(--navy); color: #fff; }

/* Intro split */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.split-panel {
  padding: 64px 48px;
}

.panel-dark {
  background: var(--navy);
  color: #cfd6e4;
}

.panel-dark h2 { color: #fff; }
.panel-dark p { color: #c2cade; }

.panel-light {
  background: var(--bg-alt);
  color: var(--text-muted);
}

/* Sections */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }

.eyebrow {
  color: var(--red);
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  margin-bottom: 8px;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 40px;
}

.cards {
  display: grid;
  gap: 32px;
}

.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  padding: 24px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: 0 16px 32px rgba(20,30,60,0.1);
  transform: translateY(-2px);
}

.card-media {
  margin: -24px -24px 20px;
  height: 180px;
  background: var(--bg-alt);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.card p {
  font-size: 0.92rem;
  margin-bottom: 12px;
}

.card a {
  color: var(--red);
  font-weight: 700;
  font-size: 0.85rem;
}

.card-simple { padding: 32px; }

.principle { border-top: 3px solid var(--red); }

/* CTA strip */
#cta-strip {
  background: var(--navy);
  color: #fff;
}

.cta-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  padding: 36px 24px;
  flex-wrap: wrap;
}

.cta-item { text-align: center; }

.cta-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: #9fb0cf;
  margin-bottom: 4px;
}

.cta-item a {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  font-family: var(--font-heading);
}

.cta-divider {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.2);
}

/* Footer */
#site-footer {
  background: var(--navy-dark);
  color: #aab6cc;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  padding: 56px 24px 32px;
}

.footer-brand img {
  height: 40px;
  margin-bottom: 16px;
}

.footer-brand p { margin: 0 0 4px; font-size: 0.9rem; }

.footer-links h4, .footer-contact h4 {
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.footer-links ul, .footer-contact ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li, .footer-contact li { margin-bottom: 10px; }

.footer-links a, .footer-contact a {
  color: #aab6cc;
  font-size: 0.9rem;
}

.footer-links a:hover, .footer-contact a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 18px 0;
  font-size: 0.8rem;
  text-align: center;
  color: #7c8aa8;
}

/* Responsive */
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .cards-3, .cards-2 { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .top-bar-inner { justify-content: center; gap: 20px; }

  .feature {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* la imagen siempre debajo del texto */
  .feature-reverse .feature-text { order: 0; }

  .contact-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; gap: 0; }

  .feature-media { aspect-ratio: 16 / 10; }
}

@media (max-width: 760px) {
  #main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: none;
  }

  #main-nav.open { display: block; }

  #main-nav > ul {
    flex-direction: column;
    padding: 8px 0;
  }

  #main-nav > ul > li > a { padding: 14px 24px; }

  #main-nav .dropdown {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 12px;
    display: none;
  }

  #main-nav .has-dropdown:hover .dropdown { display: none; }

  #main-nav .has-dropdown.open .dropdown { display: block; }

  #nav-toggle { display: flex; }

  .hero-content h1 { font-size: 1.8rem; }

  .page-hero-content {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .page-hero-content h1 { font-size: 1.7rem; }

  /* en mobile el contenido dicta la altura y la imagen queda de fondo */
  .hero-media {
    position: absolute;
    inset: 0;
  }

  .hero-media img { height: 100%; }

  .hero-content {
    position: relative;
    padding-top: 56px;
    padding-bottom: 56px;
  }
}
