/* Hero Section with Form */
.servicio-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: var(--space-20) 0;
  overflow: hidden;
}

.servicio-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-gray-900) 100%);
  z-index: -1;
}

.servicio-hero-wrapper {
  display: flex;
  gap: var(--space-12);
  align-items: center;
}

.servicio-hero-content {
  flex: 1;
  width: 50%;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding-right: var(--space-6);
}

.servicio-hero-title {
  font-size: var(--text-6xl);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  color: var(--color-light);
  line-height: var(--leading-tight);
  margin: 0;
}

.servicio-hero-subtitle {
  font-size: var(--text-2xl);
  font-weight: var(--font-medium);
  color: var(--color-light);
  opacity: 0.9;
  margin: 0;
  max-width: 90%;
}

.servicio-hero-beneficios {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.servicio-hero-beneficios li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-light);
  font-size: var(--text-lg);
}

.servicio-hero-beneficios .material-symbols-outlined {
  color: var(--color-accent);
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* Form */
.servicio-hero-form {
  flex: 1;
  width: 50%;
  position: sticky;
  top: 120px;
  align-self: flex-start;
}

.servicio-form-card {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  padding: var(--space-8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  will-change: transform;
}

.servicio-form-title {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  color: var(--color-light);
  margin: 0 0 var(--space-2);
}

.servicio-form-subtitle {
  font-size: var(--text-base);
  color: var(--color-light);
  opacity: 0.8;
}

/* Hero Right Image Slider */
.servicio-hero-right {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

.servicio-hero-right::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 30%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent);
  z-index: 1;
  pointer-events: none;
}

/* Mobile CTA Button - Hidden on desktop */
.servicio-hero-cta-mobile {
  display: none;
  align-self: flex-start;
}

/* Sticky Bottom CTA Bar - Mobile only */
.servicio-sticky-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: var(--space-4);
  background: var(--color-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 9998;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.servicio-sticky-cta.visible {
  transform: translateY(0);
}

.servicio-sticky-cta .btn {
  width: 100%;
  justify-content: center;
}

/* Form Modal */
.servicio-form-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.servicio-form-modal.active {
  opacity: 1;
  visibility: visible;
}

.servicio-form-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.servicio-form-modal-content {
  position: relative;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.servicio-form-modal.active .servicio-form-modal-content {
  transform: translateY(0);
}

.servicio-form-modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: transparent;
  border: none;
  color: var(--color-light);
  cursor: pointer;
  z-index: 1;
  padding: var(--space-2);
  transition: opacity var(--transition-base);
}

.servicio-form-modal-close:hover {
  opacity: 0.7;
}

.servicio-form-modal-close .material-symbols-outlined {
  font-size: 1.5rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .servicio-hero {
    min-height: 700px;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    padding: 0;
    gap: 3.5rem;
    overflow: visible;
  }

  .servicio-hero .container {
    flex-direction: column;
    align-items: flex-start;
    flex: 1 1 auto;
    padding-top: 70px;
    padding-bottom: 0;
    display: flex;
    justify-content: center;
  }

  .servicio-hero-wrapper {
    flex-direction: column;
    gap: var(--space-8);
    width: 100%;
  }

  .servicio-hero-content {
    width: 100%;
    padding-top: 0;
    padding-bottom: 0;
    padding-right: 0;
  }

  /* Hide desktop form, show mobile CTA */
  .servicio-hero-form {
    display: none;
  }

  .servicio-hero-cta-mobile {
    display: inline-flex;
  }

  .servicio-sticky-cta {
    display: block;
  }

  .servicio-hero-title {
    font-size: var(--text-5xl);
  }

  .servicio-hero-subtitle {
    max-width: 100%;
  }

  .servicio-hero-right {
    position: relative;
    width: 100%;
    height: auto;
    flex: 0 0 auto;
    top: auto;
    right: auto;
    z-index: 0;
  }

  .servicio-hero-right::before {
    display: none;
  }

  .servicio-hero-right .hero-slider {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .servicio-hero-right .hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  .servicio-hero-right .hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }
}

@media (max-width: 768px) {
  .servicio-hero-title {
    font-size: var(--text-4xl);
  }

  .servicio-hero-subtitle {
    font-size: var(--text-xl);
  }

  .servicio-form-card {
    padding: var(--space-8);
  }
}

/* Contact Form 7 Styles - Dark Theme */
/* Base form styles loaded from form-fields.css */
/* Override for dark theme on hero form and modal */

.servicio-hero-form .wpcf7-form,
.servicio-form-modal .wpcf7-form {
  width: 100%;
}

/* Dark theme input overrides */
.servicio-hero-form .form-field input[type="text"],
.servicio-hero-form .form-field input[type="email"],
.servicio-hero-form .form-field input[type="tel"],
.servicio-hero-form .form-field textarea,
.servicio-form-modal .form-field input[type="text"],
.servicio-form-modal .form-field input[type="email"],
.servicio-form-modal .form-field input[type="tel"],
.servicio-form-modal .form-field textarea {
  color: var(--color-light);
}

.servicio-hero-form .form-field input[type="text"]:focus,
.servicio-hero-form .form-field input[type="email"]:focus,
.servicio-hero-form .form-field input[type="tel"]:focus,
.servicio-hero-form .form-field textarea:focus,
.servicio-form-modal .form-field input[type="text"]:focus,
.servicio-form-modal .form-field input[type="email"]:focus,
.servicio-form-modal .form-field input[type="tel"]:focus,
.servicio-form-modal .form-field textarea:focus {
  background: rgba(255, 255, 255, 0.05);
}

.servicio-hero-form .form-field input::placeholder,
.servicio-hero-form .form-field textarea::placeholder,
.servicio-form-modal .form-field input::placeholder,
.servicio-form-modal .form-field textarea::placeholder {
  color: var(--color-light);
}

.servicio-hero-form .form-field textarea,
.servicio-form-modal .form-field textarea {
  min-height: 120px;
}

/* Dark theme checkbox overrides */
.servicio-hero-form .form-field-checkbox p,
.servicio-form-modal .form-field-checkbox p {
  color: var(--color-light);
}

.servicio-hero-form .form-field-checkbox input[type="checkbox"]:hover,
.servicio-form-modal .form-field-checkbox input[type="checkbox"]:hover {
  background: rgba(255, 255, 255, 0.05);
}

.servicio-hero-form .form-field-checkbox a:hover,
.servicio-form-modal .form-field-checkbox a:hover {
  color: var(--color-light);
}

/* Dark theme validation colors */
.servicio-hero-form .wpcf7-not-valid-tip,
.servicio-form-modal .wpcf7-not-valid-tip {
  color: #ff6b6b;
}

.servicio-hero-form .wpcf7-validation-errors,
.servicio-form-modal .wpcf7-validation-errors {
  background: rgba(255, 107, 107, 0.1);
  color: #ff6b6b;
  border-left-color: #ff6b6b;
}

.servicio-hero-form .wpcf7-mail-sent-ok,
.servicio-form-modal .wpcf7-mail-sent-ok {
  background: rgba(76, 175, 80, 0.1);
  color: #4caf50;
  border-left-color: #4caf50;
}

/* Features Grid - 3 columns with icons */
.servicio-caracteristicas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  margin-top: var(--space-12);
}

.servicio-caracteristica-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: flex-start;
  padding: var(--space-8);
  background: var(--color-light);
  border: 1px solid var(--color-gray-200);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.servicio-caracteristica-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.servicio-caracteristica-card h3 {
  margin: 0;
  position: relative;
  padding-bottom: var(--space-3);
}

.servicio-caracteristica-card h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background-color: var(--color-accent);
  transition: all var(--transition-base);
}

