/* ============================================================
   PROINTECA v3 — Layout System
   Containers, sections, grid patterns
   ============================================================ */

/* ── Container ── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

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

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

/* ── Section ── */
.section {
  position: relative;
  padding-block: var(--section-padding);
  overflow: hidden;
}

.section--no-overflow {
  overflow: visible;
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-16);
}

.section__label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-orange);
  margin-bottom: var(--space-4);
}

.section__label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 2px;
  background: var(--gradient-brand);
  border-radius: var(--radius-full);
}

.section__title {
  margin-bottom: var(--space-6);
}

.section__description {
  font-size: var(--text-lg);
  max-width: 60ch;
  margin-inline: auto;
}

/* ── Section Backgrounds ── */
.section--alt {
  background: var(--bg-secondary);
}

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

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

/* ── Grid Patterns ── */
.grid {
  display: grid;
  gap: var(--space-8);
}

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

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

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

.grid--auto {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

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

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

/* ── Bento Grid ── */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-6);
}

.bento-item {
  grid-column: span 4;
}

.bento-item--wide {
  grid-column: span 8;
}

.bento-item--full {
  grid-column: span 12;
}

.bento-item--half {
  grid-column: span 6;
}

/* ── Flex Layout ── */
.flex {
  display: flex;
}

.flex--center {
  align-items: center;
  justify-content: center;
}

.flex--between {
  align-items: center;
  justify-content: space-between;
}

.flex--col {
  flex-direction: column;
}

.flex--wrap {
  flex-wrap: wrap;
}

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ── Hero Layout ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Add padding to clear fixed header */
  padding-top: var(--nav-height);
  padding-bottom: var(--space-12);
}

.hero--short {
  min-height: 60vh;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--bg-primary); /* Prevent missing image flash */
}

.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1; /* Set to 1 by default to ensure visibility if JS fails */
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 1.5s ease-in-out;
}

/* Fade in once video is ready or via JS */
.hero__video.is-active,
.hero__video.is-loaded {
  opacity: 1;
}

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

.hero__overlay {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 50%, hsla(220, 35%, 5%, 0) 0%, hsla(220, 35%, 5%, 0.4) 100%),
    linear-gradient(180deg, 
      hsla(220, 35%, 5%, 0.85) 0%, 
      hsla(220, 35%, 5%, 0.3) 15%, 
      hsla(220, 35%, 5%, 0) 40%, 
      hsla(220, 35%, 5%, 0.6) 85%, 
      var(--bg-primary) 100%
    );
  z-index: 1;
}

.hero__glass {
  background: hsla(220, 42%, 10%, 0.4); /* More transparent for better glass effect */
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border: 1px solid hsla(0, 0%, 100%, 0.1);
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-12);
  max-width: min(850px, 92%); /* Slightly smaller and responsive */
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  margin-inline: auto;
  margin-top: var(--space-4); /* Extra clearance */
}

/* Line removed for performance standard */

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center; /* Centered text */
  max-width: 800px;
  margin-inline: auto;
}

.hero__title {
  margin-bottom: var(--space-6);
}

.hero__subtitle {
  font-size: var(--text-xl);
  color: var(--text-secondary);
  margin-bottom: var(--space-10);
  max-width: 55ch;
}

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

/* ── Scroll Indicator ── */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  animation: scrollBounce 2s ease-in-out infinite;
  pointer-events: none;
}

.scroll-indicator__line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--color-orange), transparent);
}

@media (max-width: 768px) {
  .scroll-indicator {
    display: none;
  }
}

/* ── Split Layout ── */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}

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

.split--reverse {
  direction: rtl;
}

.split--reverse > * {
  direction: ltr;
}

/* ── Divider ── */
.divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-orange) 0%, transparent 100%);
  border-radius: var(--radius-full);
  margin-block: var(--space-6);
}

.divider--center {
  margin-inline: auto;
}

/* ── Service Showcase ── */
.service-showcase {
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
}

.service-showcase__item {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-16);
  align-items: center;
}

.service-showcase__image-wrapper {
  position: relative;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  border: var(--border-default);
  box-shadow: var(--shadow-xl);
  aspect-ratio: 16 / 10;
  background: var(--bg-secondary);
}

.service-showcase__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.service-showcase__item:hover .service-showcase__image {
  transform: scale(1.05);
}

.service-showcase__content {
  position: relative;
  z-index: 10;
}

.service-showcase__item:nth-child(even) .service-showcase__image-wrapper {
  order: 2;
}

.service-showcase__item:nth-child(even) .service-showcase__content {
  order: 1;
}

/* Responsive adjustment for showcase */
@media (max-width: 992px) {
  .service-showcase__item {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .service-showcase__item:nth-child(even) .service-showcase__image-wrapper {
    order: 0;
  }
}

/* ── Valuation Grid ── */
.valuation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-8);
  margin-top: var(--space-12);
}

/* ── Contact Layout ── */
.contact-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: var(--space-16);
  align-items: start;
}

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

.contact-form-container {
  background: hsla(220, 42%, 10%, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid hsla(0, 0%, 100%, 0.05);
  border-radius: var(--radius-2xl);
  padding: var(--space-10);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

@media (max-width: 640px) {
  .contact-form-container {
    padding: var(--space-6);
  }
}
