/* Contenedor principal del carrusel de productos */
.titulocarrusel1 {
    max-width: 1400px;
    width: 100%;
    font-size: 28px;
    text-align: center;
    margin: 0 auto;
    padding: 30px 0 0 0;
    font-weight: bold;
}

.carrusel-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.carrusel-btn {
    background-color: #80c9fa;
    color: white;
    border: none;
    font-size: 20px;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#btnAnterior {
    left: 10px;
}

#btnSiguiente {
    right: 10px;
}

.carrusel-btn:hover {
    background-color: #3498db;
}


#btnAnterior:disabled {
    display: none;
    /* Oculta el botón cuando está deshabilitado */
}

#btnSiguiente:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.productos-carrusel {
    display: flex;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow: hidden;
    width: 100%;
    height: 370px;

}

.producto {
    width: calc(20.5% - 20px);
    padding: 8px;
    height: 370px;
    text-align: center;
    border-radius: 8px;
    flex-shrink: 0;
    margin-left: 5px;
    margin-right: 5px;
    box-sizing: border-box;
    margin: 0 auto;

}

.producto-container1 {
    position: relative;
    min-width: 170px;
    width: 89%;
    height: 348px;
    background: white;
    margin-left: -4px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    /* Opacidad al 5% */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
    /* Transición suave para el efecto hover */
    overflow: hidden;
    box-sizing: border-box;
    flex-direction: column;
    justify-content: flex-start;
    margin: 0 auto;

}

.producto-container1:hover {
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2), -2px -2px 5px rgba(0, 0, 0, 0.2);

}

.producto-container1 img {
    min-width: 170px;
    width: 95%;
    height: 50%;
    margin: 2px auto;

}

.producto .descripcion {
    width: 99%;
    height: 100px;
    font-size: 10px;
    color: rgb(85, 85, 160);
    box-sizing: border-box;
    text-align: center;
    margin: 5px auto;

}

.producto .precio_descuento {
    font-weight: bold;
    color: blue;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;

}

.producto .disponibilidad {
    font-size: 11px;
    color: #888;
    margin-top: -20px;
}

.producto .clave_producto {
    margin-top: -17px;
    font-size: 10px;
    color: #888;
    text-align: center;
}


/* --- Contenedor de los dos botones de acción (.conte_botones_producto) --- */
.conte_botones_producto {
    display: flex;
    width: 100%;
    height: 50px;
    /* Esto podría ser un factor de recorte si el corazón o el tooltip son muy grandes */
    position: absolute;
    bottom: -50px;
    /* Se anima a 0px en hover */

    left: 0;
    right: 0;
    transition: bottom 0.3s ease;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    overflow: visible;
    /* <--- ¡IMPORTANTE! Si el tooltip fuera hijo directo de este */
}

/* Cuando el producto tiene hover, la barra de botones sube */
.producto:hover .conte_botones_producto {
    bottom: 0;
}

/* --- Estilos para el botón de "Agregar al Carrito" (amarillo) --- */
.agregar-carrito {
    background: rgba(255, 255, 0, 0.864);
    color: #C13517;
    flex: 1;
    padding: 10px;
    /* Deja este padding, afecta el espacio del texto */
    text-align: center;
    cursor: pointer;
    box-sizing: border-box;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Centra verticalmente el contenido */
    align-items: center;
    /* Centra horizontalmente el contenido */
    line-height: 1.2;
    white-space: normal;
    transition: color 0.3s ease, background 0.3s ease;
    border-top-left-radius: 0px;
    border-bottom-left-radius: 0px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    height: 100%;
    /* Asegura que ocupe el 100% de la altura de su padre flex */
}

.agregar-carrito:hover {
    color: #001f3f
}

/* --- Estilos para el botón de "Lista de Deseos" (.wishlist) --- */
.wishlist {
    background: rgba(240, 240, 240, 0.864);
    cursor: pointer;
    position: relative;
    /* ¡CRUCIAL! El tooltip es 'absolute' respecto a este padre */
    flex: 1;
    padding: 10px;
    /* Considera ajustar este padding si el corazón se sigue recortando */
    text-align: center;
    box-sizing: border-box;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    line-height: 1.2;
    /* Ayuda a que el icono no tenga espacio extra vertical */
    white-space: normal;
    transition: background 0.3s ease;
    border-bottom-left-radius: 0px;
    border-bottom-right-radius: 0;
    /* Elimina los bordes superiores si el contenedor está en el fondo de la tarjeta */
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    height: 100%;
    /* Asegura que el botón tome la altura completa de su padre (.conte_botones_producto) */
    overflow: visible;
    /* <--- ¡CRUCIAL! Para que el tooltip pueda salir de sus límites */
}

