/* ============================================================================
   USAR WC Bridge — searchable breed combobox (v0.7.54)
   ============================================================================ */

/* Hide the source <select> visually but keep it focusable for assistive
   tech / form submission. Don't use display:none — Safari occasionally
   skips hidden selects during form serialization. */
.usar-breed-cb-source {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    /* Keep it in the form's natural position for browsers that look for
       the next sibling on focus restore. */
}

.usar-breed-cb {
    position: relative;
    display: block;
    width: 100%;
    font-family: 'Inter', system-ui, sans-serif;
}
.usar-breed-cb-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 80px 12px 14px;
    border: 1.5px solid #c0c8d1;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.4;
    color: #1a1a1a;
    background: #fff;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    /* Right padding leaves room for the caret + clear buttons. */
}
.usar-breed-cb-input::placeholder {
    text-transform: none;
    color: #9ca3af;
    letter-spacing: 0;
    opacity: 1;
}
.usar-breed-cb.is-open .usar-breed-cb-input,
.usar-breed-cb-input:focus {
    outline: none;
    border-color: #294a70;
    box-shadow: 0 0 0 3px rgba(41,74,112,0.15);
}
.usar-breed-cb.has-value .usar-breed-cb-input {
    border-color: #2e7d32;
}
.usar-breed-cb-caret {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #6b7280;
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
    transition: transform 0.15s;
}
.usar-breed-cb.is-open .usar-breed-cb-caret { transform: translateY(-50%) rotate(180deg); }
.usar-breed-cb-clear {
    position: absolute;
    right: 34px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 0;
    background: #f4f6f9;
    color: #4b5563;
    font-size: 16px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    display: none;
}
.usar-breed-cb.has-value .usar-breed-cb-clear { display: block; }
.usar-breed-cb-clear:hover { background: #e6e9ee; color: #1a3354; }

.usar-breed-cb-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 50;
    list-style: none;
    margin: 0;
    padding: 6px 0;
    background: #fff;
    border: 1.5px solid #c0c8d1;
    border-radius: 8px;
    max-height: 320px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 12px 32px rgba(26,51,84,0.18);
    display: none;
}
.usar-breed-cb.is-open .usar-breed-cb-list { display: block; }

.usar-breed-cb-empty {
    display: none;
    list-style: none;
    margin: 0;
    padding: 14px 16px;
    color: #6b7280;
    font-size: 14px;
    background: #fff;
    border: 1.5px solid #c0c8d1;
    border-radius: 8px;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 50;
    box-shadow: 0 12px 32px rgba(26,51,84,0.12);
}
.usar-breed-cb.is-open .usar-breed-cb-empty[style*="display: block"] { display: block; }

.usar-breed-cb-group {
    padding: 8px 14px 4px;
    font-size: 10px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    background: #fafbfd;
    border-top: 1px solid #f1f3f5;
}
.usar-breed-cb-list > li:first-child.usar-breed-cb-group { border-top: 0; }

.usar-breed-cb-item {
    padding: 11px 16px;
    font-size: 14px;
    line-height: 1.35;
    color: #1a3354;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    transition: background 0.08s;
    user-select: none;
}
.usar-breed-cb-item:hover,
.usar-breed-cb-item.is-active {
    background: #f0f6fb;
    color: #1a3354;
}

/* Mobile — bigger touch targets, larger search input. */
@media (max-width: 600px) {
    .usar-breed-cb-input {
        padding: 13px 78px 13px 13px;
        font-size: 16px; /* prevents iOS auto-zoom */
        min-height: 48px;
    }
    .usar-breed-cb-list,
    .usar-breed-cb-empty { max-height: 60vh; }
    .usar-breed-cb-item {
        padding: 14px 16px;
        font-size: 15px;
    }
    .usar-breed-cb-clear {
        right: 40px;
        width: 32px;
        height: 32px;
        line-height: 32px;
        font-size: 18px;
    }
    .usar-breed-cb-caret {
        right: 14px;
        font-size: 18px;
    }
}
