/* ==========================================================================
   1. VARIABLES Y RESET (Identidad VitBikes)
   ========================================================================== */
:root {
    --azul-vit: #26a9e0; 
    --verde-vit: #39b54a;
    --oscuro: #1a1b1e;
    --blanco: #ffffff;
    --gris-fondo: #f8f9fa;
    --gris-texto: #333333;
    --fuente-principal: 'Open Sans', sans-serif;
}

html {
    box-sizing: border-box;
    font-size: 62.5%; /* 1rem = 10px */
}

*, *:before, *:after {
    box-sizing: inherit;
}

body {
    font-family: var(--fuente-principal);
    font-size: 1.6rem;
    line-height: 1.6;
    background-color: var(--gris-fondo);
    color: var(--gris-texto);
    margin: 0;
}

.contenedor {
    max-width: 1200px;
    margin: 0 auto;
    width: 90%;
}

.no-margin { margin: 0; }
img { max-width: 100%; display: block; }

/* ==========================================================================
   2. HEADER Y NAVEGACIÓN
   ========================================================================== */
.site-header {
    background-color: var(--blanco);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-superior {
    padding: 1rem 0;
}

.barra {
    display: flex;
    flex-direction: column;
    align-items: center;
}

@media (min-width: 768px) {
    .barra {
        flex-direction: row;
        justify-content: space-between;
    }
}

.logo-img {
    height: 90px;
    width: 90px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--azul-vit);
}

.navegacion {
    margin-top: 2rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

@media (min-width: 768px) {
    .navegacion { margin-top: 0; }
}

.navegacion a {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--oscuro);
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.3s ease;
}

.navegacion a:hover { color: var(--azul-vit); }

/* ==========================================================================
   3. HERO / BANNER
   ========================================================================== */
.hero {
    background-image: linear-gradient(to right, rgba(0,0,0,0.7), rgba(0,0,0,0.2)), url('../img/main.jpg');
    background-size: cover;
    background-position: center;
    height: 350px;
    display: flex;
    align-items: center;
    color: var(--blanco);
}

.contenido-hero h2 { font-size: 3.5rem; margin-bottom: 1rem; }

/* ==========================================================================
   4. SECCIÓN PRODUCTOS (ESTABILIZADA) - REEMPLAZO DE CARD ANTERIOR
   ========================================================================== */
.destacados-container {
    padding: 5rem 0;
}

.text-center { 
    text-align: center; 
    margin-bottom: 3rem; 
    font-size: 2.8rem; 
    font-weight: 800;
}

.grid-productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(26rem, 1fr));
    gap: 3rem;
    min-height: 50rem;
}

.producto-card {
    background: var(--blanco);
    border: 1px solid #eee;
    border-radius: 1.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 48rem; /* Altura rígida para evitar temblores */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.producto-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 1.5rem 3rem rgba(0,0,0,0.1);
    border-color: var(--azul-vit);
}

.imagen-contenedor {
    width: 100%;
    height: 22rem; /* Reserva de espacio fija */
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.imagen-contenedor img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1.5rem;
    display: block;
}

.tag-departamento {
    position: absolute;
    top: 1.2rem;
    left: 1.2rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--verde-vit);
    padding: 0.4rem 1rem;
    border-radius: 0.6rem;
    font-size: 1rem;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 0.2rem 0.5rem rgba(0,0,0,0.05);
    text-transform: uppercase;
    border: 1px solid #eee;
}

.tag-code {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--verde-vit);
    padding: 0.4rem 1rem;
    border-radius: 0.6rem;
    font-size: 1rem;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 0.2rem 0.5rem rgba(0,0,0,0.05);
    text-transform: uppercase;
    border: 1px solid #eee;
}

.info-producto {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.info-producto h3 {
    font-size: 1.6rem;
    color: var(--oscuro);
    margin: 0 0 1rem 0;
    height: 4.8rem; /* Reserva exacta para 2 líneas de texto */
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

.meta-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.2rem;
    border-top: 1px solid #f1f1f1;
}

.precio {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--oscuro);
    margin: 0;
}

.stock-badge {
    font-size: 1.1rem;
    background: #f0f0f0;
    color: #666;
    padding: 0.3rem 0.8rem;
    border-radius: 0.5rem;
    font-weight: 600;
}

.btn-comprar {
    display: block;
    text-align: center;
    background-color: var(--azul-vit);
    color: var(--blanco) !important;
    text-decoration: none;
    padding: 1.2rem;
    border-radius: 0.8rem;
    margin-top: 1.5rem;
    font-weight: bold;
    font-size: 1.4rem;
    transition: background 0.3s ease;
}

.btn-comprar:hover {
    background-color: var(--oscuro);
}

