/* Rehviotsija — avaleht (headrehvid/size-finder) ja kataloog v2 (headrehvid/catalog-finder). finder.php */

.hr-sf,
.hr-finder {
    --hr-red: #C8102E;
    --hr-red-dark: #a50d26;
    --hr-ink: #1a1a1a;
    --hr-muted: #5f6368;
    --hr-line: #dcd9d3;
    --hr-field: #f4f3f0;
    --hr-navy: #1f3a68;
    --hr-radius: 12px;
}

/* ─── Mõõdu otsija (ühine) ─── */
.hr-sf {
    max-width: 760px;
    padding: 16px 20px 18px;
    border-radius: var(--hr-radius);
    background: var(--hr-field);
}
.hr-sf__form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: 12px;
    align-items: end;
    margin: 0;
}
.hr-sf__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.hr-sf label {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--hr-ink);
}
.hr-sf select {
    width: 100%;
    height: 48px;
    padding: 0 36px 0 12px;
    border: 1px solid var(--hr-line);
    border-radius: 8px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231a1a1a' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center;
    color: var(--hr-ink);
    font: inherit;
    font-size: 15px;
    appearance: none;
    cursor: pointer;
}
.hr-sf select:focus-visible,
.hr-sf__submit:focus-visible {
    outline: 2px solid var(--hr-ink);
    outline-offset: 2px;
}
.hr-sf option:disabled {
    color: #9a9a9a;
}
.hr-sf__submit {
    height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: 8px;
    background: var(--hr-red);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}
.hr-sf__submit:hover {
    background: var(--hr-red-dark);
}

.hr-sf__more {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    font-size: 13px;
}
.hr-sf__help {
    color: var(--hr-red);
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline !important; /* teema style.css: a { text-decoration: none !important } */
    text-underline-offset: 2px;
    white-space: nowrap;
}
.hr-sf__sep {
    color: var(--hr-muted);
}
.hr-sf .hr-sf__or {
    font-weight: 400;
    font-size: 13px;
    color: var(--hr-muted);
    white-space: nowrap;
}
.hr-sf__search {
    flex: 1;
    min-width: 0;
}

/* FiboSearchi vorm (tema CSS laetakse alles fookusel — need reeglid kehtivad enne ja pärast) */
.hr-sf__search .dgwt-wcas-search-wrapp {
    max-width: none;
    min-width: 0;
    margin: 0;
}
.hr-sf__search .dgwt-wcas-search-form,
.hr-sf__search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp {
    position: relative;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
}
/* !important: teema style.css (.dgwt-wcas-style-pirx … input) kasutab !important'it */
.hr-sf__search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input {
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0 44px 0 12px;
    border: 1px solid var(--hr-line) !important;
    border-radius: 8px !important;
    background: #fff !important;
    box-shadow: none;
    color: var(--hr-ink);
    font: inherit;
    font-family: inherit !important;
    font-size: 15px;
    line-height: normal;
    -webkit-appearance: none;
    appearance: none;
}
.hr-sf__search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input:focus {
    outline: 2px solid var(--hr-ink);
    outline-offset: 1px;
    box-shadow: none;
}
.hr-sf__search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input::placeholder {
    color: #8a8a8a;
    opacity: 1;
}
.hr-sf__search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit {
    position: absolute;
    top: 0;
    right: 0;
    left: auto;
    width: 44px;
    height: 44px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0 8px 8px 0;
    background: none;
    color: var(--hr-muted);
    opacity: 1;
}
.hr-sf__search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit::before {
    display: none;
}
.hr-sf__search .dgwt-wcas-ico-magnifier {
    width: 18px;
    height: 18px;
    fill: currentColor;
}
.hr-sf__search .dgwt-wcas-search-submit path {
    fill: currentColor;
}
.hr-sf__search .dgwt-wcas-preloader {
    right: 44px;
}
.hr-sf__search .dgwt-wcas-voice-search,
.hr-sf__search .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

