@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&family=Josefin+Sans:wght@400;600;700&family=Open+Sans:wght@400;700&display=swap');

:root {
  --color-primary: #0d57a4;
  --color-navy: #083b76;
  --color-accent: #ffd200;
  --color-text: #464646;
  --color-bg: #ffffff;
  --font-body: 'Nunito', sans-serif;
  --font-heading: 'Josefin Sans', sans-serif;
}

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

body {
  font-family: var(--font-body);
  color: var(--color-text);
  line-height: 1.6;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 40px;
}

h1, h2, h3 {
  font-family: var(--font-heading);
}

a {
  text-decoration: none;
  color: inherit;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 4px;
  font-weight: 700;
  transition: background 0.2s ease;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-primary);
}

.btn-primary:hover {
  background: #e6bd00;
}

/* Fixed header wrapper (top-bar + header stay pinned together) */
.fixed-header-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 101;
}

/* Top utility bar (language flag) */
.top-bar {
  background: #f2f2f2;
  border-bottom: 1px solid #e6e6e6;
}

.top-bar-inner {
  display: flex;
  justify-content: flex-end;
  padding: 6px 0;
}

.lang-switcher {
  position: relative;
}

.lang-current {
  display: flex;
  align-items: center;
  background: #e6e6e6;
  border: 1px solid #dadada;
  cursor: pointer;
  padding: 2px 4px;
}

.lang-current img {
  width: 24px;
  height: 26px;
  display: block;
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  z-index: 200;
}

.lang-switcher.open .lang-dropdown {
  display: block;
}

.lang-option {
  display: block;
  padding: 2px 4px;
  border: 1px solid #dadada;
  border-top: none;
  background: #e6e6e6;
  transition: background 0.15s ease;
}

.lang-option:hover {
  background: #d5d5d5;
}

.lang-option img {
  width: 24px;
  height: 26px;
  display: block;
}

.lang-option .lang-name {
  display: none;
}

/* Header */
.site-header {
  position: relative;
  background: #fff;
  border-bottom: 3px solid var(--color-accent);
}

.site-header .container.header-inner,
.top-bar .container.top-bar-inner {
  max-width: none;
  padding-left: 20px;
  padding-right: 20px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 95px;
}

.logo-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.logo-long {
  height: 82px;
  display: block;
}

.main-nav ul {
  display: flex;
  list-style: none;
  align-items: center;
  height: 28.59px;
}

.main-nav li:not(:last-child)::after {
  content: '|';
  color: #d6134e;
  margin: 0 4px;
}

.main-nav a {
  position: relative;
  padding: 14px 12px 3px;
  font-family: 'Nunito', 'Nunito Fallback', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.main-nav a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transform: translateX(-50%);
  transition: width 0.25s ease;
}

.main-nav a.active,
.main-nav a:hover {
  color: var(--color-primary);
  font-weight: 700;
}

.main-nav a.active::after,
.main-nav a:hover::after {
  width: 100%;
}

