/* =========================================================
   MICROTECH - CSS ORDENADO Y COMENTADO
   Archivo base reorganizado para facilitar mantenimiento.
   ========================================================= */

/* =========================================================
   1. Variables globales
   ========================================================= */
:root {
  --blue: #0d6ff2;
  --cyan: #23c2ff;
  --navy: #071d49;
  --text: #102044;
  --muted: #5f6b83;
  --bg: #f4f8fd;
  --card: #ffffff;
  --shadow: 0 18px 45px rgba(20, 93, 170, 0.14);
  --line: #e7eef8;
}

/* =========================================================
   2. Reset básico y estructura general
   ========================================================= */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding-top: 86px; /* Compensa el header fijo para que el contenido no quede debajo */
  background: #e9e9ec;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--text);
}

.site-wrap {
  max-width: 1500px;
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: #ffffff;
}

.section {
  padding-left: 11%;
  padding-right: 11%;
}

.center {
  margin: auto;
}

/* =========================================================
   3. Header / Menú principal
   ========================================================= */
.header {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1500px, 100%);
  height: 86px;
  padding: 0 8%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.62);
  border-bottom: 1px solid rgba(230, 239, 251, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

/* Estado del header cuando se hace scroll. Requiere que JS agregue la clase .scrolled */
.header.scrolled {
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(210, 229, 250, 0.75);
  box-shadow: 0 16px 42px rgba(7, 29, 73, 0.10);
}

.logo img {
  display: block;
  width: 300px;
}

.nav {
  display: flex;
  gap: 55px;
  font-size: 15px;
  font-weight: 700;
}

.nav a {
  color: #0b1d45;
  text-decoration: none;
}

.nav a:hover {
  color: var(--blue);
}

.actions {
  display: flex;
  align-items: center;
  gap: 13px;
}

/* =========================================================
   4. Botones y controles
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 38px;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(135deg, #075bd8, #22c2ff);
  border: 0;
  border-radius: 11px;
  box-shadow: 0 12px 28px rgba(0, 112, 240, 0.27);
  cursor: pointer;
}

.btn.small {
  padding: 14px 32px;
}

.theme,
.menu {
  width: 42px;
  height: 42px;
  color: #0b63d8;
  font-size: 18px;
  background: #eef6ff;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
}

.menu {
  display: none;
}

/* =========================================================
   5. Sección Hero / Inicio
   ========================================================= */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.13fr;
  align-items: center;
  min-height: 420px;
  background: linear-gradient(180deg, #f8fcff 0%, #eef7ff 100%);
}

/* Fondo decorativo con ondas SVG */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(80% 70% at 75% 0%, rgba(127, 198, 255, 0.35), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1400 360'%3E%3Cpath d='M0 80C253 160 438 164 620 95c184-70 323 52 520 38 122-8 198-63 260-108v335H0z' fill='%23dff2ff' opacity='.85'/%3E%3Cpath d='M0 248c210 52 435 33 641-40 261-93 482-7 759-84v236H0z' fill='%23bce4ff' opacity='.42'/%3E%3C/svg%3E") center / cover no-repeat;
}

.hero > * {
  position: relative;
}

.hero h1 {
  margin: 0 0 7px;
  color: #071d49;
  font-size: 54px;
  letter-spacing: 5px;
}

.hero h2 {
  margin: 0 0 12px;
  font-size: 34px;
  font-weight: 600;
}

.hero h2 span {
  color: #0875ef;
}

.hero p {
  max-width: 530px;
  margin: 0 0 28px;
  color: #182a56;
  font-size: 23px;
  line-height: 1.32;
}

.hero-img img {
  width: 100%;
  filter: drop-shadow(0 25px 35px rgba(18, 94, 177, 0.18));
}

/* =========================================================
   6. Servicios
   ========================================================= */
.services {
  padding-top: 44px;
  padding-bottom: 78px;
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, #f0f8ff 100%);
}

.title {
  margin: 0 0 38px;
  color: #071d49;
  font-size: 34px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  margin-bottom: 36px;
}

.card {
  min-height: 190px;
  padding: 34px 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease;
}

.card:hover {
  transform: translateY(-7px);
}

.card img {
  width: 72px;
  height: 72px;
}

.card h3 {
  margin: 13px 0 11px;
  color: #112148;
  font-size: 19px;
}

.card p {
  margin: 0;
  color: #3d4a64;
  font-size: 15px;
  line-height: 1.45;
}

/* =========================================================
   7. Sección Nosotros
   ========================================================= */
.about {
  position: relative;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 58px;
  align-items: center;
  padding-top: 70px;
  padding-bottom: 64px;
  background: #ffffff;
}

.about::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 180px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1400 230'%3E%3Cpath d='M0 112c227 69 390 77 555 21 211-71 377 42 604 0 100-19 179-62 241-91v188H0z' fill='%23dff3ff' opacity='.75'/%3E%3C/svg%3E") bottom / cover no-repeat;
}

