@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Montserrat:wght@700;800&display=swap');

/* Filtro para hacer el favicon blanco */
link[rel="icon"] {
  filter: brightness(0) invert(1);
}

/* Variables CSS para paleta de colores */
:root {
  --color-primary: #ADD8E6;
  --color-secondary-1: #BDE7DB;
  --color-secondary-2: #F5EBDC;
  --color-secondary-3: #D3D3D3;
  --color-text-dark: #2D3748;
  --color-text-light: #FFFFFF;
  
  /* Variables para anchos de contenedor */
  --container-max-width: 1280px; /* 7xl en Tailwind */
  --container-padding-x: 0.85rem; /* 85% de 1rem */
  --container-padding-x-sm: 1.275rem; /* 85% de 1.5rem */
  --container-padding-x-lg: 1.7rem; /* 85% de 2rem */
}

/* Sobrescribir clases de Tailwind para reducir márgenes globalmente */
.max-w-7xl {
  padding-left: 0.85rem !important;
  padding-right: 0.85rem !important;
}

@media (min-width: 640px) {
  .max-w-7xl {
    padding-left: 1.275rem !important;
    padding-right: 1.275rem !important;
  }
}

@media (min-width: 1024px) {
  .max-w-7xl {
    padding-left: 1.7rem !important;
    padding-right: 1.7rem !important;
  }
}

.max-w-4xl {
  padding-left: 0.85rem !important;
  padding-right: 0.85rem !important;
}

@media (min-width: 640px) {
  .max-w-4xl {
    padding-left: 1.275rem !important;
    padding-right: 1.275rem !important;
  }
}

@media (min-width: 1024px) {
  .max-w-4xl {
    padding-left: 1.7rem !important;
    padding-right: 1.7rem !important;
  }
}

/* Aplicar padding a todos los contenedores max-w */
[class*="max-w-"] {
  padding-left: 0.85rem !important;
  padding-right: 0.85rem !important;
}

@media (min-width: 640px) {
  [class*="max-w-"] {
    padding-left: 1.275rem !important;
    padding-right: 1.275rem !important;
  }
}

@media (min-width: 1024px) {
  [class*="max-w-"] {
    padding-left: 1.7rem !important;
    padding-right: 1.7rem !important;
  }
}

/* Clases personalizadas para control de ancho de columnas */
.section-wrapper {
  width: 100%;
  padding-top: 4rem; /* py-16 */
  padding-bottom: 4rem;
}

@media (min-width: 768px) {
  .section-wrapper {
    padding-top: 6rem; /* md:py-24 */
    padding-bottom: 6rem;
  }
}

.content-container {
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding-x);
  padding-right: var(--container-padding-x);
}

@media (min-width: 640px) {
  .content-container {
    padding-left: var(--container-padding-x-sm);
    padding-right: var(--container-padding-x-sm);
  }
}

@media (min-width: 1024px) {
  .content-container {
    padding-left: var(--container-padding-x-lg);
    padding-right: var(--container-padding-x-lg);
  }
}

.nav-brand {
  display: inline-flex;
  align-items: center;
}

.nav-logo {
  max-height: 3.25rem;
  width: auto;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

.footer-logo {
  max-width: 230px;
  width: 100%;
  height: auto;
}

.footer-social-icon {
  transition: transform 0.3s ease;
  cursor: pointer;
}

.footer-social-icon:hover {
  transform: scale(1.2);
}

.footer-bottom {
  text-align: center;
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
  color: var(--color-text-dark);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--color-primary) !important;
  transform: translateX(4px);
}

/* Scroll suave - Fuente: MDN Web Docs */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.nav-isotipo {
  width: 3rem;
  height: auto;
}

/* Fallback para navegadores que no soportan scroll-behavior */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Clase para screen readers only - WCAG 2.1 AA */
.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;
}

/* Clases reutilizables para botones */
.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-text-dark);
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-block;
  text-decoration: none;
}

.btn-primary:hover {
  background-color: #8EC5D9;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn-primary-large {
  background-color: var(--color-primary);
  color: var(--color-text-dark);
  padding: 1rem 2.5rem;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary-large:hover {
  background-color: #8EC5D9;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
  background-color: var(--color-secondary-1);
  color: var(--color-text-dark);
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-block;
  text-decoration: none;
}

.btn-secondary:hover {
  background-color: #A0D4C8;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Hero section - overlay más oscuro y texto alineado izquierda */
.hero-overlay-dark {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0.2) 100%);
}

.hero-text-left {
  text-align: left;
}

.hero-carousel {
  height: 70vh;
  min-height: 520px;
}

.hero-carousel .carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-static {
  position: relative;
  height: 320px;
  overflow: hidden;
}

