/* =========================================
   1. VARIABLES & GLOBAL RESET
   ========================================= */
:root {
    --primary-color: #0d6efd;
    --primary-hover: #0b5ed7;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --dark-bg: #212529;
    --border-radius: 10px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    overflow-x: hidden;
}

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

/* =========================================
   2. HEADER & NAVIGATION
   ========================================= */

/* Cabecera Principal */
.main-header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
    text-align: center;
}

/* Formulario de búsqueda */
.search-form {
    position: relative;
}

.search-form input {
    border-radius: 20px;
    padding-left: 20px;
    border: 1px solid #dee2e6;
}

.search-form input:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    border-color: var(--primary-color);
}

.search-form button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%); /* Centrado vertical exacto */
    border-radius: 50%;
    width: 35px;
    height: 35px;
    color: var(--secondary-color);
    border: none;
    background: transparent;
    transition: color 0.2s;
}

.search-form button:hover {
    color: var(--primary-color);
}

/* Iconos de cabecera (Carrito/Usuario) */
.header-icons a {
    color: var(--dark-bg);
    font-size: 1.3rem;
    margin-left: 15px;
    position: relative;
    transition: color 0.2s;
}

.header-icons a:hover {
    color: var(--primary-color);
}

.header-icons .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    font-size: 0.7rem;
    padding: 0.35em 0.5em;
}

/* Menú de Navegación */
.navbar-nav .nav-link {
   color: var(--secondary-color);
   font-weight: 500;
}

.navbar-nav .nav-link:hover{
    color: var(--primary-color);
    font-weight: 600;
    color: var(--dark-bg);
    text-shadow: #ffffff 1px 0 10px;
}

/* =========================================
   3. HERO SECTION & CAROUSEL
   ========================================= */
.hero-section {
    margin-top: 20px;
}

.carousel-item {
    height: 400px;
    background-color: #e9ecef;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
}

/* Textos dentro del Carousel */
.carousel-caption {
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 10%;
    text-align: left;
    background: linear-gradient(90deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%); /* Legibilidad mejorada */
}

.carousel-content {
    max-width: 600px;
}

.carousel-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    color: white;
}

.carousel-text {
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    color: #f8f9fa;
}

/* Precios en el Carousel */
.carousel-prices {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.precio-original {
    font-size: 1.4rem;
    text-decoration: line-through;
    color: #ddd;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.precio-oferta {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--success-color); /* Verde éxito */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 0 10px;
    border-radius: 5px;
}

/* Botones del Carousel */
.carousel-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-carousel {
    padding: 10px 25px;
    font-weight: 600;
    border-radius: 30px;
}

.btn-carousel-pedir {
    padding: 10px 25px;
    font-weight: 600;
    border-radius: 30px;
    border: 2px solid white;
    color: white;
    background: transparent;
}

.btn-carousel-pedir:hover {
    background-color: white;
    color: var(--dark-bg);
}

/* Indicadores */
.carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin: 0 5px;
    background-color: white;
    opacity: 0.5;
}

.carousel-indicators .active {
    background-color: var(--primary-color);
    opacity: 1;
}

/* =========================================
   4. PROMO BANNER (Lateral)
   ========================================= */
