/* Estilos específicos para la página de Servicios */
@import url('../../assets/css/base-page-styles.css');

/* Hero Section */
.hero {
  background: url('./img/hero-servicios.webp') no-repeat center center/cover;
  height: 1080px;
  margin-bottom: 4rem;
  position: relative;
  display: grid;
  place-items: center;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 1rem 2rem 2.25rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.20);
  backdrop-filter: saturate(140%) blur(2px);
  border-radius: 12px;
}

.hero h1 {
  font-size: clamp(2.5rem, 4.5vw, 4.25rem);
  line-height: 1.1;
  margin-bottom: .75rem;
  font-weight: 800;
  letter-spacing: .2px;
  color: #fff;
  text-shadow:
    0 2px 6px rgba(0,0,0,.45),
    0 8px 22px rgba(0,0,0,.35),
    0 16px 32px rgba(0,0,0,.25);
}

.hero p {
  font-size: clamp(1.0625rem, 2.2vw, 1.3125rem);
  margin: 0 auto 1.5rem auto;
  max-width: 60ch;
  color: #fff;
  opacity: .98;
  text-shadow:
    0 1px 2px rgba(0,0,0,.42),
    0 4px 12px rgba(0,0,0,.28);
}

.hero .button {
  font-size: 1.1rem;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  transition: all 0.3s ease;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(7, 30, 27, 0.8) 0%, rgba(7, 30, 27, 0.6) 100%);
  z-index: 1;
}

/* Intro Section */
.intro {
  padding: 5rem 0;
  text-align: center;
}

.section-header {
  max-width: 800px;
  margin: 0 auto 2rem;
}

.section-subtitle {
  display: inline-block;
  color: var(--primary);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.section-header h2 {
  font-size: 2.5rem;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.divider { display: none; }

.section-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 0;
}

/* Servicios Grid */
.servicios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  padding: 2rem 0 5rem;
}

.servicio-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.servicio-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.servicio-icon {
  background: transparent;
  padding: 0;
  position: relative;
  display: block;
  aspect-ratio: 1 / 1; /* cuadrada */
}

.servicio-icon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px 10px 0 0;
  display: block;
}

.servicio-card h3 {
  font-size: 1.5rem;
  color: var(--text-dark);
  margin: 1.5rem 1.5rem 1rem;
  line-height: 1.3;
}

.servicio-card > p {
  color: var(--text-muted);
  margin: 0 1.5rem 1.5rem;
  line-height: 1.7;
  flex-grow: 1;
}

.servicio-card .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.98rem;
  font-weight: 600;
  padding: 0.7rem 1.1rem;
  border-radius: 12px;
  margin: 0 1.5rem 1.5rem;
  border: 2px solid var(--primary);
  color: var(--primary);
  background: #fff;
  box-shadow: 0 6px 16px rgba(16, 72, 60, 0.12);
  transition: background-color .25s ease, color .25s ease, transform .12s ease, box-shadow .25s ease, border-color .25s ease;
  text-decoration: none;
}

.servicio-card .button:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(16, 72, 60, 0.20);
  text-decoration: none;
}

.servicio-card .button:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(16, 72, 60, 0.12);
  text-decoration: none;
}

.servicio-card .button:focus-visible {
  outline: 3px solid var(--accent-yellow);
  outline-offset: 3px;
  text-decoration: none;
}

.servicio-card .button.secondary {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
}

.servicio-card .button.secondary:hover {
  background: var(--primary);
  color: #fff;
}

html[data-theme="dark"] .servicio-card .button {
  background: #0f1418;
  color: #e5eef8;
  border-color: #9aa7b6;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .servicio-card .button:hover {
  background: #1a2229;
  border-color: #e5eef8;
}

/* Aparición suave controlada por JS (.visible) */
.servicio-card.visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Tooltip para iconos de servicios (usado por servicios.js) */
.tooltip {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%) translateY(8px);
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  font-size: 0.8125rem;
  line-height: 1.2;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  white-space: nowrap;
}