.servicio-caracteristica-card:hover h3::after {
  width: 60px;
}

.servicio-caracteristica-icon {
  font-size: 2.5rem;
  color: var(--color-accent);
}

.servicio-caracteristica-card p {
  margin: 0;
  opacity: 0.85;
  font-size: var(--text-sm);
}

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

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

/* Applications Section - Adaptive Grids */
.servicio-aplicaciones-grid {
  display: grid;
  gap: var(--space-8);
  margin-top: var(--space-12);
}

/* 2 items: 2x1 grid */
.servicio-aplicaciones-grid.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

/* 3 items: 3x1 grid */
.servicio-aplicaciones-grid.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* 4 items: 2x2 grid */
.servicio-aplicaciones-grid.grid-4 {
  grid-template-columns: repeat(2, 1fr);
}

/* 5 items: 2 top, 3 bottom */
.servicio-aplicaciones-grid.grid-5 {
  grid-template-columns: repeat(6, 1fr);
}

.servicio-aplicaciones-grid.grid-5 .category-card:nth-child(1),
.servicio-aplicaciones-grid.grid-5 .category-card:nth-child(2) {
  grid-column: span 3;
}

.servicio-aplicaciones-grid.grid-5 .category-card:nth-child(3),
.servicio-aplicaciones-grid.grid-5 .category-card:nth-child(4),
.servicio-aplicaciones-grid.grid-5 .category-card:nth-child(5) {
  grid-column: span 2;
}

/* 6 items: 3x2 grid */
.servicio-aplicaciones-grid.grid-6 {
  grid-template-columns: repeat(3, 1fr);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .servicio-aplicaciones-grid.grid-3,
  .servicio-aplicaciones-grid.grid-4,
  .servicio-aplicaciones-grid.grid-6 {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .servicio-aplicaciones-grid.grid-5 .category-card:nth-child(1),
  .servicio-aplicaciones-grid.grid-5 .category-card:nth-child(2),
  .servicio-aplicaciones-grid.grid-5 .category-card:nth-child(3),
  .servicio-aplicaciones-grid.grid-5 .category-card:nth-child(4),
  .servicio-aplicaciones-grid.grid-5 .category-card:nth-child(5) {
    grid-column: span 1;
  }
}

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

  .servicio-aplicaciones-grid.grid-5 .category-card:nth-child(1),
  .servicio-aplicaciones-grid.grid-5 .category-card:nth-child(2),
  .servicio-aplicaciones-grid.grid-5 .category-card:nth-child(3),
  .servicio-aplicaciones-grid.grid-5 .category-card:nth-child(4),
  .servicio-aplicaciones-grid.grid-5 .category-card:nth-child(5) {
    grid-column: span 1;
  }
}

/* Feature section buttons */
.servicio-caracteristica-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.servicio-caracteristica-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* Process section buttons */
.proceso-content .btn {
  margin-top: var(--space-4);
}

/* Use cases button - left aligned */
.servicio-aplicaciones .category-card .btn {
  align-self: flex-start;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Single service process - reduced padding */
.servicio-caracteristicas + .proceso .proceso-step {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.servicio-caracteristicas + .proceso .proceso-step:first-child {
  padding-top: 5rem;
}

.servicio-caracteristicas + .proceso .proceso-step:last-child {
  padding-bottom: 5rem;
}

.servicio-caracteristicas + .proceso .proceso-step-2 {
  padding-top: 5rem;
}
