/* =====================================================
   MOBILE OPTIMIZATIONS - JR GLOBAL RENT CAR
   Optimizaciones avanzadas para dispositivos móviles
   ===================================================== */

/* Viewport Meta Tag Optimizations */
@viewport {
    width: device-width;
    initial-scale: 1.0;
    maximum-scale: 5.0;
    user-scalable: yes;
}

/* Smooth Scrolling for Mobile */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Mobile Performance Optimizations */
* {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000;
    perspective: 1000;
}

/* Touch-friendly Button Sizes */
.btn, .nav-link, button {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 20px;
}

/* Mobile Navigation Improvements */
@media (max-width: 991px) {
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        border-radius: 0 0 15px 15px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        padding: 1rem;
        margin: 0;
    }
    
    .navbar-nav {
        width: 100%;
    }
    
    .nav-item {
        width: 100%;
        margin: 0.25rem 0;
    }
    
    .nav-link {
        width: 100%;
        text-align: center;
        border-radius: 8px;
        transition: all 0.3s ease;
    }
    
    .nav-link:hover,
    .nav-link:focus {
        background-color: var(--light-blue);
        transform: translateY(-2px);
    }
    
    .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin-top: 0.5rem;
        background-color: var(--light-blue);
        border: none;
        border-radius: 8px;
        box-shadow: none;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
        border-radius: 6px;
        margin: 0.25rem 0;
    }
}

/* Mobile Hero Section Optimizations */
@media (max-width: 768px) {
    .hero-slide {
        background-attachment: scroll;
        background-position: center top;
    }
    
    .hero-content {
        backdrop-filter: blur(5px);
        background: rgba(0, 0, 0, 0.3);
        border-radius: 15px;
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
}

/* Mobile Card Optimizations */
@media (max-width: 576px) {
    .card {
        margin-bottom: 1rem;
        border-radius: 15px;
        overflow: hidden;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1.1rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }
    
    .card-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }
}

/* Mobile Form Optimizations */
@media (max-width: 576px) {
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
        font-weight: 600;
    }
    
    .form-control {
        border-radius: 10px;
        border: 2px solid #e9ecef;
        transition: all 0.3s ease;
    }
    
    .form-control:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.2rem rgba(200, 16, 46, 0.25);
        transform: translateY(-1px);
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group .form-control {
        border-radius: 10px;
        margin-bottom: 0.5rem;
    }
    
    .input-group .btn {
        border-radius: 10px;
        width: 100%;
    }
}

/* Mobile Image Optimizations */
@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
        border-radius: 10px;
    }
    
    .car-image img,
    .package-image img {
        border-radius: 15px 15px 0 0;
    }
}

/* Mobile Spacing Optimizations */
@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .col,
    [class*="col-"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .py-4 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    .my-5 {
        margin-top: 2rem !important;
        margin-bottom: 2rem !important;
    }
    
    .my-4 {
        margin-top: 1.5rem !important;
        margin-bottom: 1.5rem !important;
    }
}

/* Mobile Typography Optimizations */
@media (max-width: 576px) {
    h1 {
        font-size: 1.8rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    h2 {
        font-size: 1.6rem;
        line-height: 1.3;
        margin-bottom: 0.8rem;
    }
    
    h3 {
        font-size: 1.4rem;
        line-height: 1.3;
        margin-bottom: 0.6rem;
    }
    
    h4 {
        font-size: 1.2rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
    }
    
    h5 {
        font-size: 1.1rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
    }
    
    h6 {
        font-size: 1rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
    }
    
    p {
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }
    
    .lead {
        font-size: 1rem;
        line-height: 1.5;
    }
}

/* Mobile Loading Optimizations */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-blue);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Accessibility Improvements */
@media (max-width: 576px) {
    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    
    .focus-visible:focus {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
    }
    
    .btn:focus,
    .form-control:focus,
    .nav-link:focus {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
    }
}

/* Mobile Animation Optimizations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #f8f9fa;
        --text-light: #dee2e6;
        --white: #212529;
        --light-blue: #343a40;
    }
}

/* Mobile Print Styles */
@media print {
    .navbar,
    .btn,
    .footer {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    .card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}
