/* css/catalogo.css */
body {
    background-color: #f8f9fa;
    scroll-behavior: smooth;
    padding-bottom: 70px;
    padding-top: 0;
}

.navbar {
    position: fixed; 
    width: 100%;
    z-index: 1030;
    left: 0;
    top: 0 !important;
}

.navbar .text-white { color: #333 !important; }
.navbar #total-navbar { color: #fd0d0dff !important; }

.header-banner-container {
    background-size: cover;
    background-position: center;
    color: white;
    padding: 50px 0;
    margin-bottom: 0px;
    border-bottom: 1px solid #dee2e6;
    position: relative;
}

.banner-logo {
    height: 120px;
    width: 120px;
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    margin-bottom: 1rem;
}

.product-card {
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-radius: 12px;
    transition: 0.3s;
    height: 100%;
    cursor: pointer;
    background: white;
}
.product-card:hover { transform: translateY(-5px); }
.card-img-container { height: 180px; overflow: hidden; border-top-left-radius: 12px; border-top-right-radius: 12px; }

/* =========================================================
   BARRA DE CATEGORÍAS FLOTANTE (CORRECCIÓN FLEXBOX)
========================================================= */
.sticky-categories {
    position: -webkit-sticky;
    position: sticky;
    top: 100px;
    z-index: 1020;
    background: #ffffff;
    border-radius: 50px;
    margin: 5px 15px 15px 15px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1) !important;

    /* Diseño alineado estrictamente a la izquierda */
    display: flex;
    justify-content: flex-start;
    align-items: center;
    overflow-x: auto;      
    white-space: nowrap;
    gap: 10px;
    
    /* Ocultar la barra de scroll visualmente */
    scrollbar-width: none; 
    -ms-overflow-style: none;
}

.sticky-categories::-webkit-scrollbar,
.no-scrollbar::-webkit-scrollbar {
    display: none; 
}

/* Evitar que los botones de categoría se encojan */
.sticky-categories .category-item,
.sticky-categories .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#modalProducto .modal-content {
    border-radius: 15px;
    overflow: hidden;
}

/* =========================================================
   CONTENEDOR DE IMAGEN DEL MODAL DE DETALLES
========================================================= */
.modal-img-container {
    position: relative;
    background-color: #f8fafc; 
    padding: 2.5rem; 
    display: flex;
    align-items: center;
    justify-content: center;
}

#modal-img {
    width: 100%;
    max-width: 400px; 
    aspect-ratio: 1 / 1; 
    object-fit: cover;
    border-radius: 16px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.12); 
    transition: transform 0.3s ease;
}

@media (min-width: 768px) {
    #modal-img:hover {
        transform: translateY(-5px) scale(1.02);
        box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    }
}

#modal-img:hover {
    transform: scale(1.03);
}

@media (max-width: 767px) {
    .modal-img-container {
        padding: 1.5rem; 
        background-color: #ffffff; 
    }
    
    #modal-img {
        max-height: 320px; 
        border-radius: 16px; 
    }
}

.dropdown-menu {
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 2000 !important;
}

