/**
 * KRASH DEV OS — SPRINT 05: ISOLATED HOME TECHNOLOGY MODULE
 * Strict Namespace: .home-tech-*
 * Zero global tag selectors. Zero !important overrides.
 */

.home-tech {
  position: relative;
  padding: clamp(32px, 5.5vw, 72px) 0;
  color: #eaf3ff;
}

.home-tech-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 24px);
}

.home-tech-stage {
  display: grid;
  grid-template-columns: 1.22fr 1fr;
  grid-template-areas: "visual editorial";
  gap: clamp(22px, 3.2vw, 40px);
  align-items: stretch;
  background: linear-gradient(165deg, rgba(14, 40, 58, 0.92) 0%, rgba(7, 22, 36, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 22px;
  padding: clamp(18px, 2.6vw, 28px);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* ===== ZONA VISUAL PROTAGONISTA (FOTOGRAFÍA REAL PTAR) ===== */
.home-tech-visual {
  grid-area: visual;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  min-height: 400px;
  background: #071624;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.home-tech-figure {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.015);
  transition: opacity 0.28s ease, transform 0.38s ease, visibility 0.28s;
}

.home-tech-figure.is-active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.home-tech-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.home-tech-figure::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 22, 36, 0.04) 45%, rgba(7, 22, 36, 0.78) 100%);
  pointer-events: none;
}

.home-tech-caption {
  position: absolute;
  left: 14px;
  right: auto;
  bottom: 14px;
  max-width: calc(100% - 28px);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 13px;
  border-radius: 10px;
  background: rgba(7, 22, 36, 0.76);
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(234, 243, 255, 0.95);
  font-size: 12.5px;
  line-height: 1.35;
}

.home-tech-caption-text {
  font-weight: 500;
}

/* ===== ZONA EDITORIAL Y SELECTOR CONTEXTUAL ===== */
.home-tech-editorial {
  grid-area: editorial;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(4px, 1vw, 10px) clamp(2px, 0.8vw, 8px);
}

.home-tech-header {
  display: grid;
  gap: 14px;
}

.home-tech-title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #ffffff;
}

/* Selector IA Operativa / Automatización */
.home-tech-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(6, 18, 30, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.home-tech-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(234, 243, 255, 0.78);
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.2;
  padding: 11px 14px;
  min-height: 44px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
}

.home-tech-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.home-tech-tab:focus-visible {
  outline: 2px solid #44C1E9;
  outline-offset: 2px;
}

.home-tech-tab.is-active {
  background: linear-gradient(180deg, rgba(50, 158, 206, 0.32) 0%, rgba(14, 40, 58, 0.88) 100%);
  border-color: rgba(68, 193, 233, 0.55);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* Paneles contextuales */
.home-tech-panels {
  position: relative;
}

.home-tech-panel {
  display: none;
  gap: 14px;
  align-content: start;
  opacity: 0;
}

.home-tech-panel.is-active {
  display: grid;
  opacity: 1;
}

.home-tech-mode-title {
  margin: 0;
  font-size: clamp(19px, 2.2vw, 23px);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.home-tech-copy {
  margin: 0;
  font-size: clamp(15px, 1.7vw, 17px);
  line-height: 1.58;
  color: rgba(232, 243, 255, 0.92);
  max-width: 52ch;
}

.home-tech-points {
  list-style: none;
  margin: 2px 0 4px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.home-tech-point {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: #f0f6ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.home-tech-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}

.home-tech-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  min-height: 46px;
  border-radius: 999px;
  background: #56A20B;
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 22px rgba(86, 162, 11, 0.28);
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.home-tech-cta:hover,
.home-tech-cta:focus-visible {
  background: #4b8e09;
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(86, 162, 11, 0.38);
}

.home-tech-cta-arrow {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  transition: transform 0.2s ease;
}

.home-tech-cta:hover .home-tech-cta-arrow {
  transform: translateX(3px);
}

.home-tech-alt-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(234, 243, 255, 0.86);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.home-tech-alt-link:hover,
.home-tech-alt-link:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

/* ===== EXPERIENCIA MÓVIL DEDICADA (<992px) ===== */
@media (max-width: 991.98px) {
  .home-tech-stage {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "visual"
      "panels";
    gap: 16px;
    padding: 18px;
    border-radius: 18px;
  }

  .home-tech-editorial {
    display: contents;
  }

  .home-tech-header {
    grid-area: header;
    gap: 12px;
  }

  .home-tech-panels {
    grid-area: panels;
  }

  .home-tech-title {
    font-size: clamp(22px, 5.8vw, 28px);
  }

  .home-tech-tab {
    min-height: 48px;
    font-size: 14px;
    padding: 10px 10px;
  }

  .home-tech-visual {
    grid-area: visual;
    min-height: 0;
    aspect-ratio: 16 / 10;
    border-radius: 14px;
  }

  .home-tech-caption {
    left: 10px;
    bottom: 10px;
    max-width: calc(100% - 20px);
    padding: 6px 10px;
    font-size: 11.5px;
  }

  .home-tech-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-right: 76px;
  }

  .home-tech-cta {
    width: 100%;
  }

  .home-tech-alt-link {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-tech-figure,
  .home-tech-panel,
  .home-tech-tab,
  .home-tech-cta {
    transition: none;
    animation: none;
    transform: none;
  }
}
