:root {
    --vh: var(--vh); /* Valor por defecto */
}
/* Reset básico */

/* Estilos del mensaje */
.landscape-warning {
    display: none; /* Oculto por defecto */
    position: fixed;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 1.5rem;
    text-align: center;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    top: 0;
    left: 0;
    padding: 20px;
}

/* Ocultar el contenido de la página cuando el mensaje esté activo */
body.landscape-mode main,
body.landscape-mode nav,
body.landscape-mode footer {
    display: none !important;
}

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

.emoji-img {
    width: 1.2em;  /* Ajusta según necesites */
    height: 1.2em;
    vertical-align: middle;
    display: inline-block;
}

.emoji {
    font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif !important;
    font-size: 1.5em;
}


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

/* Inicialmente ocultamos los elementos */
.fade-in {
    opacity: 0;
    animation: fadeInStaggered 0.8s ease-out forwards;
}

.contactFormPage {
    margin-top: var(--menuHeight, 0); /* Margen superior igual a la altura del navbar */
    padding-bottom: var(--footerHeight, 0); /* Padding inferior igual a la altura del footer */
    min-height: calc(var(--vh) - var(--menuHeight, 0) - var(--footerHeight, 0)); /* Altura mínima para ocupar el espacio restante */
    overflow: auto; /* Permite el scroll si el contenido es más grande */
}
/* Animaciones escalonadas */
#contact-header { animation-delay: 0.2s; }
#contact-form { animation-delay: 0.4s; }
#form-errors { animation-delay: 0.5s; }
#form-nombres { animation-delay: 0.6s; }
#form-apellidos { animation-delay: 0.8s; }
#form-correo { animation-delay: 1s; }
#form-mensaje { animation-delay: 1.2s; }
#form-boton { animation-delay: 1.4s; }
#form-contacto { animation-delay: 1.6s; }

/* Desactivar transiciones iniciales */
body.no-transition * {
    transition: none !important;
}

/* Tema oscuro */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #121212;
    color: #E0E0E0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Usa 100vh en lugar de var(--vh) */
    transition: background-color 0.5s ease, color 0.5s ease;
}

.ih-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.3rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

/* Logo */
.ih-logo img {
    width: 50px;
    height: 50px;
    transition: transform 0.3s ease;
}

.ih-logo:hover img {
    transform: scale(1.05);
}

/* Menú */
/* Navbar */
.ih-navbar {
    background-color: #1a1a1a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    display: inline-table;
    justify-content: center;
}

/* Menú */
.ih-menu {
    list-style: none;
    display: flex;
    align-items: center;
    margin-bottom: 0;
    font-family: 'DM Serif Display', serif; /* O usa 'DM Serif Display' */
    font-size: 18px; /* Ajustamos el tamaño para que no se vea pequeño */
    font-weight: 400;
}
.ih-menu-item {
    position: relative;
    margin: 0 15px;
}
/* Opciones del menú */
.ih-menu-link {
    text-decoration: none;
    color: #D4AF37;
    padding: 10px 15px;
    display: block;
    position: relative;
    transition: transform 0.3s ease, color 0.3s ease;
}

/* Efecto hover con gradiente */
.ih-menu-link:hover {
    color: white;
    background: linear-gradient(to right, #D4AF37, #C9A227);
    border-radius: 4px;
    transform: scale(1.05); /* Aumenta ligeramente el tamaño */
}

/* Línea inferior animada */
.ih-menu-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0px; /* Pegada al borde inferior */
    left: 0; /* Empieza desde la izquierda */
    background: linear-gradient(to right, #D4AF37, #C9A227);
    transition: width 0.3s ease-out;
    border-radius: 2px; /* Para que respete el borde redondeado */
}

/* Expansión de la línea al hacer hover (casi todo el ancho) */
.ih-menu-link:hover::after {
    width: calc(100% - 10px); /* Se expande dejando un pequeño margen */
}

/* Reducción de la línea hacia la izquierda */
.ih-menu-link:not(:hover)::after {
    width: 0;
}
/* Submenú */
/* Ocultar submenú por defecto */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #1a1a1a;
    padding: 0;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: scaleY(0);
    transform-origin: top;
}

