/* ==========================================================
   Representative Finder
   ========================================================== */

.representative-finder,
.representative-finder *,
.representative-finder *::before,
.representative-finder *::after {
    box-sizing: border-box;
}

.representative-finder {
    width: 100%;
    color: #1c2e3d;
}


/* Header
   ========================================================== */

.representative-finder__header {
    position: relative;
    z-index: auto;
    width: 100%;
    max-width: 82rem;
    height: auto;
    min-height: 0;
    margin: 0 0 3.5rem;
    padding: 2.5rem 0 0;
    background: transparent;
    border: 0;
    border-top: 0.6rem solid #ffed00;
}

.representative-finder__title {
    margin: 0 0 1.5rem;
    color: #1c2e3d;
}

.representative-finder__intro {
    max-width: 68rem;
    margin: 0;
    line-height: 1.5;
}


/* Search
   ========================================================== */

.representative-finder__search {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto
        minmax(0, 1fr)
        auto;
    gap: 2.5rem;
    align-items: end;
    margin: 0 0 2.5rem;
    padding: 2.8rem 3rem;
    color: #fff;
    background: #1c2e3d;
}

.representative-finder__search--state-only {
    grid-template-columns: minmax(0, 1fr) auto;
}

.representative-finder__search-field {
    min-width: 0;
}

.representative-finder__label {
    display: block;
    margin: 0 0 0.8rem;
    font-weight: 700;
    color: #fff;
}

.representative-finder__zip-group {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

.representative-finder__input,
.representative-finder__select {
    width: 100%;
    min-width: 0;
    height: 4.8rem;
    padding: 0 1.5rem;
    font: inherit;
    color: #1c2e3d;
    background: #fff;
    border: 0.2rem solid transparent;
    border-radius: 0;
}

.representative-finder__input::placeholder {
    color: #707674;
    opacity: 1;
}

.representative-finder__input:focus,
.representative-finder__select:focus {
    outline: 0.3rem solid #ffed00;
    outline-offset: 0.2rem;
}

.representative-finder__input[aria-invalid="true"] {
    border-color: #a70115;
}

.representative-finder__separator {
    align-self: end;
    padding-bottom: 1.4rem;
    color: #fff;
    text-align: center;
}

.representative-finder__submit,
.representative-finder__reset {
    min-height: 4.8rem;
    padding: 0 2rem;
    font: inherit;
    font-weight: 700;
    color: #1c2e3d;
    white-space: nowrap;
    cursor: pointer;
    background: #ffed00;
    border: 0;
    border-radius: 0;
    transition:
        background-color 160ms ease,
        color 160ms ease;
}

.representative-finder__submit:hover,
.representative-finder__reset:hover {
    color: #fff;
    background: #1c2e3d;
    box-shadow: inset 0 0 0 0.2rem #ffed00;
}

.representative-finder__submit:focus-visible,
.representative-finder__reset:focus-visible {
    outline: 0.3rem solid #fff;
    outline-offset: 0.3rem;
}

.representative-finder__error {
    margin: 0.8rem 0 0;
    color: #fff;
    font-weight: 700;
}

.representative-finder__status {
    min-height: 1.5em;
    margin: 0 0 2rem;
    font-weight: 700;
}

.representative-finder__status:empty {
    display: none;
}


/* Results
   ========================================================== */

.representative-finder__results {
    display: grid;
    gap: 2.5rem;
}

.representative-card {
    position: relative;
    overflow: hidden;
    background: #fff;
    border-top: 0.6rem solid #ffed00;
    box-shadow: 0 0.4rem 1.8rem rgba(28, 46, 61, 0.12);
}

.representative-card__content {
    padding: 2.8rem 3rem 3rem;
}


/* Company headline and logo
   ========================================================== */

.representative-card__heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2rem;
    align-items: center;
    margin: 0 0 2.4rem;
}

.representative-card__company {
    min-width: 0;
    margin: 0;
    color: #1c2e3d;
    overflow-wrap: anywhere;
}

.representative-card__logo {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 12rem;
    height: 5rem;
}

.representative-card__logo-image {
    display: block;
    width: 100% !important;
    max-width: 12rem !important;
    height: 100% !important;
    max-height: 5rem !important;
    object-fit: contain;
    object-position: right center;
}


