/* ==========================================================================
   Shared listing controls — Filter / Offer toggle / Sort by
   Loaded globally so every listing toolbar looks the same.
   ========================================================================== */

:root {
    --ctrl-ink: #1C1C2E;
    --ctrl-gold: #C89B65;
    --ctrl-text: #4a4a55;
    --ctrl-muted: #8a8a96;
    --ctrl-line: #e8e1d6;
    --ctrl-soft: #faf6f0;
    --ctrl-h: 40px;
}

.tf-shop-control {
    gap: 10px;
    margin-bottom: 28px;
}

.tf-shop-control .tf-control-filter {
    flex-wrap: wrap;
    gap: 10px;
}

/* ---------- Base control: Filter button, Offer toggle, Sort trigger ---------- */

.tf-btn-filter,
.nk-ctrl,
.tf-dropdown-sort {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: var(--ctrl-h);
    padding: 0 14px;
    border: 1px solid var(--ctrl-line);
    border-radius: 3px;
    background: #fff;
    color: var(--ctrl-ink);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    line-height: 1;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.tf-btn-filter:hover,
.nk-ctrl:hover,
.tf-dropdown-sort:hover,
.tf-dropdown-sort.show {
    border-color: var(--ctrl-ink);
    color: var(--ctrl-ink);
}

.tf-btn-filter .icon {
    margin: 0 !important;
    color: var(--ctrl-gold);
    font-size: 14px;
}

.tf-btn-filter .text {
    font-weight: 600;
}

/* ---------- Offer toggle (checkbox styled as a small switch) ---------- */

.nk-ctrl--toggle {
    margin: 0;
    user-select: none;
}

.nk-ctrl-switch {
    position: relative;
    flex: 0 0 auto;
    width: 30px;
    height: 16px;
    margin: 0;
    border: 0;
    border-radius: 999px;
    background: #ddd6cb;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: background 0.25s ease;
}

.nk-ctrl-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    transition: transform 0.25s ease;
}

.nk-ctrl-switch:checked {
    background: var(--ctrl-gold);
}

.nk-ctrl-switch:checked::after {
    transform: translateX(14px);
}

.nk-ctrl-switch:focus-visible {
    outline: 2px solid var(--ctrl-gold);
    outline-offset: 2px;
}

.nk-ctrl--toggle:has(.nk-ctrl-switch:checked) {
    border-color: var(--ctrl-gold);
    background: var(--ctrl-soft);
}

/* ---------- Sort by dropdown ---------- */

.tf-dropdown-sort {
    position: relative;
    min-width: 200px;
}

.tf-dropdown-sort .btn-select {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.tf-dropdown-sort .btn-select::before {
    content: "Sort by:";
    color: var(--ctrl-muted);
    font-weight: 400;
}

.tf-dropdown-sort .text-sort-value {
    flex: 1 1 auto;
    color: var(--ctrl-ink);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
}

.tf-dropdown-sort .btn-select .icon {
    color: var(--ctrl-muted);
    font-size: 8px;
    transition: transform 0.25s ease;
}

.tf-dropdown-sort.show .btn-select .icon {
    transform: rotate(180deg);
}

.tf-dropdown-sort .dropdown-menu {
    min-width: 100%;
    margin: 6px 0 0 !important;
    padding: 6px;
    border: 1px solid var(--ctrl-line);
    border-radius: 3px;
    box-shadow: 0 8px 24px rgba(28, 28, 46, 0.06);
}

.tf-dropdown-sort .select-item {
    padding: 0 12px;
    border-radius: 3px;
    color: var(--ctrl-text);
    font-size: 13px;
    line-height: 36px;
}

.tf-dropdown-sort .select-item::before,
.tf-dropdown-sort .select-item::after {
    display: none;
}

.tf-dropdown-sort .select-item:hover {
    background: var(--ctrl-soft);
    color: var(--ctrl-ink);
}

.tf-dropdown-sort .select-item.active {
    background: var(--ctrl-soft);
    color: var(--ctrl-ink);
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--ctrl-gold);
}

@media (max-width: 575.98px) {
    .tf-dropdown-sort {
        min-width: 0;
    }

    .tf-dropdown-sort .btn-select::before {
        display: none;
    }
}
