/* ==== Reset ==== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: url("img/Fondo.png") center/cover fixed no-repeat;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.6;
}

main { flex: 1; }

a { 
  text-decoration: none; 
  transition: all 0.3s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==== Header ==== */
header {
  position: sticky; 
  top: 0; 
  z-index: 1000;
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  padding: 15px 40px;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.logo { 
  font-size: 20px; 
  font-weight: bold; 
  color: #00c4ff;
  text-shadow: 0 0 10px rgba(0,196,255,0.5);
}

.menu { 
  list-style: none; 
  display: flex; 
  gap: 25px; 
}

.menu a { 
  color: #fff; 
  font-weight: 600; 
  padding: 8px 16px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.menu a:hover,
.menu a[aria-current="page"] { 
  color: #00c4ff;
  background: rgba(0,196,255,0.1);
}

/* Responsive menu */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    padding: 15px 20px;
  }
  
  .menu {
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
  }
  
  .menu a {
    font-size: 14px;
    padding: 6px 12px;
  }
}

/* ==== Hero ==== */
.hero {
  position: relative;
  background: url("img/Fondo.png") center/cover no-repeat;
  padding: 60px 20px 80px;
  text-align: center;
  color: #fff;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero::before {
  content: "";
  position: absolute; 
  inset: 0;
  background: rgba(0,0,0,0.55);
}

.hero-inner { 
  position: relative; 
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  color: #00c4ff;
  text-shadow: 0 0 12px rgba(0,196,255,0.7), 0 0 25px rgba(0,196,255,0.4);
  margin-bottom: 20px;
  animation: fadeInUp 0.8s ease-out;
}

.hero p { 
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin-bottom: 20px;
  animation: fadeInUp 1s ease-out;
}

.hero a.btn {
  background: linear-gradient(135deg, #00c4ff 0%, #0077aa 100%);
  color: #fff;
  padding: 14px 32px; 
  border-radius: 8px;
  font-weight: bold; 
  font-size: 1.1rem;
  transition: all 0.3s ease;
  margin-top: 30px;
  display: inline-block;
  box-shadow: 0 4px 15px rgba(0,196,255,0.3);
  animation: fadeInUp 1.2s ease-out;
}

.hero a.btn:hover { 
  background: linear-gradient(135deg, #fff 0%, #e0f7ff 100%);
  color: #0077aa;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,196,255,0.5);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 50px 20px 70px;
    min-height: 200px;
  }
  
  .hero a.btn {
    margin-top: 20px;
    padding: 12px 24px;
    font-size: 1rem;
  }
}

/* ==== Secciones ==== */
section { 
  padding: 80px 20px;
}

section h2 {
  text-align: center;
  margin-bottom: 50px;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.7);
  position: relative;
  padding-bottom: 15px;
}

section h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, transparent, #00c4ff, transparent);
  border-radius: 2px;
}

@media (max-width: 768px) {
  section {
    padding: 60px 15px;
  }
}

/* ==== Servicios ==== */
.services-grid {
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px; 
  max-width: 1200px; 
  margin: auto;
  padding: 0 20px;
}

.service-card {
  background: rgba(255,255,255,0.97);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  border-top: 5px solid #00c4ff;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0,196,255,0.1), transparent);
  transition: left 0.5s ease;
}

.service-card:hover::before {
  left: 100%;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0,196,255,0.4);
  border-top-color: #0077aa;
}

.service-card h3 { 
  margin-bottom: 15px; 
  color: #0077aa;
  font-size: 1.3rem;
}

.service-card p { 
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
  margin-bottom: 20px;
}