.promo-banner {
    height: 400px;
    background-color: var(--primary-color);
    border-radius: var(--border-radius);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.promo-banner h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.promo-banner p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

/* Efecto decorativo de círculo */
.promo-banner::before {
    content: "";
    position: absolute;
    width: 200px;
    height: 200px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -50px;
    right: -50px;
}

.promo-banner::after {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    bottom: -30px;
    left: -30px;
}

/* =========================================
   5. PRODUCTS SECTION & FILTERS
   ========================================= */
.products-section {
    margin-top: 50px;
    margin-bottom: 50px;
}

.section-title {
    font-weight: 700;
    font-size: 1.8rem;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 10px;
    color: var(--dark-bg);
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Filtros */
.product-filters {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    margin-bottom: 30px;
    border: 1px solid #eee;
}

/* =========================================
   6. PRODUCT CARD (Optimizado)
   ========================================= */
.product-card {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 25px;
    height: 100%; /* Igualar alturas en grid */
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.product-card.en-oferta {
    border: 1px solid var(--danger-color);
}

/* Imagen del Producto */
.product-img {
    height: 220px; /* Altura fija para uniformidad */
    background-color: #fff;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #f0f0f0;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Muestra imagen completa sin recorte */
    padding: 15px;
    transition: transform 0.3s;
}

.product-card:hover .product-img img {
    transform: scale(1.05);
}

/* Badges sobre la imagen */
.product-img .badge {
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Información del Producto */
.product-info {
    padding: 20px;
    flex-grow: 1; /* Empuja el contenido para llenar la tarjeta */
    display: flex;
    flex-direction: column;
}

.product-category {
    color: var(--secondary-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.product-title {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.6em; /* Altura para 2 líneas */
}

/* Precios */
.product-pricing {
    margin-top: auto; /* Empuja precios hacia abajo si hay espacio */
    margin-bottom: 15px;
}

.product-price {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--dark-bg);
}

.product-old-price {
    text-decoration: line-through;
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-right: 5px;
}

.product-offer-end {
    font-size: 0.75rem;
    margin-top: 5px;
    font-weight: 500;
}

/* Acciones (Botones) */
.product-actions {
    display: flex;
    flex-direction: column; /* Botones uno encima del otro para móvil/cards estrechas */
    gap: 10px;
    margin-top: 10px;
}

.product-actions .btn {
    width: 100%;
    border-radius: 20px;
}

/* =========================================
   7. BUTTONS & UTILITIES
   ========================================= */
/* Primario */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Outline Primario (Carrito) */
.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Botón "Pedir Ahora" (Verde) */
.btn-now {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-now:hover:not(:disabled) {
    background-color: #218838;
    border-color: #1e7e34;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
}

.btn-now.disabled, 
.btn-now:disabled {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Utilidades de Texto */
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }

/* =========================================
   8. PAGINATION
   ========================================= */
.pagination {
    margin-bottom: 0;
    gap: 5px;
}

.pagination .page-link {
    color: var(--primary-color);
    border: 1px solid #dee2e6;
    padding: 8px 16px;
    border-radius: 5px !important; /* Separados estilo moderno */
    margin: 0 2px;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 5px rgba(13, 110, 253, 0.3);
}

.pagination .page-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.pagination-info {
    text-align: center;
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-top: 15px;
}

/* =========================================
   9. VENDEDORES OFFCANVAS
   ========================================= */
.vendedor-select-btn {
    border: 1px solid #e9ecef;
    margin-bottom: 10px;
    border-radius: 10px !important;
    transition: all 0.2s;
}

.vendedor-select-btn:hover {
    background-color: #f8f9fa;
    border-color: var(--primary-color);
    transform: translateX(5px);
}

/* =========================================
   10. FOOTER
   ========================================= */
.footer {
    background-color: var(--dark-bg);
    color: white;
    padding: 60px 0 20px;
    font-size: 0.95rem;
}

.footer h5 {
    font-weight: 700;
    margin-bottom: 25px;
    font-size: 1.1rem;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer ul li {
    margin-bottom: 12px;
}

.footer ul li a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.3s, padding-left 0.3s;
}

.footer ul li a:hover {
    color: white;
    padding-left: 5px; /* Efecto de deslizamiento */
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 50%;
    transition: background-color 0.3s;
    text-decoration: none;
}

.social-links a:hover {
    background-color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid #343a40;
    padding-top: 25px;
    margin-top: 40px;
    font-size: 0.85rem;
    color: #6c757d;
}

/* =========================================
   11. RESPONSIVE MEDIA QUERIES
   ========================================= */
/* Tablet y menor */
@media (max-width: 991px) {
    .promo-banner {
        margin-top: 30px;
        height: 300px;
    }
    
    .carousel-item {
        height: 350px;
    }
}

/* Móvil Landscape */
@media (max-width: 768px) {
    .carousel-item {
        height: 300px;
    }

    .carousel-caption h2 {
        font-size: 1.8rem;
    }

    .carousel-caption p {
        font-size: 1rem;
    }
    
    .carousel-prices {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .product-img {
        height: 180px;
    }
    
    .carousel-actions {
        width: 100%;
    }
    
    .btn-carousel, .btn-carousel-pedir {
        width: 100%;
        text-align: center;
    }
}

/* Móvil Portrait */
@media (max-width: 576px) {
    .carousel-item {
        height: 400px; /* Más alto en móvil para que quepa el texto */
    }

    .carousel-caption {
        padding: 20px;
        background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.8) 100%);
        justify-content: flex-end;
    }

    .carousel-caption h2 {
        font-size: 1.5rem;
    }

    .carousel-caption p {
        font-size: 0.9rem;
    }

    .promo-banner {
        height: 250px;
    }

    .promo-banner h3 {
        font-size: 1.5rem;
    }
    
    /* Ajustes botones móviles */
    .product-actions {
        flex-direction: column;
    }
}

.product-filters {
    background: rgba(255, 255, 255, 0.1); 
    backdrop-filter: blur(10px); 

    /* Espaciado y Sombra Refinada */
    padding: 20px 25px; /* Espaciado interno más generoso */
    border-radius: 12px; /* Bordes ligeramente más redondeados */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05); /* Sombra suave y profesional */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Borde sutil para definir el área */
    margin-bottom: 30px; /* Separación de la grilla de productos */
}

.filter-label {
    /* Tipografía y Color */
    font-weight: 600; /* Ligeramente más grueso */
    color: #495057; /* Un gris oscuro, menos agresivo que el negro puro */
    font-size: 0.85rem; /* Tamaño un poco más pequeño para dar jerarquía */
    display: block; /* Asegura que la etiqueta ocupe su propia línea */
    margin-bottom: 6px; /* Espaciado debajo de la etiqueta */
    text-transform: uppercase; /* Uso sutil de mayúsculas */
    letter-spacing: 0.5px;
}

.form-select{
    border: none !important;
    color: var(--secondary-color);
    background-color: #f6f6f6;
}