:root {
  --primary-color: #008bd0;
  --white: #fff;
  --dark-blue: #222b45;
  --yellow-accent: #f9e833ff;
  --light-blue: #f9fbfc;
  --card-glow: 0 0 32px 0 #f9e83355, 0 4px 36px 0 #008bd066;
  --card-gradient: linear-gradient(120deg, #f1faff 35%, #fffbe4 100%);
  --card-shadow: 0 12px 40px rgba(0, 139, 208, 0.13), 0 2px 8px #e7e7e7;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
html, body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background-color: var(--white);
  color: #333;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
::-webkit-scrollbar-thumb { background: var(--yellow-accent); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }

/* Header */
header {
  background-color: var(--white);
  padding: 20px 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 15px rgba(0,0,0,0.07);
  transition: all 0.3s cubic-bezier(.86,.21,.37,1.07);
}
header.scrolled { padding: 10px 0; }
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo-l { color: var(--primary-color); }
.logo-and { color: gray; }
.logo-e { color: var(--yellow-accent); }
.nav-links {
  display: flex;
  list-style: none;
}
.nav-links li { margin-left: 30px; }
.nav-links a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(.86,.21,.37,1.07);
  position: relative;
}
.nav-links a:hover { color: var(--primary-color); }
.nav-links a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2.5px;
  bottom: -5px;
  left: 0;
  background-color: var(--primary-color);
  transition: width 0.3s cubic-bezier(.86,.21,.37,1.07);
}
.nav-links a:hover::after { width: 100%; }
.hamburger { display: none; cursor: pointer; }

/* Servicios Section */
.services {
  padding: 120px 0 80px 0;
  background: linear-gradient(120deg, var(--light-blue) 50%, #fffbe4 100%);
  min-height: 100vh;
  overflow: hidden;
}
.section-title {
  text-align: center;
  margin-bottom: 65px;
  animation: fadeInDown 1s;
}
.section-title h2 {
  font-size: 2.7rem;
  color: var(--dark-blue);
  margin-bottom: 18px;
  letter-spacing: 1.2px;
  font-weight: bold;
}
.section-title h2 span {
  color: var(--primary-color);
  font-weight: 800;
}
.section-title p {
  font-size: 1.18rem;
  color: #567;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
  font-weight: 500;
}

/* Grid de servicios */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 38px 38px;
  margin-top: 48px;
  animation: fadeInUp 1.3s;
}

/* Tarjeta de servicio */
.service-card {
  background: var(--card-gradient);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 38px 32px 34px 32px;
  cursor: pointer;
  transition: box-shadow 0.35s, transform 0.25s cubic-bezier(.86,.21,.37,1.07);
  will-change: transform;
  z-index: 1;
  animation: serviceCardIn 0.7s;
  isolation: isolate;
}
.service-card:before {
  content: "";
  position: absolute;
  top: -8px; left: -8px; right: -8px; bottom: -8px;
  z-index: 0;
  border-radius: 28px;
  background: linear-gradient(120deg, var(--primary-color), var(--yellow-accent), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.service-card:hover:before {
  opacity: 0.19;
  filter: blur(2px);
}
.service-card:hover {
  box-shadow: var(--card-glow);
  /* 3D scale handled by JS */
}

.service-image {
  height: 260px;
  margin-bottom: 20px;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  z-index: 2;
  background: #f2f5fa;
  box-shadow: 0 4px 18px rgba(0,139,208,0.10);
}
.service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(.17,.67,.83,.67), filter 0.4s;
  border-radius: 14px;
}
.service-card:hover .service-image img {
  transform: scale(1.13) rotate(-2deg);
  filter: brightness(1.09) contrast(1.07) saturate(1.13);
}
.service-card::after {
  content: "";
  display: block;
  position: absolute;
  left: 40%;
  top: 50%;
  width: 170px;
  height: 170px;
  pointer-events: none;
  background: radial-gradient(circle, var(--yellow-accent) 0 35%, transparent 70%);
  opacity: 0.07;
  z-index: 0;
  filter: blur(4px);
  transform: translate(-50%, -50%);
}

.service-content h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 13px;
  line-height: 1.4;
  letter-spacing: 0.2px;
  transition: color 0.3s;
}
.service-content p {
  color: #555;
  line-height: 1.63;
  font-size: 1.01rem;
  margin-bottom: 22px;
  font-weight: 500;
}
.service-card a {
  color: var(--yellow-accent);
  background: var(--primary-color);
  padding: 9px 22px;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  font-size: 1.01rem;
  border-bottom: 2px solid transparent;
  transition: color 0.22s, border-color 0.22s, box-shadow 0.22s, background 0.22s;
  box-shadow: 0 2px 8px rgba(0,139,208,0.04);
}
.service-card a i {
  margin-left: 11px;
  font-size: 1.08em;
  transition: transform 0.22s;
}
.service-card a:hover {
  background: var(--yellow-accent);
  color: var(--primary-color);
  box-shadow: 0 5px 24px #f9e83333;
}
.service-card a:hover i {
  transform: translateX(7px) scale(1.13);
}

