/* ==========================================================================
   STQ S.A. - Landing Page Corporativa
   ========================================================================== */

/* 1. VARIABLES (SISTEMA DE DISEÑO)
   ========================================================================== */
:root {
  /* Paleta Cromática */
  --color-white: #FFFFFF;
  --color-text-main: #6D6E71;
  --color-text-dark: #3A3A3A;
  --color-bg-alt: #F4F6F7;
  --color-footer: #1F2A30;

  --color-primary: #1787A8;
  --color-tech-blue: #0F5F78;
  --color-tech-blue-hover: #0C4C61;
  --color-support-green: #6BAE3F;
  --color-border: #E5E7E9;

  /* Tipografía */
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Sistema de Espaciado (múltiplos de 8) */
  --space-8: 8px;
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-56: 56px;
  --space-64: 64px;
  --space-72: 72px;
  --space-96: 96px;

  /* Layout y Grid */
  --container-max-width: 1200px;
  --container-padding: var(--space-24);
  --grid-gutter: var(--space-24);

  /* Borders & Shadows */
  --radius-btn: 6px;
  --radius-card: 8px;
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.08);

  /* Breakpoints:
     Mobile: 360px+
     Tablet: 768px+
     Desktop: 1024px+
     Desktop Lg: 1440px+
  */

  /* Espaciado de Sección Dinámico */
  --section-padding-y: var(--space-56);
}

@media (min-width: 768px) {
  :root {
    --section-padding-y: var(--space-72);
  }
}

@media (min-width: 1024px) {
  :root {
    --section-padding-y: var(--space-96);
  }
}

/* 2. RESET Y BASE
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-main);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  width: 60vw;
  height: 60vw;
  background-image: url('../assets/img/logo_isotipo.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.08;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: -1;
}

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

ul,
ol {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

/* 3. TIPOGRAFÍA
   ========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  color: var(--color-text-dark);
  margin-bottom: var(--space-16);
}

h1 {
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1.2;
  font-weight: 700;
  /* Bold */
}

h2 {
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.25;
  font-weight: 600;
  /* SemiBold */
}

h3 {
  font-size: clamp(18px, 3vw, 22px);
  line-height: 1.35;
  font-weight: 600;
  /* SemiBold */
}

.text-large {
  font-size: 18px;
  line-height: 1.6;
}

.text-small {
  font-size: 14px;
  line-height: 1.5;
}

p {
  margin-bottom: var(--space-16);
}

p:last-child {
  margin-bottom: 0;
}

/* 4. LAYOUT / GRID
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* Grid System - Mobile First */
.grid {
  display: grid;
  gap: var(--grid-gutter);
  grid-template-columns: repeat(4, 1fr);
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(8, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(12, 1fr);
  }
}

/* Utilidad para spans de columnas (ejemplo simple, estructurado directo en las clases o usando CSS Grid areas) */
.grid-col-12 {
  grid-column: span 4;
}

.grid-col-6 {
  grid-column: span 4;
}

.grid-col-4 {
  grid-column: span 4;
}

.grid-col-3 {
  grid-column: span 4;
}

@media (min-width: 768px) {
  .grid-col-12 {
    grid-column: span 8;
  }

  .grid-col-6 {
    grid-column: span 4;
  }

  .grid-col-4 {
    grid-column: span 4;
  }

  /* 2 cols out of 8 isn't ideal for 3 items, usually use auto-fit */
  .grid-col-3 {
    grid-column: span 2;
  }
}

@media (min-width: 1024px) {
  .grid-col-12 {
    grid-column: span 12;
  }

  .grid-col-6 {
    grid-column: span 6;
  }

  .grid-col-4 {
    grid-column: span 4;
  }

  .grid-col-3 {
    grid-column: span 3;
  }
}

/* Layout utilities */
.section {
  padding-top: var(--section-padding-y);
  padding-bottom: var(--section-padding-y);
}

