/**
 * IDX Pro Portal - Widget Styles
 * Version: 2.1.0
 */

/* Theming — root fallbacks ensure modals/overlays rendered outside #idx-pro-portal still get colors */
:root {
    --idx-primary:      #4a9d9c;
    --idx-primary-dark: #3a7d7c;
    --idx-secondary:    #1a2332;
}

#idx-pro-portal {
    --idx-primary:      #4a9d9c;
    --idx-primary-dark: #3a7d7c;
    --idx-secondary:    #1a2332;
}

.idx-portal {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: #1f2937;
}

.idx-portal * {
    box-sizing: border-box;
}

/* Header */
.idx-portal-header {
    margin-bottom: 30px;
    text-align: center;
}

.idx-portal-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--idx-secondary);
    margin: 0;
}

/* Search Form */
.idx-portal-search {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.idx-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.idx-form-group {
    display: flex;
    flex-direction: column;
}

.idx-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.idx-form-group input,
.idx-form-group select {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.idx-form-group input:focus,
.idx-form-group select:focus {
    outline: none;
    border-color: var(--idx-primary);
}

/* Buttons */
.idx-btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: var(--idx-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
}

.idx-btn-primary:hover {
    background: var(--idx-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 157, 156, 0.3);
}

.idx-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Results */
.idx-portal-results {
    min-height: 200px;
}

.idx-results-header {
    margin-bottom: 20px;
    font-size: 18px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.idx-results-header strong {
    color: var(--idx-secondary);
    font-weight: 700;
}

/* Results meta bar: count label + pagination */
.idx-results-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 15px;
    color: #6b7280;
}

.idx-pagination {
    display: flex;
    gap: 8px;
    align-items: center;
}

.idx-page-btn {
    padding: 6px 16px;
    background: #fff;
    color: var(--idx-primary, #4a9d9c);
    border: 1.5px solid var(--idx-primary, #4a9d9c);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.idx-page-btn:hover {
    background: var(--idx-primary, #4a9d9c);
    color: #fff;
}

.idx-pagination-footer {
    padding: 20px 0 4px;
    justify-content: center;
}

/* Map toggle button */
.idx-map-toggle-btn {
    padding: 8px 18px;
    background: white;
    color: var(--idx-secondary);
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.idx-map-toggle-btn:hover {
    border-color: var(--idx-primary);
    color: var(--idx-primary);
}

/* Load More */
.idx-load-more {
    text-align: center;
    padding: 24px 0 8px;
}

.idx-btn-load-more {
    padding: 12px 32px;
    background: white;
    color: var(--idx-primary);
    border: 2px solid var(--idx-primary);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.idx-btn-load-more:hover {
    background: var(--idx-primary);
    color: white;
}

.idx-btn-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Map layout — side by side */
.idx-results-body {
    /* default: nothing extra, grid flows normally */
}

.idx-results-body.idx-map-active {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.idx-results-body.idx-map-active .idx-map-cards-panel {
    width: 50%;
    flex-shrink: 0;
    max-height: 720px;
    overflow-y: auto;
}

.idx-map-panel {
    width: 50%;
    height: 720px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    position: sticky;
    top: 0px;
    background: #e5e7eb;
    margin: 0 !important;
    padding: 0 !important;
}

/* Tighten card grid inside map panel */
.idx-results-body.idx-map-active .idx-properties-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.idx-results-body.idx-map-active .idx-property-image {
    height: 170px;
}

/* Mobile: stack vertically */
@media (max-width: 900px) {
    .idx-results-body.idx-map-active {
        flex-direction: column;
    }

    .idx-results-body.idx-map-active .idx-map-cards-panel {
        width: 100%;
        max-height: none;
    }

    .idx-map-panel {
        width: 100%;
        height: 400px;
        position: static;
    }
}

/* Properties Grid */
.idx-properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.idx-property-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    transition: all 0.3s;
    cursor: pointer;
}

.idx-property-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: var(--idx-primary);
}

.idx-property-image {
    position: relative;
    width: 100%;
    height: 220px;
    background: #f3f4f6;
    overflow: hidden;
}

.idx-property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.idx-property-price {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--idx-secondary);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 18px;
}

.idx-property-details {
    padding: 20px;
}

.idx-property-address {
    font-size: 16px;
    font-weight: 600;
    color: var(--idx-secondary);
    margin-bottom: 6px;
}

.idx-property-location {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 12px;
}

.idx-property-features {
    display: flex;
    gap: 15px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    font-size: 14px;
    color: #6b7280;
}

.idx-property-extra {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Loading */
.idx-loading {
    text-align: center;
    padding: 60px 20px;
}

.idx-spinner {
    border: 4px solid #e5e7eb;
    border-top: 4px solid var(--idx-primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: idx-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes idx-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.idx-loading p {
    color: #6b7280;
    font-size: 16px;
}

/* No Results */
.idx-no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
}

.idx-no-results h3 {
    font-size: 24px;
    color: var(--idx-secondary);
    margin-bottom: 12px;
}

.idx-no-results p {
    color: #6b7280;
    font-size: 16px;
}

/* Error */
.idx-error {
    text-align: center;
    padding: 40px 20px;
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 12px;
}

.idx-error h3 {
    color: #dc2626;
    margin-bottom: 10px;
}

.idx-error p {
    color: #991b1b;
}

/* Responsive */
@media (max-width: 768px) {
    .idx-portal {
        padding: 15px;
    }
    
    .idx-portal-search {
        padding: 20px;
    }
    
    .idx-form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .idx-properties-grid {
        grid-template-columns: 1fr;
    }
    
    .idx-portal-header h2 {
        font-size: 22px;
        }
        
        .idx-search-actions {
        flex-direction: column;
    }
    
    .idx-search-actions button {
        width: 100%;
        white-space: normal !important;
    }
}

/* ============================================
   AUTHENTICATION & USER UI
   ============================================ */

.idx-portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.idx-btn-login {
    padding: 10px 24px;
    background: var(--idx-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.idx-btn-login:hover {
    background: var(--idx-primary-dark);
    transform: translateY(-2px);
}

.idx-user-dropdown {
    position: relative;
}

/* Invisible bridge covers the gap between button and menu so hover stays active */
.idx-user-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 12px;
}

.idx-user-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid var(--idx-primary);
    border-radius: 8px;
    font-weight: 600;
    color: var(--idx-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.idx-user-btn:hover {
    background: var(--idx-primary);
    color: white;
}

.idx-user-menu-items {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1000;
}

.idx-user-dropdown:hover .idx-user-menu-items {
    display: block;
}

.idx-user-menu-items a {
    display: block;
    padding: 12px 16px;
    color: #1f2937;
    text-decoration: none;
    transition: background 0.2s;
}

.idx-user-menu-items a:first-child {
    border-radius: 8px 8px 0 0;
}

.idx-user-menu-items a:last-child {
    border-radius: 0 0 8px 8px;
    border-top: 1px solid #e5e7eb;
}

.idx-user-menu-items a:hover {
    background: #f9fafb;
}

/* Auth Modal */
.idx-auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.idx-auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.idx-auth-box {
    position: relative;
    background: white;
    padding: 32px 40px 40px;
    border-radius: 12px;
    max-width: 460px;
    width: 92%;
    z-index: 10001;
    max-height: 90vh;
    overflow-y: auto;
}

/* Auth tabs */
.idx-auth-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin: -4px -40px 24px;
    padding: 0 40px;
}

.idx-auth-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 0;
    font-size: 15px;
    font-weight: 600;
    color: #9ca3af;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}

.idx-auth-tab.active {
    color: var(--idx-primary);
    border-bottom-color: var(--idx-primary);
}

.idx-auth-tab:hover:not(.active) {
    color: #6b7280;
}

/* Signup form two-column row */
.idx-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 0;
}

/* Signup selects */
.idx-auth-box select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    margin-bottom: 14px;
    color: #1f2937;
    background: white;
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239ca3af' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.idx-auth-box select:focus {
    outline: none;
    border-color: var(--idx-primary);
}

/* Signup checkbox group */
.idx-signup-checkbox-group {
    margin-bottom: 16px;
}

.idx-signup-checkbox-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
}

.idx-signup-checkboxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
}

.idx-signup-checkboxes label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

.idx-signup-checkboxes input[type="checkbox"] {
    width: auto;
    margin: 0;
    padding: 0;
    border: none;
    accent-color: var(--idx-primary);
}

.idx-auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 32px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
}

.idx-auth-close:hover {
    color: #1f2937;
}

.idx-auth-box h2 {
    margin-bottom: 12px;
    font-size: 28px;
}

.idx-auth-box p {
    margin-bottom: 24px;
    color: #6b7280;
}

.idx-auth-box input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    margin-bottom: 14px;
    transition: border-color 0.2s;
}

.idx-auth-box input:focus {
    outline: none;
    border-color: var(--idx-primary);
}

.idx-auth-box .idx-btn-primary {
    width: 100%;
    margin-bottom: 12px;
}

.idx-btn-secondary {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: #6b7280;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.idx-btn-secondary:hover {
    border-color: var(--idx-primary);
    color: var(--idx-primary);
}

.idx-btn-text {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 0;
    width: 100%;
    text-align: center;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s;
    display: block;
    margin-top: 4px;
}

.idx-btn-text:hover {
    color: var(--idx-primary);
}

.idx-auth-error {
    padding: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    margin-top: 16px;
}

/* Favorite Button */
.idx-favorite-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9) !important;
    border: none !important;
    border-radius: 50%;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

#idx-pro-portal .idx-favorite-btn svg {
    fill: none !important;
    stroke: #6b7280 !important;
    pointer-events: none;
}

