/* ─────────────────────────────────────────────
   Cratiko — Shop Toolbar
   Transforma la barra de filtros/orden de WooCommerce
   + Oxygen al estilo pill minimalista
   ───────────────────────────────────────────── */

/* ── 1. CONTENEDOR GENERAL DE LA BARRA ─────── */

.woocommerce-products-header,
.woocommerce .woocommerce-products-header {
    display: none; /* oculta título de categoría si existe */
}

/* Barra result-count + ordering */
.woocommerce-result-count,
.woocommerce-ordering {
    margin: 0;
    padding: 0;
}

/* Texto "Showing X–Y of Z results" — más sutil */
.woocommerce-result-count {
    font-size: 13px;
    color: #999;
    font-weight: 400;
    letter-spacing: 0;
    align-self: center;
}

/* ── 2. SORT — pill button ──────────────────── */

.woocommerce-ordering form,
form.woocommerce-ordering {
    margin: 0;
}

/* Wrapper del select de Oxygen/Breakdance */
.bde-woo-select {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Prefijo "SORT:" antes del select */
.bde-woo-select::before {
    content: "SORT:";
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #e45a9b;
    position: absolute;
    left: 14px;
    pointer-events: none;
    z-index: 1;
}

/* El select nativo */
.bde-woo-select select.orderby {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* Pill */
    border: 1.5px solid #e45a9b;
    border-radius: 100px;
    background: transparent;

    /* Espaciado: deja lugar para "SORT:" a la izquierda */
    padding: 9px 42px 9px 60px;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #e45a9b;
    cursor: pointer;
    min-width: 200px;

    transition: border-color 0.15s ease, background 0.15s ease;
}

.bde-woo-select select.orderby:hover {
    border-color: #555;
    background: #f8f8f8;
}

.bde-woo-select select.orderby:focus {
    outline: none;
    border-color: #e45a9b;
    box-shadow: 0 0 0 2px rgba(35,40,45,.1);
}

/* Flecha personalizada — reemplaza la de Oxygen */
.bde-woo-select__arrow {
    position: absolute;
    right: 15px;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e45a9b;
    font-size: 0;
}

.bde-woo-select__arrow::after {
    content: "";
    display: block;
    width: 8px;
    height: 8px;
    border-right: 1.5px solid #e45a9b;
    border-bottom: 1.5px solid #e45a9b;
    transform: rotate(45deg) translateY(-2px);
}

/* ── 3. FILTRO DE CATEGORÍAS — [cratiko_category_filter] ── */

.cratiko-category-filter {
    display: flex;
    align-items: center;
}

.cratiko-cat-filter__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.cratiko-cat-filter__item {
    margin: 0;
    padding: 0;
}

/* Pill base */
.cratiko-cat-filter__link {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border: 1.5px solid #e45a9b;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #e45a9b;
    text-decoration: none;
    background: transparent;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    line-height: 1;
}

/* Hover */
.cratiko-cat-filter__link:hover {
    background: #e45a9b;
    color: #fff;
}

nav.cratiko-category-filter {
    border-bottom: solid 1px #ffe8f4;
    border-top: solid 1px #ffe8f4;
    margin-bottom: 30px;
    padding: 20px 0px 20px 0px;
}

/* Categoría activa */
.cratiko-cat-filter__link.is-active,
.cratiko-cat-filter__item.is-active .cratiko-cat-filter__link {
    background: #e45a9b;
    color: #fff;
    pointer-events: none;
}

/* Conteo de productos (opcional) */
.cratiko-cat-filter__count {
    font-weight: 400;
    opacity: 0.65;
    font-size: 10px;
    margin-left: 4px;
}

/* ── Filtros de atributo nativos de WooCommerce/Oxygen ── */
/* (Por si usas widget_layered_nav además del shortcode)   */

.bde-woo-filter-list ul,
.widget_layered_nav ul,
.bde-woo-filter-attribute ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.bde-woo-filter-list ul li,
.widget_layered_nav ul li,
.bde-woo-filter-attribute ul li {
    margin: 0;
    padding: 0;
}

.bde-woo-filter-list ul li a,
.widget_layered_nav ul li a,
.bde-woo-filter-attribute ul li a {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border: 1.5px solid #e45a9b;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #e45a9b;
    text-decoration: none;
    background: transparent;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.bde-woo-filter-list ul li a:hover,
.widget_layered_nav ul li a:hover,
.bde-woo-filter-attribute ul li a:hover,
.bde-woo-filter-list ul li.chosen a,
.widget_layered_nav ul li.chosen a,
.bde-woo-filter-attribute ul li.chosen a {
    background: #e45a9b;
    color: #fff;
}

.bde-woo-filter-list .count,
.widget_layered_nav .count,
.bde-woo-filter-attribute .count {
    display: none;
}

/* ── 4. TOGGLE GRID / LIST (si está en el template) ── */
/* Aplica si usas un elemento custom o el de Oxygen      */

.cratiko-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cratiko-view-toggle button,
.cratiko-view-toggle a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    color: #888;
    transition: border-color 0.15s ease, color 0.15s ease;
    text-decoration: none;
}

.cratiko-view-toggle button:hover,
.cratiko-view-toggle a:hover,
.cratiko-view-toggle button.active,
.cratiko-view-toggle a.active {
    border-color: #e45a9b;
    color: #e45a9b;
}

.cratiko-view-toggle svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ── 5. RESPONSIVE ──────────────────────────── */

@media (max-width: 768px) {
    .bde-woo-select select.orderby {
        min-width: 160px;
        padding: 8px 36px 8px 54px;
        font-size: 10px;
    }

    .bde-woo-filter-list ul li a,
    .widget_layered_nav ul li a,
    .bde-woo-filter-attribute ul li a {
        padding: 7px 14px;
        font-size: 10px;
    }

    .woocommerce-result-count {
        display: none; /* En móvil se puede ocultar para ahorrar espacio */
    }
}
