/*
  UI común de productos: paginación pill con flechas y ajustes responsivos.
  Extraído desde plantillas para evitar estilos inline y facilitar reutilización.
*/

/* Paginación (wrapper y estados) */
.pagination-wrapper {
    margin: 24px 0;
    background: #f4f8fa;
    border-radius: 999px;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pagination-wrapper .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: none;
    border-radius: 999px;
    color: rgba(50, 50, 60, 1);
    background: transparent;
    text-decoration: none;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.pagination-wrapper .page-numbers:hover {
    background: rgba(232, 240, 240, 1);
    color: rgba(50, 50, 60, 1);
}

.pagination-wrapper .page-numbers.current {
    background: var(--bs-primary);
    color: #fff;
}

.pagination-wrapper .page-numbers.prev,
.pagination-wrapper .page-numbers.next {
    width: 34px;
    height: 34px;
    padding: 0;
    background: #fff;
    color: rgba(50, 50, 60, 1);
    border: 1px solid #e0e6ea;
    border-radius: 999px;
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
}

.pagination-wrapper .page-numbers.prev:hover,
.pagination-wrapper .page-numbers.next:hover {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
    background: #fff;
}

.pagination-wrapper .page-numbers.dots {
    pointer-events: none;
    background: transparent;
}

/* Ajustes responsivos: más acolchado en móvil */
@media only screen and (max-width: 600px) {
    .pagination-wrapper .page-numbers {
        padding: 5px 10px !important;
    }
}

/* --- Ajustes móviles y estructura de tarjetas/productos --- */
@media only screen and (max-width: 600px) {
    .sin-flex {
        flex-direction: column;
    }

    .col-12.col-md-6.cotizador-link {
        text-align: center !important;
    }

    .product-item {
        height: 520px !important;
    }

    .col-md-6.col-md-6.cotizador-link {
        text-align: center;
        padding-right: 10px;
        margin-top: 20px;
        padding-bottom: 30px;
    }

    .col-12.col-md-6.btn-ver-producto-tienda {
        text-align: center;
    }

    .precio {
        font-size: 20px !important;
        text-align: center !important;
    }

    a.btn-ver-link-card {
        text-align: center;
    }
}

/* Nombre y precio (desktop base) */
p.precio {
    color: #000000;
    font-size: 24px;
    text-align: start;
}

p.iva-incluido {
    text-align: start;
}

/* Elementos comunes */
.imagenes {
    text-align: center;
}

a.cotizardo-link {
    margin: 0;
    text-decoration: none;
}

/* Sidebar de cotización */
.sidebar-cotizacion {
    position: fixed;
    top: 0;
    right: -500px;
    width: 500px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.sidebar-cotizacion.active {
    right: 0;
}

.sidebar-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* UI de filtros: acordeones en sidebar */
.filtros-container .accordion,
.filtros-container .accordion-item,
.filtros-container .accordion-body {
    background-color: #f4f8fa !important;
}

.filtros-container .accordion-button,
.filtros-container .accordion-button:not(.collapsed) {
    background-color: #f4f8fa !important;
}

.filtros-container .form-check-label {
    display: flex;
    align-items: center;
    width: 100%;
}

.filtros-container .form-check-label .badge {
    margin-left: auto !important;
    background: rgba(232, 240, 240, 1) !important;
    color: rgba(50, 50, 60, 1) !important;
}

.filtros-container .accordion-button::after {
    display: none !important;
}

.filtros-container .accordion-button::before {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
    content: "";
    background-image: var(--bs-accordion-btn-icon);
    background-repeat: no-repeat;
    background-size: 1.0rem;
    transition: transform .2s ease-in-out;
}

.filtros-container .accordion-button:not(.collapsed)::before {
    background-image: var(--bs-accordion-btn-active-icon);
    transform: rotate(180deg);
}

.form-check-input:disabled ~ .form-check-label {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-select option:disabled {
    color: #999;
}

/* Ajustes varios específicos vistos en plantillas */
div#categoriasAccordion3 {
    background: #f4f8fa;
}

.accordion-body {
    padding: 0px !important;
}

button.accordion-button {
    color: #000000 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 10px 0px !important;
}

div#categoriasAccordion0 {
    background: rgba(244, 248, 250, 1);
}

/* Ajustes móviles adicionales para el botón del sidebar de filtros */
.btn-sidebar-container {
    position: fixed;
    top: 10px;
    left: 70%;
    z-index: 1051;
    display: none;
}

@media (max-width: 768px) {
    .btn-sidebar-container {
        display: block;
        top: -6px;
    }

    button.btn.btn-primary.btn-sm.w-100.mb-2 {
        background: rgba(0, 94, 184, 1.8);
    }

    .sidebar-filtros #closeSidebarBtn {
        display: block !important;
    }

    button.accordion-button {
        font-size: 13px !important;
    }
}

