/* ================================== */
/* === ESTILOS GENERALES DEL CATÁLOGO === */
/* ================================== */

:root {
    /* El color principal se define en una etiqueta <style> en index.php */
    /* --color-principal: #D32F2F; */
}

.bg-principal { background-color: var(--color-principal); }
.text-principal { color: var(--color-principal); }
.btn-principal { background-color: var(--color-principal); color: white; border-color: var(--color-principal); }
.btn-principal:hover { background-color: var(--color-principal); filter: brightness(90%); border-color: var(--color-principal); }

.sticky-top { top: -1px; }
.product-card img { height: 200px; object-fit: contain; padding: 10px; }


/* ================================== */
/* === AJUSTES DE PULIDO (v2) === */
/* ================================== */

/* 1. Controles Visibles y Mejorados para el Carrusel */
#productModalCarousel .carousel-control-prev-icon,
#productModalCarousel .carousel-control-next-icon {
    filter: invert(1) grayscale(100) brightness(0.5);
    width: 2.5rem;
    height: 2.5rem;
}


/* ========================================================== */
/* INICIO: CÓDIGO ACTUALIZADO PARA MENÚ DE CATEGORÍAS    */
/* ========================================================== */

/* 2. Contenedor del Menú de Categorías */
.category-menu .navbar-nav {
    flex-wrap: nowrap; /* Mantiene los elementos en una sola línea */
    padding-bottom: 15px; /* Espacio para la barra de scroll */
    
    /* ¡IMPORTANTE! Fuerza la alineación a la izquierda para anular el centrado */
    justify-content: flex-start !important; 
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* 3. Estilos para los Enlaces y Efectos (conservados y mejorados) */
.category-menu .nav-item {
    flex-shrink: 0; /* Evita que los botones se encojan */
}

.category-menu .nav-link {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 8px 20px;
    margin: 0 5px;
    color: #333;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    white-space: nowrap; /* Evita que el texto del botón se parta */
}

.category-menu .nav-link:hover,
.category-menu .nav-link.active {
    background-color: var(--color-principal);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: var(--color-principal);
}

/* 4. Estilos para hacer visible la Barra de Scroll en PC */
/* Funciona en navegadores como Chrome, Safari, Edge, etc. */
.category-menu::-webkit-scrollbar {
    height: 8px; /* Altura de la barra de scroll */
}

.category-menu::-webkit-scrollbar-track {
    background: #f1f1f1; /* Color del fondo de la barra */
}

.category-menu::-webkit-scrollbar-thumb {
    background: #ccc; /* Color de la barra de scroll */
    border-radius: 4px;
}

.category-menu::-webkit-scrollbar-thumb:hover {
    background: #aaa; /* Color al pasar el mouse */
}

/* ========================================================== */
/* FIN: CÓDIGO ACTUALIZADO PARA MENÚ DE CATEGORÍAS      */
/* ========================================================== */


/* ================================== */
/* === CARRITO FLOTANTE Y PANEL LATERAL (v3 - DEFINITIVO) === */
/* ================================== */

/* --- Carrito Flotante --- */
.floating-cart {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: var(--color-principal);
    color: white;
    height: 60px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    cursor: pointer;
    z-index: 1050;
    transition: transform 0.3s ease;
}
.floating-cart:hover {
    transform: scale(1.05);
}
.cart-icon-container {
    position: relative;
    margin-right: 15px;
}
#cart-item-count {
    position: absolute;
    top: -8px;
    right: -12px;
}
.cart-total-container {
    font-weight: bold;
    font-size: 1.1rem;
}

/* --- Panel Lateral y Overlay --- */
.cart-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1055;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-in-out, visibility 0.4s;
}
.cart-panel-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.cart-panel {
    position: fixed;
    top: 0;
    right: -450px; /* Inicia oculto fuera de la pantalla */
    width: 420px;
    max-width: 90%;
    height: 100%;
    background-color: white;
    box-shadow: -4px 0 15px rgba(0,0,0,0.15);
    z-index: 1060;
    transition: right 0.4s ease-in-out;
}
.cart-panel.open {
    right: 0; /* Lo hace visible */
}

/* Estructura interna del panel */
#cart-view, #checkout-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

/* ESTADO INICIAL: Ocultar el checkout por defecto */
#checkout-view {
    display: none;
}

.cart-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.cart-panel-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
}
.cart-panel-footer {
    padding: 15px;
    border-top: 1px solid #eee;
    background-color: #f8f9fa;
    flex-shrink: 0;
}

#bienvenida-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.6);
            z-index: 1050; 
            display: none; 
            justify-content: center;
            align-items: center;
        }

        #bienvenida-modal-content {
            background-color: #ffffff;
            padding: 2rem;
            border-radius: 8px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.3);
            text-align: center;
            max-width: 600px;
            width: 90%;
            position: relative;
            font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }

        #bienvenida-modal-close-btn {
            position: absolute;
            top: -15px;
            right: -15px;
            width: 35px;
            height: 35px;
            background-color: var(--color-principal);
            color: #ffffff;
            border: none;
            border-radius: 50%;
            font-size: 25px;
            font-weight: bold;
            cursor: pointer;
            display: flex;
            justify-content: center;
            align-items: center;
            line-height: 1;
        }
        
        #bienvenida-modal-content h2 {
            font-size: 2.2rem;
            margin-top: 0;
            margin-bottom: 1rem;
            color: black;
        }

        #bienvenida-modal-content p {
            color: #555;
            margin-bottom: 1.5rem;
        }

        #bienvenida-modal-content ol {
            text-align: left;
            display: inline-block; 
            margin: 0;
            padding-left: 25px; 
            color: #555;
            line-height: 1.6;
        }

        #bienvenida-modal-entendido-btn {
            background-color: var(--color-principal);
            color: #ffffff;
            border: none;
            border-radius: 6px;
            padding: 12px 30px;
            font-size: 1rem;
            font-weight: 500;
            cursor: pointer;
            margin-top: 1.5rem;
            transition: filter 0.2s;
        }
        
        #bienvenida-modal-entendido-btn:hover {
            filter: brightness(90%);
        }
        
        #btnVolverArriba {
    display: none; /* Oculto por defecto */
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    
    border: none;
    outline: none;
    background-color: var(--color-principal); /* Usa tu color principal */
    color: white;
    cursor: pointer;
    
    width: 50px;
    height: 50px;
    border-radius: 50%; /* Lo hace circular */
    font-size: 24px;

    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: opacity 0.3s, visibility 0.3s;
}

#btnVolverArriba:hover {
    filter: brightness(90%);
}