.service-card a {
  display: inline-block; 
  margin-top: 12px;
  background: linear-gradient(135deg, #00c4ff 0%, #0077aa 100%);
  color: #fff; 
  padding: 10px 20px;
  border-radius: 6px; 
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(0,170,255,0.3);
}

.service-card a:hover { 
  background: linear-gradient(135deg, #0077aa 0%, #005580 100%);
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(0,170,255,0.5);
}

@media (max-width: 640px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .service-card {
    padding: 25px;
  }
}

/* ==== Bloques generales ==== */
.detalle-servicio {
  background: rgba(255,255,255,0.95);
  border-radius: 16px;
  padding: 50px;
  max-width: 1000px;
  margin: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  line-height: 1.8;
}

.detalle-servicio h2 {
  color: #0077aa;
  margin-top: 30px;
  margin-bottom: 20px;
  font-size: 1.8rem;
  text-align: left;
  text-shadow: none;
  padding-bottom: 10px;
  border-bottom: 2px solid #00c4ff;
}

.detalle-servicio h2:first-child {
  margin-top: 0;
}

.detalle-servicio h2::after {
  display: none;
}

.detalle-servicio p {
  margin-bottom: 20px;
  color: #444;
}

.detalle-servicio ul { 
  margin-left: 30px;
  margin-bottom: 20px;
}

.detalle-servicio li {
  margin-bottom: 10px;
  color: #555;
}

.detalle-servicio strong {
  color: #0077aa;
}

@media (max-width: 768px) {
  .detalle-servicio {
    padding: 30px 20px;
  }
  
  .detalle-servicio h2 {
    font-size: 1.5rem;
  }
}

/* ==== Proyectos ==== */
.proyecto { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 30px; 
  margin-bottom: 40px;
  background: rgba(245,248,250,0.8);
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.proyecto:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.proyecto img {
  flex: 1 1 300px; 
  border-radius: 12px; 
  object-fit: cover; 
  max-height: 250px;
  width: 100%;
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}

.proyecto:hover img {
  transform: scale(1.02);
}

.proyecto-info { 
  flex: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.proyecto-info h3 { 
  color: #0077aa; 
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.proyecto-info p {
  color: #555;
  line-height: 1.7;
}

@media (max-width: 768px) {
  .proyecto {
    flex-direction: column;
    gap: 20px;
  }
  
  .proyecto img {
    max-height: 200px;
  }
}

/* ==== Formulario ==== */
form { 
  display: flex; 
  flex-direction: column; 
  gap: 20px; 
  max-width: 600px; 
  margin: 30px auto;
}

form input, 
form textarea, 
form select {
  padding: 14px 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  background: #fff;
}

form input:focus, 
form textarea:focus, 
form select:focus {
  outline: none;
  border-color: #00c4ff;
  box-shadow: 0 0 0 3px rgba(0,196,255,0.1);
}

/* Campo de teléfono con selector de país */
.phone-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.phone-input-wrapper label {
  font-weight: 600;
  color: #0077aa;
  font-size: 1rem;
}

.phone-input-group {
  display: flex;
  align-items: stretch;
  border: 2px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  background: white;
  transition: all 0.3s ease;
}

.phone-input-group:focus-within {
  border-color: #00c4ff;
  box-shadow: 0 0 0 3px rgba(0,196,255,0.1);
}

.country-select {
  background: linear-gradient(135deg, #00c4ff 0%, #0077aa 100%);
  color: white;
  padding: 14px 12px;
  font-weight: bold;
  font-size: 0.95rem;
  border: none !important;
  border-right: 2px solid #0077aa !important;
  cursor: pointer;
  min-width: 160px;
  outline: none !important;
  box-shadow: none !important;
}

.country-select option {
  background: white;
  color: #333;
  padding: 10px;
}

.phone-prefix {
  background: linear-gradient(135deg, #00c4ff 0%, #0077aa 100%);
  color: white;
  padding: 14px 18px;
  font-weight: bold;
  font-size: 1rem;
  border-right: 2px solid #0077aa;
  white-space: nowrap;
}

.phone-input-group input {
  border: none !important;
  flex: 1;
  padding: 14px 16px;
  font-size: 1rem;
  outline: none;
  box-shadow: none !important;
}

.phone-input-group input:focus {
  outline: none;
  border: none;
}

.phone-input-wrapper:focus-within .phone-input-group {
  border-color: #00c4ff;
  box-shadow: 0 0 0 3px rgba(0, 196, 255, 0.1);
}

form textarea {
  resize: vertical;
  min-height: 120px;
}

.textarea-wrapper {
  position: relative;
}

.textarea-wrapper small {
  display: block;
  margin-top: 8px;
  color: #666;
  font-size: 0.85rem;
  text-align: right;
}

form label {
  font-weight: 600;
  color: #333;
  margin-bottom: -10px;
}

form button {
  background: linear-gradient(135deg, #00c4ff 0%, #0077aa 100%);
  color: #fff;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,196,255,0.3);
  margin-top: 10px;
}

form button:hover {
  background: linear-gradient(135deg, #0077aa 0%, #005580 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,196,255,0.5);
}

form button:active {
  transform: translateY(0);
}

@media (max-width: 640px) {
  form {
    max-width: 100%;
  }
  
  form input,
  form textarea,
  form select {
    font-size: 16px; /* Previene zoom en iOS */
  }
}

/* ==== Footer ==== */
footer {
  background: url("img/Banner.jpg") center/cover no-repeat;
  position: relative; 
  color: #fff; 
  text-align: center;
  padding: 50px 20px; 
  margin-top: auto;
}

footer::before {
  content: ""; 
  position: absolute; 
  inset: 0; 
  background: rgba(0,0,0,0.8);
}

footer p { 
  position: relative; 
  z-index: 1; 
  margin: 10px 0;
  font-size: 1rem;
}

footer a {
  color: #00c4ff;
  text-decoration: underline;
  transition: color 0.3s ease;
}

footer a:hover {
  color: #fff;
}

@media (max-width: 640px) {
  footer {
    padding: 40px 15px;
  }
  
  footer p {
    font-size: 0.9rem;
  }
}

/* ==== Botón flotante de WhatsApp ==== */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
  z-index: 999;
  transition: all 0.3s ease;
  text-decoration: none;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(37, 211, 102, 0.7);
}

.whatsapp-float svg {
  width: 35px;
  height: 35px;
  fill: white;
}

@media (max-width: 768px) {
  .whatsapp-float {
    bottom: 20px;
    right: 20px;
    width: 55px;
    height: 55px;
  }
  
  .whatsapp-float svg {
    width: 30px;
    height: 30px;
  }
}

/* ==== Texto justificado para Quienes Somos ==== */
.detalle-servicio p {
  margin-bottom: 20px;
  color: #444;
  text-align: justify;
}

/* ==== Utilidades ==== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ==== Performance optimizations ==== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
