/* ==========================================================================
   VERSION RESPONSIVA - ITR
   ========================================================================== */

/* ============================================================
   HEADER OPTIMIZADO PARA MÓVILES - ITR
   ============================================================ */

@media (max-width: 991px) {
    /* Ajuste del contenedor principal del header */
    .header {
        padding: 10px 0;
        position: fixed;
        width: 100%;
        top: 0;
        z-index: 1000;
        background: #fff;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    /* Botón de hamburguesa a la derecha */
    .navbar-toggler {
        border: none;
        padding: 8px;
    }

    /* El menú desplegable */
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #fff;
        padding: 20px;
        border-top: 1px solid #eee;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    }

    /* Lista de navegación en vertical */
    .navbar-nav {
        width: 100%;
    }

    .nav-item {
        width: 100%;
        text-align: left;
        border-bottom: 1px solid #f8f8f8;
        padding: 5px 0;
    }

    .nav-link {
        color: #333 !important;
        font-size: 1.1rem;
        display: block;
        padding: 10px 15px !important;
    }

    /* --- El Buscador en Móvil --- */
    .search-container {
        padding: 15px 0 !important;
        width: 100%;
    }

    .search-container input {
        width: 100% !important;
        height: 45px;
        border: 1px solid #be03fc;
    }

    /* --- Fila de Iconos (User y Carrito) --- */
    /* Los ponemos en una fila horizontal dentro del menú para que no ocupen mucho espacio */
    .login_btn {
        display: inline-block !important;
        width: auto !important;
        border-bottom: none !important;
    }

    .login_btn a {
        font-size: 1.5rem !important;
        color: #be03fc !important;
        padding: 15px 25px !important;
    }
}

/* Ajuste para que el contenido no quede debajo del header fijo */
body {
    padding-top: 80px;
}

@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }
}

/* Ajustes generales para móviles */
@media (max-width: 768px) {
    /* Banner: Evitar que sea gigante en móvil */
    .banner_main {
        padding-top: 60px; /* Espacio por el header fixed */
    }
    .text-bg figure img {
        height: 250px; /* Altura controlada para móvil */
        object-fit: cover;
    }
    .carousel-caption {
        bottom: 10px;
    }
    .text-bg h1 {
        font-size: 24px !important;
        line-height: 28px !important;
    }

    /* Productos: 2 por fila en lugar de 1 solo (mejor conversión) */
    .col-sm-12 {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 5px; /* Menos espacio entre tarjetas */
    }

    .producto-card h5 {
        font-size: 14px; /* Texto más pequeño para que quepa */
        height: 40px;
        overflow: hidden;
    }

    .producto-card .precio {
        font-size: 16px !important;
    }

    /* Ajustar botones de la tarjeta en móvil */
    .btn-sm {
        font-size: 11px;
        padding: 5px 2px;
    }

    /* Footer: Apilar elementos */
    .footer-flex {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* Ajustes para pantallas muy pequeñas (iPhone SE, etc) */
@media (max-width: 400px) {
    .col-sm-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* 1. Ajustes Generales de Contenedores */
.container, .container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

/* 2. Navegación y Header */
@media (max-width: 991px) {
    .navigation.navbar {
        padding: 10px 0;
    }
    
    .navbar-collapse {
        background: #fff;
        padding: 20px;
        border-radius: 10px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        margin-top: 15px;
    }

    .navbar-nav .nav-item {
        text-align: center;
        margin: 10px 0;
    }

    /* Ajuste del buscador en móviles */
    .search-container {
        width: 100%;
        padding: 10px 0;
    }
    
    #searchResults {
        width: 100%;
        left: 0;
    }
}

/* 3. Banner y Carrusel Principal */
@media (max-width: 768px) {
    .banner_main h1 {
        font-size: 2.2rem !important; /* Ajuste automático del h1 que pediste */
        line-height: 1.2;
    }

    .banner_main .text-bg figure img {
        height: auto;
        max-height: 300px;
        object-fit: cover;
    }

    .carousel-caption {
        position: relative;
        left: 0;
        right: 0;
        bottom: 0;
        padding-top: 20px;
    }
}

/* 4. Grid de Productos (Cards) */
@media (max-width: 576px) {
    /* Hacemos que en celulares muy pequeños los productos ocupen casi todo el ancho */
    .col-sm-12 {
        padding: 0 10px;
    }

    .producto-card {
        margin-bottom: 20px;
    }

    .producto-card .card-title {
        font-size: 1.1rem;
    }
}

/* 5. Modales Responsivos (Detalle de Producto) */
@media (max-width: 768px) {
    #modalProducto .modal-dialog {
        margin: 10px;
    }

    #carouselProducto img {
        height: 250px !important;
    }

    .modal-body .row > div {
        margin-bottom: 20px;
    }
}

/* 6. Sección de Testimonios (Clientes) */
@media (max-width: 768px) {
    .clients_box {
        padding: 20px;
    }

    .clients_box figure img {
        width: 80px;
    }

    .clients_box p {
        font-size: 14px;
        line-height: 1.5;
    }
}

