body {
    background-color: #f4f6f9;
}

/* Desktop: restaurar layout original (titulo izquierda, buscador+selects a la derecha) */
@media (min-width: 993px) {
    .catalog-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .catalog-header .top-row {
        display: block;
    }

    .catalog-header .selects-row {
        display: flex;
        gap: 10px;
        align-items: center;
        width: auto;
    }

    .catalog-header .selects-row > #buscador {
        width: 300px;
        min-width: 220px;
    }

    .catalog-header .selects-row select {
        width: auto;
    }
}

/* NAVBAR */
.navbar-custom{
    background: linear-gradient(90deg, #0b3d91, #1f4fa3, #3f89da);
    padding: 15px;

    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.navbar-brand {
    font-size: 22px;
    letter-spacing: 0.5px;
}

.sidebar{
    background: #fff;
    box-shadow: 4px 0 12px rgba(0,0,0,0.06);
    position: fixed;
    top: 70px;
    left: 0;
    width: 253px;
    height: calc(100vh - 70px);
    overflow-y: auto;
}

.sidebar-backdrop {
    display: none;
}

.sidebar-toggle-btn {
    font-weight: 700;
    min-width: 42px;
    min-height: 38px;
    line-height: 1;
}

/* HEADER USUARIO CON DEGRADADO */
.sidebar-user {
    background: linear-gradient(90deg, #023B82, #0C64CF, #3F89DA);
    color: white;
    text-align: center;
    padding: 17px 10px;
    margin-top: 30px;
    margin-bottom: 30px;
    font-weight: bold;
    font-size: 18px;
}

        /* BOTONES GENERALES */
/* BOTONES GENERALES */
.sidebar .list-group-item {
    border: none;
    background: transparent;
    font-weight: 500;
    text-align: center; /* 🔥 centra los no activos */
    padding: 14px 10px;
    transition: 0.3s;
}

.sidebar .active {
    position: relative;
    background: linear-gradient(90deg, #0b3d91, #2353a5, #3f89da);
    color: white !important;
    text-align: center;
    font-weight: bold;
    padding: 12px;
    font-size: 18px;
}

.sidebar .active::before {
    content: "";
    position: absolute;
    left: 40px; /* 🔥 mueve la barra hacia la derecha */
    top: 50%;
    transform: translateY(-50%);
    width: 7px; /* grosor */
    height: 70%;
    background-color: #ffd400;
    border-radius: 10px;
}

.main-content{
    margin-left: 240px;
    margin-top: 70px;
    width: calc(100% - 240px);
    padding: 40px;
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 15px;
    }

    /* Compress navbar so brand + toggle + 2 buttons fit on small phones */
    .navbar-brand {
        font-size: 15px !important;
    }

    .navbar-custom .ms-auto {
        gap: 0.25rem !important;
    }

    .navbar-custom .ms-auto .btn {
        padding: 4px 8px !important;
        font-size: 12px !important;
    }
}

.language-floating{

position:fixed;

bottom:25px;
left:25px;

z-index:9999;

background:white;

border-radius:50px;

padding:6px;

box-shadow:0 10px 25px rgba(0,0,0,.15);

display:flex;
gap:6px;

}

/* WIDGET IDIOMA */

.language-widget{

position:fixed;

bottom:25px;
left:25px;

z-index:9999;

}

/* WIDGET IDIOMA */
.language-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 80px;
    height: 50px;
    border: none;
    background: #0b3d91;
    color: white;
    padding: 0 16px;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,.25);
    transition: .2s;
}

.language-toggle:hover {
    transform: scale(1.05);
}

.language-current {
    font-weight: 600;
}

.language-menu {
    position: absolute;
    bottom: 60px;
    left: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,.2);
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.language-option {
    border: none;
    background: white;
    padding: 10px 16px;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    width: 160px;
    transition: .2s;
}

.language-option:hover {
    background: #f3f4f6;
}

@media (max-width: 576px) {
    .language-toggle {
        width: 45px;
        height: 45px;
        min-width: auto;
        padding: 0;
        font-size: 12px;
    }

    .language-menu {
        bottom: 55px;
        left: -60px;
    }

    .language-option {
        width: 140px;
        padding: 8px 12px;
        font-size: 12px;
    }
}

        /* TITULOS */
/* TITULOS */
.page-title {
    font-weight: 700;
}

.subtitle {
    color: #6c757d;
}

        /* CARD PRODUCTO */
/* CARD PRODUCTO */
.catalog-product-grid {
    align-items: stretch;
}

.catalog-product-col {
    display: flex;
}

.producto-card {
    background: white;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.13);
    padding: 20px;
    transition: 0.2s;
    border: 1px solid #c5c5c5;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.producto-card:hover {
    transform: translateY(-3px);
}

        /* IMAGEN */
/* IMAGEN */
.producto-img {
    height: 160px;
    object-fit: contain;
    width: 100%;
    flex-shrink: 0;
}

        /* NOMBRE PRODUCTO */
/* NOMBRE PRODUCTO */
.product-name {
    color: #1f4fa3;
    font-weight: 700;
    font-size: 18px;
    line-height: 1.25;
    min-height: 3.2em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.35rem;
}

        /* TEXTO UNIDADES */
