/**
 * Canary Connect — PLZ Autocomplete Styles v1.1.0
 * Dropdown styling consistent with service-search dropdown.
 * Colors: #004B87 (primary), #f0f7ff (hover), #e5e7eb (border)
 */

/* Wrapper — relative anchor for dropdown */
.cc-zip-wrapper {
    position: relative;
    width: 100%;
}

/* Display input inherits form styles, no extra overrides needed */
.cc-zip-display {
    width: 100%;
    box-sizing: border-box;
}

/* Dropdown container */
.cc-zip-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
    z-index: 9999;
    overflow: hidden;
    max-height: 340px;
    overflow-y: auto;
    animation: ccZipDropIn 0.15s ease-out;
}

.cc-zip-dropdown.active {
    display: block;
}

@keyframes ccZipDropIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Individual item */
.cc-zip-item {
    padding: 12px 16px;
    font-size: 15px;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.12s ease;
    line-height: 1.4;
    min-height: 44px; /* touch target */
    box-sizing: border-box;
}

.cc-zip-item:hover,
.cc-zip-item.highlighted {
    background: #f0f7ff;
    color: #004B87;
}

.cc-zip-item + .cc-zip-item {
    border-top: 1px solid #f3f4f6;
}

/* PLZ number — bold blue */
.cc-zip-code {
    font-weight: 700;
    color: #004B87;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* Separator dash */
.cc-zip-sep {
    color: #9ca3af;
    flex-shrink: 0;
}

/* Place name */
.cc-zip-name {
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Highlighted item — also color inner spans */
.cc-zip-item.highlighted .cc-zip-name,
.cc-zip-item:hover .cc-zip-name {
    color: #004B87;
}

/* No results message */
.cc-zip-no-results {
    color: #9ca3af !important;
    cursor: default !important;
    font-style: italic;
    justify-content: center;
}

.cc-zip-no-results:hover {
    background: transparent !important;
    color: #9ca3af !important;
}

/* Scrollbar styling */
.cc-zip-dropdown::-webkit-scrollbar {
    width: 6px;
}

.cc-zip-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.cc-zip-dropdown::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.cc-zip-dropdown::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ===================================
   MOBILE ADJUSTMENTS
   =================================== */

@media (max-width: 768px) {
    .cc-zip-dropdown {
        border-radius: 8px;
        max-height: 220px;
    }

    .cc-zip-item {
        padding: 14px 16px;
        font-size: 16px; /* prevent iOS zoom */
    }
}

/* ===================================
   HP FORM INTEGRATION
   Ensure wrapper doesn't break HP layout
   =================================== */

.hp-form__field .cc-zip-wrapper {
    position: relative;
}

/* Guest wizard integration */
.cc-form-group .cc-zip-wrapper {
    position: relative;
}