#idx-pro-portal .idx-favorite-btn.favorited svg {
    fill: #dc2626 !important;
    stroke: #dc2626 !important;
}

.idx-favorite-btn:hover {
    transform: scale(1.1);
    background: white !important;
}

.idx-favorite-btn.favorited {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

/* Search Actions */
.idx-search-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: nowrap;
    align-items: stretch;
}

.idx-search-actions button {
    flex: 1;
    min-width: 0;
    font-size: 14px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   LIGHTBOX / MODAL STYLES
   ============================================ */

.idx-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.idx-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.idx-lightbox-content {
    position: relative;
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 400px;
    grid-template-rows: 1fr; /* constrain row to container height so details can scroll */
    z-index: 10001;
}

.idx-lightbox-close {
    position: absolute;
    top: 16px;
    right: calc(400px + 16px);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    transition: all 0.2s;
}

.idx-lightbox-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.idx-lightbox-gallery {
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;   /* clip images that overflow — prevents gallery height from shifting with aspect ratio */
    min-height: 0;      /* proper grid-child behaviour: allow row to constrain this element */
}

.idx-lightbox-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.idx-lightbox-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.idx-lightbox-image-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.idx-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10002;
}

.idx-lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.idx-lightbox-prev {
    left: 20px;
}

.idx-lightbox-next {
    right: 20px;
}

