/* Yujju design system — tienda y categorías.
   Banner de título sobrio, sidebar sin cajas, barra de orden limpia,
   paginación en cuadros y grilla con gaps consistentes. */

/* ── Banner de título ────────────────────────────────────────────────────── */
.yj-ds .goal-breadscrumb.has_bg {
    position: relative;
    background-size: cover;
    background-position: center;
}
.yj-ds .goal-breadscrumb.has_bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, color-mix(in srgb, var(--yj-ink) 25%, transparent), color-mix(in srgb, var(--yj-ink) 50%, transparent));
    pointer-events: none;
}
.yj-ds .goal-breadscrumb .container {
    position: relative;
    z-index: 1;
}
@media (min-width: 992px) {
    .yj-ds .goal-breadscrumb .wrapper-breads {
        padding: var(--yj-space-9) 0;
    }
    .yj-ds .goal-breadscrumb {
        margin-bottom: var(--yj-space-7);
    }
}
.yj-ds .goal-breadscrumb .bread-title {
    font-family: var(--yj-font-display) !important;
    font-size: var(--yj-h1);
    font-weight: 500;
    line-height: var(--yj-leading-tight);
    letter-spacing: 0;
    color: var(--yj-white);
}
.yj-ds .goal-breadscrumb .breadcrumb {
    margin-top: var(--yj-space-3);
    font-family: var(--yj-font-body);
    font-size: 13px;
    letter-spacing: .02em;
    color: color-mix(in srgb, var(--yj-white) 75%, transparent);
}
.yj-ds .goal-breadscrumb .breadcrumb a {
    font-weight: 400;
    color: color-mix(in srgb, var(--yj-white) 85%, transparent);
}
.yj-ds .goal-breadscrumb .breadcrumb a:hover {
    color: var(--yj-white);
    text-decoration: underline;
}
.yj-ds .goal-breadscrumb .breadcrumb .active {
    font-weight: 500;
    color: var(--yj-white);
}
.yj-ds .goal-breadscrumb .breadcrumb > li + li::before {
    color: color-mix(in srgb, var(--yj-white) 60%, transparent);
}

/* ── Sidebar: widgets sin caja ───────────────────────────────────────────── */
.yj-ds .sidebar .widget,
.yj-ds #mobile-offcanvas-sidebar .widget {
    padding: 0;
    margin-bottom: var(--yj-space-6);
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.yj-ds .sidebar .widget .widget {
    margin-bottom: 0;
}
.yj-ds .sidebar .widget-title,
.yj-ds #mobile-offcanvas-sidebar .widget-title {
    position: relative;
    margin: 0 0 var(--yj-space-4);
    padding: 0 0 var(--yj-space-3);
    font-family: var(--yj-font-body) !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: var(--yj-tracking-caps);
    text-transform: uppercase;
    color: var(--yj-ink);
    border-bottom: var(--yj-border);
}
.yj-ds .sidebar .widget-title::before,
.yj-ds .sidebar .widget-title::after,
.yj-ds #mobile-offcanvas-sidebar .widget-title::before,
.yj-ds #mobile-offcanvas-sidebar .widget-title::after {
    display: none;
}

/* Categorías: lista limpia, contador en muted. */
.yj-ds .widget_product_categories ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.yj-ds .widget_product_categories li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--yj-space-2);
    margin: 0;
    padding: var(--yj-space-2) 0;
    border: 0;
    font-size: var(--yj-text-sm);
}
.yj-ds .widget_product_categories li a {
    font-family: var(--yj-font-body);
    font-weight: 400;
    color: var(--yj-text);
}
.yj-ds .widget_product_categories li a:hover,
.yj-ds .widget_product_categories li.current-cat > a {
    color: var(--yj-primary);
}
.yj-ds .widget_product_categories li.current-cat > a {
    font-weight: 600;
}
.yj-ds .widget_product_categories li .count {
    font-size: var(--yj-text-xs);
    color: var(--yj-muted);
}
.yj-ds .widget_product_categories li .children {
    flex-basis: 100%;
    padding-left: var(--yj-space-4);
}

/* Filtro de precio: slider en primary y botón compacto. */
.yj-ds .widget_price_filter .price_slider {
    height: 2px;
    margin: var(--yj-space-3) var(--yj-space-2) var(--yj-space-5);
    background: var(--yj-line-strong);
    border: 0;
}
.yj-ds .widget_price_filter .ui-slider-range {
    background: var(--yj-primary) !important;
}
.yj-ds .widget_price_filter .ui-slider-handle {
    top: -7px;
    width: 16px;
    height: 16px;
    background: var(--yj-white) !important;
    border: 2px solid var(--yj-primary) !important;
    border-radius: 50%;
    box-shadow: none;
}
.yj-ds .widget_price_filter .price_slider_amount {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    gap: var(--yj-space-3);
}
.yj-ds .widget_price_filter .price_slider_amount .price_label {
    font-family: var(--yj-font-body) !important;
    font-size: var(--yj-text-sm);
    color: var(--yj-muted);
}
.yj-ds .widget_price_filter .price_label span {
    font-family: inherit !important;
    font-weight: 600;
    color: var(--yj-ink);
}
:is(.yj-ds.woocommerce, .yj-ds .woocommerce) .widget_price_filter .price_slider_amount .button,
.yj-ds .widget_price_filter .price_slider_amount .button {
    min-height: 36px;
    padding: 0 var(--yj-space-4);
    font-size: var(--yj-text-sm) !important;
}