/* Sidebar y componentes de cotización compartidos */
.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.titulo-productos-seleccionados {
    font-size: 17px;
}

.sidebar-body {
    flex: 1;
    overflow-y: auto;
}

.producto-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
}

.col-md-6.col-md-6.cotizador-link {
    text-align: end;
    padding-right: 10px;
}

.producto-imagen img {
    max-width: 100px;
    height: auto;
    border-radius: 5px;
    margin-bottom: 10px;
}

.producto-detalles h4 {
    font-size: 1rem;
    margin: 0;
    color: #333;
}

.form-cotizacion .form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.form-cotizacion .form-control {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
}

.form-cotizacion .form-control:focus {
    border-color: #005EB8;
    box-shadow: 0 0 0 0.2rem rgba(0, 94, 184, 0.25);
}

.btn-enviar-cotizacion {
    background: #005EB8;
    border: none;
    padding: 12px;
    font-weight: 600;
    border-radius: 5px;
}

.btn-enviar-cotizacion:hover {
    background: #004494;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lista-productos {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    background-color: #f9f9f9;
}

.producto-item {
    background-color: white;
    transition: all 0.2s ease;
}

.producto-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.producto-imagen-mini img {
    border-radius: 4px;
}

.btn-eliminar-producto {
    border: none;
    padding: 4px 8px;
    font-size: 12px;
}

.btn-limpiar-productos {
    background-color: #dc3545;
}

/* Hover para botón limpiar productos */
.btn-limpiar-productos:hover {
    background-color: #c82333;
    border-color: #bd2130;
    color: #fff;
}

/* Elementos comunes de producto */
.nombre-producto {
    font-size: 13px !important;
    color: #495057;
    text-align: start;
}

.imagenes {
    text-align: center;
}

a.cotizardo-link {
    margin: 0;
    text-decoration: none;
}


/* Sidebar de cotización */
.sidebar-cotizacion {
    position: fixed;
    top: 0;
    right: -500px;
    width: 500px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.sidebar-cotizacion.active {
    right: 0;
}

.sidebar-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Acordeones de categorías */
div#categoriasAccordion3 {
    background: #f4f8fa;
}

div#categoriasAccordion0 {
    background: rgba(244, 248, 250, 1);
}

.accordion-body {
    padding: 0px !important;
}

button.accordion-button {
    color: #000000 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 10px 0px !important;
}

/* Fondo y borde superior para cuerpos de acordeón */
.accordion-body {
    background-color: #F4F8FA;
    border-top: 1px solid #e0e0e0;
}

/* Paginación */
.pagination-wrapper .page-numbers {
    padding: 5px 10px;
}

/* Ajustes móviles generales */
@media (max-width: 768px) {
    .sidebar-cotizacion {
        width: 100%;
        right: -100%;
    }

    .sidebar-cotizacion.active {
        right: 0;
    }

    .btn-sidebar-container {
        display: block;
    }
}

/* Utilidades */

.product-item {
    height: 520px !important;
}

.btn-ver-link-card {
    text-align: center;
}

/* Botón cerrar del sidebar de filtros */
.sidebar-filtros #closeSidebarBtn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    display: none;
}

/* Icono del acordeón a la izquierda (Bootstrap 5) */
.accordion-button::after {
    display: none !important;
}

.accordion-button::before {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
    content: "";
    background-image: var(--bs-accordion-btn-icon);
    background-repeat: no-repeat;
    background-size: 1.0rem;
    transition: transform .2s ease-in-out;
}

.accordion-button:not(.collapsed)::before {
    background-image: var(--bs-accordion-btn-active-icon);
    transform: rotate(180deg);
}

/* Fondo acordeones en filtros */
.filtros-container .accordion,
.filtros-container .accordion-item,
.filtros-container .accordion-body {
    background-color: #f4f8fa !important;
}

.filtros-container .accordion-button {
    background-color: #f4f8fa !important;
}

.filtros-container .accordion-button:not(.collapsed) {
    background-color: #f4f8fa !important;
}

/* Badge y label en filtros */
.filtros-container .form-check-label {
    display: flex;
    align-items: center;
    width: 100%;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 400 !important;
}

.filtros-container .form-check-label .badge {
    margin-left: auto !important;
    background: rgba(232, 240, 240, 1) !important;
    color: rgba(50, 50, 60, 1) !important;
    font-weight: 400 !important;
}

/* Interacciones y detalles de filtros */

.filtros-container .form-check:last-child {
    border-bottom: 0;
}

.filtros-container .form-check-input {
    margin-right: 0.5rem;
    cursor: pointer;
    border-color: rgba(50, 50, 60, 0.25);
    box-shadow: none !important;
}

