/* ==========================================================================
   BREADCRUMBS
   ========================================================================== */
.hybinet-toolbar__breadcrumbs-row {
    margin-bottom: 8px;
}

.hybinet-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--hybinet-color-text-primary);
    font-weight: 600;
}

.hybinet-breadcrumbs a {
    color: var(--hybinet-color-text-secondary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

.hybinet-breadcrumbs a:hover {
    color: var(--hybinet-color-brand-primary);
}

.hybinet-breadcrumb-separator {
    color: var(--hybinet-color-text-meta);
    opacity: 0.5;
    display: block;
}

/* ==========================================================================
   CATALOG TOOLBAR COMPONENT
   ========================================================================== */
.hybinet-catalog__toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 2rem;
    flex-wrap: nowrap;
}

.hybinet-toolbar__title-row {
    flex-shrink: 1;
    min-width: 0;
}

.hybinet-toolbar__title {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: 800;
    margin: 0;
    line-height: 1.1;
    color: var(--hybinet-color-title);
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hybinet-toolbar__controls-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.hybinet-toolbar__controls-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.hybinet-btn-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none !important;
    border-radius: 50px;
    background: transparent !important;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--hybinet-color-title) !important;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.hybinet-btn-filters:hover,
.hybinet-btn-filters:focus,
.hybinet-btn-filters:active {
    background-color: var(--hybinet-color-bg-tertiary) !important;
    color: var(--hybinet-palette-black) !important;
    outline: none !important;
    box-shadow: none !important;
}

.hybinet-toolbar__separator {
    display: inline-block;
    width: 1px;
    height: 24px;
    background-color: rgba(0, 0, 0, 0.15);
    align-self: center;
    flex-shrink: 0;
}

/* ==========================================================================
   CUSTOM ORDERING DROPDOWN
   ========================================================================== */
.hybinet-toolbar__sort {
    display: none;
}

.hybinet-toolbar__sort:has(> *) {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hybinet-toolbar__controls-left:has(> *) ~ .hybinet-toolbar__sort::before {
    content: '';
    display: block;
    width: 1px;
    height: 24px;
    background-color: rgba(0, 0, 0, 0.15);
}

.hybinet-toolbar__sort .woocommerce-ordering {
    margin: 0;
}

.hybinet-custom-ordering {
    position: relative;
}

.hybinet-custom-ordering__trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--hybinet-color-title);
    cursor: pointer;
    white-space: nowrap;
    border-radius: 50px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.hybinet-custom-ordering__trigger:hover,
.hybinet-custom-ordering__trigger:focus,
.hybinet-custom-ordering__trigger:active,
.hybinet-custom-ordering__trigger[aria-expanded="true"] {
    color: var(--hybinet-palette-black);
    background-color: var(--hybinet-color-bg-tertiary) !important;
    outline: none;
    box-shadow: none;
}

.hybinet-custom-ordering__trigger svg {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.hybinet-custom-ordering__trigger[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.hybinet-custom-ordering__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: max-content;
    min-width: 200px;
    max-width: calc(100vw - 32px);
    background: var(--hybinet-palette-white);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    list-style: none;
    margin: 0;
    padding: 6px;
    z-index: 200;
    animation: hybinet-ordering-in 0.15s ease;
}

.hybinet-custom-ordering__menu[hidden] {
    display: none;
}

@keyframes hybinet-ordering-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hybinet-custom-ordering__menu li {
    margin: 0;
    padding: 0;
}

.hybinet-custom-ordering__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 0.9rem;
    color: var(--hybinet-color-text-primary);
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s ease;
}

.hybinet-custom-ordering__option:hover {
    background-color: var(--hybinet-color-bg-secondary);
    color: var(--hybinet-color-text-primary);
}

.hybinet-custom-ordering__option.is-active {
    font-weight: 600;
}

.hybinet-custom-ordering__label {
    flex: 1;
    white-space: normal;
    word-break: break-word;
    padding-right: 12px;
}

.hybinet-custom-ordering__radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.15s ease;
}

.hybinet-custom-ordering__option.is-active .hybinet-custom-ordering__radio {
    border-color: var(--hybinet-color-title);
}

.hybinet-custom-ordering__radio-inner {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--hybinet-color-title);
}

/* ==========================================================================
   FILTER BADGE
   ========================================================================== */
.hybinet-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 50px;
    background-color: var(--hybinet-color-brand-accent);
    color: var(--hybinet-palette-black);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

/* ==========================================================================
   CLEAR ALL BUTTON
   ========================================================================== */
.hybinet-active-filters__clear {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--hybinet-color-text-meta);
    text-decoration: none;
    transition: color 0.15s ease;
    margin-left: 2px;
}

.hybinet-active-filters__clear:hover {
    color: var(--hybinet-color-status-danger);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 767px) {
    .hybinet-catalog__toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .hybinet-toolbar__controls-row {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas: "left sort";
        align-items: center;
        gap: 8px 12px;
    }

    .hybinet-toolbar__controls-left {
        grid-area: left;
        flex: unset;
    }

    .hybinet-toolbar__sort {
        grid-area: sort;
        align-self: center;
    }

    .hybinet-toolbar__controls-left:has(> *) ~ .hybinet-toolbar__sort::before {
        display: none;
    }
}