/* Productos destacados del sidebar. */
.yj-ds .sidebar ul.product_list_widget {
    margin: 0;
    padding: 0;
}
.yj-ds .sidebar ul.product_list_widget li {
    display: flex;
    align-items: center;
    gap: var(--yj-space-3);
    margin: 0;
    padding: var(--yj-space-3) 0;
    border: 0;
    border-bottom: var(--yj-border);
}
.yj-ds .sidebar ul.product_list_widget li:last-child {
    border-bottom: 0;
}
.yj-ds .sidebar ul.product_list_widget .left-content {
    flex: 0 0 64px;
    width: 64px;
    margin: 0;
}
.yj-ds .sidebar ul.product_list_widget .left-content img {
    width: 64px;
    height: 64px;
    margin: 0;
    object-fit: contain;
    background: var(--yj-white);
    border: var(--yj-border);
    border-radius: var(--yj-radius);
}
.yj-ds .sidebar ul.product_list_widget .right-content {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
}
.yj-ds .sidebar ul.product_list_widget .product-title {
    margin: 0 0 var(--yj-space-1);
    font-family: var(--yj-font-body) !important;
    font-size: var(--yj-text-sm);
    font-weight: 400;
    line-height: 1.4;
}
.yj-ds .sidebar ul.product_list_widget .product-title a,
.yj-ds .sidebar ul.product_list_widget .product-title a:not(:hover) {
    font-weight: 400;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-family: inherit !important;
    color: var(--yj-ink);
}
.yj-ds .sidebar ul.product_list_widget .amount,
.yj-ds .sidebar ul.product_list_widget .amount bdi {
    font-family: var(--yj-font-body) !important;
    font-size: var(--yj-text-sm);
    font-weight: 600;
    color: var(--yj-ink);
}
.yj-ds .sidebar ul.product_list_widget del .amount,
.yj-ds .sidebar ul.product_list_widget del .amount bdi {
    font-weight: 400;
    color: var(--yj-muted);
}

/* ── Barra superior: resultados + orden + vista ──────────────────────────── */
.yj-ds .goal-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--yj-space-3);
    padding: 0 0 var(--yj-space-4);
    margin-bottom: var(--yj-space-5);
    background: transparent;
    border: 0;
    border-bottom: var(--yj-border);
}
.yj-ds .goal-filter::before,
.yj-ds .goal-filter::after,
.yj-ds .widget_price_filter .price_slider_amount::before,
.yj-ds .widget_price_filter .price_slider_amount::after,
.yj-ds .widget_price_filter .price_slider_amount .clear {
    display: none; /* el clearfix ocupa sitio dentro del flex */
}
.yj-ds .goal-filter .woocommerce-result-count {
    margin: 0;
    font-size: var(--yj-text-sm);
    color: var(--yj-muted);
}
.yj-ds .goal-filter .wrapper-right,
.yj-ds .goal-filter .left-inner {
    display: flex;
    align-items: center;
    gap: var(--yj-space-3);
    margin: 0;
}
.yj-ds .goal-filter .woocommerce-ordering {
    margin: 0;
}
.yj-ds .goal-filter .orderby {
    height: 40px;
    min-height: 40px;
    padding: 0 var(--yj-space-6) 0 var(--yj-space-3);
    font-family: var(--yj-font-body);
    font-size: var(--yj-text-sm);
    text-transform: none;
    letter-spacing: 0;
    color: var(--yj-text);
    border: var(--yj-border);
    border-radius: var(--yj-radius);
}
.yj-ds .goal-filter .display-mode {
    display: flex;
    gap: var(--yj-space-1);
}
.yj-ds .goal-filter .display-mode .change-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0;
    font-size: 16px;
    color: var(--yj-muted);
    border: var(--yj-border);
    border-radius: var(--yj-radius);
}
.yj-ds .goal-filter .display-mode .change-view:hover,
.yj-ds .goal-filter .display-mode .change-view.active {
    color: var(--yj-primary);
    border-color: var(--yj-primary);
}

/* ── Grilla: gaps consistentes ───────────────────────────────────────────── */
.yj-ds .products-grid > .row,
.yj-ds .products > .row {
    row-gap: 0;
}
.yj-ds .products-wrapper-grid .product-block.grid {
    margin-bottom: 0;
}
.yj-ds .products-wrapper-grid > .row > .product,
.yj-ds .products-wrapper-grid .row-products-wrapper > .product {
    margin-bottom: var(--yj-space-6);
}

