/* ==========================================================================
   1. CONFIGURACIÓN GLOBAL Y ESTRUCTURA
   ========================================================================== */
body {
    background-color: #f5f5f5;
    color: #333;
    /* El padding se gestiona abajo en Responsividad */
}

/* Forzar que no haya subrayados en todo el sitio si lo prefieres */
a { text-decoration: none !important; }

/* ==========================================================================
   2. NAVBAR (ESCRITORIO Y GENERAL)
   ========================================================================== */
.sticky-top { z-index: 1020; }

.nav-link {
    display: flex;
    align-items: center;
    color: #444 !important;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.nav-link:hover { color: #e60023 !important; }

/* Iconos específicos del Nav Escritorio */
.nav-desktop-icon i {
    font-size: 1.5rem !important;
    color: #444;
    transition: color 0.2s ease;
}

.nav-desktop-icon:hover i { color: #e60023 !important; }

.nav-desktop-icon .position-relative {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Badge del carrito sobrepuesto */
.badge-cart-desktop {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: #e60023;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    z-index: 2;
}

/* ==========================================================================
   3. TARJETAS DE PRODUCTO (GRID)
   ========================================================================== */
.product-card {
    transition: transform 0.2s ease;
    border-radius: 12px;
}

.product-card:hover { transform: translateY(-5px); }

.product-title {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
    color: #444;
}

.brand-text { font-size: 0.7rem; font-weight: 600; }

.discount-box {
    background-color: #e60023;
    color: white;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border-radius: 4px;
    min-height: 40px;
}

.price-usd { color: #e60023; font-weight: 700; font-size: 1rem; }
.price-bs { color: #888; font-size: 0.75rem; }

/* Iconos sobre la tarjeta */
.wishlist-icon, .btn-detail {
    position: absolute;
    top: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
}

.wishlist-icon { left: 10px; background-color: white; color: #888; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.wishlist-icon:hover, .wishlist-icon.active { color: #e60023; transform: scale(1.1); }

.btn-detail { right: 10px; background-color: #e60023; color: white; cursor: pointer; }

.badge-new {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: #00d1b2;
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 12px;
    border-radius: 0 0 8px 8px;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ==========================================================================
   4. CARRITO LATERAL (OFFCANVAS)
   ========================================================================== */
.cart-title-link {
    color: #333 !important;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

.cart-title-link:hover { color: #e60023 !important; }

.cart-img-container {
    width: 65px;
    height: 65px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 8px;
    background-color: #f8f9fa;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-img-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Selector de Cantidad Consolidado */
.qty-selector {
    width: 85px;
    height: 28px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    display: flex;
}

.btn-qty {
    border: none !important;
    background-color: #f1f1f1;
    font-size: 0.9rem;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
}

.btn-qty:hover { color: #e60023; background-color: #e9ecef; }

.qty-input {
    border: none !important;
    background-color: #fff !important;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    width: 25px;
    padding: 0;
}

.text-danger { font-size: 1.05rem; letter-spacing: -0.5px; }
.offcanvas-footer { background: white; }

/* ==========================================================================
   5. FOOTER Y MENÚ MÓVIL
   ========================================================================== */
footer { border-top: 4px solid #e60023; }
footer a { color: #bbb !important; transition: all 0.3s ease; }
footer a:hover { color: #e60023 !important; }

.nav-link-custom {
    text-decoration: none !important;
    color: #888;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nav-link-custom i { font-size: 1.2rem; margin-bottom: -2px; }
.nav-link-custom.active { color: #e60023; }

.nav-link-custom .badge {
    margin-top: -2px;
    margin-left: -2px;
    border: 1.5px solid white;
}

/* ==========================================================================
   6. RESPONSIVIDAD (MEDIA QUERIES)
   ========================================================================== */

/* Móviles */
@media (max-width: 767px) {
    body { padding-bottom: 75px; } /* Espacio para el menú inferior */
    footer { padding-bottom: 80px !important; }
}

/* Escritorio */
@media (min-width: 768px) {
    body { padding-bottom: 0; }
    .fixed-bottom { display: none !important; }
}

/* Utilidades */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; white-space: nowrap; }

@media (max-width: 767px) {
    footer {
        /* Deja espacio extra para que la barra fija no lo tape */
        padding-bottom: 90px !important; 
    }
}

.badge-new {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    color: white; /* Color por defecto */
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 12px;
    border-radius: 0 0 8px 8px;
    z-index: 5;
    letter-spacing: 1px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-transform: uppercase;
}

.discount-box {
    font-size: 0.75rem;
    height: fit-content;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
}

.product-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

.price-usd {
    font-size: 1.1rem;
}

.price-bs {
    font-size: 0.8rem;
}


/* ==========================================================================
   6. Estilos específicos para la estética del login Clientes
   ========================================================================== */

.login-card-container {
    min-height: calc(100vh - 150px); /* Centrado vertical aproximado */
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    border-radius: 15px;
    border-top: 6px solid #e60023; /* Rojo institucional de tu index.php */
}
.btn-primary-damasco {
    background-color: #e60023;
    border: none;
    padding: 12px;
    font-weight: 700;
    transition: opacity 0.3s;
}
.btn-primary-damasco:hover {
    background-color: #c5001e;
    opacity: 0.9;
}
.social-btn {
    border: 1px solid #ddd;
    background: white;
    font-size: 0.9rem;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s;
}
.social-btn:hover {
    background: #f1f1f1;
}


/* Contenedor del paginador */
.pagination {
    gap: 8px; /* Espaciado entre círculos */
}

/* Estilo base para todos los botones de la paginación */
.pagination .page-item .page-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important; /* Círculo perfecto */
    border: none;
    background-color: #fff;
    color: #444;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    padding: 0; /* Quita el padding de Bootstrap para centrar iconos */
}

/* Estado Activo (Página actual) */
.pagination .page-item.active .page-link {
    background-color: #e60023 !important; /* Rojo Damasco */
    color: white !important;
    box-shadow: 0 4px 10px rgba(230, 0, 35, 0.3);
}

/* Hover (Pasar el mouse) */
.pagination .page-item:not(.active):not(.disabled) .page-link:hover {
    background-color: #f8f9fa;
    color: #e60023;
    transform: scale(1.1);
}

/* Botones Deshabilitados (Anterior/Siguiente cuando no hay más) */
.pagination .page-item.disabled .page-link {
    opacity: 0.4;
    background-color: #eee;
    pointer-events: none;
}
    



.empty-state-container {
    padding: 80px 0;
    text-align: center;
}
.icon-box-empty {
    width: 120px;
    height: 120px;
    background-color: #fff0f1;
    color: #e60023;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 30px;
    font-size: 3.5rem;
    animation: fadeIn 0.8s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}
.search-term {
    color: #e60023;
    font-weight: 700;
}
.suggested-card {
    border: none;
    border-radius: 15px;
    transition: transform 0.3s;
}
.suggested-card:hover {
    transform: translateY(-5px);
}

h3 {
  /* Ajusta los 100px según la altura de tu menú */
  scroll-margin-top: 100px; 
}

        :root { --rojo-damasco: #e60023; }

        /* Hero Section Personalizado */
        .hero-welcome {
            background: linear-gradient(rgba(255,255,255,0.9), rgba(255,255,255,0.9)), 
                        url('https://images.unsplash.com/photo-1531297484001-80022131f5a1?ixlib=rb-4.0.3&auto=format&fit=crop&w=1400&q=80');
            background-size: cover;
            background-position: center;
            min-height: 70vh;
            display: flex;
            align-items: center;
        }

        .btn-welcome {
            padding: 15px 40px;
            font-size: 1.1rem;
            font-weight: 700;
            border-radius: 50px;
            transition: all 0.3s ease;
        }

        .category-circle {
            width: 100px;
            height: 100px;
            background: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2rem;
            color: var(--rojo-damasco);
            margin: 0 auto 15px;
            box-shadow: 0 10px 20px rgba(0,0,0,0.05);
            transition: 0.3s;
        }

        .category-link:hover .category-circle {
            background: var(--rojo-damasco);
            color: white;
            transform: translateY(-5px);
        }

        .featured-text {
            color: var(--rojo-damasco);
            font-weight: 800;
            letter-spacing: 2px;
        }


        .slider-laboratorios {
            width: 100%;
            margin: auto;
            overflow: hidden;
            position: relative;
            padding: 20px 0;
        }

        .slide-track {
            display: flex;
            width: calc(250px * 10); /* Ajusta: (ancho de imagen + margen) * total de imágenes */
            animation: scroll-infinito 20s linear infinite;
        }

        .slide-track img {
            width: 150px; /* Tamaño fijo para consistencia */
            height: 50px;
            object-fit: contain;
            margin: 0 40px;
            filter: grayscale(100%);
            opacity: 0.6;
        }

        @keyframes scroll-infinito {
            0% { transform: translateX(0); }
            100% { transform: translateX(calc(-150px * 5 - 80px * 5)); } 
            /* El cálculo debe ser exactamente la mitad del ancho total del slide-track */
        }

        /* Pausar al pasar el mouse para que el cliente vea bien el laboratorio */
        .slider-laboratorios:hover .slide-track {
            animation-play-state: paused;
        }

        /* Elimina el espacio superior que el navegador añade al primer h1 */
        .hero-welcome h1 {
            margin-top: 0 !important;
            padding-top: 10px;
        }

        /* Ajusta el padding de la sección para que respire pero no flote */
        .hero-welcome {
            padding-top: 2rem !important; /* Ajusta este valor según necesites */
            padding-bottom: 4rem !important;
            /* Si tu header es fijo, podrías necesitar un margin-top negativo sutil */
            margin-top: -1px; 
        }

        /* Mejora la transición con el header */
        .featured-text {
            display: inline-block;
            margin-top: 1rem;
            font-size: 0.85rem;
            letter-spacing: 1px;
            color: #dc3545;
            font-weight: 700;
        }        

    /* Contenedor para centrar verticalmente y evitar que aparezca muy abajo */
    .empty-results-container {
        min-height: 70vh; /* Ocupa el 70% del alto de la ventana */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 2rem 0;
    }

    /* Icono homogenizado con el estilo de la 404 */
    .icon-box-empty {
        width: 100px;
        height: 100px;
        background: #f8d7da; /* Fondo rojo muy claro */
        color: #dc3545;    /* Rojo Bootstrap */
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 3rem;
        margin-bottom: 1.5rem;
    }

    .search-term {
        color: #dc3545;
        font-weight: 700;
        font-style: italic;
    }

    /* Contenedor principal centrado */
    .error-404-container {
        min-height: 75vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 2rem 0;
    }

    /* Código 404 con degradado */
    .error-code {
        font-size: 8rem;
        line-height: 1;
        font-weight: 900;
        background: linear-gradient(135deg, #dc3545 0%, #85141e 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        margin-bottom: 1rem;
    }

    /* Icono con animación */
    .icon-box-404 {
        width: 110px;
        height: 110px;
        background: #f8d7da;
        color: #dc3545;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 3.5rem;
        margin-bottom: 1.5rem;
        /* Activamos la animación */
        animation: pulse-red 2s infinite;
    }

    /* Definición de la animación de palpitación */
    @keyframes pulse-red {
        0% {
            transform: scale(0.95);
            box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
        }
        70% {
            transform: scale(1);
            box-shadow: 0 0 0 15px rgba(220, 53, 69, 0);
        }
        100% {
            transform: scale(0.95);
            box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
        }
    }

    .info-card-404 {
        max-width: 500px;
        background-color: #fcfcfc;
    }            