.tooltip.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(17, 24, 39, 0.92);
}

/* Accesibilidad: foco visible en botones dentro del hero/cta */
.hero .button:focus-visible,
.cta .button:focus-visible {
  outline: 3px solid var(--accent-yellow);
  outline-offset: 3px;
}

/* Tema oscuro */
html[data-theme="dark"] .servicio-card {
  background: #0f1418;
  border-color: #334155;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .servicio-card > p,
html[data-theme="dark"] .servicio-lista li {
  color: #9aa7b6;
}

html[data-theme="dark"] .servicio-icon {
  background: #0b1014;
}

.servicio-lista {
  margin: 0 1.5rem 2rem;
  padding: 0;
  list-style: none;
}

.servicio-lista li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.servicio-lista li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

/* CTA Section */
.cta {
  position: relative;
  /* Fallback color */
  background: var(--primary);
  /* Imagen CTA con overlay más transparente */
  background: linear-gradient(135deg, rgba(7, 30, 27, 0.55) 0%, rgba(7, 30, 27, 0.35) 100%), url('./img/cta/servicios-cta.webp') no-repeat center / cover;
  color: white;
  padding: 6rem 0;
  min-height: 520px;
  text-align: center;
  overflow: hidden;
}

.cta-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem;
}

.cta h2 {
  font-size: 2.75rem;
  margin-bottom: 1.25rem;
  line-height: 1.2;
  letter-spacing: .2px;
  font-weight: 800;
  color: #FDFEFE; /* más claro para mayor énfasis */
  text-shadow:
    0 2px 6px rgba(0,0,0,.45),
    0 8px 22px rgba(0,0,0,.35);
}

.cta p {
  font-size: 1.225rem;
  margin-bottom: 2.25rem;
  opacity: 0.96;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  color: #F3FAF7; /* tono más claro y cálido */
  text-shadow:
    0 1px 3px rgba(0,0,0,.35),
    0 6px 18px rgba(0,0,0,.28);
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cta .button {
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.9rem 2.1rem;
  border-radius: 14px;
  transition: background-color .25s ease, color .25s ease, box-shadow .25s ease, transform .12s ease, border-color .25s ease;
  text-decoration: none;
}

.cta .button.primary {
  background: #ffffff;
  color: var(--primary);
  border: 2px solid #ffffff;
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
}

.cta .button.secondary {
  background: rgba(255,255,255,0.10);
  border: 2px solid rgba(255,255,255,0.92);
  color: #ffffff;
  backdrop-filter: saturate(140%) blur(2px);
  box-shadow: 0 10px 28px rgba(0,0,0,.16);
}

.cta .button.primary:hover {
  background: #f4f7f6;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0,0,0,.20);
}

.cta .button.secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0,0,0,.20);
}

.cta .button:active { transform: translateY(0); box-shadow: 0 6px 14px rgba(0,0,0,.18); }
.cta .button:focus-visible { outline: 3px solid var(--accent-yellow); outline-offset: 3px; }

.cta-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('../../assets/img/patterns/dots-pattern.png') center/cover;
  opacity: 0.1;
  z-index: 1;
}

/* Responsive */
@media (max-width: 992px) {
  .hero h1 {
    font-size: 3rem;
  }
  
  .section-header h2,
  .cta h2 {
    font-size: 2.2rem;
  }
  
  .servicios-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  .hero {
    height: 60vh;
    min-height: 500px;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .section-header h2,
  .cta h2 {
    font-size: 2rem;
  }
  
  .intro,
  .cta {
    padding: 4rem 0;
  }
  
  .cta {
    min-height: 400px;
  }
  
  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .cta .button {
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 576px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .section-header h2,
  .cta h2 {
    font-size: 1.75rem;
  }
  
  .servicios-grid {
    grid-template-columns: 1fr;
  }
  
  .servicio-card {
    max-width: 400px;
    margin: 0 auto;
  }
}