.idx-lightbox-details {
    padding: 40px;
    overflow-y: auto !important;
    min-height: 0 !important;
    max-height: 90vh !important;
    height: 90vh !important;
    align-self: stretch !important;
    box-sizing: border-box !important;
    background: #f9fafb;
}

.idx-lightbox-price {
    font-size: 36px;
    font-weight: 700;
    color: var(--idx-secondary);
    margin-bottom: 16px;
}

.idx-lightbox-address {
    font-size: 20px;
    font-weight: 600;
    color: var(--idx-secondary);
    margin-bottom: 8px;
}

.idx-lightbox-location {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 2px solid #e5e7eb;
}

.idx-lightbox-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.idx-lightbox-feature {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.idx-lightbox-extra {
    font-size: 13px;
    color: #9ca3af;
    margin-top: 12px;
}

.idx-feature-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    font-weight: 600;
}

.idx-feature-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--idx-secondary);
}

/* ============================================
   PANEL MODALS (Favorites & Saved Searches)
   ============================================ */

.idx-panel-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.idx-panel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.idx-panel-content {
    position: relative;
    background: white;
    border-radius: 12px;
    width: 95%;
    max-width: 1100px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    z-index: 10001;
    overflow: hidden;
}

.idx-panel-content-narrow {
    max-width: 640px;
}

.idx-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.idx-panel-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--idx-secondary);
}

.idx-panel-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.idx-panel-close:hover {
    color: #1f2937;
}

