/* ==========================================
 * RESPONSIVE & MOBILE OPTIMIZATIONS
 * Estilos adicionales para mejorar la experiencia móvil
 * ========================================== */

/* ==================== MOBILE MENU ==================== */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 32px;
    height: 28px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    width: 32px;
    height: 3px;
    background: var(--color-text-light);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
}

.hamburger::before {
    transform: translateY(-10px);
}

.hamburger::after {
    transform: translateY(10px);
}

/* Animación del hamburger cuando está activo */
.mobile-menu-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger::before {
    transform: rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger::after {
    transform: rotate(-45deg);
}

/* Menú móvil */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background: var(--color-bg-dark);
    z-index: 1000;
    padding: 100px 2rem 2rem;
    overflow-y: auto;
    transition: right 0.3s ease-in-out;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mobile-menu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu a {
    display: block;
    padding: 1.25rem 0;
    color: var(--color-text-light);
    font-size: 1.1rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-menu a:hover,
.mobile-menu a.active {
    color: var(--color-primary);
    padding-left: 1rem;
}

.mobile-menu a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: var(--color-primary);
    border-radius: 2px;
}

/* Overlay para cerrar el menú */
.mobile-menu.active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

/* ==================== MEDIA QUERIES ==================== */

/* Tablets y móviles grandes */
@media (max-width: 992px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .container {
        padding: 0 1.5rem;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    /* Ajustar grid de vehículos */
    .vehiculos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Ajustar filtros */
    .filtros-form {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .filtro-item {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 150px;
    }
}

/* Móviles */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero {
        min-height: 90vh;
        padding-top: 100px;
    }
    
    .hero-title {
        font-size: 2.2rem;
        line-height: 1.2;
        margin-bottom: 1.5rem;
    }
    
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
    }
    
    /* Grid de vehículos a 1 columna */
    .vehiculos-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Tarjetas de vehículo */
    .vehiculo-card {
        max-width: 100%;
    }
    
    .vehiculo-image {
        height: 220px;
    }
    
    .vehiculo-content {
        padding: 1.5rem;
    }
    
    .vehiculo-content h2,
    .vehiculo-content h3 {
        font-size: 1.3rem;
    }
    
    .vehiculo-precio {
        font-size: 1.4rem;
    }
    
    .vehiculo-specs {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .vehiculo-specs span {
        font-size: 0.85rem;
    }
    
    /* Filtros */
    .filtros-form {
        flex-direction: column;
    }
    
    .filtro-item {
        width: 100%;
        min-width: 100%;
    }
    
    .filtro-select,
    .filtro-input {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }
    
    .btn-search-filtro {
        width: 100%;
        height: 50px;
    }
    
    /* Header */
    .header .container {
        padding: 0 1rem;
    }
    
    .navbar {
        padding: 0.75rem 0;
    }
    
    .logo img {
        width: 50px;
        height: 50px;
    }
    
    .logo span {
        font-size: 1rem;
    }
    
    .logo > div::after {
        font-size: 0.6rem;
    }
    
    .btn-contact {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
    }
    
    /* Botones */
    .btn {
        padding: 0.9rem 1.8rem;
        font-size: 0.9rem;
    }
    
    .btn-primary {
        padding: 1rem 2rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }
    
    .footer-section h3 {
        font-size: 1.1rem;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    /* Formularios */
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .formulario-venta-modal {
        padding: 1.5rem;
        max-height: 95vh;
    }
    
    .formulario-venta-container {
        padding: 2rem 1.5rem;
    }
    
    .formulario-venta-title {
        font-size: 1.8rem;
    }
    
    /* Secciones */
    .porque-grid,
    .servicios-grid,
    .como-comprar-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .page-header {
        padding: 6rem 0 2.5rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    /* WhatsApp flotante */
    .floating-whatsapp {
        width: 55px;
        height: 55px;
        bottom: 1.5rem;
        right: 1.5rem;
    }
    
    .floating-whatsapp svg {
        width: 22px;
        height: 22px;
    }
}

/* Móviles pequeños */
@media (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero {
        min-height: 85vh;
        padding-top: 90px;
    }
    
    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 1.25rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .vehiculo-image {
        height: 200px;
    }
    
    .vehiculo-content {
        padding: 1.25rem;
    }
    
    .vehiculo-content h2,
    .vehiculo-content h3 {
        font-size: 1.2rem;
    }
    
    .vehiculo-precio {
        font-size: 1.3rem;
    }
    
    .precio-anterior {
        font-size: 1rem;
    }
    
    .vehiculo-specs span {
        font-size: 0.8rem;
        padding: 0.4rem 0.7rem;
    }
    
    .logo img {
        width: 45px;
        height: 45px;
    }
    
    .logo span {
        font-size: 0.95rem;
    }
    
    .logo > div::after {
        font-size: 0.55rem;
    }
    
    .btn-contact {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 0.85rem 1.5rem;
        font-size: 0.85rem;
    }
    
    .page-header {
        padding: 5.5rem 0 2rem;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .formulario-venta-modal {
        padding: 1rem;
    }
    
    .formulario-venta-container {
        padding: 1.5rem 1rem;
    }
    
    .formulario-venta-title {
        font-size: 1.5rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-group input,
    .form-group select {
        padding: 0.75rem 0.875rem;
        font-size: 0.95rem;
    }
    
    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
    
    .floating-whatsapp {
        width: 50px;
        height: 50px;
        bottom: 1rem;
        right: 1rem;
    }
    
    .floating-whatsapp svg {
        width: 20px;
        height: 20px;
    }
    
    /* Badges */
    .badge-nuevo,
    .badge-descuento,
    .badge-estado {
        font-size: 0.7rem;
        padding: 0.4rem 0.75rem;
    }
    
    /* Ajustar espaciado de secciones */
    section {
        padding: 3rem 0;
    }
    
    .hero-actions-float {
        padding: 2rem 0;
    }
    
    .testimonials-section,
    .porque-section,
    .vende-section,
    .como-comprar-section {
        padding: 3rem 0;
    }
}

/* Móviles muy pequeños */
@media (max-width: 375px) {
    .hero-title {
        font-size: 1.6rem;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .vehiculo-content h2,
    .vehiculo-content h3 {
        font-size: 1.1rem;
    }
    
    .vehiculo-precio {
        font-size: 1.2rem;
    }
    
    .logo span {
        font-size: 0.9rem;
    }
    
    .btn-contact {
        padding: 0.55rem 0.9rem;
        font-size: 0.75rem;
    }
    
    .mobile-menu {
        width: 90%;
    }
}

/* Landscape móviles */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 120px 0 3rem;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-search {
        margin-top: 1rem;
    }
    
    .mobile-menu {
        padding-top: 80px;
    }
}

/* Mejoras de rendimiento para móviles */
@media (max-width: 768px) {
    /* Reducir animaciones en móviles para mejor rendimiento */
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.2s !important;
    }
    
    /* Optimizar imágenes */
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ==================== TOUCH OPTIMIZATIONS ==================== */
@media (hover: none) and (pointer: coarse) {
    /* Aumentar áreas táctiles */
    .btn,
    .nav-links a,
    .mobile-menu a,
    .vehiculo-card,
    .filtro-select,
    .filtro-input {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Eliminar hover effects en dispositivos táctiles */
    .vehiculo-card:hover {
        transform: none;
    }
    
    /* Mejorar feedback táctil */
    .btn:active,
    .vehiculo-card:active {
        transform: scale(0.98);
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .header,
    .footer,
    .floating-whatsapp,
    .mobile-menu-toggle,
    .btn-contact,
    .filtros-section,
    .chatbot-widget {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .vehiculo-card {
        page-break-inside: avoid;
        border: 1px solid #000;
        margin-bottom: 1rem;
    }
}
