/* --------------------------------------------------------------------------
   01. ESTRUCTURA Y LAYOUT PRINCIPAL
   -------------------------------------------------------------------------- */
.main__catalogo--principal .contenedor {
    padding: 2rem;
    margin-top: 2rem;
    border-radius: 2rem;
}

.QuieneSomos__main--contenedor__banner {
    display: grid;
    align-content: center;
}

.Trefacciones__cont span {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.catalogo__filtrado,
.tabla__compatibilidad,
.productos__datos--contenedor,
.contenedor__buscador__encontrados {
    display: grid;
}

.tabla__compatibilidad {
    padding-bottom: 3rem;
}

.producto__contenedor {
    padding-bottom: 5rem;
}

/* --------------------------------------------------------------------------
   02. BARRA DE BÚSQUEDA Y ENCABEZADOS
   -------------------------------------------------------------------------- */
.catalogo__filtrado--buscador {
    margin-bottom: 2rem;
}

/* --------------------------------------------------------------------------
   03. SIDEBAR DE FILTROS Y CONTROLES GLOBALES
   -------------------------------------------------------------------------- */
.filtros__contenedor {
    margin: 5px 0 5px 0;
}

.filtros__contenedor button {
    border: 1px solid;
    border-radius: 4px;
}

.filtros__contenedor button:hover,
.filtro__activo {
    background-color: #de0007;
    color: #fff;
}

/* ---- Diseño Moderno de "Tu Selección" (Pills) ---- */
.tags__contenedor {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    background-color: #f3f4f6;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    margin: 0.4rem;
    border: 1px solid #e5e7eb;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.tags__contenedor:hover {
    background-color: #e5e7eb;
    transform: translateY(-2px);
}

.tags__contenedor .fa-times {
    font-size: 1.2rem;
    color: #6b7280;
    cursor: pointer;
    order: 2; /* Tachita a la derecha */
}

.Filtro_Seleccion {
    font-size: 1.15rem;
    font-weight: 500;
    color: #111827;
    order: 1; /* Texto a la izquierda */
}

.viewmorebtn {
    color: var(--blanco);
    background-color: var(--primario);
}

.viewmorebtn:focus {
    border: solid 1px #000;
    box-shadow: none;
    color: var(--blanco);
    background-color: var(--primario-oscuro);
}

/* Animación de los íconos de acordeón */
.fa-angle-down {
    transition: transform 0.3s ease;
}

.rotar-180 {
    transform: rotate(180deg);
}

/* ---- Animación Global del Acordeón ---- */
.contenido__opciones {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    transition: max-height 0.4s ease-in-out, opacity 0.3s ease, margin-top 0.3s ease;
}

.contenido__opciones.abierto {
    max-height: fit-content;
    opacity: 1;
    margin-top: 1rem;
}

/* Checkboxes Personalizados */
.container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.container input:checked~.checkmark {
    background-color: red;
    border-color: red;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 1.6rem;
    width: 1.6rem;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.container:hover input~.checkmark {
    background-color: #e5e7eb;
    border-color: #9ca3af;
}

.checkmark:after {
    position: absolute;
    display: none;
}

.container input:checked~.checkmark:after {
    display: block;
}

.container .checkmark:after {
    left: 0.5rem;
    top: 0.1rem;
    width: 0.5rem;
    height: 1rem;
    border: solid white;
    border-width: 0 3px 3px 0;
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
}

.container {
    display: block;
    position: relative;
    padding-left: 2.2rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    font-size: 1.2rem;
}

/* ---- Estilos para los Radios de "Ordenar por" ---- */
.container__radio {
    display: block;
    position: relative;
    padding-left: 2.8rem;
    margin-bottom: 1.5rem;
    cursor: pointer;
    font-size: 1.3rem;
    color: #4b5563;
    font-weight: 500;
    padding-top: 0.2rem;
}
.container__radio input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}
.radiomark {
    position: absolute;
    top: 0;
    left: 0;
    height: 2rem;
    width: 2rem;
    background-color: #f3f4f6;
    border: 2px solid #d1d5db;
    border-radius: 50%; /* Circular */
    transition: all 0.2s ease;
}
.container__radio:hover input ~ .radiomark {
    background-color: #e5e7eb;
}
.container__radio input:checked ~ .radiomark {
    background-color: #fff;
    border-color: #de0007;
}
.radiomark:after {
    content: "";
    position: absolute;
    display: none;
}
.container__radio input:checked ~ .radiomark:after {
    display: block;
}
.container__radio .radiomark:after {
    top: 0.4rem;
    left: 0.4rem;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    background: #de0007;
}
.opcion__ordenamiento {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #f3f4f6;
}

/* --------------------------------------------------------------------------
   04. PRODUCTOS Y TARJETAS 
   -------------------------------------------------------------------------- */
.home__pr {
    border: 1px solid var(--gris-mid);
    background-color: var(--blanco);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.block2 {
    border: 2px solid var(--blanco);
    border-radius: 0.5rem;
}

.block2-txt {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.block2-brand {
    font-size: 1.1rem;
    font-weight: 600;
    color: #6b7280 !important;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.block2-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    margin-bottom: 1.5rem;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 5.4rem;
}

.block2:hover .block2-name {
    transition: 0.8s;
    height: max-content;
}

.wrap-slick2 .wrap-pic-w,
.productos__informacion .wrap-pic-w {
    position: relative;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f8f9fa;
    width: 100%;
}

.productos__informacion .wrap-pic-w a {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 20rem;
    width: 100%;
    padding: 1rem;
}

.productos__informacion img {
    max-height: 18rem;
    max-width: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.descripcion-producto {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: space-between;
    height: 100%;
}

.precio__imgprove {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.precio__producto {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primario);
    margin: 0;
}

.precio__producto.price {
    color: var(--primario);
}

.line_through-red {
    display: block;
    font-size: 1.3rem;
    color: #9ca3af;
    text-decoration: line-through;
    text-decoration-color: #de0007;
    font-weight: 500;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.sku_row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed #e5e7eb;
    padding-top: 1rem;
    margin-bottom: 1.5rem;
}

.sku_label,
.sku_value {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1rem;
    color: #4b5563;
    padding: 0;
}

.sku_value {
    font-weight: bold;
    color: #111827;
}

.avisos__productos {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    z-index: 10;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: flex-start;
    width: 90%;
}

.promocion__aviso,
.nuevo__aviso,
.agotado__aviso,
.enviogratis__aviso {
    color: var(--blanco);
    border-radius: 0.3rem;
    padding: 0.2rem 0.6rem;
    text-transform: uppercase;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: default;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* --------------------------------------------------------------------------
   05. PAGINACIÓN
   -------------------------------------------------------------------------- */
.pagination {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.item-pagination {
    font-family: Montserrat-Regular;
    font-size: 1.3rem;
    display: grid;
    align-items: center;
    color: var(--negro);
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 50%;
    border: 1px solid var(--negro);
    margin: 0.6rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.item-pagination:hover {
    background-color: var(--primario-oscuro);
    color: var(--blanco);
}

.active-pagination {
    background-color: var(--primario);
    color: var(--blanco);
}

/* --------------------------------------------------------------------------
   06. DISPOSITIVOS MÓVILES
   -------------------------------------------------------------------------- */
.mobiledevice .nuestrosproductos__masvendidos {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem;
}

.mobiledevice .productos__informacion {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mobiledevice .productos__informacion .wrap-pic-w a {
    min-height: 12rem;
    padding: 0.5rem;
}

.mobiledevice .productos__informacion img {
    width: auto;
    max-width: 100%;
    max-height: 11rem;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.mobiledevice .block2-txt {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.mobiledevice .block2-name {
    font-size: 1.15rem;
    height: 4.5rem;
    margin-bottom: 0.5rem;
}

.mobiledevice .precio__producto {
    font-size: 1.6rem;
}

.mobiledevice .sku_label,
.mobiledevice .sku_value {
    font-size: 0.95rem;
}

.mobiledevice .sku_row {
    margin-bottom: 1rem;
}

.mobiledevice .desktop-only {
    display: none !important;
}

/* Controles de Menú Mobile Superior */
.mobiledevice .open__opciones {
    display: flex;
    width: 100%;
    text-align: center;
    justify-content: space-around;
    background-color: var(--blanco);
    border-bottom: solid 1px #e5e7eb;
    height: 5rem;
    align-items: center;
    column-gap: 1rem;
    margin-bottom: 2rem;
}

.mobiledevice .open__opciones--Orden,
.mobiledevice .open__opciones--Filtros {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    font-weight: 600;
    color: #4b5563;
}

.mobiledevice .catalogo__filtrado--buscador input {
    height: 4rem;
}

.mobiledevice .Trefacciones__cont {
    background-color: var(--primario);
    color: var(--blanco);
    text-align: center;
}

.badge-filtros {
    background-color: var(--primario);
    color: var(--blanco);
    border-radius: 1rem;
    padding: 0.1rem 0.6rem;
    font-size: 1.1rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* ==== Menú Lateral Móvil (Bottom Sheet) ==== */
.overlay-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99998 !important;
}

.overlay-modal.activo {
    opacity: 1;
    visibility: visible;
}

.mobiledevice .filtros,
.mobiledevice .filtros__orden {
    position: fixed;
    bottom: -100%;
    left: 0;
    top: auto; 
    right: auto;
    width: 100%;
    max-width: none;
    height: 70vh;
    background: #fff;
    z-index: 99999 !important;
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.15); 
}

.mobiledevice .filtros.activo,
.mobiledevice .filtros__orden.activo {
    bottom: 0;
}

.sidebar-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.5rem 2rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 20px 20px 0 0;
    position: relative;
}

/* El Pill (Indicador de Arrastre) */
.sidebar-header::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 45px;
    height: 5px;
    background-color: #9ca3af;
    border-radius: 10px;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: #111827;
}

.btn-cerrar {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 3rem;
    color: #9ca3af;
    padding: 0;
    line-height: 1;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2rem;
    overscroll-behavior: contain;
}

.sidebar-footer {
    flex-shrink: 0;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.04);
    position: relative;
    z-index: 10;
}

.btn-ver-resultados {
    width: 100%;
    padding: 1.5rem;
    background-color: var(--primario);
    color: var(--blanco);
    border: none;
    border-radius: 0.8rem;
    font-size: 1.6rem;
    font-weight: 600;
    cursor: pointer;
}

/* ---- Espaciado y Tipografía de App para Móvil ---- */
.mobiledevice .filtros__contenedor {
    padding: 1.8rem 2rem;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.mobiledevice .filtros__header {
    font-size: 1.4rem;
    font-weight: 600;
    color: #374151;
}

.mobiledevice .container {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    color: #4b5563;
}

.mobiledevice .filtros__subtitle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.mobiledevice .filtro__aplicar {
    display: flex;
    justify-content: center;
}

.mobiledevice .filtro__quitar {
    display: none;
}

.mobiledevice .filtro__aplicar--button {
    height: 4rem;
    width: 25rem;
    font-size: 1.6rem;
    font-family: 'Poppins';
    background-color: var(--primario);
    color: var(--blanco);
    margin: 1rem;
    border-radius: 1rem;
    border: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobiledevice .filtro__aplicar--button:active {
    transform: scale(0.95);
    opacity: 0.9;
}

/* --------------------------------------------------------------------------
   07. ESCRITORIO
   -------------------------------------------------------------------------- */
.desktop .mobile-only {
    display: none !important;
}

.desktop .overlay-modal {
    display: none !important;
}

.desktop .open__opciones {
    display: none;
}

.desktop .filtros__orden {
    display: none !important;
}

.desktop .Trefacciones__cont {
    display: grid;
    align-content: center;
    grid-row: 1;
}

.desktop .productos__informacion {
    grid-template-columns: none;
}

.desktop .productos__informacion .wrap-pic-w {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
}

.desktop .productos__informacion a img {
    width: auto;
    max-height: 20rem;
    margin: 0 auto;
    padding: 1rem;
    mix-blend-mode: multiply;
}

.desktop .productos__informacion .wrap-pic-w a {
    display: grid;
    min-height: 20rem;
}

.desktop .productos__refacciones {
    padding: 2rem;
    border-radius: 2rem;
    margin: 0 auto;
    width: 105rem;
    height: fit-content;
}

.desktop .contenedor__filtrado {
    margin: 0 auto;
    width: 105rem;
}

.desktop .menurefacciones__completo {
    padding: 2rem;
    border-radius: 2rem;
    display: flex;
    max-width: 146rem;
    margin: 0 auto;
    gap: 2rem;
}

/* El Panel Lateral en Escritorio */
.desktop .filtros {
    background-color: var(--blanco);
    width: 26rem;
    height: fit-content;
    border-radius: 1rem;
    padding: 2rem;
    align-content: flex-start;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.desktop .sidebar-content {
    display: block;
    overflow-y: visible;
}

.desktop .filtros__subtitle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.desktop .filtros__contenedor {
    width: 100%;
    height: auto;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.desktop .filtros__contenedor:last-child {
    border-bottom: none;
}

/* Botón transparente para limpiar en Escritorio */
.desktop .filtro__quitar--button {
    height: auto;
    padding: 0.8rem;
    width: 100%;
    font-size: 1.2rem;
    margin-top: 1rem;
    font-family: 'Poppins';
    background-color: transparent;
    color: var(--primario);
    border: 1px solid var(--primario);
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.desktop .filtro__quitar--button:hover {
    background-color: var(--primario);
    color: var(--blanco);
}

.desktop .filtro__aplicar {
    display: none;
}

.desktop .catalogo {
    min-width: 150rem;
    max-width: 157rem;
    justify-self: center;
}

.desktop .contenedor__buscador__encontrados {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 2rem;
}

.desktop .catalogo__filtrado--buscador {
    width: 40rem;
    display: grid;
    justify-self: flex-end;
}

.desktop .catalogo__filtrado--buscador input {
    width: 100%;
    height: 4rem;
    padding-left: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

.desktop .catalogo__filtrado--buscador button {
    width: 5rem;
    height: 4rem;
    background: transparent;
    border: none;
}

.desktop .catalogo__filtrado--buscador button:hover {
    color: var(--primario);
}

.desktop .refacciones__productos {
    width: 120rem;
    margin: 0 auto;
}

/* ----- MIN-WIDTH BREAKPOINTS GLOBALES ----- */
@media(min-width: 768px) {
    .nuestrosproductos__masvendidos {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(24rem, 1fr));
        grid-gap: 2rem;
    }
}

@media(min-width: 800px) {
    .body__theme--dark .home__pr:hover {
        box-shadow: 5px 10px 20px var(--blanco);
    }

    .home__pr:hover {
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    }

    .precio__imgprove {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: row;
    }
}