/* ==========================================
   INGENR Layout — layout.css
   Containers, Grid, Sections, Page Structure
   ========================================== */

/* ===== CONTAINERS ===== */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-8);
}

.container--wide {
  max-width: var(--container-2xl);
}

.container--narrow {
  max-width: var(--container-md);
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-5);
  }
}

/* ===== SECTIONS ===== */
.section {
  padding: var(--space-24) 0;
  position: relative;
}

.section--sm {
  padding: var(--space-16) 0;
}

.section--lg {
  padding: var(--space-32) 0;
}

.section--surface {
  background: var(--surface-glass);
  border-top: var(--border-subtle);
  border-bottom: var(--border-subtle);
}

.section--dark {
  background: var(--surface-dark);
}

.section--gradient {
  background: linear-gradient(
    180deg,
    var(--primary-bg) 0%,
    var(--primary-bg-light) 50%,
    var(--primary-bg) 100%
  );
}

.section__header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--space-12);
}

.section__header h2 {
  margin-bottom: var(--space-4);
}

.section__header p {
  margin: 0 auto;
  font-size: var(--text-lg);
  color: var(--text-muted);
}

/* ===== HERO SECTION ===== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: var(--navbar-height);
}

.hero__video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: var(--z-behind);
}

.hero__canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-behind);
}

.hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(10, 25, 47, 0.3) 0%,
    rgba(10, 25, 47, 0.6) 60%,
    var(--primary-bg) 100%
  );
  z-index: 0;
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 860px;
  padding: var(--space-8);
}

.hero__label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--accent-light);
  border: 1px solid rgba(200, 134, 46, 0.2);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--accent);
  margin-bottom: var(--space-6);
}

.hero__label svg {
  width: 16px;
  height: 16px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
}

.hero__title {
  font-size: var(--text-7xl);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: var(--space-6);
  color: var(--text-primary);
}

.hero__title .accent {
  color: var(--accent);
}

.hero__subtitle {
  font-size: var(--text-xl);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto var(--space-8);
  line-height: var(--leading-relaxed);
}

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.hero__scroll-indicator {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  animation: float 2.5s ease-in-out infinite;
}

.hero__scroll-indicator svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
}

@media (max-width: 1024px) {
  .hero__title {
    font-size: var(--text-5xl);
  }
}

@media (max-width: 768px) {
  .hero {
    min-height: 90vh;
    min-height: 90dvh;
  }

  .hero__title {
    font-size: var(--text-4xl);
  }

  .hero__subtitle {
    font-size: var(--text-base);
  }
}

@media (max-width: 480px) {
  .hero__title {
    font-size: var(--text-3xl);
  }

  .hero__actions {
    flex-direction: column;
  }

  .hero__actions .btn {
    width: 100%;
  }
}

/* ===== GRIDS ===== */
.grid {
  display: grid;
  gap: var(--space-6);
}

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

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

.grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

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

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

@media (max-width: 768px) {
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }
}

/* ===== SPLIT LAYOUT (Contact page) ===== */
.split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: start;
}

.split-layout__content {
  padding-right: var(--space-8);
}

.split-layout__form {
  background: var(--surface-dark);
  border: var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
}

@media (max-width: 1024px) {
  .split-layout {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .split-layout__content {
    padding-right: 0;
  }
}

@media (max-width: 480px) {
  .split-layout__form {
    padding: var(--space-6);
  }
}

/* ===== HORIZONTAL SCROLL CONTAINER ===== */
.horizontal-scroll-section {
  position: relative;
  overflow: hidden;
}

.horizontal-scroll-container {
  display: flex;
  flex-wrap: nowrap;
  width: 400%;
}

.horizontal-scroll-panel {
  width: 100vw;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-8);
  position: relative;
}