/* TEXTO UNIDADES */
.units-text {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.35;
    min-height: 2.7em;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.producto-card > .mb-2 {
    margin-top: auto;
}

.producto-card .agregar-btn,
.producto-card .agregar-btn-login {
    margin-top: auto;
}

        /* BOTONES CANTIDAD */
/* BOTONES CANTIDAD */
.qty-btn {
    background: #1f4fa3;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-weight: bold;
}

        /* BOTON AMARILLO */
/* BOTON AMARILLO */
.btn-yellow {
    background: #ffd400;
    font-weight: 600;
    border: none;
}

.btn-yellow:hover {
    background: #e6c200;
}

        /* SIDEBAR MOBILE */

@media (max-width: 768px) {
    /* organiza filtros y buscador en columna */
    .catalog-header .selects-row {
        flex-direction: column;
        gap: 10px !important;
    }

    #buscador {
        width: 100%;
        min-width: unset !important;
        margin-bottom: 6px;
    }

    .presentacion-select {
        min-width: 100% !important;
    }

    .agregar-btn {
        padding: 12px 14px;
        font-size: 15px;
    }

    .qty-btn {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }

    .producto-card {
        padding: 14px;
        text-align: left;
    }

    .product-name {
        font-size: 17px;
        text-align: left;
        min-height: 2.9em;
    }

    .info-presentacion {
        text-align: left;
        justify-content: flex-start;
    }

    /* Apilar y centrar título + controles en móviles */
    .catalog-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .catalog-header .top-row {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .catalog-header .page-title {
        text-align: center;
        margin: 0;
    }

    .catalog-header .selects-row {
        width: 100%;
    }

    .catalog-header .selects-row > #buscador {
        width: 100%;
        min-width: 0;
    }

    .catalog-header .selects-row {
        width: 100%;
        display: flex;
        gap: 10px;
        flex-direction: column;
    }

    .catalog-header .selects-row select {
        width: 100%;
    }
}



        @media (max-width:576px){

        .producto-img{
        height:120px;
        }

        .product-name{
        font-size:16px;
        min-height:auto;
        }

        .units-text{
        font-size:12px;
        min-height:auto;
        }

        .producto-card{
        padding:15px;
        }

        }

        /* Ajustes adicionales para pantallas muy pequeñas */
        @media (max-width:420px){

        .producto-img{
        height:100px;
        }

        .qty-btn{
        width:40px;
        height:40px;
        }

        .agregar-btn{
        font-size:14px;
        padding:10px 12px;
        }

        #buscador{
        font-size:14px;
        }

        }

        /* ========================= */
        /* TABLET RESPONSIVE (768px - 992px) */
        /* Mantener sidebar vertical y mejorar touch targets */
        /* ========================= */

        @media (min-width: 768px) and (max-width: 992px){

        .sidebar{
        height: calc(100vh - 72px);
        border-right:1px solid #e5e5e5;
        border-bottom:none;
        position:sticky;
        top:72px;
        background:#fff;
        z-index:10;
        max-width:230px;
        }

        /* usuario */
        .sidebar-user{
        margin:18px 12px;
        padding:12px;
        font-size:16px;
        border-radius:8px;
        }

        /* botones en vertical con mayor área táctil */
        .sidebar .list-group{
        display:block;
        padding:8px 0;
        }

        .sidebar .list-group-item{
        width:100%;
        text-align:left;
        padding:10px 18px;
        font-size:15px;
        margin:6px 10px;
        border-radius:8px;
        }

        /* mantiene barra amarilla pero más cerca del borde */
        .sidebar .active::before{
        display:block;
        left:8px;
        height:60%;
        }

        /* filtros más cómodos en tablet */
        .d-flex.gap-2{
        flex-wrap:nowrap;
        gap:10px !important;
        }

        #buscador{
        flex:1;
        min-width:220px !important;
        }

        /* Posicionar buscador a la derecha en la fila superior; selects debajo */
        .catalog-header .top-row{
        display:flex;
        justify-content:space-between;
        align-items:center;
        width:100%;
        }

        .catalog-header .top-row > div:first-child{
        flex:1 1 auto;
        min-width:200px;
        }

        /* Buscador arriba a la derecha (agrupado dentro de selects-row), tamaño fijo razonable */
        .catalog-header .selects-row > #buscador{
        width:260px;
        max-width:40vw;
        }

        /* Selects en la línea inferior: categoria izquierda, marca derecha */
        .catalog-header .selects-row{
        display:flex;
        justify-content:space-between;
        gap:12px;
        width:100%;
        margin-top:8px;
        }

        .catalog-header .selects-row select{
        width:48%;
        min-width:140px;
        }

        }

/* ============================================ */
/* ESTILOS PARA MODO INVITADO                 */
/* ============================================ */

/* Indicador visual para modo invitado */
.sidebar-user.guest-mode {
    background: linear-gradient(90deg, #dc6d6d, #e67e7e, #f09999) !important;
    border-left: 4px solid #d32f2f;
}

/* Botón de login en el sidebar para invitados */
.sidebar .list-group-item:not(.active):hover {
    background-color: #f0f0f0;
}

.sidebar button.list-group-item {
    color: #d32f2f;
    font-weight: 600;
}

.sidebar button.list-group-item:hover {
    background-color: #ffe6e6;
    color: #d32f2f;
}

/* Botón "Inicia sesión para cotizar" */
.agregar-btn-login {
    background: white !important;
    color: #d32f2f !important;
    border: 2px solid #d32f2f !important;
    font-weight: 600 !important;
    transition: all 0.3s ease;
}

.agregar-btn-login:hover {
    background: #ffe6e6 !important;
    color: #d32f2f !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.3);
}

.agregar-btn-login:active {
    transform: translateY(0);
}

/* OFF-CANVAS SIDEBAR MOBILE / TABLET */
@media (max-width: 992px) {
    .main-content {
        margin-left: 0;
        width: 100%;
        height: auto;
        min-height: calc(100vh - 70px);
        padding: 20px;
    }

    .sidebar {
        display: block;
        position: fixed;
        left: -320px;
        z-index: 1040;
        transition: left 0.25s ease;
    }

    .sidebar.show {
        left: 0;
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 1035;
    }

    .sidebar-backdrop.show {
        display: block;
    }
}