/* Address and contact
   ========================================================== */

.representative-card__columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem 4rem;
}

.representative-card__address,
.representative-card__contact {
    min-width: 0;
}

.representative-card__address p,
.representative-card__contact p {
    margin: 0 0 1rem;
    line-height: 1.55;
}

.representative-card__address p:last-child,
.representative-card__contact p:last-child {
    margin-bottom: 0;
}

.representative-card__contact-person {
    margin-bottom: 1.5rem !important;
}

.representative-card__contact a {
    color: #1c2e3d;
    text-decoration: underline;
    text-decoration-thickness: 0.1rem;
    text-underline-offset: 0.2rem;
    overflow-wrap: anywhere;
}

.representative-card__contact a:hover {
    text-decoration-thickness: 0.2rem;
}


/* Details
   ========================================================== */

.representative-card__details {
    margin: 2.5rem -3rem -3rem;
    border-top: 0.1rem solid #d5dbd5;
}

.representative-card__details-toggle {
    position: relative;
    padding: 1.8rem 5.5rem 1.8rem 3rem;
    font-weight: 700;
    color: #1c2e3d;
    cursor: pointer;
    list-style: none;
    background: #f6f7f7;
}

.representative-card__details-toggle::-webkit-details-marker {
    display: none;
}

.representative-card__details-toggle::after {
    position: absolute;
    top: 50%;
    right: 3rem;
    width: 1rem;
    height: 1rem;
    content: "";
    border-right: 0.2rem solid currentColor;
    border-bottom: 0.2rem solid currentColor;
    transform: translateY(-70%) rotate(45deg);
    transition: transform 160ms ease;
}

.representative-card__details[open]
    .representative-card__details-toggle::after {
    transform: translateY(-30%) rotate(225deg);
}

.representative-card__details-toggle:hover {
    background: #ffed00;
}

.representative-card__details-toggle:focus-visible {
    outline: 0.3rem solid #ffed00;
    outline-offset: -0.3rem;
}

.representative-card__details-content {
    padding: 2.5rem 3rem 3rem;
    line-height: 1.55;
}

.representative-card__details-content > :first-child {
    margin-top: 0;
}

.representative-card__details-content > :last-child {
    margin-bottom: 0;
}


/* Empty result
   ========================================================== */

.representative-finder__no-results {
    margin: 2.5rem 0 0;
    padding: 2rem;
    font-weight: 700;
    color: #1c2e3d;
    background: #f6f7f7;
    border-left: 0.6rem solid #ffed00;
}

.representative-finder [hidden] {
    display: none !important;
}


/* Responsive
   ========================================================== */

@media (max-width: 64rem) {
    .representative-finder__search {
        /* grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); */
        gap: 2rem;
    }

    .representative-finder__separator {
        display: none;
    }

    .representative-finder__reset {
        justify-self: start;
    }
}

@media (max-width: 48rem) {
    .representative-finder__search {
        grid-template-columns: 1fr;
        padding: 2.4rem;
    }

    .representative-finder__search--state-only {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 1rem;
    }

    .representative-finder__zip-group {
        flex-wrap: wrap;
    }

    .representative-finder__input {
        flex: 1 1 18rem;
    }

    .representative-finder__submit {
        flex: 0 0 auto;
    }

    .representative-card__columns {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 40rem) {
    .representative-finder__header {
        padding-top: 2rem;
    }

    .representative-finder__search,
    .representative-card__content {
        padding-right: 2rem;
        padding-left: 2rem;
    }

    .representative-card__heading {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .representative-card__logo {
        justify-self: start;
    }

    .representative-card__logo-image {
        object-position: left center;
    }

    .representative-card__details {
        margin-right: -2rem;
        margin-left: -2rem;
    }

    .representative-card__details-toggle,
    .representative-card__details-content {
        padding-left: 2rem;
    }

    .representative-card__details-toggle {
        padding-right: 5rem;
    }

    .representative-card__details-toggle::after {
        right: 2rem;
    }
}

@media (max-width: 30rem) {
    .representative-finder__zip-group {
        display: grid;
        grid-template-columns: 1fr;
    }

    .representative-finder__submit,
    .representative-finder__reset {
        width: 100%;
    }

    .representative-finder__search--state-only
        .representative-finder__reset {
        width: auto;
    }
}