/* Animación de apertura en escalera */
@keyframes openStaircase {
    from {
        opacity: 0;
        transform: scaleY(0);
    }
    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

/* Animación de cierre */
@keyframes closeStaircase {
    from {
        opacity: 1;
        transform: scaleY(1);
    }
    to {
        opacity: 0;
        transform: scaleY(0);
    }
}

/* Aplicar animación en todas las pantallas */
.ih-menu.active,
.dropdown-menu.active {
    visibility: visible;
    animation: openStaircase 0.3s ease-out forwards;
}

/* Animación de cierre */
.ih-menu.closing,
.dropdown-menu.closing {
    animation: closeStaircase 0.3s ease-out forwards;
}

.dropdown-item-switch{
    color: #D4AF37; /* Texto en dorado */
    text-decoration: none;
    transition: background 0.3s ease, color 0.3s ease;
}

.dropdown-item {
    color: #D4AF37; /* Texto en dorado */
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    transition: background 0.3s ease, color 0.3s ease;
    width: 100%;
}

/* Hover en modo oscuro */
.dropdown-item:hover {
    background: linear-gradient(to right, #D4AF37, #C9A227);
    color: #000;
}

.dropdown:hover .dropdown-menu {
    display: block;
}
/* Mostrar flechas solo en móviles */
.dropdown-arrow {
    display: none;
    transition: transform 0.3s ease;
}
.dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Mantener el hover activo mientras el submenú esté desplegado */
.dropdown.active > .dropdown-toggle,
.dropdown:hover > .dropdown-toggle {
    background: linear-gradient(to right, #D4AF37, #C9A227);
    color: white;
    border-radius: 4px;
    transform: scale(1.05); /* Aumenta ligeramente el tamaño */
}

/* Evitar efectos no deseados en la opción Soporte */
.dropdown-toggle::after,
.dropdown-toggle::before {
    content: none !important;
    display: none !important;
}

/* Rotación de la flecha del submenú en móviles */
.dropdown-toggle .dropdown-arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}

/* Botón hamburguesa */
.ih-toggle {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 2rem;
    color: #D4AF37;
}

/* Ajustar tamaño del botón de cierre (X) */
.ih-close-icon {
    font-size: 2.4rem; /* Ajusta el tamaño de la X */
    display: none; /* Sigue oculta por defecto */
}

/* Cuando el menú está abierto, ocultar hamburguesa y mostrar X */
.ih-toggle.open .ih-toggle-icon {
    display: none;
}

.ih-toggle.open .ih-close-icon {
    display: block;
    
}

/* Botón de cambio de tema */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color 0.5s ease, color 0.5s ease;
    color: #D4AF37; /* Color del icono */
}

/* Efecto hover */
.theme-toggle:hover {
    background: linear-gradient(to right, #D4AF37, #C9A227);
    color: white;
}

/* Ajuste para tema claro */
.light-theme .theme-toggle {
    color: #333;
}

.light-theme .theme-toggle:hover {
    background: linear-gradient(to right, #D4AF37, #C9A227);
    color: white;
}

/* Transición para el cambio de tema */
.ih-navbar, .ih-menu-link, .dropdown-menu, .dropdown-item {
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Estilos para el switch */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #D4AF37;
}

input:focus + .slider {
    box-shadow: 0 0 1px #ceae45;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Asegúrate que el dropdown no se cierre al hacer clic en el switch */
.dropdown-menu .switch,
.dropdown-menu input {
    z-index: 5;
}

/* Tema claro para el menú */
.light-theme .ih-navbar {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.light-theme .ih-menu-link {
    color: #333;
}

.light-theme .ih-menu-link:hover {
    color: #ffffff;
    background: linear-gradient(to right, #D4AF37, #C9A227);
}

.light-theme .dropdown-menu {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.light-theme .dropdown-item {
    color: #333;
}

.light-theme .dropdown-item-switch {
    color: #333;
}

.light-theme .dropdown-item:hover {
    color: #ffffff;
    background: linear-gradient(to right, #D4AF37, #C9A227);
}

.light-theme .ih-toggle {
    color: #333;
}

.light-theme .dropdown-arrow {
    color: #333;
}

.btn-primary,
button[type="submit"] {
    background: linear-gradient(to right, #D4AF37, #C9A227);
    border: none;
    color: white;
    padding: 10px 25px;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover,
button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

/* Footer */
.footer {
    background-color: var(--footer-bg, #1a1a1a);
    color: var(--footer-text, #fff);
    padding: 1rem;
    text-align: center;
    transition: background-color 0.5s ease, color 0.5s ease;
    width: 100%;
    margin-top: auto; /* Esto empuja el footer hacia abajo */
    z-index: 2;
}

.footer-p{
    margin-bottom: 0 !important;
}

.footer-link {
    color: #D4AF37;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: #FFFFFF;
    text-decoration: underline;
}

/* Estilos para el tema claro */
body.light-theme {
    background-color: #f8f9fa;
    color: #1a1a1a;
}

.light-theme .footer {
    background-color: #ffffff;
    color: #333;
}

.light-theme .footer-link {
    color: #D4AF37;
}

.light-theme .footer-link:hover {
    text-decoration: underline;
}

.light-theme .btn-primary,
.light-theme button[type="submit"] {
    background: linear-gradient(to right, #D4AF37, #C9A227);
    border: none;
    color: white;
    padding: 10px 25px;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.light-theme .btn-primary:hover,
.light-theme button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

/* Aplica la marca de agua dentro del modal */
.modal-content {
    background-color: #fff !important; /* Fondo blanco */
    color: #000 !important; /* Texto negro */
    position: relative; /* Necesario para la imagen de fondo */
}

#contenido-terminos {
    position: relative;
    background-color: white;
    min-height: 300px;
    overflow-y: auto;
    padding: 20px;
    text-align: justify;
}

#marca-agua {
    position: fixed; /* Fija la imagen para que no se salga de los términos */
    top: 10%;
    left: 50%;
    transform: translateX(-50%); /* Centrar la imagen */
    width: 70%; /* Ocupa todo el ancho del contenido */
    height: 75%; /* Solo se mostrará dentro del área visible */
    max-height: 100%; /* No debe salir del área */
    object-fit: contain; /* Mantiene la proporción */
    opacity: 0.1; /* Ajustar la transparencia según necesidad */
    z-index: 1; /* Se mantiene en el fondo */
    pointer-events: none; /* Evita que interfiera con el texto */
}

.modal-body {
    overflow-y: auto;
    max-height: 70vh;
    position: relative;
}

/* Asegurar que el contenido del modal esté por encima */
.modal-body, .modal-header {
    position: relative;
    z-index: 1;
}

body.modal-open {
    position: fixed;
    width: 100%;
    overflow: hidden; /* Bloquea el scroll de la página cuando el modal está abierto */
    height: 100vh; /* Evita que el usuario pueda desplazarse en la página */
}

.modal-dialog {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vw;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    margin: 0;
}

#terminosModal .modal-body {
    text-align: justify;
}

@media (min-width: 769px) { /* PC */
    .modal-dialog {
        width: 60vw !important;
        height: 100vh !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .p-contact-info{
        text-align: justify !important;
    }

    .modal-dialog {
        width: 90vw !important;
        height: 80vh !important;
    }
}

@media (max-width: 639px) {
    .ih-menu {
        position: absolute;
        top: 100%; /* Justo debajo de .ih-container */
        left: 0;
        width: 100%;
        background-color: #1a1a1a;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0;
        opacity: 0;
        visibility: hidden;
        transform: scaleY(0);
        transform-origin: top;
        transition: background-color 0.5s ease, color 0.5s ease;
    }

    .light-theme .ih-menu{
        background-color: #fff;
    }

    /* Reutilizar animación de apertura en escalera */
    .ih-menu.active {
        visibility: visible;
        animation: openStaircase 0.3s ease-out forwards;
    }

    .theme-toggle{
        padding: 0;
    }

    .dropdown-menu {
        position: absolute; /* Cambia a posición absoluta */
        left: 50%; /* Centra el submenú horizontalmente respecto al botón */
        transform: translateX(-50%) !important; /* Ajusta el centrado */
        width: auto; /* Ancho automático según el contenido */
        min-width: 150px; /* Ancho mínimo para evitar que sea demasiado estrecho */
        display: none; /* Oculta el submenú por defecto */
        text-align: center; /* Centra el texto dentro del submenú */
    }

    /* Mostrar el submenú cuando esté activo */
    .dropdown-menu.active {
        display: block;
    }

}
@media (min-width: 640px) {
    .ih-toggle {
        display: none !important;
    }
    .dropdown-arrow {
        display: none !important;
    }
    .dropdown-menu {
        position: absolute;
        right: 0; /* Despliega el submenú desde el borde derecho */
        left: auto; /* Anula la posición izquierda por defecto */
        transform: translateX(0); /* Evita que se desplace fuera de la pantalla */
    }
}