/* ── Paginación ──────────────────────────────────────────────────────────── */
.yj-ds .goal-pagination {
    margin-top: var(--yj-space-6);
}
.yj-ds .goal-pagination ul.page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--yj-space-2);
    border: 0;
}
.yj-ds .goal-pagination ul.page-numbers li {
    margin: 0;
    border: 0;
}
.yj-ds .goal-pagination ul.page-numbers li > a,
.yj-ds .goal-pagination ul.page-numbers li > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--yj-space-2);
    margin: 0;
    font-family: var(--yj-font-body);
    font-size: var(--yj-text-sm);
    font-weight: 500;
    line-height: 1;
    color: var(--yj-text);
    background: var(--yj-white);
    border: var(--yj-border);
    border-radius: var(--yj-radius);
    box-shadow: none;
}
.yj-ds .goal-pagination ul.page-numbers li > a:hover {
    color: var(--yj-primary);
    border-color: var(--yj-primary);
    background: var(--yj-white);
}
.yj-ds .goal-pagination ul.page-numbers li > span.current {
    color: var(--yj-white);
    background: var(--yj-primary-strong);
    border-color: var(--yj-primary-strong);
}
.yj-ds .goal-pagination ul.page-numbers li > span.dots {
    border-color: transparent;
    background: transparent;
}

/* ── Grilla del catálogo: 4 / 3 / 2 columnas con CSS grid ────────────────────
   Independiente de las clases col-* que el tema calcula con product_columns. */
.yj-ds .archive-shop .products.row {
    margin-left: 0;
    margin-right: 0;
}
.yj-ds .archive-shop .products-wrapper-grid .row-products-wrapper {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--yj-space-5);
}
.yj-ds .archive-shop .products-wrapper-grid .row-products-wrapper::before,
.yj-ds .archive-shop .products-wrapper-grid .row-products-wrapper::after {
    display: none;
}
.yj-ds .archive-shop .products-wrapper-grid .row-products-wrapper > .product {
    width: auto;
    float: none;
    margin: 0;
    padding: 0;
    clear: none;
}
@media (max-width: 991px) {
    .yj-ds .archive-shop .products-wrapper-grid .row-products-wrapper {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 768px) {
    .yj-ds .archive-shop .products-wrapper-grid .row-products-wrapper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--yj-space-3);
    }
}

/* ── Móvil: botón «Filtrar» y panel lateral off-canvas ───────────────────── */
@media (max-width: 991px) {
    /* El tema lo fija como pestaña roja en el borde; aquí es un botón en línea. */
    .yj-ds .mobile-sidebar-btn {
        position: static;
        display: inline-flex;
        align-items: center;
        gap: var(--yj-space-2);
        min-height: 40px;
        margin: 0 0 var(--yj-space-4);
        padding: 0 var(--yj-space-4);
        font-family: var(--yj-font-body);
        font-size: var(--yj-text-sm);
        font-weight: 500;
        text-decoration: none;
        color: var(--yj-ink);
        background: var(--yj-white);
        border: 1px solid var(--yj-line-strong);
        border-radius: var(--yj-radius);
        box-shadow: none;
    }
    .yj-ds .mobile-sidebar-btn:hover,
    .yj-ds .mobile-sidebar-btn:focus-visible {
        text-decoration: none;
        color: var(--yj-primary);
        border-color: var(--yj-primary);
    }
    .yj-ds .mobile-sidebar-btn i {
        font-size: 14px;
    }
    .yj-ds .sidebar.sidebar-left,
    .yj-ds .sidebar.sidebar-right {
        padding: var(--yj-space-5) var(--yj-space-4);
        overflow-y: auto;
    }
    .yj-ds .sidebar.active {
        box-shadow: var(--yj-shadow-float);
    }
    .yj-ds .close-sidebar-btn {
        display: inline-flex;
        align-items: center;
        gap: var(--yj-space-2);
        margin: 0 0 var(--yj-space-5);
        font-size: var(--yj-text-sm);
        color: var(--yj-ink);
    }
    .yj-ds #mobile-offcanvas-sidebar .mobile-sidebar-wrapper {
        padding: var(--yj-space-5) var(--yj-space-4);
        overflow-y: auto;
    }
    .yj-ds .mobile-sidebar-panel-overlay.active {
        background: color-mix(in srgb, var(--yj-ink) 35%, transparent);
    }
}
@media (max-width: 767px) {
    .yj-ds .goal-breadscrumb .wrapper-breads {
        padding: var(--yj-space-7) 0;
    }
    .yj-ds .goal-filter .woocommerce-result-count {
        flex-basis: 100%;
    }
    .yj-ds .goal-filter .wrapper-right {
        flex: 1 1 auto;
        justify-content: space-between;
        gap: var(--yj-space-3);
        min-width: 0;
    }
    .yj-ds .goal-filter .woocommerce-ordering {
        flex: 1 1 auto;
        min-width: 0;
    }
    /* El cambio de vista se mantiene: quien eligió «lista» puede volver a la grilla. */
    .yj-ds .goal-filter .display-mode .change-view {
        width: 36px;
        height: 36px;
    }
}