/* ==========================================================================
   5. SECCIÓN CONTACTO (MAPA)
   ========================================================================== */
.seccion-contacto {
    padding: 5rem 0;
}

.contacto-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
}

@media (min-width: 768px) {
    .contacto-grid {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

.mapa-contenedor, .mapouter, .gmap_canvas {
    width: 100% !important;
    height: 450px !important;
    border-radius: 1.5rem;
    overflow: hidden;
    position: relative;
}

.mapa-contenedor iframe {
    width: 100% !important;
    height: 100% !important;
    border: 0;
}

.enlace-social {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 2rem;
    text-decoration: none;
    color: var(--gris-texto);
    font-weight: bold;
    font-size: 1.7rem;
}

.enlace-social i { font-size: 3rem; }
.color-whatsapp { color: #25D366; }
.color-instagram { color: #E1306C; }

/* ==========================================================================
   6. FOOTER Y BOTÓN FLOTANTE
   ========================================================================== */
.site-footer {
    background-color: var(--oscuro);
    color: var(--blanco) !important;
    padding: 4rem 0 2rem 0;
    margin-top: 5rem;
}

.site-footer a {
    color: var(--blanco) !important;
}

.final-copyright {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #333;
}

.final-copyright p { color: #bbb; }
.final-copyright span { color: var(--azul-vit); font-weight: bold; }

.whatsapp-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: var(--verde-vit);
    color: var(--blanco) !important;
    padding: 1.2rem 2rem;
    border-radius: 5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 9999;
}

    /* Estilos del Menú de Departamentos */
    .seccion-departamentos {
        padding: 3rem 0;
        text-align: center;
    }

    .flex-dept {
        display: flex;
        flex-wrap: wrap;
        gap: 1.2rem;
        justify-content: center;
        max-width: 1100px;
        margin: 0 auto;
    }

    .btn-dept {
        display: inline-flex;
        align-items: center;
        background-color: #ffffff;
        border: 1px solid #e2e8f0;
        color: #4a5568;
        padding: 0.8rem 1.6rem;
        border-radius: 0.8rem;
        text-decoration: none;
        font-weight: 600;
        font-size: 1.3rem;
        transition: all 0.2s ease;
        box-shadow: 0 1px 2px rgba(0,0,0,0.05);
        text-transform: capitalize;
    }

    .btn-dept:hover {
        border-color: var(--azul-vit);
        color: var(--azul-vit);
        background-color: #f0f9ff;
        transform: translateY(-2px);
    }

    .btn-dept.activo {
        background-color: var(--azul-vit);
        color: #ffffff !important;
        border-color: var(--azul-vit);
        box-shadow: 0 4px 12px rgba(38, 169, 224, 0.25);
    }

    .btn-dept.activo svg {
        opacity: 1;
    }

    .titulo-dept {
        font-size: 1.4rem;
        color: #888;
        text-transform: uppercase;
        letter-spacing: 2px;
        margin-bottom: 2rem;
        font-weight: 700;
    }


    /* Contenedor de iconos */
.acciones-usuario {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: 20px;
}

/* Estilo para Registro */
.btn-usuario {
    color: var(--oscuro);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.btn-usuario i {
    font-size: 1.4rem;
    color: #007bff; /* Azul VitBikes */
}

.nav-link-cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-weight: bold;
}

.cart-badge {
    background-color: #ff4757; /* Rojo deportivo */
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 5px;
    padding: 2px;
    /* Efecto de pulso si el carrito no está vacío */
    box-shadow: 0 0 0 rgba(255, 71, 87, 0.4);
    animation: pulse 2s infinite;
}

/* Solo anima si hay algo en el carrito */
.cart-badge:empty { display: none; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 71, 87, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}

.btn-usuario:hover, .btn-carrito:hover {
    color: #007bff;
    transform: scale(1.05);
}

/* Ajuste Responsivo para móviles */
@media (max-width: 768px) {
    .barra {
        flex-direction: column;
        gap: 15px;
    }
    .acciones-usuario {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        border-top: 1px solid #eee;
        padding-top: 10px;
    }
}

/* Estilo Profesional para el Botón de Añadir */
.btn-agregar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 350px;
    padding: 18px 30px;
    margin-top: 15px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px rgba(0, 123, 255, 0.3);
}

.btn-agregar:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 25px rgba(0, 123, 255, 0.4);
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

.btn-agregar:active {
    transform: translateY(0) scale(0.98);
}

.btn-agregar i {
    font-size: 1.3rem;
}

/* Estilo para el botón de login (cuando no hay sesión) */
.btn-login-shop {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding: 15px 25px;
    color: #007bff;
    background: #eef6ff;
    border: 2px dashed #007bff;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: 0.3s;
}

.btn-login-shop:hover {
    background: #007bff;
    color: white;
}