/* 7. Footer Responsivo */
@media (max-width: 768px) {
    .footer-flex {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        text-align: center;
    }

    .footer-link {
        width: 100%;
        justify-content: center;
    }
}

/* 8. Ajustes de Utilidad para Imágenes */
.img-fluid {
    max-width: 100%;
    height: auto;
}

/* ============================================================
   AJUSTES RESPONSIVE - SECCIÓN PROMOCIONES ITR
   ============================================================ */

/* --- Ajustes generales y Tablets (991px o menos) --- */
@media (max-width: 991px) {
    .navigation.navbar {
        padding: 10px;
    }

    .navbar-collapse {
        background: #fff;
        border-radius: 10px;
        margin-top: 15px;
        padding: 20px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }

    .nav-item {
        margin-bottom: 10px;
        text-align: center;
    }

    .search-container {
        width: 100%;
        margin: 15px 0;
    }

    #searchResults {
        width: 100%;
        left: 0;
    }

    .titlepage h1 {
        font-size: 2rem;
    }

    .titlepage h2 {
        font-size: 1.2rem;
    }
}

/* --- Ajustes para Celulares (768px o menos) --- */
@media (max-width: 768px) {
    /* Optimización de Header */
    .header {
        padding: 10px 0;
    }

    .login_btn {
        display: inline-block;
        width: 45%; /* Coloca el icono de usuario y carrito lado a lado */
        text-align: center;
    }

    /* Ajuste de Grilla de Productos */
    .contenido.container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .producto-card {
        margin-bottom: 25px;
    }

    .card-img-top img {
        max-height: 150px !important; /* Imagen un poco más pequeña en móviles */
    }

    .badge-promo-client {
        padding: 3px 10px;
        font-size: 0.8rem;
    }

    /* Títulos de sección */
    .titlepage {
        margin-bottom: 20px;
    }

    .titlepage h1 {
        font-size: 1.6rem;
    }

    .titlepage h2 {
        font-size: 1rem;
        padding: 0 10px;
    }

    /* Paginación */
    .pagination {
        font-size: 0.85rem;
        flex-wrap: wrap;
    }

    .page-link {
        padding: 8px 12px;
    }
}

/* --- Ajustes para Celulares Pequeños (575px o menos) --- */
@media (max-width: 575px) {
    /* Forzar 2 columnas en móviles si las tarjetas son pequeñas, 
       o dejar 1 columna bien centrada */
    .col-sm-12 {
        padding-left: 15px;
        padding-right: 15px;
    }

    .precio-oferta-real {
        display: block; /* El precio real baja a una nueva línea para no amontonarse */
        font-size: 1.2rem;
    }

    .precio-tachado {
        font-size: 0.8rem;
    }

    /* Botones del carrito */
    .btn-sm {
        padding: 10px;
        font-size: 0.9rem;
    }
}

/* --- Mejoras de UX para el Buscador en Móvil --- */
#searchResults {
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    position: absolute;
    background: white;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 0 0 10px 10px;
}

/* ============================================================
   AJUSTES RESPONSIVE - SECCIÓN MARCAS ITR
   ============================================================ */

/* --- Ajustes generales y Tablets (991px o menos) --- */
@media (max-width: 991px) {
    .about {
        padding-top: 100px !important; /* Reduce el espacio superior en tablets */
    }

    .glasses_box {
        margin-bottom: 30px;
        padding: 20px;
        background: #fcfcfc;
        border-radius: 15px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    }
}

/* --- Ajustes para Celulares (768px o menos) --- */
@media (max-width: 768px) {
    .about {
        padding-top: 80px !important;
    }

    .titlepage h2 {
        font-size: 1.5rem;
        line-height: 1.2;
    }

    /* Ajuste de los logotipos de marcas */
    .glasses_box figure {
        height: 120px !important; /* Logos más pequeños en móvil */
    }

    .glasses_box figure img {
        max-height: 100px !important;
    }

    .glasses_box h3 {
        font-size: 1.2rem;
        margin: 15px 0 !important;
    }

    /* Footer Responsive */
    .footer-flex {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 20px 0;
    }

    .footer-link {
        width: 100%;
        justify-content: center;
        font-size: 0.9rem;
    }
}

/* --- Ajustes para Celulares Pequeños (575px o menos) --- */
@media (max-width: 575px) {
    .about {
        padding-top: 70px !important;
    }

    .titlepage h2 {
        font-size: 1.3rem;
    }

    /* Botones de marcas al 100% de ancho del contenedor */
    .glasses_box .btn {
        width: 100%;
        padding: 12px 20px;
    }

    .copy-text {
        font-size: 0.8rem;
        text-align: center;
    }
}



/* --- Estilos base para el Footer (Asegurar visibilidad) --- */
.main-footer {

    color: #fff;
    margin-top: 50px;
}

.footer-dark-bar {
    background: #1a1a1a;
    padding: 20px 0;
}

.footer-flex {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
}

.footer-link {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: 0.3s;
}

.footer-link:hover {
    color: #be03fc;
    text-decoration: none;
}

.copy-area {
    background: #111;
    padding: 15px 0;
    text-align: center;
}