.hero-static img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 5s ease;
}

.hero-static:hover img {
  transform: scale(1.08);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0.35));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
}

.hero-text-animated {
  color: white;
  animation: heroFadeUp 0.9s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes heroFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .hero-carousel {
    height: 60vh;
    min-height: 460px;
  }
}

@media (max-width: 768px) {
  .hero-carousel {
    height: 420px;
    min-height: 420px;
  }
}

@media (max-width: 480px) {
  .hero-carousel {
    height: 360px;
    min-height: 360px;
  }
}

/* Estilos del carrusel */
.carousel-container {
  position: relative;
}

.carousel-slide {
  transition: opacity 700ms ease-in-out;
}

.carousel-slide.active {
  opacity: 1;
}

.carousel-control {
  transition: all 0.3s ease;
}

.carousel-control:hover {
  transform: translateY(-50%) scale(1.1);
}

.carousel-dot {
  transition: all 0.3s ease;
  cursor: pointer;
}

.carousel-dot[aria-selected="true"] {
  background-color: white;
  width: 2rem;
}

/* Estados hover para tarjetas de servicios */
.service-card {
  transition: all 0.35s ease;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  border: 1px solid #E5E7EB;
  background-color: #fff;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 25px 45px rgba(15, 23, 42, 0.16);
  border-color: var(--color-primary);
}

.service-card svg {
  transition: transform 0.4s ease;
}

.service-card:hover svg {
  transform: translateY(-6px) scale(1.08);
}

/* Animación suave para enlaces */
a {
  transition: color 0.3s ease;
}

/* Asegurar contraste WCAG AA en textos sobre fondo primario */
.bg-primary-text {
  color: var(--color-text-dark);
}

/* Mejora de accesibilidad para focus visible */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Estilos para formulario de contacto */
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #D1D5DB;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: white;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(173, 216, 230, 0.2);
}

.form-input:invalid:not(:placeholder-shown),
.form-textarea:invalid:not(:placeholder-shown) {
  border-color: #EF4444;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text-dark);
}

.form-error {
  color: #EF4444;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Copyright resaltado en footer */
.footer-copyright {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text-dark);
}

/* ============================================ */
/* EFECTO FLIP 3D PARA CARDS */
/* ============================================ */

.flip-card {
  background-color: transparent;
  perspective: 1000px;
  height: 210px; /* Compactado ~25% adicional */
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner,
.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.125rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.flip-card-front {
  background-color: white;
  border: 1px solid #E5E7EB;
}

.flip-card-back {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary-1) 100%);
  color: #1F2937;
  transform: rotateY(180deg);
}

/* Responsive: en móvil el flip se activa con tap/click */
@media (max-width: 768px) {
  .flip-card {
    height: 200px;
  }
  
  .flip-card:hover .flip-card-inner {
    transform: none;
  }
  
  .flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
  }
}

/* ============================================ */
/* LAYOUT DETALLADO DE SERVICIOS */
/* ============================================ */

.service-list {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.service-item {
  display: grid;
  gap: 2rem;
  align-items: stretch;
}

@media (min-width: 1024px) {
  .service-item {
    grid-template-columns: 0.95fr 1.05fr;
  }
}

.service-info-card {
  background-color: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.service-info-card h3 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1F2937;
}

.service-info-card p {
  color: #4B5563;
  line-height: 1.7;
}

.service-includes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.service-includes li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: #374151;
  font-weight: 500;
}

.service-includes li::before {
  content: "✔";
  color: var(--color-primary);
  font-weight: 700;
}

.service-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.service-photo {
  width: 100%;
  height: 100%;
  border-radius: 0.75rem;
  background-size: cover;
  background-position: center;
  border: 3px solid #fff;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.service-flip {
  height: 320px;
}

.service-flip .flip-card {
  height: 100%;
}

/* ============================================ */
/* FOOTER COMPACTO */
/* ============================================ */

.footer-compact {
  background-color: var(--color-secondary-2);
  color: var(--color-text-dark);
  padding: 2.5rem 0;
}

.footer-columns {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-columns {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.footer-column {
  flex: 1;
  min-width: 200px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.footer-links a {
  color: #1F2937;
  font-weight: 500;
  text-decoration: none;
}

.footer-links a:hover {
  color: #0f172a;
}

.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #1F2937;
  font-weight: 500;
}

.footer-contact-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
}

.footer-bottom {
  border-top: 1px solid rgba(15, 23, 42, 0.2);
  margin-top: 2rem;
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-weight: 600;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* Prevenir animaciones si el usuario prefiere movimiento reducido - WCAG 2.1 */
@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;
  }
  
  .carousel-slide {
    transition: none;
  }
}