.header-social {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.social-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.social-icon svg {
  width: 55%;
  height: 55%;
  fill: currentColor;
}

.social-icon.fb { background: transparent; }
.social-icon.fb svg { width: 100%; height: 100%; }
.social-icon.tw { background: #0f1419; }
.social-icon.ig { background: transparent; }
.social-icon.ig svg { width: 100%; height: 100%; }
.social-icon.gmb { background: transparent; }
.social-icon.gmb svg { width: 100%; height: 100%; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger span {
  width: 26px;
  height: 3px;
  background: var(--color-primary);
}

/* Hero - sliding carousel (photos carry their own promo text/design) */
.hero {
  position: relative;
  /* Las imágenes son banners anchos (~1350x620); mantener esa proporción, pero limitar la altura (como en el sitio original) para que no se vea gigante en pantallas anchas */
  width: 100%;
  aspect-ratio: 1350 / 620;
  max-height: 575px;
  background: var(--color-navy);
  overflow: hidden;
}

.hero-slides {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

/* La transición se activa solo después del primer render (clase 'ready' vía JS),
   así al cargar/refrescar se ve una sola foto y desde ahí empieza el efecto */
.hero-slides.ready .hero-slide {
  transition: transform 1s ease-in-out;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 1;
}

/* Solid-color bar with the quote, sits below the hero photo */
.hero-quote-bar {
  background: var(--color-primary);
  height: 77px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  text-align: center;
}

.hero-quote {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2.2vw, 1.4rem);
  max-width: 900px;
  margin: 0 auto;
  color: #fff;
}

/* Inicio: el slide se queda fijo y el contenido lo va tapando al hacer scroll */
.home-hero-fixed {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1;
}


.home-content-wrap {
  position: relative;
  z-index: 2;
  background: var(--color-bg);
}

/* Intro teaser: Quiénes somos / Productos */
.intro-teaser {
  padding: 80px 40px;
  background-color: rgba(233, 230, 230, 0.8);
}

.intro-teaser .container,
.certs-social .container,
.qs-contact .container {
  max-width: 960px;
}

.teaser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 50px;
}

.teaser-circle {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 20px;
}

.teaser-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.teaser-circle:hover img {
  transform: translateY(-8px);
}

.teaser-col h3 {
  color: var(--color-primary);
  font-family: 'Josefin Sans', 'Josefin Sans Fallback';
  font-size: 20px;
  margin-bottom: 12px;
  text-align: center;
}

.teaser-col p {
  width: 460px;
  max-width: 100%;
  margin: 0 auto 10px;
  font-size: 14px;
  line-height: normal;
  text-align: left;
  font-family: 'Open Sans', sans-serif;
}

.teaser-col .more-info-link {
  display: block;
  width: 460px;
  max-width: 100%;
  margin: 0 auto;
  text-align: right;
  color: #ff0000;
  font-weight: 700;
  font-size: 14px;
  font-family: 'Open Sans', sans-serif;
}

/* Certifications + social row */
.certs-social {
  padding: 55px 0;
  background: var(--color-navy);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.certs-social.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.certs-social-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.certs-logo img {
  max-width: 480px;
}

.certs-logo {
  margin-left: -20px;
}

.social-row {
  display: flex;
  gap: 14px;
}

.social-row a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.social-row a svg {
  width: 55%;
  height: 55%;
  fill: currentColor;
}

.social-row a.fb { background: transparent; }
.social-row a.fb svg { width: 100%; height: 100%; }
.social-row a.tw { background: #0f1419; }
.social-row a.ig { background: transparent; }
.social-row a.ig svg { width: 100%; height: 100%; }

.social-row a.waze {
  overflow: hidden;
}

.social-row a.waze img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Scroll-to-top row, own darker navy strip below the blue certs/contact sections */
.scroll-top-row {
  background: #063c74;
  padding: 6px 40px;
  text-align: center;
}

.scroll-top-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  color: #fff;
}

.scroll-top-btn svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.scroll-top-btn:hover {
  color: rgb(203, 203, 203);
}

/* Inner pages (stubs) */
.inner-page {
  padding: 80px 0;
  min-height: 40vh;
}

.inner-page h1 {
  color: var(--color-primary);
  margin-bottom: 20px;
}

/* Page title bar (inner pages) */
.page-title-bar {
  padding: 30px 0;
}

.page-title-bar .container {
  display: flex;
  align-items: center;
  gap: 20px;
}

.page-title-line {
  flex: 1;
  height: 1px;
  background: rgba(184,184,184,0.4);
}

.page-title {
  color: #b8b8b8;
  font-weight: 400;
  font-size: 1.6rem;
  white-space: nowrap;
}

/* Quiénes somos - intro (imagen + texto) */
.qs-intro {
  padding: 40px 0 60px;
  overflow: hidden;
}

.qs-intro .container {
  max-width: 960px;
}

.qs-intro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 50px;
  align-items: center;
}

.qs-intro-img img {
  width: 100%;
  height: auto;
  display: block;
}

.qs-intro-img {
  opacity: 0;
  transform: translateX(-500px);
  transition: opacity 1.1s ease-out, transform 1.1s ease-out;
}

.qs-intro-text {
  opacity: 0;
  transform: translateX(500px);
  transition: opacity 1.1s ease-out, transform 1.1s ease-out;
}

.qs-intro-img.is-visible,
.qs-intro-text.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.qs-intro-text h2 {
  color: #04568c;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin-bottom: 16px;
}

.qs-intro-text p {
  font-family: 'Open Sans', sans-serif;
}

/* Historia / Visión / Misión — efecto de fondo fijo (como el original) */
.qs-hvm {
  position: relative;
  padding: 140px 0;
  background-color: rgba(245, 244, 244, 1);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  overflow: hidden;
}

.qs-hvm-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(1.5px);
}

.qs-hvm .container {
  position: relative;
  z-index: 2;
  max-width: 960px;
}

.qs-hvm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.qs-hvm-col {
  background-color: rgba(255, 255, 255, 0.8);
  padding: 24px;
  text-align: center;
  box-shadow: rgba(0, 0, 0, 0.25) 0 3px 11px 0;
}

.qs-hvm-col h3 {
  color: #04568c;
  font-family: 'Josefin Sans', 'Josefin Sans Fallback';
  font-size: clamp(1.3rem, 3vw, 1.5rem);
  margin-bottom: 12px;
}

.qs-hvm-col p {
  font-family: 'Open Sans', 'Open Sans Fallback';
  margin-bottom: 16px;
}

.leer-mas {
  color: #9e0521;
  font-weight: 700;
}

.qs-divider {
  border: none;
  min-height: 2px;
  width: 40px;
  margin-left: auto;
  margin-right: auto;
  background: grey;
}

/* Productos - banner "Mobiliario" (banner delgado; cover llena el ancho sin bordes, recortando un poco arriba/abajo) */
.prod-banner {
  aspect-ratio: 1907 / 230;
  background: var(--color-primary) url('../assets/mobiliario-banner.webp') center/cover no-repeat;
}

/* Productos - galería de catálogos */
.prod-catalogs {
  padding: 30px 0 40px;
}

.prod-catalogs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 960px;
  margin: 0 auto;
}