/* Redes sociales */
.hero-social {
  margin-top: 28px;
  text-decoration: none;
  display: flex;
  gap: 24px;
}
.social-l {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  text-emphasis: none;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  font-size: 1.5rem;
  transition: background 0.3s, color 0.3s, transform 0.2s;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.08);
  border: 1.5px solid #fff2;
}
.social-l:hover {
  background: var(--yellow-accent);
  color: #16205b;
  transform: scale(1.1) rotate(-7deg);
  border: 1.5px solid var(--yellow-accent);
}

/* Footer */
footer {
  background: linear-gradient(120deg, #23272f 70%, #008bd0 100%);
  color: var(--white);
  padding: 60px 0 20px;
}
.footer-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}
.footer-logo {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}
.footer-logo img {
  width: 40px;
  height: 40px;
  margin-right: 10px;
}
.footer-logo h2 {
  color: var(--primary-color);
  font-size: 20px;
}
.footer-about p {
  color: #ccc;
  line-height: 1.6;
}
.footer-links h3,
.footer-services h3,
.footer-contact h3 {
  color: var(--white);
  font-size: 18px;
  margin-bottom: 20px;
  position: relative;
}
.footer-links h3::after,
.footer-services h3::after,
.footer-contact h3::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 40px;
  height: 2px;
  background-color: var(--primary-color);
}
.footer-links ul,
.footer-services ul {
  list-style: none;
}
.footer-links ul li,
.footer-services ul li {
  margin-bottom: 10px;
}
.footer-links ul li a,
.footer-services ul li a {
  color: #ccc;
  text-decoration: none;
  transition: all 0.3s ease;
}
.footer-links ul li a:hover,
.footer-services ul li a:hover {
  color: var(--yellow-accent);
  padding-left: 5px;
}
.footer-contact p {
  display: flex;
  align-items: flex-start;
  margin-bottom: 15px;
  color: #ccc;
}
.footer-contact p i {
  color: var(--primary-color);
  margin-right: 10px;
  font-size: 18px;
}
.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #444;
}
.footer-bottom p { color: #ccc; }
.footer-bottom span { color: var(--primary-color); }

/* Animaciones */
@keyframes fadeInDown {
  0% { opacity:0; transform: translateY(-50px);}
  100% { opacity:1; transform: translateY(0);}
}
@keyframes fadeInUp {
  0% { opacity:0; transform: translateY(60px);}
  100% { opacity:1; transform: translateY(0);}
}
@keyframes serviceCardIn {
  from { opacity: 0; transform: scale(0.94);}
  to { opacity: 1; transform: scale(1);}
}
@media (max-width: 600px) {
  .service-image { height: 240px !important;
   }
     nav {
    padding: 0 10px;
  }
  .hamburger {
    right: 20px; /* Si usas position absolute/fixed */
  }
}

@media (max-width: 370px) {
  .service-image {
    height: 320px !important; /* Extra alto para los más chicos */
  } 
}
@media (max-width: 400px) {
  .service-image { height: 250px !important; 
  }
    nav {
    padding: 0 10px;
  }
  .hamburger {
    right: 20px; /* Si usas position absolute/fixed */
  }
}

/* Responsive */
@media (max-width: 1200px) {
  .services-grid { grid-template-columns: repeat(2, 1fr);}
}
@media (max-width: 900px) {
  .services-grid { grid-template-columns: 1fr; gap: 26px;}
  .service-card { padding: 26px 18px 25px 18px;}
  .service-image { height: 170px;}
}
@media (max-width: 768px) {
  .section-title h2 { font-size: 26px; }
  header { padding: 10px 0; }
  nav { flex-direction: row; }
  .container { width: 98%; }
  .services-grid { grid-template-columns: 1fr; }
  .service-content h3 { font-size: 1.2rem; }
  .service-image { height: 150px; }
  .footer-container { grid-template-columns: repeat(2, 1fr); }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background-color: var(--white);
    flex-direction: column;
    padding: 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 1001;
  }
  .nav-links.active { display: flex; }
  .nav-links li {
    margin: 10px 0;
    text-align: center;
  }
  .hamburger { display: block; }
}
@media (max-width: 600px) {
  .container { width: 99%; }
  .section-title h2 { font-size: 20px; }
  .service-content p { font-size: 0.85rem; }
  .service-card { padding: 13px; }
  .service-image { height: 100px; }
  .footer-logo h2,
  .footer-about p,
  .footer-links ul li a,
  .footer-services ul li a,
  .footer-contact p { font-size: 13px; }
  .footer-container { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .service-image { height: 80px; }
  .service-card { padding: 7px; }
  .section-title h2 { font-size: 15px; }
  .footer-logo h2,
  .footer-about p,
  .footer-links ul li a,
  .footer-services ul li a,
  .footer-contact p { font-size: 11px; }
}