.bg-primary-subtle { background-color: #e3f2fd !important; border: 1px solid #0ea5e9 !important; }

.btn-outline-danger.border-0:hover { background-color: transparent; color: #dc3545; transform: scale(1.1); transition: 0.2s; }

#btn-like i { transition: transform 0.2s ease; }
#btn-like i.bi-heart-fill { color: #dc3545; transform: scale(1.2); }

.btn-like-card {
    position: absolute;
    top: 10px; right: 10px;
    background: rgba(255, 255, 255, 0.8);
    border: none; border-radius: 50%;
    width: 35px; height: 35px;
    display: flex; align-items: center; justify-content: center;
    color: #dc3545; transition: 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); z-index: 10;
}
.btn-like-card:hover { transform: scale(1.1); background: #fff; }
.btn-like-card i.bi-heart-fill { color: #dc3545; }

.promo-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1040;
    height: 40px;
    background-color: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 0;
    font-size: 0.85rem;
    color: #475569;
    text-align: center;
}
.promo-bar a { color: #e90e0eff; text-decoration: none; font-weight: bold; }
.promo-bar a:hover { text-decoration: underline; }

#lista-carrito .fw-bold { line-height: 1.2; word-break: break-word; }

.footer-negocio {
    background-color: #ffffff;
    border-top: 100px solid #eee;
    width: 100%;
}

.footer-negocio p {
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* --- Configuración especial para Plan Gratis --- */
body.plan-gratis { padding-top: 110px; }
body.plan-gratis .navbar { top: 40px !important; }
body.plan-gratis .sticky-categories { top: 95px; }
body.plan-gratis .category-title { scroll-margin-top: 130px; }

.status-badge {
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem 1rem !important;
}

.horario-menu {
    min-width: 280px;
    transform: translateX(-50%);
    left: 50%;
    margin-top: 0.5rem;
}

.horario-item {
    font-size: 0.85rem;
    color: #333;
}

.direccion-text {
    font-size: 1.1rem; 
    line-height: 1.2;
}

html { scroll-behavior: smooth; }

.category-title {
    padding-top: 20px; 
    margin-top: -20px;
    scroll-margin-top: 100px;
}

/* =========================================================
   MÁRGENES RESPONSIVOS GLOBALES
========================================================= */
@media (max-width: 767px) {
    .px-extra-grande { padding-left: 1rem !important; padding-right: 1rem !important; }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .px-extra-grande { padding-left: 3rem !important; padding-right: 3rem !important; }
}

@media (min-width: 1200px) {
    .px-extra-grande { padding-left: 6rem !important; padding-right: 6rem !important; }
}

/* =========================================================
   AJUSTES RESPONSIVOS PARA TARJETAS E IFRAMES
========================================================= */
@media (max-width: 575px) {
    .product-card { margin-bottom: 15px; }
    .product-card img { height: 150px; object-fit: cover; }
}

@media (min-width: 992px) {
    .row-cols-lg-5 > .col { min-width: 200px; }
}

@media (max-width: 768px) {
    body { font-size: 1.1rem; }
}

@media (max-width: 400px) {
    .product-card .card-title { font-size: 0.9rem !important; }
    .product-card .btn-add { font-size: 0.8rem !important; padding: 4px 8px !important; }
}

/* =========================================================
   AJUSTES RESPONSIVOS PARA LA BARRA SUPERIOR (NAVBAR)
========================================================= */
@media (max-width: 575px) {
    .navbar .container {
        display: flex !important;
        flex-wrap: nowrap !important; 
        padding-left: 5px !important;
        padding-right: 5px !important;
        align-items: center;
        justify-content: space-between;
    }
    .navbar .h4 { font-size: 1.2rem !important; }
    .navbar .gap-2 { gap: 0.3rem !important; }
    .navbar .ms-2 { margin-left: 0.2rem !important; }
    .navbar .me-3 { margin-right: 0.4rem !important; }
    .navbar .me-2 { margin-right: 0.2rem !important; }
    .navbar .me-1 { margin-right: 0.1rem !important; }
    .navbar #total-navbar { font-size: 0.95rem !important; }
    .navbar #cart-count { font-size: 0.4rem !important; padding: 0.2em 0.3em !important; }
    .navbar .btn-sm { font-size: 0.75rem !important; padding: 0.25rem 0.5rem !important; white-space: nowrap !important; }
}

@media (max-width: 400px) {
    .navbar .h4 { font-size: 1rem !important; }
    .navbar #total-navbar { font-size: 0.85rem !important; }
    .navbar .btn-sm { font-size: 0.7rem !important; padding: 0.2rem 0.4rem !important; }
    .navbar .btn-sm i { margin-right: 2px; } 
}

/* =========================================================
   AJUSTES RESPONSIVOS PARA LA BARRA DE CATEGORÍAS (STICKY)
========================================================= */
@media (max-width: 575px) {
    .sticky-categories {
        display: flex !important;
        justify-content: flex-start !important; /* Fuerza inicio desde la izquierda */
        flex-wrap: nowrap !important;    
        overflow-x: auto !important;     
        white-space: nowrap !important;
        gap: 0.4rem !important;          
        padding-top: 10px !important;
        padding-bottom: 10px !important;
        margin: 5px 0 15px 0 !important; /* Permite que toque los bordes de la pantalla */
        border-radius: 0 !important;     /* Elimina bordes redondos en móviles */
        border-left: none !important;
        border-right: none !important;
        background-color: #ffffff !important; 
        
        -ms-overflow-style: none !important;  
        scrollbar-width: none !important;     
    }
    
    .sticky-categories::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }

    .category-item, 
    .sticky-categories a, 
    .sticky-categories .nav-link,
    .sticky-categories .btn {
        font-size: 0.85rem !important;       
        padding: 6px 12px !important;        
        flex: 0 0 auto !important;           
        border-radius: 30px !important;      
    }
}

@media (max-width: 400px) {
    .sticky-categories {
        gap: 0.3rem !important;              
    }
    
    .category-item, 
    .sticky-categories a, 
    .sticky-categories .nav-link,
    .sticky-categories .btn {
        font-size: 0.8rem !important;        
        padding: 5px 10px !important;        
    }
}

/* =========================================================
   AJUSTES PARA EL MODAL DE DETALLE DE PRODUCTO (SCROLL)
========================================================= */
#modal-desc {
    line-height: 1.5;
    max-height: 4.5em;
    overflow-y: auto;
    padding-right: 8px;
}

#modal-desc::-webkit-scrollbar {
    width: 5px;
}

#modal-desc::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 10px;
}

#modal-desc::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

#modal-desc::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}