.horizontal-scroll-panel__number {
  font-family: var(--font-heading);
  font-size: 8rem;
  font-weight: 800;
  color: rgba(200, 134, 46, 0.08);
  position: absolute;
  top: var(--space-8);
  left: var(--space-8);
  line-height: 1;
  user-select: none;
}

.horizontal-scroll-panel__icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xl);
  background: var(--accent-light);
  margin-bottom: var(--space-6);
}

.horizontal-scroll-panel__icon svg {
  width: 40px;
  height: 40px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.5;
}

.horizontal-scroll-panel__title {
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  text-align: center;
}

.horizontal-scroll-panel__desc {
  max-width: 500px;
  text-align: center;
  font-size: var(--text-lg);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
}

/* Progress bar for horizontal scroll */
.horizontal-scroll-progress {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-3);
  z-index: 10;
}

.horizontal-scroll-progress__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(93, 126, 150, 0.3);
  transition: all var(--transition-base);
}

.horizontal-scroll-progress__dot.active {
  background: var(--accent);
  width: 32px;
}

@media (max-width: 768px) {
  /* En mobile no hay scroll-jacking horizontal: se muestran las 4 fases
     como una lista vertical numerada (ver js/horizontal-scroll.js, que
     desactiva el pin de GSAP bajo 768px). */
  .horizontal-scroll-section {
    overflow: visible;
  }

  .horizontal-scroll-container {
    flex-direction: column;
    width: 100%;
  }

  .horizontal-scroll-panel {
    width: 100%;
    min-height: auto;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
    padding: var(--space-6) var(--space-6);
    gap: var(--space-4);
    border-bottom: var(--border-subtle);
  }

  .horizontal-scroll-panel:last-child {
    border-bottom: none;
  }

  .horizontal-scroll-panel__number {
    position: static;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    top: auto;
    left: auto;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-bg);
    background: var(--accent);
    border-radius: var(--radius-full);
    opacity: 1;
    line-height: 1;
    margin-top: 4px;
  }

  .horizontal-scroll-panel__icon {
    width: 48px;
    height: 48px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .horizontal-scroll-panel__icon svg {
    width: 24px;
    height: 24px;
  }

  .horizontal-scroll-panel__body {
    flex: 1;
    min-width: 0;
  }

  .horizontal-scroll-panel__title {
    font-size: var(--text-lg);
    text-align: left;
    margin-bottom: var(--space-2);
  }

  .horizontal-scroll-panel__desc {
    max-width: none;
    text-align: left;
    font-size: var(--text-sm);
  }

  /* Los puntos de progreso solo tienen sentido con el scroll-jacking del
     desktop; en la lista vertical de mobile no aportan información. */
  .horizontal-scroll-progress {
    display: none;
  }
}

/* ===== STACKED CARDS (Cases) ===== */
.stacked-cards-section {
  position: relative;
}

.stacked-card {
  background: var(--primary-bg-light);
  border: var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  margin-bottom: var(--space-6);
  position: relative;
  transition: transform var(--transition-base);
}

.stacked-card__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--accent-light);
  border: 1px solid rgba(200, 134, 46, 0.2);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.stacked-card__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-6);
}

.stacked-card__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.stacked-card__column h4 {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--accent);
  margin-bottom: var(--space-3);
}

.stacked-card__column p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
}

.stacked-card__result {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--success-bg);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--success);
  font-weight: 500;
}

.stacked-card__result svg {
  width: 18px;
  height: 18px;
  stroke: var(--success);
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .stacked-card__grid {
    grid-template-columns: 1fr;
  }

  .stacked-card {
    padding: var(--space-6);
  }
}

/* ===== LEAD MAGNET BANNER ===== */
.lead-magnet {
  background: linear-gradient(135deg, var(--surface-dark) 0%, var(--primary-bg-light) 100%);
  border: var(--border-accent);
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-12);
  display: flex;
  align-items: center;
  gap: var(--space-10);
  margin-top: var(--space-16);
}

