:root {
  --primary: #2563eb;
  --dark: #0f172a;
  --bg: #f8fafc;
  --card: #ffffff;
  --muted: #64748b;
  --radius: 16px;
  --shadow: 0 12px 30px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(180deg, #eef2ff, var(--bg));
  color: var(--dark);
}

/* HEADER */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2rem;
  background: #fff;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

header img { width: 70px; }

nav a {
  margin-left: 1.5rem;
  text-decoration: none;
  font-weight: 500;
  color: var(--dark);
  transition: color 0.3s;
}

nav a:hover { color: var(--primary); }

/* HERO */
.hero {
  max-width: 1200px;
  margin: 3rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
  gap: 2rem;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 1rem;
}

.hero span { color: var(--primary); }

.hero p {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1.8rem;
}

.hero-image {
  width: 100%;
  max-height: 420px;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .6s ease;
}

/* BOTÓN */
.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: .75rem 1.6rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  box-shadow: var(--shadow);
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

.btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
}

/* SERVICIOS */
.services {
  max-width: 1200px;
  margin: 4rem auto;
  padding: 0 1.5rem;
}

.services h2 {
  text-align: center;
  margin-bottom: 2.5rem;
  font-size: 2rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.8rem;
}

.card {
  background: var(--card);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(37, 99, 235, 0.15);
}

.card i {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
  transition: transform 0.3s;
}

.card:hover i {
  transform: scale(1.1);
}

.card h3 {
  margin: 1rem 0;
  font-size: 1.3rem;
  color: var(--dark);
}

.card p {
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.card-arrow {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  font-size: 1.5rem;
  color: var(--primary);
  transition: all 0.3s;
  opacity: 0;
}

.card:hover .card-arrow {
  opacity: 1;
  transform: translateX(6px);
}

/* MODAL */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}

.modal.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: white;
  border-radius: 20px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--muted);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--bg);
  color: var(--dark);
}

.modal-header {
  padding: 2.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

.modal-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-icon i {
  font-size: 2.5rem;
  color: white;
}

.modal-title h2 {
  margin: 0 0 0.5rem;
  color: var(--dark);
  font-size: 1.8rem;
}

.modal-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.modal-body {
  padding: 2.5rem;
  display: grid;
  grid-template-columns: 40% 60%;
  gap: 2.5rem;
  align-items: start;
}

.modal-description {
  overflow-y: auto;
  max-height: 500px;
  padding-right: 1rem;
}

.modal-description::-webkit-scrollbar {
  width: 6px;
}

.modal-description::-webkit-scrollbar-track {
  background: var(--bg);
}

.modal-description::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.modal-description::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.modal-description h3 {
  font-size: 1rem;
  margin: 1rem 0 0.6rem;
  color: var(--dark);
  font-weight: 600;
}

.modal-description h3:first-child {
  margin-top: 0;
}

.modal-description p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  font-size: 0.9rem;
}

.modal-description ul {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 0;
}

.modal-description li {
  color: var(--muted);
  padding: 0.35rem 0 0.35rem 1.6rem;
  position: relative;
  line-height: 1.5;
  font-size: 0.9rem;
}

.modal-description li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

.modal-gallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-gallery h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--dark);
  font-weight: 600;
}

.gallery-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gallery-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.gallery-nav {
  background: var(--bg);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.gallery-nav:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

.gallery-viewer {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  min-height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
}

.gallery-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: opacity 0.3s;
  padding: 1rem;
}

.gallery-counter {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.gallery-thumbnails {
  display: flex;
  gap: 0.8rem;
  overflow-x: auto;
  padding: 0.5rem 0;
}

.gallery-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 10px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.gallery-thumbnail {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.gallery-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumbnail:hover {
  transform: scale(1.05);
}

.gallery-thumbnail.active {
  border-color: var(--primary);
}

.modal-footer {
  display: flex;
  gap: 1rem;
  padding: 1.5rem 2.5rem;
  border-top: 1px solid #e2e8f0;
  background: var(--bg);
}

.btn-primary {
  flex: 1;
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: white;
  color: var(--muted);
  border: 1px solid #e2e8f0;
  padding: 0.75rem 1.6rem;
}

.btn-secondary:hover {
  border-color: var(--muted);
  color: var(--dark);
  background: var(--bg);
}

/* CONTACTO */
.contact {
  background: #fff;
  padding: 4rem 1.5rem;
  margin-top: 4rem;
}

.contact h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
}

.contact form {
  max-width: 520px;
  margin: auto;
  display: grid;
  gap: 1rem;
}

input, textarea {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  border: 1px solid #e2e8f0;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* FOOTER */
footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  background: white;
  border-top: 1px solid #e2e8f0;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .modal-body {
    grid-template-columns: 1fr;
  }

  .gallery-viewer {
    min-height: 300px;
  }
}

@media (max-width: 768px) {
  .modal-body {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }

  .modal-header {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-description {
    max-height: 250px;
  }

  .gallery-viewer {
    min-height: 250px;
  }

  .btn {
    width: 100%;
  }

  nav a {
    margin-left: 1rem;
    font-size: 0.9rem;
  }
}