.idx-panel-body {
    overflow-y: auto;
    padding: 24px 28px;
    flex: 1;
}

/* Favorites grid */
.idx-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.idx-panel-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.idx-panel-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    border-color: var(--idx-primary);
}

/* Empty state */
.idx-panel-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.idx-panel-empty h3 {
    font-size: 20px;
    color: var(--idx-secondary);
    margin: 0 0 10px 0;
}

.idx-panel-empty p {
    font-size: 15px;
    margin: 0;
}

/* Saved search rows */
.idx-search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
}

.idx-search-item:last-child {
    border-bottom: none;
}

.idx-search-item-info {
    flex: 1;
    min-width: 0;
}

.idx-search-item-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--idx-secondary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.idx-search-item-filters {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.idx-search-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.idx-btn-run-search {
    padding: 8px 16px;
    background: var(--idx-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.idx-btn-run-search:hover {
    background: var(--idx-primary-dark);
}

.idx-btn-delete-search {
    padding: 8px 16px;
    background: white;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.idx-btn-delete-search:hover {
    background: #fef2f2;
    border-color: #dc2626;
}

@media (max-width: 640px) {
    .idx-panel-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .idx-panel-grid {
        grid-template-columns: 1fr;
    }

    .idx-search-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .idx-search-item-actions {
        width: 100%;
    }

    .idx-btn-run-search,
    .idx-btn-delete-search {
        flex: 1;
    }
}

/* Property Card Meta (Type/Style + MLS#) */
.idx-property-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
    font-size: 12px;
    color: #9ca3af;
    flex-wrap: wrap;
}

.idx-property-style {
    color: #6b7280;
    font-weight: 500;
}

.idx-mls-number {
    font-family: monospace;
    font-size: 11px;
}

/* Lightbox — Public Remarks */
.idx-lightbox-remarks {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.idx-remarks-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    font-weight: 600;
    margin-bottom: 10px;
}

.idx-remarks-text {
    font-size: 14px;
    color: #374151;
    line-height: 1.65;
}

.idx-remarks-extras {
    font-size: 13px;
    color: #6b7280;
    margin-top: 10px;
    line-height: 1.55;
}

/* Lightbox — Favourite Icon Button (top-right, beside close) */
.idx-lightbox-fav-icon {
    position: absolute;
    top: 16px;
    right: calc(400px + 64px);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    transition: all 0.2s;
}

.idx-lightbox-fav-icon:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Force round shape — overrides Astra padding/border/background on buttons */
.idx-lightbox-fav-icon,
.idx-lightbox-close {
    padding: 0 !important;
    background: rgba(0, 0, 0, 0.7) !important;
    border: none !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
}

.idx-lightbox-fav-icon.favorited,
.idx-lightbox-fav-icon.favorited:hover {
    background: rgba(220, 38, 38, 0.85) !important;
}

.idx-lightbox-gallery {
    background: #000 !important;
    overflow: hidden !important;
    min-height: 0 !important;
}

.idx-lightbox-fav-icon.favorited {
    background: rgba(220, 38, 38, 0.85);
}

.idx-lightbox-fav-icon.favorited:hover {
    background: rgba(220, 38, 38, 1);
}

/* Lightbox Responsive */
@media (max-width: 968px) {
    .idx-lightbox-content {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        height: 100vh;
        height: 100dvh; /* excludes browser chrome on mobile */
        width: 100%;
        max-width: 100%;
        border-radius: 0;
    }

    /* Push close/fav buttons below the browser address bar */
    .idx-lightbox-close {
        top: 56px;
        right: 16px;
    }

    .idx-lightbox-fav-icon {
        top: 56px;
        right: 68px; /* 48px button + 16px right + 4px gap */
    }

    .idx-lightbox-details {
        height: auto !important;      /* override height: 90vh !important from desktop rule */
        max-height: 40vh !important;  /* override max-height: 90vh !important from desktop rule */
        padding: 24px;
    }

    .idx-lightbox-price {
        font-size: 28px;
    }

    .idx-lightbox-address {
        font-size: 18px;
    }

    .idx-lightbox-nav {
        width: 44px;
        height: 44px;
        /* top: max() clamps the arrow center below the close/fav button zone (≈56px + 40px + gap = ~110px).
           When the gallery is large, 50% wins and arrows stay centred.
           When the gallery is small, 130px wins and arrows stay clear of the top buttons. */
        top: max(130px, 50%);
    }

    .idx-lightbox-nav:hover {
        /* keep scale without translateY duplication */
        transform: translateY(-50%) scale(1.1);
    }

    .idx-lightbox-prev {
        left: 10px;
    }

    .idx-lightbox-next {
        right: 10px;
    }
}

/* ============================================
   ADDITIONAL FILTERS POPOUT
   ============================================ */

.idx-btn-more-filters {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 12px 20px;
    background: #fff;
    color: #374151;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    white-space: nowrap;
}

.idx-btn-more-filters:hover {
    border-color: var(--idx-primary, #4a9d9c);
    color: var(--idx-primary, #4a9d9c);
}

.idx-btn-more-filters.idx-btn-filters-active {
    border-color: var(--idx-primary, #4a9d9c);
    background: color-mix(in srgb, var(--idx-primary, #4a9d9c) 10%, #fff);
    color: var(--idx-primary, #4a9d9c);
}

#idx-extra-filter-count {
    font-weight: 700;
}

.idx-extra-filters-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.idx-extra-filters-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
}

.idx-extra-filters-panel {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 14px;
    width: 480px;
    max-width: 100%;
    max-height: calc(100vh - 40px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.idx-extra-filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.idx-extra-filters-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.idx-extra-filters-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    flex: 1;
}

.idx-ef-section-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--idx-primary, #4a9d9c);
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 6px;
    margin-top: 4px;
}

.idx-ef-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.idx-ef-check-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 5px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 20px;
    background: #f9fafb;
    color: #374151;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    user-select: none;
}

.idx-ef-check-item input[type="checkbox"] {
    display: none;
}

.idx-ef-check-item:has(input:checked) {
    border-color: var(--idx-primary, #4a9d9c);
    background: var(--idx-primary, #4a9d9c);
    color: #fff;
}

.idx-extra-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.idx-extra-filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.idx-extra-filter-group select,
.idx-extra-filter-group input[type="number"] {
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #1f2937;
    background: #fff;
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.idx-extra-filter-group select:focus,
.idx-extra-filter-group input[type="number"]:focus {
    outline: none;
    border-color: var(--idx-primary, #4a9d9c);
}

.idx-extra-filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* Collapsible multi-select dropdowns (Property Type, Style, Basement) */
.idx-ef-multi-select {
    position: relative;
}

.idx-ef-multi-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    color: #1f2937;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s;
}

.idx-ef-multi-trigger:hover {
    border-color: var(--idx-primary, #4a9d9c);
}

.idx-ef-multi-badge {
    background: var(--idx-primary, #4a9d9c);
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    min-width: 20px;
    text-align: center;
    line-height: 1.4;
}

.idx-ef-multi-arrow {
    margin-left: auto;
    font-size: 11px;
    color: #6b7280;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.idx-ef-multi-select.idx-ef-ms-open .idx-ef-multi-trigger {
    border-color: var(--idx-primary, #4a9d9c);
}

.idx-ef-multi-select.idx-ef-ms-open .idx-ef-multi-arrow {
    transform: rotate(180deg);
}

.idx-ef-multi-panel {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 12px;
    z-index: 200;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    flex-wrap: wrap;
    gap: 8px;
}

.idx-ef-multi-select.idx-ef-ms-open .idx-ef-multi-panel {
    display: flex;
}

.idx-extra-filters-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 24px 20px;
    border-top: 1px solid #e5e7eb;
}

.idx-extra-filters-actions .idx-btn-primary,
.idx-extra-filters-actions .idx-btn-secondary {
    width: 100%;
}

@media (max-width: 600px) {
    .idx-extra-filters-modal {
        align-items: flex-end;
        padding: 0;
    }

    .idx-extra-filters-panel {
        width: 100%;
        border-radius: 18px 18px 0 0;
        max-height: 90vh;
    }

    .idx-extra-filter-row {
        grid-template-columns: 1fr;
    }
}
/* Pending onboarding notice (shown when using platform credentials) */
.idx-pending-notice {
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.875rem;
    color: #78350f;
    line-height: 1.5;
}