.catalog-card {
  position: relative;
  display: block;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateY(80px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.catalog-card:nth-child(2) {
  transition-delay: 0.15s;
}

.catalog-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.catalog-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.catalog-card:hover img {
  transform: scale(1.08);
}

/* Contáctenos */
.ct-hero {
  position: relative;
  min-height: 220px;
  background: var(--color-primary) url('../assets/banner1.jpg') center/cover no-repeat;
}

.ct-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.37);
}

.ct-heading {
  background: var(--color-primary);
  color: #fff;
  padding: 40px 0;
  text-align: center;
}

.ct-heading h2 {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 400;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  margin-bottom: 20px;
}

.social-row-center {
  justify-content: center;
}

.ct-form-section {
  padding: 40px 0;
}

.ct-form-intro {
  text-align: center;
  margin-bottom: 24px;
  color: #000;
  font-size: 1rem;
}

.ct-form {
  max-width: 680px;
  margin: 0 auto;
}

.ct-field {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.ct-field label {
  flex: 0 0 90px;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--color-text);
}

.ct-field input,
.ct-field select {
  box-sizing: border-box;
  width: 554.88px;
  height: 40px;
  max-width: 100%;
  padding: 9px 12px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.9rem;
}

.ct-field textarea {
  box-sizing: border-box;
  width: 554.8px;
  max-width: 100%;
  padding: 9px 12px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.9rem;
  resize: vertical;
}

.ct-submit {
  text-align: center;
}

.ct-submit button {
  background: #e10600;
  color: #fff;
  border: none;
  width: 280px;
  padding: 11px 36px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.05em;
}

.ct-submit button:hover {
  background: #b80500;
}

.ct-form-success {
  margin-top: 20px;
  text-align: center;
  color: #0a7a2f;
  font-weight: 700;
}

.ct-map iframe {
  display: block;
}

/* Custom Plastic Injection Molding */
.cpim {
  padding: 50px 0 60px;
  background-color: rgba(236, 235, 235, 1);
}

.cpim .container {
  max-width: 960px;
}

.cpim-title {
  color: var(--color-primary);
  font-family: 'Nunito', 'Nunito Fallback', sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 4vw, 30px);
  margin-bottom: 24px;
  text-align: center;
}

.cpim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.cpim-col {
  font-family: 'Nunito', 'Nunito Fallback', sans-serif;
}

.cpim-col p {
  margin-bottom: 14px;
  text-align: left;
}

/* Líneas en blanco como en el original (dmNewParagraph con <br>) */
.cpim-col p.cpim-space {
  margin-bottom: 0;
}

/* Fila de contacto (fondo azul) */
.qs-contact {
  background: var(--color-navy);
  color: #fff;
  padding: 50px 0;
}

.qs-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.qs-contact-text {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.95rem;
}

.qs-contact-text a {
  color: #c7e4ff;
}

.qs-contact-logo {
  text-align: center;
}

.qs-contact-logo img {
  max-width: 100%;
  height: auto;
}

/* Footer bottom bar (dark) */
.site-footer {
  background: #1f1f1f;
  color: #fff;
  padding: 38px 0;
}

.site-footer .container {
  max-width: none;
  padding-left: 20px;
  padding-right: 20px;
}