/* Estilos para el ICONO del corazón (.wishlist i) - para solucionar el recorte */
.wishlist i {
    /* Color manejado por JS, no CSS */
    font-size: 1.8em;
    /* ¡Prueba este valor! O 1.5em si 2em es demasiado grande y se recorta */
    line-height: 1;
    /* Esto es muy importante para reducir el espacio vertical del ícono */
    display: block;
    /* Asegura que tome su propio espacio */
    transition: color 0.3s ease;
    /* Transición suave para el color del icono (si JS lo cambia) */
}

.wishlist i.bi-heart-fill.deseo-activo {
    color: #000080 !important;
    /* Azul Marino definitivo */
}

/* Opcional: Asegurar que el gris sin deseo esté claro */
.wishlist i.bi-heart {
    color: gray;
}


/* 🟢 Estilo para el ícono al pasar el mouse - para corazones VACÍOS */
.wishlist:hover i.bi-heart {
    color: #000080;
    /* Un color azul más claro para el hover */
}

/* 🟢 Estilo para el ícono lleno - esta es la regla clave */
/* Debe tener mayor especificidad para que el color no se borre en hover */
.wishlist i.bi-heart-fill {
    color: #000080;
    /* Azul oscuro para el corazón lleno */
}


/* --- ESTILOS PARA EL TOOLTIP (.deseo-tooltip1) --- */
.deseo-tooltip1 {
    position: absolute;
    right: 4%;
    transform: translateX(-73%);
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;

    /* Elimina los bordes superiores si el contenedor está en el fondo de la tarjeta */

    font-size: 10px;
    white-space: nowrap;
    z-index: 10;
    /* Aumenta el z-index aún más, para asegurar que esté en la capa superior */
    opacity: 0;
    pointer-events: none;
    /*transition: opacity 0.3s ease, bottom 0.3s ease;*/
    /* Posición INICIAL: Fuera de la vista (debajo del botón), listo para subir */
    bottom: -25px;
    /* Ajusta este valor. Podría ser -15px, -20px, etc. */
    /* Debe ser lo suficientemente negativo para que al inicio el tooltip no se vea */
    /* y que al animarse a 'calc(100% + 5px)' quede por encima de la barra. */
}

/* Clase que activa la visibilidad del tooltip (añadida/removida por JS) */
.deseo-tooltip1.show-tooltip {
    opacity: 1;
    pointer-events: auto;
    /* Posición FINAL: 5px por encima del botón. */
    bottom: calc(100% + 5px);
}



.producto.sin-imagen img {
    display: none;
}

.producto.sin-imagen .descripcion,
.producto.sin-imagen .precio_descuento,
.producto.sin-imagen .disponibilidad,
.producto.sin-imagen .clave {
    font-size: 8.5px;
    color: #333;
    text-align: center;
}

/*CONFIGURACIÓN MODAL CARRUSEL FICHA TECNICA*/
#agregaralcarritocarrusel .modal-body {
    overflow: hidden;
}

#agregaralcarritocarrusel .modal-body .col-6:first-child {
    overflow: hidden;
}

#agregaralcarritocarrusel .modal-body .col-6:last-child {
    overflow-y: auto;
    max-height: 50vh;
}

#agregaralcarritocarrusel .modal-body #modalFichaTecnica {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Centrar el modal verticalmente */
#agregaralcarritocarrusel .modal-dialog {
    display: flex;
    align-items: center;
    /* Asegura que el modal esté centrado verticalmente */
    margin: 0 auto;
}


/*****CONFIGURACIÓN DEL CONTADOR DE PRODUCTOS ENCIMA DEL CARRITO*********/
.carrito-cantidad {
    position: absolute;
    top: 5px;
    /* Ajusta la distancia desde la parte superior */
    right: 5px;
    /* Ajusta la distancia desde la parte derecha */
    background-color: red;
    color: white;
    font-size: 14px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 20px;
    border-radius: 50%;
    /* Hace que el contador sea un círculo */
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3);
}

/* Asegurar que el contenedor del botón sea relativo */
.position-relative {
    position: relative;
}

body.modal-open {
    padding-right: 17px !important;
}