.lead-magnet__icon {
  width: 80px;
  height: 80px;
  min-width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  border-radius: var(--radius-xl);
}

.lead-magnet__icon svg {
  width: 40px;
  height: 40px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.5;
}

.lead-magnet__content {
  flex: 1;
}

.lead-magnet__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.lead-magnet__text {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.lead-magnet__form {
  display: flex;
  gap: var(--space-3);
}

.lead-magnet__form input {
  flex: 1;
  max-width: 300px;
}

@media (max-width: 768px) {
  .lead-magnet {
    flex-direction: column;
    text-align: center;
    padding: var(--space-8);
  }

  .lead-magnet__form {
    flex-direction: column;
    width: 100%;
  }

  .lead-magnet__form input {
    max-width: none;
  }
}

/* ===== QUOTE BLOCK (Nosotros) ===== */
.quote-block {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-12) 0;
  text-align: center;
  position: relative;
}

.quote-block__photo {
  width: 96px;
  height: 96px;
  margin: 0 auto var(--space-6);
  border-radius: var(--radius-full);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(93, 126, 150, 0.15), rgba(200, 134, 46, 0.08));
  border: 2px solid rgba(200, 134, 46, 0.3);
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 1;
}

.quote-block__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.quote-block::before {
  content: '"';
  font-family: var(--font-heading);
  font-size: 10rem;
  color: rgba(200, 134, 46, 0.1);
  position: absolute;
  top: -2rem;
  left: 50%;
  transform: translateX(-50%);
  line-height: 1;
  user-select: none;
}

.quote-block__text {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-6);
}

.quote-block__author {
  font-size: var(--text-base);
  color: var(--accent);
  font-weight: 500;
}

.quote-block__role {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

@media (max-width: 768px) {
  .quote-block {
    padding: var(--space-8) 0;
  }

  .quote-block::before {
    font-size: 6rem;
    top: -1rem;
  }

  .quote-block__text {
    font-size: var(--text-xl);
  }
}

@media (max-width: 480px) {
  .quote-block__photo {
    width: 80px;
    height: 80px;
  }

  .quote-block::before {
    font-size: 4.5rem;
  }

  .quote-block__text {
    font-size: var(--text-lg);
  }
}

/* ===== VALUES GRID (Nosotros) ===== */
.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.value-card {
  text-align: center;
  padding: var(--space-8) var(--space-6);
}

.value-card__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-5);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xl);
  background: var(--accent-light);
  border: 1px solid rgba(200, 134, 46, 0.15);
}

.value-card__icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.5;
}

.value-card__title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.value-card__text {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
}

@media (max-width: 768px) {
  .values-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/* ===== INTERNAL PAGE HERO ===== */
.page-hero {
  padding: calc(var(--navbar-height) + var(--space-16)) 0 var(--space-16);
  text-align: center;
  background: linear-gradient(180deg, var(--primary-bg-light) 0%, var(--primary-bg) 100%);
  border-bottom: var(--border-subtle);
}

.page-hero h1 {
  margin-bottom: var(--space-4);
}

.page-hero p {
  max-width: 600px;
  margin: 0 auto;
  font-size: var(--text-lg);
}

.page-hero p a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===== CTA BANNER ===== */
.cta-banner {
  background: linear-gradient(135deg, var(--primary-bg-light) 0%, rgba(200, 134, 46, 0.08) 100%);
  border: var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-12) var(--space-10);
  text-align: center;
}

.cta-banner h3 {
  margin-bottom: var(--space-3);
}

.cta-banner p {
  margin: 0 auto var(--space-6);
}

@media (max-width: 480px) {
  .cta-banner {
    padding: var(--space-8) var(--space-5);
  }
}

/* ===== MOBILE OVERLAY ===== */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 25, 47, 0.6);
  z-index: calc(var(--z-navbar) - 1);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.mobile-overlay.active {
  display: block;
  opacity: 1;
}