.footer-copy {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-legal-link {
  text-decoration: underline;
}

/* Responsive: tablet */
@media (max-width: 1024px) {
  .container { padding: 0 24px; }
  .header-inner { gap: 12px; }
  .teaser-grid { gap: 30px; }
  .qs-hvm-grid { gap: 16px; }

  /* Menú a hamburguesa desde tablet: el ítem "CUSTOM PLASTIC INJECTION MOLDING"
     es demasiado largo y se corta en el menú horizontal a estos anchos. */
  .header-social { display: none; }
  .hamburger { display: flex; }
  .main-nav { display: none; }
  .main-nav.open {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 8px 12px rgba(0,0,0,0.12);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    z-index: 50;
  }
  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    height: auto;
  }
  .main-nav li:not(:last-child)::after { content: none; }
  .main-nav li { border-bottom: 1px solid #eee; }
  .main-nav a {
    display: block;
    padding: 14px 20px;
    min-height: 44px;
    white-space: normal;
  }
  .main-nav a::after { display: none; }
}

/* Responsive: mobile */
@media (max-width: 767px) {
  .container { padding: 0 16px; }

  /* Header */
  .site-header .container.header-inner,
  .top-bar .container.top-bar-inner { padding-left: 16px; padding-right: 16px; }
  .header-inner { height: 64px; gap: 10px; }
  .logo-long { height: 46px; }
  .header-social { display: none; }
  .hamburger { display: flex; }

  /* Menú desplegable a pantalla completa */
  .main-nav { display: none; }
  .main-nav.open {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 8px 12px rgba(0,0,0,0.12);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }
  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    height: auto;
  }
  .main-nav li:not(:last-child)::after { content: none; }
  .main-nav li { border-bottom: 1px solid #eee; }
  .main-nav a {
    display: block;
    padding: 14px 20px;
    white-space: normal;
  }
  .main-nav a::after { display: none; }

  /* Hero: dejar que mande el aspect-ratio para mostrar el banner completo
     (con su texto incrustado a la izquierda) sin recortar los lados. */
  .hero { min-height: 0; }
  .hero-quote-bar { height: auto; min-height: 56px; padding: 10px 16px; }

  /* Quiénes somos / Productos (teaser) */
  .intro-teaser { padding: 40px 20px; }
  .teaser-grid { gap: 36px; }
  .teaser-circle { width: 160px; height: 160px; }

  /* Certificaciones + redes */
  .certs-social-grid { justify-content: center; text-align: center; }
  .certs-logo { margin-left: 0; }
  .certs-logo img { max-width: 100%; }

  /* Grids a una columna */
  .qs-intro-grid,
  .qs-hvm-grid,
  .qs-contact-grid,
  .prod-catalogs-grid,
  .cpim-grid { grid-template-columns: 1fr; }
  .teaser-col p { width: 100%; max-width: 440px; }

  /* Productos: banner "Mobiliario" muy panorámico; en móvil llenar el banner
     (cover) anclando a la izquierda para mostrar "Mobiliario" sobre las sillas,
     sin franjas azules. Se recorta la parte derecha (mesas/jardín). */
  .prod-banner {
    aspect-ratio: auto;
    min-height: 140px;
    background-size: cover;
    background-position: left center;
  }

  /* La animación de deslizar desde los lados (translateX ±500px) empuja el
     contenido fuera de la pantalla en móvil; el IntersectionObserver nunca lo
     detecta y queda invisible (espacio en blanco). Mostrarlo siempre. */
  .qs-intro-img,
  .qs-intro-text {
    opacity: 1;
    transform: none;
    transition: none;
  }

  /* Quiénes somos: intro y Historia/Visión/Misión */
  .qs-hvm { padding: 50px 0; }
  .qs-hvm-grid { gap: 20px; }

  /* Contáctenos: el formulario apila la etiqueta sobre el campo */
  .ct-field {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .ct-field label { flex: none; }
  .ct-submit button { width: 100%; max-width: 280px; }

  /* Touch targets ≥44px: enlaces del menú, iconos sociales y opción de idioma */
  .main-nav a { padding: 14px 20px; min-height: 44px; }
  .social-row a { width: 48px; height: 48px; }
  .lang-current,
  .lang-option { padding: 6px 8px; }
  .lang-current img,
  .lang-option img { width: 30px; height: 32px; }

  /* Footer */
  .footer-copy { flex-wrap: wrap; }
}

/* En dispositivos táctiles (móviles/tablets), background-attachment:fixed no
   funciona bien (iOS/Safari lo ignora o descuadra). Usar scroll anclado a la sección. */
@media (hover: none) {
  .qs-hvm {
    background-attachment: scroll;
  }
}

/* Accesibilidad: respetar la preferencia de movimiento reducido.
   Muestra las secciones ya reveladas y atenúa animaciones/transiciones. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  /* Evita que elementos con reveal por scroll queden invisibles */
  .certs-social,
  .qs-intro-img,
  .qs-intro-text,
  .catalog-card {
    opacity: 1 !important;
    transform: none !important;
  }
}
