/**
 * Ced_AdvanceSearch
 */
.advance-search-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Toggle inside the header search bar, left of the Search button */
.block-search:has(.advance-search-toggle) #search {
    padding-right: 54px;
}

.block-search button.advance-search-toggle {
    position: absolute;
    top: 0;
    right: 100px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 42px;
    padding: 0;
    margin: 0;
    color: #000;
    background: transparent;
    border: 0;
    border-left: 1px solid #e1e1e1;
    border-radius: 0;
    box-shadow: none;
    cursor: pointer;
}

.block-search button.advance-search-toggle:hover,
.block-search button.advance-search-toggle:focus,
.block-search button.advance-search-toggle.active {
    background: #fff8e1;
}

.block-search button.advance-search-toggle:focus-visible {
    outline: 2px solid #fcb800;
    outline-offset: -2px;
}

.advance-search-toggle-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.advance-search-toggle-icon > span {
    display: block;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
}

.advance-search-toggle-icon > span:nth-child(1) {
    width: 18px;
}

.advance-search-toggle-icon > span:nth-child(2) {
    width: 12px;
}

.advance-search-toggle-icon > span:nth-child(3) {
    width: 6px;
}

.advance-search-toggle.has-filters::after {
    content: '';
    position: absolute;
    top: 9px;
    right: 10px;
    width: 7px;
    height: 7px;
    background: #fcb800;
    border-radius: 50%;
}

.has-advance-search .minisearch .loading-mask {
    right: 146px;
}

/* Panel */
.top-search-wrap.has-advance-search {
    position: relative;
}

.advance-search-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1000;
    width: 100%;
    min-width: min(600px, calc(100vw - 30px));
    font-size: 1.4rem;
    color: #000;
    text-align: left;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 3px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.advance-search-panel[hidden] {
    display: none;
}

.advance-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid #e1e1e1;
}

.advance-search-title {
    font-size: 1.6rem;
    font-weight: 600;
}

.advance-search-panel button.advance-search-close {
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 2.4rem;
    line-height: 1;
    color: #666;
    background: transparent;
    border: 0;
    box-shadow: none;
    cursor: pointer;
}

.advance-search-panel button.advance-search-close:hover,
.advance-search-panel button.advance-search-close:focus {
    color: #000;
}

.advance-search-fields {
    padding: 8px 20px 4px;
}

.advance-search-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    align-items: center;
    gap: 6px 16px;
    padding: 6px 0;
}

.advance-search-label {
    margin: 0;
    font-weight: 500;
    color: #333;
}

.advance-search-control {
    position: relative;
    min-width: 0;
}

.advance-search-control-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.advance-search-price {
    display: flex;
    align-items: center;
    gap: 10px;
}

.advance-search-price-separator {
    color: #666;
}

.advance-search-panel input.input-text,
.advance-search-panel select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    margin: 0;
    font-size: 1.4rem;
    color: #000;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-shadow: none;
}

.advance-search-panel input.input-text:focus,
.advance-search-panel select:focus {
    border-color: #fcb800;
    outline: none;
    box-shadow: 0 0 0 1px #fcb800;
}

.advance-search-panel input[type="number"] {
    -moz-appearance: textfield;
}

/* Searchable dropdown */
.advance-search-panel select.advance-search-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.advance-search-select {
    position: relative;
}

.advance-search-panel input.advance-search-select-input {
    padding-right: 34px;
    background-image: linear-gradient(45deg, transparent 50%, #666 50%), linear-gradient(135deg, #666 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
}

.advance-search-select-list {
    position: absolute;
    top: calc(100% + 2px);
    right: 0;
    left: 0;
    z-index: 5;
    max-height: 240px;
    padding: 4px 0;
    margin: 0;
    overflow-y: auto;
    list-style: none;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.advance-search-select-list[hidden] {
    display: none;
}

.advance-search-select-option,
.advance-search-select-empty {
    padding: 8px 12px;
    margin: 0;
    line-height: 1.4;
}

.advance-search-select-option {
    cursor: pointer;
}

.advance-search-select-option:hover,
.advance-search-select-option.active {
    background: #fff8e1;
}

.advance-search-select-option[aria-selected="true"] {
    font-weight: 600;
}

.advance-search-select-empty {
    color: #666;
}

/* Messages and actions */
.advance-search-message {
    padding: 8px 12px;
    margin: 4px 20px 0;
    color: #8a1f11;
    background: #fdf0ef;
    border-radius: 3px;
}

.advance-search-message[hidden] {
    display: none;
}

.advance-search-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px 18px;
}

.advance-search-panel .advance-search-actions button.action,
.advance-search-applied button.advance-search-modify {
    height: 42px;
    padding: 0 24px;
    margin: 0;
    font-size: 1.4rem;
    font-weight: 500;
    line-height: 42px;
    color: #000;
    text-transform: none;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-shadow: none;
    cursor: pointer;
}

.advance-search-panel .advance-search-actions button.action:hover,
.advance-search-applied button.advance-search-modify:hover {
    border-color: #000;
}

.advance-search-panel .advance-search-actions button.advance-search-submit {
    min-width: 120px;
    background: #fcb800;
    border-color: #fcb800;
}

.advance-search-panel .advance-search-actions button.advance-search-submit:hover {
    background: #e5a700;
    border-color: #e5a700;
}

/* Applied filters on the results page */
.advance-search-applied {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 3px;
}

.advance-search-applied-title {
    font-weight: 600;
}

.advance-search-applied-list {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.advance-search-applied-item {
    padding: 4px 10px;
    margin: 0;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 3px;
}

.advance-search-applied-label {
    color: #666;
}

.advance-search-applied button.advance-search-modify {
    height: 36px;
    padding: 0 16px;
    line-height: 36px;
}

/* Tablet and mobile */
@media (max-width: 767px) {
    .advance-search-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }

    .advance-search-header,
    .advance-search-fields,
    .advance-search-actions {
        padding-right: 14px;
        padding-left: 14px;
    }

    .advance-search-message {
        margin-right: 14px;
        margin-left: 14px;
    }

    .advance-search-actions button.action {
        flex: 1 1 0;
        padding: 0 12px;
    }
}

.mfp-content .advance-search-panel {
    position: static;
    min-width: 0;
    max-height: calc(100vh - 140px);
    margin-top: 12px;
    overflow-y: auto;
    box-shadow: none;
}