.section--bg-alt {
  background-color: var(--color-bg-alt);
}

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

.section-header {
  margin-bottom: var(--space-48);
}

/* 5. COMPONENTES
   ========================================================================== */

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 48px;
  padding: 14px 32px;
  border-radius: var(--radius-btn);
  border: none;
  font-size: 16px;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn--primary {
  background-color: var(--color-tech-blue);
  color: var(--color-white);
}

.btn--primary:hover,
.btn--primary:active {
  background-color: var(--color-tech-blue-hover);
}

.btn--secondary {
  background-color: transparent;
  color: var(--color-text-dark);
  border: 1.5px solid var(--color-text-dark);
}

.btn--secondary:hover,
.btn--secondary:active {
  background-color: #EFEFEF;
}

.btn--technical {
  position: relative;
  overflow: hidden;
  background-color: transparent;
  color: var(--color-tech-blue);
  padding: 8px 16px;
  min-height: auto;
}

.btn--technical::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 16px;
  right: 16px;
  height: 1px;
  background-color: var(--color-primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.btn--technical:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.btn--technical:hover,
.btn--technical:active {
  color: var(--color-primary);
  background-color: rgba(23, 135, 168, 0.05);
}

.btn-group {
  display: flex;
  gap: var(--space-16);
  flex-wrap: wrap;
}

.btn-group--center {
  justify-content: center;
}

/* Tarjetas (Cards) */
.card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: var(--space-24);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
}

.card__icon {
  margin-bottom: var(--space-16);
  color: var(--color-primary);
}

.card__icon svg {
  width: 40px;
  height: 40px;
  stroke-width: 1.5;
}

.card__title {
  margin-bottom: var(--space-8);
  font-size: 20px;
}

.card__desc {
  color: var(--color-text-main);
  font-size: 14px;
  flex-grow: 1;
}

/* Image Placeholders en tarjetas */
.card__img-placeholder,
.card__img-container {
  width: 100%;
  height: 200px;
  background-color: #EFEFEF;
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-16);
  color: #999;
  font-size: 14px;
  border: 1px dashed #CCC;
  overflow: hidden;
  /* Asegurar que la imagen no desborde el radio */
}

.card__img-container {
  border-style: solid;
  /* Borde sólido para contenedores con imagen real */
  border-color: var(--color-border);
}

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

.card:hover .card__image {
  transform: scale(1.05);
  /* Sutil micro-interacción técnica */
}

/* Lista de productos interior de la tarjeta */
.product-group {
  margin-bottom: var(--space-16);
}

.product-group__title {
  font-size: 14px;
  color: var(--color-text-dark);
  font-weight: 600;
  margin-bottom: var(--space-8);
}

.product-group__list {
  list-style-type: none;
  padding-left: 0;
}

.product-group__list li {
  position: relative;
  padding-left: 16px;
  font-size: 14px;
  color: var(--color-text-main);
  margin-bottom: 4px;
}

.product-group__list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--color-primary);
}

.product-group__list li a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.header.is-scrolled {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 120px;
  transition: height 0.3s ease;
}

.header.is-scrolled .nav {
  height: 80px;
}

.nav__brand-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 24px;
  color: var(--color-tech-blue);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  min-width: 0;
}

@media (min-width: 768px) {
  .nav__brand-logo {
    gap: 16px;
  }
}

.nav__brand-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-tech-blue);
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
  display: none;
}

@media (min-width: 480px) {
  .nav__brand-name {
    font-size: 13px;
    display: none;
  }
}

@media (min-width: 768px) {
  .nav__brand-name {
    display: block;
    font-size: 15px;
  }
}

@media (min-width: 1024px) {
  .nav__brand-name {
    font-size: 18px;
  }
}

.nav__brand-logo img {
  height: 80px;
  width: auto;
  transition: transform 0.3s ease;
}

@media (min-width: 768px) {
  .nav__brand-logo img {
    height: 96px;
  }
}