.about > * {
  position: relative;
}

.about h2,
.contact h2 {
  margin: 0 0 28px;
  color: #071d49;
  font-size: 32px;
}

.about p {
  font-size: 16.5px;
  line-height: 1.55;
}

.about ul {
  padding-left: 20px;
  font-size: 16px;
  line-height: 1.65;
}

.about li::marker {
  color: #0875ef;
}

.about-img img {
  display: block;
  width: 100%;
  border-radius: 70px 0 0 70px;
}

/* =========================================================
   8. Contacto y formulario
   ========================================================= */
.contact {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 0.78fr;
  gap: 80px;
  align-items: center;
  padding-top: 40px;
  padding-bottom: 72px;
  background: linear-gradient(180deg, #ffffff 0%, #f1f9ff 100%);
}

.contact::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 60%;
  height: 160px;
  background: linear-gradient(160deg, transparent 10%, rgba(181, 224, 255, 0.62));
  clip-path: ellipse(80% 60% at 80% 80%);
}

.contact > * {
  position: relative;
  z-index: 1;
}

form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  max-width: 650px;
}

input,
textarea {
  width: 100%;
  padding: 15px 18px;
  font: inherit;
  background: #ffffff;
  border: 1px solid #d9e4f2;
  border-radius: 9px;
  box-shadow: 0 8px 22px rgba(12, 70, 130, 0.06);
}

textarea {
  grid-column: 2;
  grid-row: 2 / 4;
  min-height: 111px;
  resize: vertical;
}

.contact-form .btn {
  width: 230px;
  padding: 14px 22px;
}

.contact-info {
  font-size: 18px;
  font-weight: 700;
  line-height: 2.25;
}

.contact-info span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-right: 16px;
  background: #eef7ff;
  border-radius: 12px;
}

/* =========================================================
   9. Footer
   ========================================================= */
.footer {
  position: relative;
  display: grid;
  grid-template-columns: 250px 1fr auto auto;
  gap: 25px;
  align-items: center;
  min-height: 100px;
  padding: 24px 11%;
  color: #ffffff;
  background: linear-gradient(135deg, #013b8a, #075bd8);
}

.footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 110% at 80% 0, rgba(36, 197, 255, 0.25), transparent 52%);
}

.footer > * {
  position: relative;
}

.footer img {
  width: 220px;
}

.footer p {
  margin: 0;
  font-weight: 700; /* Corregido: antes estaba 7100, valor inválido */
}

.footer small {
  text-align: center;
  opacity: 0.32;
}

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

.social a {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  color: #075bd8;
  font-weight: 800;
  background: #ffffff;
  border-radius: 50%;
}

/* =========================================================
   10. Animaciones
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.show {
  opacity: 1;
  transform: none;
}

/* =========================================================
   11. Modo oscuro
   ========================================================= */
body.dark {
  --text: #eef6ff;
  --muted: #b7c5d8;
  --bg: #081225;
  --card: #0f2140;
  --line: #21395d;
  background: #061020;
}

