/* Company lookup above the billing block of the public forms - see js/companyLookup.js. */

.company-lookup {
    position: relative;
}

.company-lookup__input {
    width: 100%;
}

.company-lookup__hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #777;
}

.company-lookup__results {
    display: none;
    position: absolute;
    z-index: 1080;
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    margin-top: 2px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
    text-align: left;
}

.company-lookup.is-open .company-lookup__results {
    display: block;
}

.company-lookup__item {
    display: block;
    padding: 10px 12px;
    min-height: 38px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    touch-action: manipulation;
}

.company-lookup__item:last-child {
    border-bottom: 0;
}

.company-lookup__item.is-active,
.company-lookup__item:hover {
    background: #f5f7fa;
}

.company-lookup__name {
    display: block;
    font-weight: 600;
    line-height: 1.3;
}

.company-lookup__address {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #777;
    line-height: 1.3;
}

.company-lookup__empty {
    padding: 10px 12px;
    font-size: 13px;
    color: #777;
}

.company-lookup.is-loading .company-lookup__input {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6' fill='none' stroke='%23bbb' stroke-width='2' stroke-dasharray='9 24'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 8 8' to='360 8 8' dur='.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

@media (pointer: coarse) {
    .company-lookup__input {
        font-size: 16px;
    }

    .company-lookup__item {
        padding: 12px;
        min-height: 44px;
    }
}

/*
 * Two-way switch of the billing block: súkromná osoba / firemné údaje (a radio list, the label
 * is the button) and platca DPH áno / nie (plain buttons driven by js/companyLookup.js).
 */

.company-switch {
    display: inline-flex;
    flex-wrap: wrap;
    max-width: 100%;
    border: 1px solid #112b5d;
    border-radius: 4px;
    overflow: hidden;
    vertical-align: middle;
}

.company-switch input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.company-switch__button {
    display: inline-block;
    margin: 0;
    padding: 8px 16px;
    min-height: 38px;
    border: 0;
    border-right: 1px solid #112b5d;
    border-radius: 0;
    background: #fff;
    color: #112b5d;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-appearance: none;
    appearance: none;
}

.company-switch__button:last-child {
    border-right: 0;
}

.company-switch__button:hover {
    background: #f5f7fa;
}

.company-switch__button.is-active,
.company-switch input[type="radio"]:checked + .company-switch__button {
    background: #112b5d;
    color: #fff;
}

.company-switch input[type="radio"]:focus-visible + .company-switch__button {
    outline: 2px solid #18448c;
    outline-offset: -2px;
}

.company-vat {
    margin: 0;
}

.company-vat__label {
    display: inline-block;
    margin: 0 10px 6px 0;
    font-size: 14px;
    vertical-align: middle;
}

.company-vat .company-switch {
    margin-bottom: 6px;
}

.company-vat__field[hidden] {
    display: none;
}

@media (pointer: coarse) {
    .company-switch__button {
        min-height: 44px;
        font-size: 16px;
    }
}
