/* Ajustes para evitar el desbordamiento horizontal en pantallas móviles pequeñas */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Mejora de la interacción táctil en carrusel móvil */
@media (max-width: 1024px) {
    .group\/carousel button {
        opacity: 0.8 !important;
        background-color: rgba(18, 18, 18, 0.7);
        padding: 0.5rem;
    }
}

/* Custom Scrollbar for Luxury Aesthetic */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #121212;
}
::-webkit-scrollbar-thumb {
    background: #DFCBB5;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #D4AF37;
}

/* Custom Keyframe Animations */
@keyframes subtleZoom {
    0% {
        transform: scale(1.03) translateZ(0);
    }
    50% {
        transform: scale(1.07) translateZ(0);
    }
    100% {
        transform: scale(1.03) translateZ(0);
    }
}

.animate-subtle-zoom {
    animation: subtleZoom 25s infinite ease-in-out;
}

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

.animate-fade-in {
    opacity: 0;
    animation: fadeInUp 1.2s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

/* Sticky Navbar Elegant Scroll Styling */
.header-scrolled {
    background-color: rgba(18, 18, 18, 0.95) !important;
    backdrop-filter: blur(12px);
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    border-bottom: 1px solid rgba(223, 203, 181, 0.15);
}

.header-scrolled #header-logo,
.header-scrolled #desktop-menu a {
    color: #FAF9F6;
}

.header-scrolled .btn-primary {
    border-color: #DFCBB5 !important;
    color: #DFCBB5 !important;
}

.header-scrolled .btn-primary:hover {
    background-color: #DFCBB5 !important;
    color: #121212 !important;
}

/* Active Service Tab Highlight State */
.service-tab-active {
    color: #D4AF37 !important;
    border-color: #D4AF37 !important;
    font-weight: 600;
}

/* Custom Intersect Transition Properties */
.scroll-animated {
    will-change: transform, opacity;
}

/* Lightbox overlay styling */
#lightbox-img {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#cookie-banner {
  z-index: 99999 !important;
  isolation: isolate;
}

/* --- Respaldo en CSS puro para el menú móvil (#mobile-menu) ---
   La utilidad "bg-luxuryBlack/98" usada en el HTML no está incluida en
   el build actual de tailwind.css (sí existen /60, /90 y /95, pero no
   /98), así que el panel del menú se queda sin fondo y se ve
   transparente sobre el contenido de la página al abrirse en móvil.
   Esta regla no depende del build de Tailwind: sigue funcionando
   aunque css/tailwind.css no se haya recompilado con la clase nueva,
   y es inofensiva si en algún momento sí se recompila. */
#mobile-menu {
  background-color: rgba(18, 18, 18, 0.98);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  isolation: isolate;
}

/* En pantallas muy bajas (celulares en horizontal o con poca altura),
   evita que el contenido del menú se apriete o se corte: permite
   scroll interno y da un poco más de espacio entre los enlaces. */
@media (max-height: 500px) {
  #mobile-menu {
    overflow-y: auto;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
  }
  #mobile-menu nav {
    gap: 1rem;
  }
}

/* --- Respaldo en CSS puro para politicas.html ---
   Estas reglas no dependen del build de Tailwind: siguen funcionando
   aunque css/tailwind.css todavía no se haya recompilado con las
   clases nuevas del HTML. Es seguro dejarlas incluso después de
   recompilar Tailwind (son inofensivas si las utilidades ya existen). */

/* Enlace "Saltar al contenido": oculto hasta recibir foco */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  background: #121212;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 0.25rem;
  text-decoration: none;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Espacio de despeje bajo el header fijo y antes del footer del sitio,
   en la página de políticas (espacio EXTERIOR a la tarjeta) */
#politicas-wrapper {
  padding-top: 4rem;
  padding-bottom: 3rem;
}
@media (min-width: 640px) {
  #politicas-wrapper {
    padding-top: 4.5rem;
  }
}
@media (min-width: 1024px) {
  #politicas-wrapper {
    padding-top: 5rem;
    padding-bottom: 4rem;
  }
}

/* Espacio INTERIOR de la tarjeta de contenido: más aire arriba y abajo
   del texto, independiente de si py-12/lg:py-20 ya están compilados */
#main-content {
  padding-top: 4rem;
  padding-bottom: 4rem;
}
@media (min-width: 1024px) {
  #main-content {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
}

/* Offset del ancla para el índice interno, sin depender de scroll-mt-* */
#main-content [id] {
  scroll-margin-top: 6rem;
}

/* Estilos de impresión: útil para documentos legales como politicas.html.
   Oculta navegación, footer editorial y banner de cookies; deja texto
   legible en negro sobre blanco. */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
    }

    main {
        box-shadow: none !important;
        border: none !important;
        background: #ffffff !important;
        margin: 0 !important;
        max-width: 100% !important;
    }

    a {
        color: #000000 !important;
        text-decoration: underline !important;
    }
}

/* --- Galería de la sección "MI FORMACIÓN" ---
   Estructura: tarjeta en columna en móvil (foto arriba, nombre abajo)
   y en fila desde 640px (foto a la izquierda, nombre a la derecha),
   igual que la galería de referencia.

   Estas reglas NO dependen del build de Tailwind: las utilidades que
   harían falta para el ancho de la foto (sm:w-[42%], min-w-0) no están
   incluidas en css/tailwind.css, así que se resuelven aquí. Son
   inofensivas si en algún momento se recompila Tailwind. */
.formacion-card-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  flex-shrink: 0;
}

.formacion-card-body {
  min-width: 0;
}

@media (min-width: 640px) {
  .formacion-card-media {
    width: 42%;
    aspect-ratio: auto;
    align-self: stretch;
    min-height: 16rem;
  }

  .formacion-card-body {
    flex: 1 1 auto;
  }
}

/* Respeta la preferencia del sistema de reducir animaciones */
@media (prefers-reduced-motion: reduce) {
  .formacion-card img {
    transition: none !important;
    transform: none !important;
  }
}

/* Respaldo: "text-justify" no está en el build actual de css/tailwind.css */
.text-justify {
  text-align: justify;
}