/* Critical CSS para Mazda Guatemala - Optimizado para Lighthouse */

/* Reset básico y estilos fundamentales */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* Skip link para accesibilidad */
.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link:focus {
    position: static;
    width: auto;
    height: auto;
    left: auto;
    clip: auto;
    padding: 8px 12px;
    background: #000;
    color: #fff;
    z-index: 1000;
    text-decoration: none;
}

/* Layout principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.container-fluid {
    width: 100%;
    padding: 0;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 15px;
}

.col-sm-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 15px;
}

.col-lg-3 {
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0 15px;
}

/* Carrusel crítico */
.carousel {
    position: relative;
    margin-bottom: 0;
}

.carousel-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-item {
    position: relative;
    display: none;
    width: 100%;
    transition: transform 0.6s ease-in-out;
}

.carousel-item.active {
    display: block;
}

.carousel-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Tarjetas de vehículos */
.snip1361 {
    position: relative;
    overflow: hidden;
    margin: 10px;
    background: #000;
    color: #fff;
    text-align: left;
    font-size: 16px;
    box-shadow: 0 0 5px rgba(0,0,0,0.15);
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.snip1361:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.snip1361 img {
    max-width: 100%;
    height: 200px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.snip1361 figcaption {
    padding: 20px;
    position: relative;
}

.snip1361 h2 {
    font-weight: bold;
    font-size: 1.4em;
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: -1px;
    text-align: center;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 8px 16px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

/* Tipografía */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 1rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.lead {
    font-size: 1.25rem;
    font-weight: 300;
    margin-bottom: 1rem;
}

.text-center {
    text-align: center;
}

.text-uppercase {
    text-transform: uppercase;
}

/* Utilidades de espaciado */
.py-5 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.pt-4 {
    padding-top: 1.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .col-sm-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .snip1361 h2 {
        font-size: 1.2em;
    }
}

@media (max-width: 576px) {
    .col-lg-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .snip1361 {
        margin: 5px;
    }
    
    .snip1361 figcaption {
        padding: 15px;
    }
}

/* Optimizaciones para móviles */
@media (max-width: 480px) {
    .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .snip1361 img {
        height: 150px;
    }
}

/* Mejoras de rendimiento */
img {
    max-width: 100%;
    height: auto;
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
}

/* Botón scroll to top */
.scrollTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: none;
    z-index: 1000;
    transition: all 0.3s ease;
}

.scrollTop:hover {
    background: #0056b3;
    transform: scale(1.1);
}

/* Animaciones optimizadas */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}