.header.is-scrolled .nav__brand-logo img {
  transform: scale(0.85);
}

/* Navegación Desktop */
.nav__list {
  display: none;
}

@media (min-width: 1024px) {
  .nav__list {
    display: flex;
    gap: var(--space-32);
    align-items: center;
  }

  .nav__item a {
    color: var(--color-text-dark);
    font-weight: 500;
    font-size: 15px;
  }

  .nav__item a:hover {
    color: var(--color-primary);
  }
}

/* Menú Móvil */
.nav__toggle {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--color-text-dark);
}

@media (min-width: 1024px) {
  .nav__toggle {
    display: none;
  }
}

.mobile-menu {
  position: fixed;
  top: 80px;
  left: 0;
  width: 100%;
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-24);
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 99;
}

.header.is-scrolled .mobile-menu {
  top: 80px;
}

/* 6. TECHNICAL PAGE LAYOUT
   ========================================================================== */
.tech-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-48);
}

@media (min-width: 1024px) {
  .tech-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 64px;
  }

  .tech-content {
    flex: 1;
    min-width: 0;
  }

  .side-gallery {
    width: 320px;
    flex-shrink: 0;
  }
}

.side-gallery__sticky {
  position: sticky;
  top: 140px;
}

.side-gallery__title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-dark);
  margin-bottom: var(--space-16);
  padding-bottom: var(--space-8);
  border-bottom: 2px solid var(--color-tech-blue);
  letter-spacing: 0.5px;
}

.side-gallery__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (max-width: 1023px) {
  .side-gallery__grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

.side-gallery__img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.side-gallery__img:hover {
  transform: scale(1.04);
  z-index: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 7. SECCIONES ESPECÍFICAS
   ========================================================================== */

/* Hero */
.hero {
  min-height: 75vh;
  display: flex;
  align-items: center;
  padding-top: calc(80px + var(--section-padding-y));
  /* Offset por el mheader fijo */
  padding-bottom: var(--section-padding-y);
  background-color: var(--color-white);
  text-align: center;
}

.hero__content {
  max-width: 800px;
  margin: 0 auto;
}

.hero__subtitle {
  color: var(--color-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 14px;
  margin-bottom: var(--space-16);
  display: block;
}

.hero p {
  margin-bottom: var(--space-32);
}

/* About Overlay */
.about__grid {
  align-items: center;
}

/* Featured Product */
.featured-product__grid {
  align-items: center;
}

.featured-product__content {
  padding-right: var(--space-24);
}

.featured-product__image {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: var(--space-48);
  text-align: center;
}

/* Products Line */
.products__list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--grid-gutter);
}

@media (min-width: 768px) {
  .products__list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .products__list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Cobertura / CTA Final */
.cta-final {
  position: relative;
  background-color: var(--color-footer);
  background-image: url('../resources/img/mapa.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-blend-mode: luminosity;
  color: var(--color-white);
  text-align: center;
}

.cta-final::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(31, 42, 48, 0.95);
  /* Capa de contraste con el color-footer */
  z-index: 1;
}

.cta-final .container {
  position: relative;
  z-index: 2;
}

/* Footer */
.footer {
  background-color: var(--color-footer);
  color: #A0AAB2;
  padding-top: var(--space-64);
  padding-bottom: var(--space-24);
}

.footer h3 {
  color: var(--color-white);
  font-size: 18px;
  margin-bottom: var(--space-24);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-48);
  margin-bottom: var(--space-48);
}

@media (min-width: 768px) {
  .footer__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer__links li {
  margin-bottom: var(--space-8);
}

.footer__links a:hover {
  color: var(--color-white);
}

.footer__bottom {
  text-align: center;
  padding-top: var(--space-24);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
}

/* 7. ANIMACIONES
   ========================================================================== */

/* Fade-In Up (Reveal on Scroll) */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}

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

/* Stagger delay para grids */