/**
 * Property Autocomplete Styling for Beth Gerber Real Estate
 * Enhanced property search dropdown with branded styling, images, and dividers
 * Applied to default Magento autocomplete structure
 */

/* Autocomplete container */
.search-autocomplete {
    display: none;
    border: 1px solid var(--k-15, #D9D9D9);
    border-top: 2px solid var(--era-navy, #151F6D);
    background: #fff !important;
    box-shadow: 0 6px 16px rgba(21, 31, 109, 0.12);
    border-radius: 0 0 6px 6px;
    z-index: 99999 !important;
    position: absolute;
    width: 400px !important;
    max-width: 95vw !important;
    font-family: var(--font-primary, "Red Hat Display"), sans-serif;
    max-height: 80vh;
    overflow-y: auto;
    padding: 0 !important;
}

.search-autocomplete::before {
    content: "";
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--era-red, #e4002a) 0%, var(--era-navy, #151F6D) 100%);
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
}

.search-autocomplete ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Individual search result item */
.search-autocomplete ul li {
    position: relative;
    border-bottom: 1px solid var(--k-10, #E6E6E6);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    display: block;
}

.search-autocomplete ul li a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
}

.search-autocomplete ul li:not(:last-child)::after {
    content: "";
    display: block;
    height: 1px;
    background: linear-gradient(90deg,
        rgba(196, 188, 183, 0.1) 0%,
        rgba(196, 188, 183, 0.5) 50%,
        rgba(196, 188, 183, 0.1) 100%);
    position: absolute;
    bottom: 0;
    left: 10px;
    right: 10px;
}

.search-autocomplete ul li:last-child {
    border-bottom: none;
    border-radius: 0 0 6px 6px;
}

.search-autocomplete ul li:hover,
.search-autocomplete ul li.selected {
    background-color: var(--k-5, #F2F2F2);
}

/* Property item layout */
.property-item-details {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Property image container */
.property-image-container {
    flex-shrink: 0;
    width: 90px;
    height: 80px;
    overflow: hidden;
    border-radius: 4px;
    background-color: var(--k-10, #E6E6E6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.property-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.property-placeholder {
    color: var(--k-30, #B3B3B3);
    font-size: 24px;
}

/* Property info container */
.property-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Address styling */
.property-address.qs-option-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--era-navy, #151F6D);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-primary, "Red Hat Display"), sans-serif;
    display: block;
    line-height: 1.4;
}

.search-autocomplete ul li:hover .property-address,
.search-autocomplete ul li.selected .property-address {
    color: var(--era-red, #e4002a);
}

/* MLS number */
.property-mls {
    font-size: 11px;
    font-weight: 500;
    color: var(--k-50, #808080);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Property features (beds, baths, sqft) */
.property-features {
    font-size: 12px;
    color: var(--k-40, #999999);
    font-weight: 400;
}

/* Price container - horizontal layout */
.price-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
}

/* Property status badge */
.property-status {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 3px;
    line-height: 1.4;
    display: inline-block;
    white-space: nowrap;
}

/* Status badge colors */
.property-status-active {
    background-color: #0066CC;
    color: #fff;
}

.property-status-pending {
    background-color: #FF9500;
    color: #fff;
}

.property-status-sold {
    background-color: var(--era-navy, #151F6D);
    color: #fff;
}

.property-status-coming-soon {
    background-color: #34C759;
    color: #fff;
}

.property-status-contingent {
    background-color: #FF9500;
    color: #fff;
}

/* Property price - scoped to autocomplete only */
.search-autocomplete .property-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--era-red, #e4002a);
    white-space: nowrap;
    margin-left: auto;
}

/* Legacy address styling (fallback) */
.search-autocomplete ul li .qs-option-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--era-navy, #151F6D);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-primary, "Red Hat Display"), sans-serif;
    display: block;
    line-height: 1.4;
}

.search-autocomplete ul li:hover .qs-option-name,
.search-autocomplete ul li.selected .qs-option-name {
    color: var(--era-red, #e4002a);
}

/* Amount field */
.search-autocomplete ul li .amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--era-red, #e4002a);
    margin-left: auto;
    font-family: var(--font-primary, "Red Hat Display"), sans-serif;
    display: none; /* Hide by default */
}

/* Loading state */
.search-autocomplete.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Empty results */
.search-autocomplete .empty-message {
    padding: 15px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .search-autocomplete {
        width: 95vw;
        max-width: 400px;
    }

    .search-autocomplete ul li .qs-option-name {
        font-size: 13px;
    }

    .property-image-container {
        width: 70px;
        height: 60px;
    }

    .property-address.qs-option-name {
        font-size: 13px;
    }

    .property-mls {
        font-size: 10px;
    }

    .property-features {
        font-size: 11px;
    }

    .search-autocomplete .property-price {
        font-size: 14px;
    }

    .property-status {
        font-size: 9px;
        padding: 2px 6px;
    }
}