/* Mobile Menu Component Styles */

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    z-index: 50;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    animation: fadeIn 0.3s ease-out;
    -webkit-overflow-scrolling: touch;
    will-change: transform, opacity;
}

.mobile-menu-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Close Button */
.mobile-menu-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    color: white;
    font-size: 2.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg) scale(1.1);
}

/* Mobile Logo */
.mobile-menu-logo {
    margin-bottom: 3rem;
    transition: transform 0.3s ease;
}

.mobile-menu-logo:hover {
    transform: scale(1.05);
}

.mobile-logo-image {
    height: 3rem;
    width: auto;
}

/* Mobile Navigation */
.mobile-navigation {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: center;
    font-size: 1.5rem;
}

.mobile-nav-link {
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 1rem;
    border-radius: 0.5rem;
    position: relative;
    overflow: hidden;
}

.mobile-nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.mobile-nav-link:hover::before {
    left: 100%;
}

.mobile-nav-link:hover {
    color: #fbbf24;
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

/* Mobile Services Dropdown */
.mobile-services-dropdown {
    position: relative;
}

.mobile-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 1rem;
    border-radius: 0.5rem;
    font-size: 1.5rem;
}

.mobile-dropdown-trigger:hover {
    color: #fbbf24;
    background-color: rgba(255, 255, 255, 0.05);
}

.mobile-dropdown-icon {
    height: 1.25rem;
    width: 1.25rem;
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.mobile-services-dropdown.open .mobile-dropdown-icon {
    transform: rotate(180deg);
}

.mobile-dropdown-menu {
    margin-top: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 1rem;
    font-size: 1.25rem;
    animation: slideDown 0.3s ease-out;
}

.mobile-services-dropdown.open .mobile-dropdown-menu {
    display: flex;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-dropdown-link {
    color: #bfdbfe;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.75rem;
    border-radius: 0.375rem;
    position: relative;
    overflow: hidden;
}

.mobile-dropdown-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.1), transparent);
    transition: left 0.5s ease;
}

.mobile-dropdown-link:hover::before {
    left: 100%;
}

.mobile-dropdown-link:hover {
    color: #fbbf24;
    background-color: rgba(255, 255, 255, 0.05);
}

/* Mobile Menu Animation States */
.mobile-menu-enter {
    opacity: 0;
    transform: scale(0.95);
}

.mobile-menu-enter-active {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.mobile-menu-exit {
    opacity: 1;
    transform: scale(1);
}

.mobile-menu-exit-active {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease-in, transform 0.3s ease-in;
}

/* Background Pattern */
.mobile-menu-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* Responsive Design */
@media (min-width: 768px) {
    .mobile-menu-overlay {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .mobile-navigation {
        font-size: 1.25rem;
        gap: 1.5rem;
    }
    
    .mobile-dropdown-menu {
        font-size: 1rem;
    }
    
    .mobile-menu-close {
        font-size: 2rem;
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .mobile-logo-image {
        height: 2.5rem;
    }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    .mobile-nav-link,
    .mobile-dropdown-link,
    .mobile-dropdown-trigger {
        min-height: 44px; /* iOS recommended touch target */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    nav a:active,
    nav button:active {
        background-color: rgba(59, 130, 246, 0.1);
        transform: scale(0.98);
    }
}

/* Mobile Menu Styles - Diseño Moderno */

/* Animación de entrada del menú desde la derecha */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Animación de salida del menú hacia la derecha */
@keyframes slideOutRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

/* Estilo para las transiciones de Vue */
.transition {
    transition-property: all;
}

.ease-out {
    transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
}

.ease-in {
    transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}

.duration-300 {
    transition-duration: 300ms;
}

.duration-200 {
    transition-duration: 200ms;
}

.duration-150 {
    transition-duration: 150ms;
}

/* Backdrop blur para navegadores que lo soporten */
@supports (backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px)) {
    .backdrop-blur-sm {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}

/* Fallback para navegadores sin backdrop-filter */
@supports not ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
    .backdrop-blur-sm {
        background-color: rgba(0, 0, 0, 0.6);
    }
}

/* Mejora de rendimiento para animaciones */
.mobile-menu-container {
    will-change: transform, opacity;
}

/* Estilo para scroll suave en iOS */
nav {
    -webkit-overflow-scrolling: touch;
}

/* Animación sutil para los items del menú */
nav a,
nav button {
    position: relative;
    overflow: hidden;
}

nav a::before,
nav button::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background-color: rgba(59, 130, 246, 0.1);
    transition: width 0.3s ease;
}

nav a:hover::before,
nav button:hover::before {
    width: 100%;
}

/* Estilo para el botón de WhatsApp con efecto de pulso */
@keyframes pulse-green {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
}

.hover\:scale-\[1\.02\]:hover {
    animation: pulse-green 2s infinite;
}

/* Scroll personalizado para el menú */
nav::-webkit-scrollbar {
    width: 4px;
}

nav::-webkit-scrollbar-track {
    background: transparent;
}

nav::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 4px;
}

nav::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

/* Accesibilidad: Focus visible */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Optimización para pantallas pequeñas */
@media (max-width: 360px) {
    .max-w-sm {
        max-width: 90vw;
    }
}

/* Safe area para dispositivos con notch */
@supports (padding: max(0px)) {
    .px-4 {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .py-5 {
        padding-top: max(1.25rem, env(safe-area-inset-top));
        padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
    }
}