.filtros-container .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem rgba(27, 146, 142, 0.25) !important;
}

.filtros-container .form-check-input:checked {
    background-color: rgba(27, 146, 142, 1);
    border-color: rgba(27, 146, 142, 1);
}

.filtros-container .form-check-label:hover {
    color: rgba(50, 50, 60, 0.9) !important;
}

.filtros-container .form-check-input:checked + .form-check-label .badge {
    background: rgba(27, 146, 142, 0.12) !important;
    color: rgba(27, 146, 142, 1) !important;
}

.filtros-container .accordion-item {
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: .5rem;
}

.filtros-container .accordion-button:hover {
    background-color: #eef4f6 !important;
}

@media (max-width: 576px) {
    .filtros-container .accordion-button {
        font-size: .95em;
    }

    .filtros-container .form-check-label {
        font-size: .95em;
    }
}

/* Grid de productos */
.productos-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    padding: 20px;
}

@media (min-width: 1400px) {
    .productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* Search Results UI: paginación y sidebar de cotización */
.pagination-wrapper {
    margin: 24px 0;
    background: #f4f8fa;
    border-radius: 999px;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pagination-wrapper .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: none;
    border-radius: 999px;
    color: rgba(50, 50, 60, 1);
}

.pagination-wrapper .page-numbers:hover {
    background: #e9eef2;
}

/* Etapas de flujo de cotización */
.etapas-indicador {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    border-bottom: 1px solid #e9ecef;
}

.etapa-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.etapa-item.active {
    opacity: 1;
}

.etapa-numero {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.etapa-item.active .etapa-numero {
    background-color: #007bff;
    color: #fff;
}

.etapa-texto {
    font-size: 12px;
    font-weight: 500;
    color: #6c757d;
}

.etapa-item.active .etapa-texto {
    color: #007bff;
}

.etapa-separador {
    width: 60px;
    height: 2px;
    background-color: #e9ecef;
    margin: 0 20px;
}

.etapa-content {
    display: none;
}

.etapa-content.active {
    display: block;
}

.etapa-navegacion {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.btn-siguiente, .btn-anterior {
    min-width: 120px;
}

.resumen-lista {
    max-height: 150px;
    overflow-y: auto;
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
}

.pagination-wrapper .page-numbers.current {
    background: #2c7be5;
    color: #fff;
    font-weight: 600;
}

.pagination-wrapper .prev, .pagination-wrapper .next {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Sidebar de cotización */
.sidebar-cotizacion {
    position: fixed;
    top: 0;
    right: -420px;
    width: 420px;
    height: 100vh;
    background: #fff;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.08);
    transition: right 0.3s ease;
    z-index: 1050;
}

.sidebar-cotizacion.active {
    right: 0;
}

.sidebar-cotizacion .sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-cotizacion .sidebar-body {

    overflow-y: auto;
    height: calc(100vh - 120px);
}

.sidebar-cotizacion .sidebar-footer {
    padding: 16px;
    border-top: 1px solid #e9ecef;
}

.resumen-producto {
    display: flex;
    gap: 12px;
    align-items: center;
}

.resumen-producto-imagen {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: #f8f9fa;
}

.resumen-producto-nombre {
    font-size: 14px;
    color: #495057;
}

span.badge.bg-primary.ms-2 {
    margin-left: auto !important;
}

.filter-actions button {
    background: #005eb8;
    border-radius: 40px;
    text-transform: uppercase;
    font-weight: bold;
    padding: 10px;
}


/* Responsive */
@media (max-width: 768px) {
    .sidebar-cotizacion {
        width: 100%;
        right: -100%;
    }

    .sidebar-cotizacion.active {
        right: 0;
    }

    .sin-flex {
        flex-direction: column;
    }
}

.resumen-producto-nombre {
    font-size: 0.7rem;
    width: 300px;
    padding: 0px 20px;
}


/* Contenedor que define el espacio de la imagen */
.image-skeleton-container {
    position: relative;
    /* Las dimensiones deben definirse aquí o inline en el HTML */
    background-color: #f0f0f0; 
    overflow: hidden;
}

/* ------------------------------------------- */
/* EFECTO ESQUELETO (SKELETON / SHIMMER) */
/* ------------------------------------------- */

/* Aplica el fondo animado al contenedor mientras la imagen está oculta */
.image-skeleton-container:not(.loaded) {
    /* Define la apariencia del esqueleto */
    background: linear-gradient(to right, #f0f0f0 0%, #e0e0e0 20%, #f0f0f0 40%, #f0f0f0 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

/* La imagen real se oculta hasta que esté lista */
.lazy-image {
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* La imagen se muestra y el efecto esqueleto desaparece */
.image-skeleton-container.loaded .lazy-image {
    opacity: 1;
}

/* Animación del efecto Shimmer */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}