/* Filters + "Sırala" above recipe cards (Customizations\RecipeListingToolbar). */
.yt-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    margin: 0 0 1.25rem;
}

.yt-tools-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.yt-tools-menu {
    position: relative;
}

.yt-tools-menu summary,
.yt-tools-chip,
.yt-tools-chip:visited {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem .9rem;
    border: 1px solid var(--gt-theme-tertiary, #dedcd4);
    border-radius: 999px;
    background: #fff;
    color: var(--gt-theme-secondary, #162a28);
    font-size: .9375rem;
    line-height: 1.4;
    text-decoration: none;
    list-style: none;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

.yt-tools-menu summary::-webkit-details-marker {
    display: none;
}

.yt-tools-menu summary:hover,
.yt-tools-menu summary:focus-visible,
.yt-tools-menu[open] summary,
.yt-tools-chip:hover,
.yt-tools-chip:focus-visible {
    border-color: var(--gt-theme-primary, #ff4400);
}

/* A filter that is on. */
.yt-tools-menu.is-active summary,
.yt-tools-chip.is-active,
.yt-tools-chip.is-active:visited {
    border-color: var(--gt-theme-primary, #ff4400);
    background: var(--gt-theme-primary, #ff4400);
    color: #fff;
    font-weight: 600;
}

/* Tick in a chip that is on. */
.yt-tools-check {
    flex: none;
    margin-left: -.15rem;
}

.yt-tools-label {
    opacity: .7;
}

.yt-tools-value {
    font-weight: 600;
}

.yt-tools-chevron {
    flex: none;
    transition: transform .15s ease;
}

.yt-tools-menu[open] .yt-tools-chevron {
    transform: rotate(180deg);
}

.yt-tools-menu ul {
    position: absolute;
    left: 0;
    top: calc(100% + .4rem);
    z-index: 20;
    min-width: 100%;
    margin: 0;
    padding: .4rem;
    border: 1px solid var(--gt-theme-tertiary, #dedcd4);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .12);
    list-style: none;
    white-space: nowrap;
}

/* "Filtrele" + "Sırala" on the right. */
.yt-tools-end {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
}

.yt-tools-sort ul {
    left: auto;
    right: 0;
}

.yt-tools-icon {
    flex: none;
}

/* Number of filters on, in the orange "Filtrele" button. */
.yt-tools-badge {
    display: inline-grid;
    place-items: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 .3rem;
    border-radius: 999px;
    background: #fff;
    color: var(--gt-theme-primary, #ff4400);
    font-size: .75rem;
    font-weight: 700;
    line-height: 1;
}

/* The "Filtrele" panel. */
.yt-tools-panel {
    position: absolute;
    right: 0;
    top: calc(100% + .4rem);
    z-index: 20;
    width: min(340px, calc(100vw - 32px));
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--gt-theme-tertiary, #dedcd4);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .12);
}

.yt-tools-panel fieldset {
    margin: 0 0 .9rem;
    padding: 0;
    border: 0;
    min-width: 0;
}

.yt-tools-panel legend {
    margin: 0 0 .45rem;
    padding: 0;
    color: var(--gt-theme-secondary, #162a28);
    font-size: .875rem;
    font-weight: 600;
}

.yt-tools-options {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

/* The theme sets labels in capitals. */
.yt-tools-option {
    position: relative;
    margin: 0;
    font: inherit;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
}

.yt-tools-option input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.yt-tools-option span {
    display: inline-block;
    padding: .35rem .75rem;
    border: 1px solid var(--gt-theme-tertiary, #dedcd4);
    border-radius: 999px;
    color: var(--gt-theme-secondary, #162a28);
    font-size: .875rem;
    line-height: 1.4;
    white-space: nowrap;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

.yt-tools-option:hover span {
    border-color: var(--gt-theme-primary, #ff4400);
}

.yt-tools-option input:focus-visible + span {
    outline: 2px solid var(--gt-theme-primary, #ff4400);
    outline-offset: 2px;
}

.yt-tools-option input:checked + span {
    border-color: var(--gt-theme-primary, #ff4400);
    background: var(--gt-theme-primary, #ff4400);
    color: #fff;
    font-weight: 600;
}

.yt-tools-panel-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding-top: .75rem;
    border-top: 1px solid var(--gt-theme-tertiary, #dedcd4);
}

.yt-tools-panel .yt-tools-clear,
.yt-tools-panel .yt-tools-clear:visited {
    display: inline;
    padding: 0;
    color: var(--gt-theme-primary, #ff4400);
    font-size: .875rem;
    font-weight: 600;
    text-decoration: underline;
}

.yt-tools-panel .yt-tools-clear:hover {
    background: none;
}

.yt-tools-apply {
    margin-left: auto;
    padding: .45rem 1.1rem;
    border: 0;
    border-radius: 999px;
    background: var(--gt-theme-primary, #ff4400);
    color: #fff;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
}

/* With the script every change applies at once. */
.yt-tools-js .yt-tools-apply {
    display: none;
}

/* While the next page of results loads in the background. */
.yt-tools-loading > :not(.yt-tools) {
    opacity: .45;
    pointer-events: none;
    transition: opacity .15s ease .1s;
}

.yt-tools .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.yt-tools-menu li {
    margin: 0;
}

.yt-tools-menu a,
.yt-tools-menu a:visited {
    display: block;
    padding: .5rem .8rem;
    border-radius: 10px;
    color: var(--gt-theme-secondary, #162a28);
    font-size: .9375rem;
    text-decoration: none;
}

.yt-tools-menu a:hover,
.yt-tools-menu a:focus-visible {
    background: var(--yt-surface, #fff2ea);
    color: var(--gt-theme-primary, #ff4400);
}

.yt-tools-menu a[aria-current] {
    color: var(--gt-theme-primary, #ff4400);
    font-weight: 600;
}

@media (max-width: 575.98px) {
    /* Tight enough that three chips (two of them on) and "Sırala" share a 390px row. */
    .yt-tools {
        gap: .4rem;
        margin-bottom: 1rem;
    }

    .yt-tools-filters {
        gap: .35rem;
    }

    .yt-tools-end {
        gap: .35rem;
    }

    .yt-tools-menu summary,
    .yt-tools-chip,
    .yt-tools-chip:visited {
        gap: .25rem;
        padding: .4rem .6rem;
        font-size: .875rem;
    }

    /* "Sırala:" goes, the chosen order stays. The panel opens under the whole row. */
    .yt-tools-filter {
        position: static;
    }

    .yt-tools {
        position: relative;
    }

    .yt-tools-panel {
        left: 0;
        right: 0;
        width: auto;
    }

    .yt-tools-label {
        display: none;
    }
}