/* ─── Kataloog ─── */
.hr-finder {
    margin-top: 8px;
    margin-bottom: 4px;
    color: var(--hr-ink);
}
.hr-sf--catalog {
    max-width: none;
    padding: 18px 20px 16px;
    border: 1px solid #e9e7e2;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.hr-sf--catalog .hr-sf__form {
    display: flex;
    align-items: flex-end;
}
.hr-sf--catalog .hr-sf__field {
    flex: 1 1 0;
}
.hr-sf--catalog .hr-sf__field--laius,
.hr-sf--catalog .hr-sf__field--korgus,
.hr-sf--catalog .hr-sf__field--diam {
    flex-grow: .75;
}
.hr-sf--catalog .hr-sf__field--tyyp {
    flex-grow: 1.3;
}
.hr-sf--catalog .hr-sf__field--tootja {
    flex-grow: 1.15;
}
.hr-sf--catalog select {
    height: 46px;
}
.hr-sf--catalog .hr-sf__submit {
    height: 46px;
}
.hr-sf--catalog .hr-sf__more {
    margin-top: 12px;
}

/* Laoseisu rida (teema [filter_usps] asemel) */
.hr-finder-usps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    margin-block: 4px 18px !important; /* külgvaru: alignwide joondus */
    padding: 0;
    list-style: none;
    color: #3c4043;
    font-size: 15px;
}
.hr-finder-usps li {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
}
.hr-finder-usps svg {
    flex: none;
}
.hr-finder-usps strong {
    color: #1a1a1a;
}
.hr-finder-usps__info a {
    color: #1f3a68 !important;
    font-size: inherit;
    font-weight: 600;
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

/* Mobiili kokkuvõte (nupp peidus suuremal ekraanil) */
.hr-finder__toggle {
    display: none;
}

/* Aktiivsed filtrid */
.hr-finder__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}
.hr-finder__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 10px 0 14px;
    border-radius: 999px;
    background: var(--hr-navy);
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none !important;
}
.hr-finder__chip:hover {
    background: #16304f;
}
.hr-finder__x {
    font-size: 17px;
    font-weight: 400;
    opacity: .85;
}
.hr-finder__clear {
    margin-left: 4px;
    color: var(--hr-red) !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline !important;
    text-underline-offset: 3px;
}
.hr-finder__chip:focus-visible,
.hr-finder__clear:focus-visible,
.hr-finder__toggle:focus-visible {
    outline: 2px solid var(--hr-ink);
    outline-offset: 2px;
}

/* Tahvel */
@media (max-width: 1100px) {
    .hr-sf--catalog .hr-sf__form {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ─── Mobiil ─── */
@media (max-width: 781px) {
    .hr-sf {
        padding: 14px;
    }
    .hr-sf__form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .hr-sf__submit {
        grid-column: 1 / -1;
    }
    .hr-sf select,
    .hr-sf__submit,
    .hr-sf__search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input {
        font-size: 16px; /* iOS ei zoomi */
    }
    .hr-sf__search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input,
    .hr-sf__search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit {
        height: 48px;
    }
    .hr-sf__more {
        flex-wrap: wrap;
        row-gap: 8px;
    }
    .hr-sf__sep {
        display: none;
    }
    .hr-sf .hr-sf__or {
        flex-basis: 100%;
    }
    .hr-sf__search {
        flex-basis: 100%;
    }

    .hr-sf--catalog {
        padding: 14px;
    }
    .hr-sf--catalog .hr-sf__form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .hr-finder-usps {
        flex-direction: column;
        font-size: 14px;
    }
    .hr-finder__toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        min-height: 48px;
        margin: 0 0 8px;
        padding: 10px 14px;
        border: 1px solid #e9e7e2;
        border-radius: var(--hr-radius);
        background: #fff;
        color: var(--hr-ink);
        font: inherit;
        font-size: 15px;
        font-weight: 600;
        text-align: left;
        cursor: pointer;
    }
    .hr-finder__sum {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .hr-finder__edit {
        flex: none;
        color: var(--hr-red);
        font-size: 14px;
        text-decoration: underline;
        text-underline-offset: 3px;
    }
    .hr-finder:not([data-collapsed]) .hr-finder__toggle {
        display: none;
    }
    .hr-finder[data-collapsed]:not(.is-open) .hr-finder__panel {
        display: none;
    }
    .hr-finder.is-open .hr-finder__edit {
        visibility: hidden;
    }
}