body.dark .site-wrap,
body.dark .about {
  background: #081225;
}

body.dark .header {
  background: rgba(8, 18, 37, 0.58);
  border-color: rgba(45, 75, 118, 0.55);
}

body.dark .header.scrolled {
  background: rgba(8, 18, 37, 0.72);
  border-bottom: 1px solid rgba(64, 103, 158, 0.55);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}

body.dark .logo img {
  content: url("../imagenes/logo-microtech-white.svg"); /* Requiere que exista este archivo */
}

body.dark .nav a,
body.dark .hero h1,
body.dark .title,
body.dark .about h2,
body.dark .contact h2,
body.dark .services .title {
  color: #ffffff;
}

body.dark .hero,
body.dark .services,
body.dark .contact {
  background: linear-gradient(180deg, #081225, #0b1d37);
}

body.dark .hero h2 {
  color: #0d3f8f;
  text-shadow: 0 0 18px rgba(35, 194, 255, 0.18);
}

body.dark .hero h2 span {
  color: #075bd8;
}

body.dark .hero p {
  color: #0b3b82;
  font-weight: 600;
}

body.dark .about p,
body.dark .about li {
  color: #d5e7ff;
}

body.dark .card {
  background: #0f2140;
}

body.dark .card h3,
body.dark .card p {
  color: #ffffff;
}

body.dark input,
body.dark textarea {
  color: #ffffff;
  background: #101f38;
  border-color: #29476e;
}

body.dark .theme {
  color: #62c7ff;
  background: #132b4d;
}

/* =========================================================
   12. Responsive tablet
   ========================================================= */
@media (max-width: 1050px) {
  .header {
    padding: 0 4%;
  }

  .logo img {
    width: 250px;
  }

  .nav {
    gap: 22px;
  }

  .section {
    padding-left: 6%;
    padding-right: 6%;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-text {
    padding-top: 45px;
  }

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

  .about,
  .contact {
    grid-template-columns: 1fr;
  }

  .about-img img {
    border-radius: 38px;
  }

  .footer {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

/* =========================================================
   13. Responsive móvil
   ========================================================= */
@media (max-width: 760px) {
  body {
    padding-top: 76px; /* Header más bajo en móvil */
  }

  .header {
    min-height: 76px;
    height: auto;
  }

  .menu {
    display: block;
  }

  .nav {
    position: fixed;
    top: 86px;
    left: 4%;
    right: 4%;
    display: none;
    flex-direction: column;
    padding: 18px;
    text-align: center;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e7eef8;
    border-radius: 18px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
  }

  .nav.open {
    display: flex;
  }

  body.dark .nav {
    background: #0f2140;
  }

  .btn.small {
    display: none;
  }

  .logo img {
    width: 220px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .hero h2 {
    font-size: 27px;
  }

  .hero p {
    font-size: 19px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  form {
    grid-template-columns: 1fr;
  }

  textarea {
    grid-column: auto;
    grid-row: auto;
  }

  .section {
    padding-left: 5%;
    padding-right: 5%;
  }

  .footer img {
    width: 210px;
  }
}

/* =========================================================
   14. Mejoras solicitadas: Hero rotativo y servicios clickeables
   ========================================================= */
.hero-kicker {
  margin-bottom: 10px;
  color: #071d49;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 5px;
}

.hero-slider h1 {
  max-width: 640px;
  margin: 0 0 14px;
  color: #071d49;
  font-size: 48px;
  line-height: 1.08;
  letter-spacing: -1.4px;
}

.hero-slider p {
  min-height: 92px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn.ghost {
  color: #075bd8;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(13, 111, 242, 0.18);
  box-shadow: none;
}

.hero-dots {
  display: flex;
  gap: 9px;
  margin: -10px 0 24px;
}

.hero-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  background: rgba(13, 111, 242, 0.25);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.hero-dots button.active {
  width: 28px;
  background: #075bd8;
}

.services .cards {
  grid-template-columns: repeat(5, 1fr);
}

.service-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.service-link span {
  display: inline-block;
  margin-top: 16px;
  color: #075bd8;
  font-size: 14px;
  font-weight: 800;
}

.service-link:hover span {
  text-decoration: underline;
}

.service-page-hero {
  min-height: auto;
  padding-top: 78px;
  padding-bottom: 78px;
  grid-template-columns: 1fr;
}

.service-page-hero .hero-slider h1 {
  max-width: 820px;
}

.service-detail {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  padding-top: 62px;
  padding-bottom: 76px;
  background: #ffffff;
}

.service-detail h2 {
  margin: 0 0 18px;
  color: #071d49;
  font-size: 32px;
}

.service-detail p,
.service-detail li {
  color: #3d4a64;
  font-size: 16.5px;
  line-height: 1.65;
}

.service-panel {
  padding: 30px;
  background: linear-gradient(180deg, #f8fcff, #eef7ff);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.service-panel h3 {
  margin-top: 0;
  color: #071d49;
}

body.dark .hero-kicker,
body.dark .hero-slider h1,
body.dark .service-detail h2,
body.dark .service-panel h3 {
  color: #ffffff;
}

body.dark .hero-slider p {
  color: #d5e7ff;
}

body.dark .btn.ghost {
  color: #ffffff;
  background: rgba(15, 33, 64, 0.75);
  border-color: rgba(98, 199, 255, 0.25);
}

body.dark .service-detail {
  background: #081225;
}

body.dark .service-detail p,
body.dark .service-detail li {
  color: #d5e7ff;
}

body.dark .service-panel {
  background: linear-gradient(180deg, #0f2140, #0b1d37);
}

@media (max-width: 1200px) {
  .services .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1050px) {
  .hero-slider h1 {
    font-size: 42px;
  }
  .service-detail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .hero-slider h1 {
    font-size: 34px;
  }
  .hero-slider p {
    min-height: auto;
  }
  .services .cards {
    grid-template-columns: 1fr;
  }
}


.hero h1, .hero h2 { color: #6b7280; }

/* Hover efecto servicios */
.servicio, .service-card, .card-servicio {
    transition: all 0.3s ease;
    cursor: pointer;
}

.servicio:hover, .service-card:hover, .card-servicio:hover {
    filter: brightness(0.9);
    transform: translateY(-5px);
}


/* Ajuste específico: sección Nuestros Servicios */
#servicios .servicio,
#servicios .service-card,
#servicios .card-servicio,
.servicios .servicio,
.servicios .service-card,
.servicios .card-servicio,
.services .servicio,
.services .service-card,
.services .card-servicio,
section[id*="servicio"] .servicio,
section[id*="servicio"] .service-card,
section[id*="servicio"] .card-servicio {
  transition: background-color .28s ease, border-color .28s ease, transform .28s ease, box-shadow .28s ease, filter .28s ease;
  cursor: pointer;
}

#servicios .servicio:hover,
#servicios .service-card:hover,
#servicios .card-servicio:hover,
.servicios .servicio:hover,
.servicios .service-card:hover,
.servicios .card-servicio:hover,
.services .servicio:hover,
.services .service-card:hover,
.services .card-servicio:hover,
section[id*="servicio"] .servicio:hover,
section[id*="servicio"] .service-card:hover,
section[id*="servicio"] .card-servicio:hover {
  background-color: #e5e7eb !important;
  border-color: #cbd5e1 !important;
  filter: none !important;
  transform: translateY(-5px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, .14);
}

/* Mantiene legibles los textos dentro del cuadro gris */
#servicios .servicio:hover *,
#servicios .service-card:hover *,
#servicios .card-servicio:hover *,
.servicios .servicio:hover *,
.servicios .service-card:hover *,
.servicios .card-servicio:hover *,
.services .servicio:hover *,
.services .service-card:hover *,
.services .card-servicio:hover *,
section[id*="servicio"] .servicio:hover *,
section[id*="servicio"] .service-card:hover *,
section[id*="servicio"] .card-servicio:hover * {
  color: #111827;
}
