/**
 * Zira Filtro por Rebajas — discounted products card grid.
 *
 * Brand palette:
 *   #9c8b7b  — primary (buttons, sale prices, links, accents)
 *   #9cad8f  — secondary sage (active states, highlights)
 *   #e9e8e7  — light background, borders
 *   #bfb8af  — muted text, secondary borders
 *   #bead9b  — hover states, warm accents
 *
 * External stylesheet enqueued on the shop page when the filter is active
 * (?rebajas=1 AND zira_sale_filter_enable=yes), or on any page where the
 * sidebar widget is placed.
 */

/* ── Grid container ──────────────────────────────────────────────────── */

.zira-sale-filter {
    margin: 24px 0;
    font-family: inherit;
}

.zira-sale-filter__title {
    margin: 0 0 20px;
    font-size: 1.4em;
    font-weight: 700;
    color: inherit;
}

/* ── Card grid ───────────────────────────────────────────────────────── */

.zira-sale-filter__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

/* ── Individual card ─────────────────────────────────────────────────── */

.zira-sale-filter__card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e9e8e7;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.zira-sale-filter__card:hover {
    box-shadow: 0 8px 24px rgba(156, 139, 123, 0.18);
    transform: translateY(-2px);
}

/* ── Image ───────────────────────────────────────────────────────────── */

.zira-sale-filter__image-link {
    display: block;
    text-decoration: none;
}

.zira-sale-filter__image img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.zira-sale-filter__image .woocommerce-placeholder {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9e8e7;
    color: #bfb8af;
    font-size: 0.9em;
}

/* ── Card body ───────────────────────────────────────────────────────── */

.zira-sale-filter__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px 16px 16px;
}

/* ── Product name ────────────────────────────────────────────────────── */

.zira-sale-filter__name {
    margin: 0 0 8px;
    font-size: 0.95em;
    font-weight: 600;
    line-height: 1.4;
}

.zira-sale-filter__name a {
    color: #3a3a3a;
    text-decoration: none;
}

.zira-sale-filter__name a:hover {
    color: #9c8b7b;
}

/* ── Price ───────────────────────────────────────────────────────────── */

.zira-sale-filter__price {
    margin: 0 0 10px;
    font-size: 1.05em;
    line-height: 1;
}

.zira-sale-filter__price del {
    color: #bfb8af;
    font-weight: 400;
    font-size: 0.85em;
    margin-right: 6px;
}

.zira-sale-filter__price ins {
    color: #9c8b7b;
    font-weight: 700;
    text-decoration: none;
}

/* ── Stock ───────────────────────────────────────────────────────────── */

.zira-sale-filter__stock {
    margin: 0 0 6px;
    font-size: 0.85em;
    color: #9cad8f;
    font-weight: 600;
}

/* ── Dimensions ──────────────────────────────────────────────────────── */

.zira-sale-filter__dimensions {
    margin: 0 0 10px;
    font-size: 0.8em;
    color: #bfb8af;
}

/* ── CTA button ──────────────────────────────────────────────────────── */

.zira-sale-filter__link {
    display: block;
    margin: auto 0 0;
    padding: 10px 0;
    background: #9c8b7b;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    font-size: 0.9em;
    font-weight: 600;
    transition: background 0.2s ease;
}

.zira-sale-filter__link:hover {
    background: #bead9b;
    color: #fff;
}

/* ── Sidebar widget ──────────────────────────────────────────────────── */

.zira-sale-filter-widget {
    margin: 8px 0;
}

.zira-sale-filter-widget__toggle {
    display: block;
    padding: 10px 14px;
    background: #9c8b7b;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
}

.zira-sale-filter-widget__toggle:hover {
    background: #bead9b;
    color: #fff;
    text-decoration: none;
}

.zira-sale-filter-widget.is-active .zira-sale-filter-widget__toggle {
    background: #9cad8f;
}

.zira-sale-filter-widget.is-active .zira-sale-filter-widget__toggle:hover {
    background: #9c8b7b;
}

/* ── Pagination ─────────────────────────────────────────────────────── */

.zira-sale-filter__pagination {
    margin-top: 32px;
    text-align: center;
}

.zira-sale-filter__pagination .page-numbers {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    border: 1px solid #bfb8af;
    border-radius: 4px;
    color: #3a3a3a;
    text-decoration: none;
    font-weight: 500;
}

.zira-sale-filter__pagination .page-numbers.current {
    background: #9c8b7b;
    color: #fff;
    border-color: #9c8b7b;
}

.zira-sale-filter__pagination .page-numbers:hover:not(.current) {
    background: #e9e8e7;
}

.zira-sale-filter__pagination .page-numbers.dots {
    border: none;
    padding: 6px 4px;
}

/* ── Hide native loop remnants when filter grid is active ────────────── */

.zira-sale-filter ~ ul.products,
.zira-sale-filter ~ .woocommerce-info,
.zira-sale-filter ~ .woocommerce-no-products-found {
    display: none;
}