@media screen and (min-width: 768px) and (max-width: 991px) {

    /* 1. AJUSTE DEL TÍTULO */
    .titulocarrusel1 {
        font-size: 22px !important;
        padding: 20px 0 10px 0 !important;
    }

    /* 2. CONTENEDOR DE PRODUCTOS (ALTURA ADAPTATIVA) */
    .productos-carrusel {
        height: 420px !important;
        /* Aumentamos altura para que quepa la descripción */
        gap: 10px !important;
    }

    /* 3. TAMAÑO DEL PRODUCTO (3 POR PANTALLA) */
    .producto {
        /* (100% / 3) menos el margen = aprox 31% */
        width: 31% !important;
        height: 400px !important;
        margin: 0 5px !important;
    }

    .producto-container1 {
        width: 100% !important;
        height: 380px !important;
        min-width: unset !important;
        /* Quitamos el mínimo de PC */
    }

    /* 4. IMAGEN DEL PRODUCTO */
    .producto-container1 img {
        height: 160px !important;
        /* Altura fija para que todas las tarjetas alineen */
        object-fit: contain !important;
        /* No estira el producto */
        padding: 10px !important;
    }

    /* 5. TEXTOS Y PRECIOS (AJUSTE DE POSICIÓN) */
    .producto .descripcion {
        height: 65px !important;
        /* Espacio controlado para el texto */
        font-size: 11px !important;
        margin-bottom: 2px !important;
    }

    .producto .precio_descuento {
        font-size: 16px !important;
        /* BAJAMOS EL PRECIO: Aumentamos el margen superior */
        margin-top: 15px !important;
        margin-bottom: 2px !important;
    }

    .producto .disponibilidad {
        font-size: 10px !important;
        margin-top: 8px !important;
        line-height: 1 !important;
    }

    .producto .clave_producto {
        font-size: 10px !important;
        /* SUBIMOS LA CLAVE: Usamos margen negativo para acercarla a la disponibilidad */
        margin-top: -8px !important;
        margin-bottom: 5px !important;
        /* Espacio antes de los botones */
    }

    /* 6. BOTONES (SIEMPRE VISIBLES EN TABLET) */
    /* En tablets no hay 'hover' con mouse, mejor que se vean o suban fácil */
    .conte_botones_producto {
        bottom: 0 !important;
        /* Los dejamos visibles para que el usuario pueda comprar */
        height: 45px !important;
        background: rgba(255, 255, 255, 0.9) !important;
    }

    .agregar-carrito {
        font-size: 11px !important;
        padding: 5px !important;
    }

    /* 7. BOTONES DE NAVEGACIÓN (MÁS GRANDES PARA EL DEDO) */
    .carrusel-btn {
        width: 45px !important;
        height: 45px !important;
        background-color: rgba(128, 201, 250, 0.9) !important;
    }
}











/* ============================================================
   CARRUSEL: 7 RENGLONES DE DESCRIPCIÓN + BOTONES GRANDES
   ============================================================ */
@media screen and (max-width: 768px) {

    .titulocarrusel1 {
        font-size: 20px !important;
        padding: 15px 0 !important;
    }

    .productos-carrusel {
        display: flex !important;
        overflow: hidden !important;
        height: auto !important;
        padding-bottom: 10px !important;
    }

    .producto {
        width: 100% !important;
        flex: 0 0 100% !important;
        /* Aumentamos a 540px para dar espacio a los 7 renglones */
        height: 540px !important;
        margin: 0 !important;
        padding: 0 10px !important;
        box-sizing: border-box !important;
    }

    .producto-container1 {
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        background: #fff;
    }

    .producto-container1 img {
        height: 180px !important;
        width: auto !important;
        max-width: 90% !important;
        object-fit: contain !important;
        margin: 15px auto !important;
    }

    /* 🎯 ESPACIO PARA 7 RENGLONES */
    .producto .descripcion {
        font-size: 13.5px !important;
        /* Calculado: ~18px por línea x 7 = 126px */
        height: 126px !important;
        min-height: 126px !important;
        padding: 0 15px !important;
        margin-bottom: 10px !important;
        line-height: 1.4 !important;
        overflow: hidden;
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 7 !important;
        overflow: hidden !important;
    }

    .producto .precio_descuento {
        font-size: 22px !important;
        color: blue !important;
        font-weight: bold !important;
        margin: 10px 0 5px 0 !important;
        text-align: center !important;
    }

    .producto .disponibilidad,
    .producto .clave_producto {
        font-size: 12px !important;
        margin-top: 2px !important;
        margin-bottom: 2px !important;
        display: block !important;
        text-align: center !important;
    }

    /* 🎯 BOTONES IGUALES Y MÁS ALTOS */
    .conte_botones_producto {
        display: flex !important;
        width: 100% !important;
        height: 65px !important;
        /* Altura aumentada como pediste */
        position: relative !important;
        margin-top: auto !important;
        bottom: 0 !important;
    }

    .agregar-carrito {
        background: #ffff00 !important;
        /* Amarillo */
        color: #ff0000 !important;
        /* Rojo */
        flex: 1 !important;
        /* 50% de ancho */
        font-size: 16px !important;
        font-weight: bold !important;
        border: none !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        border-bottom-left-radius: 8px !important;
    }

    .wishlist {
        background: #f2f2f2 !important;
        /* Gris */
        flex: 1 !important;
        /* 50% de ancho */
        border: none !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        border-bottom-right-radius: 8px !important;
    }

    .wishlist i {
        font-size: 24px !important;
        color: #333 !important;
    }

    .deseo-tooltip1 {
        display: none !important;
    }

    /* Flechas laterales flotantes */
    .carrusel-btn {
        width: 40px !important;
        height: 40px !important;
        background-color: rgba(128, 201, 250, 0.7) !important;
        z-index: 30 !important;
    }
}