/* LAYOUT */
#products {
    padding-top: 20px;
}

.shop-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ELIMINAR ESPACIO FANTASMA DE WOOCOMMERCE */
ul.products::before,
ul.products::after {
    display: none !important;
    content: none !important;
}

/* FILTROS */
/* ===========================
   FILTROS SIDEBAR
=========================== */

.filters-form {
    border: 1px solid #eee;
    padding: 20px;
    background: #fff;
    font-family: inherit;
}

.filters-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
}

/* Grupo */
.filter-group {
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 10px;
}

/* Título */
.filter-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: left;
    cursor: pointer;
    position: relative;
    color: #333;
}

/* Flecha */
.filter-toggle::after {
    content: "▾";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    transition: transform 0.2s ease;
}

/* Abierto */
.filter-group.open .filter-toggle::after {
    transform: translateY(-50%) rotate(180deg);
}

/* Contenido */
.filter-content {
    margin-top: 10px;
}

/* Items */
.filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    margin-bottom: 8px;
    cursor: pointer;
}

/* Checkbox custom */
.filter-item input[type="checkbox"] {
    appearance: none;
    width: 14px;
    height: 14px;
    border: 2px solid #0033ff;
    background: #fff;
    cursor: pointer;
}

.filter-item input[type="checkbox"]:checked {
    background: #0033ff;
}

/* Precio */
.price-range input {
    width: 100%;
    padding: 6px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
}

/* Botón aplicar */
.filters-submit {
    width: 100%;
    margin-top: 15px;
    padding: 10px;
    background: #0033ff;
    border: none;
    font-weight: 700;
    cursor: pointer;
}

/* ===========================
   TOGGLE FILTROS
=========================== */

/* Por defecto: contenido oculto */
.filter-group .filter-content {
    display: none;
}

/* Cuando está abierto */
.filter-group.open .filter-content {
    display: block;
}

/* Flecha (solo en toggles) */
.filter-toggle::after {
    content: "▾";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    transition: transform 0.2s ease;
}

/* Flecha rotada */
.filter-group.open .filter-toggle::after {
    transform: translateY(-50%) rotate(180deg);
}

/* ===========================
   SECCIONES NO TOGGLE
=========================== */

/* Estas NO deben ocultarse nunca */
.filter-group.no-toggle .filter-content {
    display: block !important;
}

/* Estas NO deben mostrar flecha */
.filter-group.no-toggle .filter-toggle {
    cursor: default;
}

.filter-group.no-toggle .filter-toggle::after {
    display: none;
}


/* Checkbox */
.woocommerce-widget-layered-nav-list li {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

/* GRID */
.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* PAGINACIÓN */
.shop-pagination {
    margin: 40px 0;
    display: flex;
    justify-content: center;
}

.woocommerce-pagination ul.page-numbers {
    display: flex;
    gap: 10px;
    list-style: none;
}

.woocommerce-pagination .page-numbers li a,
.woocommerce-pagination .page-numbers li span {
    width: 40px;
    height: 40px;
    background: #0a0f3d;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.woocommerce-pagination .page-numbers li .current {
    background: #1a2bff;
}

.filter-toggle {
    position: relative;
}

.filter-toggle::after {
    content: "⌄";
    transition: transform 0.2s ease;
}

.filter-content.open+.filter-toggle::after {
    transform: rotate(180deg);
}

.shop-order {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: space-between;
}

.woocommerce-ordering select {
    border: 3px solid #0033ff;
    padding: 8px 10px;
    font-size: 1.1rem;
}

.woocommerce-ordering select:focus {
    outline: none;
}

/* ===========================
   PAGINACIÓN TIENDA
=========================== */

.sancar-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 40px 0;
}

/* Base */
.sancar-pagination .page-numbers {
    min-width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    background-color: #02004D;
    /* azul oscuro */
    color: #ffffff;

    font-size: 15px;
    font-weight: 600;
    text-decoration: none;

    border-radius: 2px;
    transition: background-color 0.2s ease;
}

/* Hover */
.sancar-pagination a.page-numbers:hover {
    background-color: #0033ff;
}

/* Página actual */
.sancar-pagination .current {
    background-color: #0033ff;
    cursor: default;
}

/* Flecha anterior */
.sancar-pagination .prev {
    font-size: 18px;
    line-height: 1;
}

/* Desactivar hover en current */
.sancar-pagination .current:hover {
    background-color: #0033ff;
}

/* =========================================================
   LOADER FULLSCREEN
========================================================= */
/* ===========================
   LOADER OVERLAY + SPINNER
=========================== */

.shop-loader {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.shop-loader.active {
    display: flex;
}

/* CONTENEDOR */
.shop-loader .spinner {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 6px solid rgba(255, 255, 255, 0.25);
    border-top-color: #ffffff;
    animation: sancar-spin 0.9s linear infinite;
}

/* ANIMACIÓN */
@keyframes sancar-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

#shop-ordering {
    padding: 8px 10px;
    font-size: 18px;
    border: 3px solid #0033ff;
}

#shop-ordering:focus {
    outline: none;
}

#shop-result-count {
    font-size: 18px;
    padding: 8px 0px;
}

.woocommerce-error,
.woocommerce-info,
.woocommerce-message {
    border-top: 3px solid #0033ff;
    font-size: 18px;
}

.woocommerce-info::before {
    color: #0033ff;
}
.filter-group.clear{
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 20px;
}

/* Botón limpiar filtros */
.filters-clear {
    text-decoration: none;
    width: 100%;
    text-align: center;
    padding: 10px;
    margin-top: 15px;
    border: 3px solid #0033ff;
    color: #0033ff !important;
    font-weight: 700;
    background: #ffffff;
    cursor: pointer;
    text-transform: uppercase;
    transition: .3s ease all;
}

.filters-clear:hover {
    background: #0033ff;
    color: #fff !important;
}

/* ===========================
   MOBILE FILTER BAR
=========================== */

.shop-mobile-bar {
    display: none;
    width: 100%;
    margin-bottom: 15px;
}

.shop-mobile-bar .open-filters {
    width: 100%;
    padding: 14px;
    background: #0033ff;
    color: #fff;
    border: none;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
}

/* ===========================
   MOBILE FILTER SIDEBAR
=========================== */

@media (max-width: 900px) {

    .shop-layout {
        grid-template-columns: 1fr;
    }

    .shop-filters {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 360px;
        height: 100vh;
        background: #fff;
        z-index: 9999;
        overflow-y: auto;
        transition: left .3s ease;
        padding: 20px;
    }

    .shop-filters.open {
        left: 0;
    }

    body.filters-open {
        overflow: hidden;
    }

    .shop-mobile-bar {
        display: block;
    }
}

/* ===========================
   GRID MOBILE 2x2
=========================== */

@media (max-width: 900px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 900px) {
    .shop-order {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    #shop-ordering,
    #shop-result-count {
        width: 100%;
        text-align: center;
    }
}

/* 🔑 Forzar cards normales dentro de la tienda */
.woocommerce ul.products .product-card-bm {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 0 0 auto;
}

/* Grid exclusivo de tienda */
.shop-results .woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 900px) {
    .shop-results .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
    }
}

.product-card-bm,
.product-card-bm * {
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.product-image img {
    max-width: 100%;
    height: auto;
}

