/**
 * LoyalMLS Bridge — Frontend Styles v1.1.0
 * Covers: search bar, listing grid templates, single templates
 * Colors, font, and grid columns are controlled via CSS variables
 * injected by LoyalMLSDesignSystem (Settings → Design tab).
 */

/* ═══════════════════════════════════════════
   SEARCH WIDGET
   ═══════════════════════════════════════════ */
.lmls-search-wrap *, .lmls-search-wrap *::before, .lmls-search-wrap *::after { box-sizing: border-box; }
.lmls-search-wrap {
    font-family: var(--lmls-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: var(--lmls-font-size, 14px);
    color: var(--lmls-text, #1a202c);
    margin-bottom: 12px;
    position: relative;
    z-index: 100;
}
.lmls-search-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 6px 8px 6px 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    flex-wrap: wrap;
}
.lmls-search-bar .lmls-location {
    flex: 1 1 200px;
    min-width: 160px;
    position: relative;
    display: flex;
    align-items: center;
}
.lmls-search-bar .lmls-location input[type="text"] {
    flex: 1; min-width: 0; border: none; outline: none;
    font-size: 15px; color: #1a202c; background: transparent; padding: 8px 0;
}
.lmls-search-bar .lmls-location input::placeholder { color: #a0aec0; }
.lmls-loc-spinner {
    display: none; width: 16px; height: 16px; flex-shrink: 0; margin-left: 8px;
    border: 2px solid #e2e8f0; border-top-color: var(--lmls-primary, #1a56db);
    border-radius: 50%; animation: lmls-spin .7s linear infinite;
}
.lmls-loc-spinner--active { display: block; }
@keyframes lmls-spin { to { transform: rotate(360deg); } }
.lmls-divider { width: 1px; height: 26px; background: #e2e8f0; flex-shrink: 0; margin: 0 2px; }

/* Pills */
.lmls-pill { position: relative; flex-shrink: 0; }
.lmls-pill__btn {
    display: flex; align-items: center; gap: 4px;
    padding: 7px 12px; border: 1px solid transparent; border-radius: 8px;
    background: transparent; cursor: pointer; font-size: 13px; font-weight: 500;
    color: #4a5568; white-space: nowrap; transition: background .15s, border-color .15s;
}
.lmls-pill__btn:hover, .lmls-pill--open .lmls-pill__btn {
    background: #f7fafc; border-color: #e2e8f0; color: var(--lmls-primary, #1a56db);
}
.lmls-pill__btn .lmls-caret { font-size: 9px; opacity: .5; transition: transform .2s; }
.lmls-pill--open .lmls-pill__btn .lmls-caret { transform: rotate(180deg); }

/* Dropdowns */
.lmls-dropdown {
    display: none; position: absolute; top: calc(100% + 8px); left: 0;
    min-width: 220px; background: #fff; border: 1px solid #e2e8f0;
    border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.12);
    padding: 16px; z-index: 9999;
}
.lmls-dropdown--right { left: auto; right: 0; }
.lmls-dropdown--wide { min-width: 290px; }
.lmls-pill--open .lmls-dropdown { display: block; }
.lmls-dropdown h4 {
    font-size: 11px; font-weight: 700; color: #718096;
    text-transform: uppercase; letter-spacing: .6px; margin: 0 0 10px;
}
.lmls-dropdown hr { border: none; border-top: 1px solid #f0f0f0; margin: 12px 0; }

/* Radio rows */
.lmls-radio-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.lmls-radio-row input[type="radio"] { display: none; }
.lmls-radio-row label {
    padding: 5px 12px; border: 1px solid #e2e8f0; border-radius: 20px;
    cursor: pointer; font-size: 13px; color: #4a5568; user-select: none;
    transition: background .15s, border-color .15s, color .15s;
}
.lmls-radio-row input[type="radio"]:checked + label { background: var(--lmls-primary, #1a56db); border-color: var(--lmls-primary, #1a56db); color: #fff; }

/* Price inputs */
.lmls-price-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lmls-price-row input[type="text"] {
    width: 100%; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 8px 10px; font-size: 13px; color: #1a202c; outline: none;
}
.lmls-price-row input:focus { border-color: var(--lmls-primary, #1a56db); }

/* Checkboxes */
.lmls-checkbox-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; cursor: pointer; }
.lmls-checkbox-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--lmls-primary, #1a56db); flex-shrink: 0; cursor: pointer; }
.lmls-checkbox-item label { cursor: pointer; font-size: 13px; color: #4a5568; flex: 1; }

/* Status chips */
.lmls-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lmls-chips input[type="checkbox"] { display: none; }
.lmls-chips label {
    padding: 4px 11px; border: 1px solid #e2e8f0; border-radius: 20px;
    cursor: pointer; font-size: 12px; color: #4a5568; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}
.lmls-chips input[type="checkbox"]:checked + label { background: var(--lmls-primary, #1a56db); border-color: var(--lmls-primary, #1a56db); color: #fff; }

/* Type list */
.lmls-type-list { list-style: none; margin: 0; padding: 0; }
.lmls-type-list li { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 6px; }
.lmls-type-list li:hover { background: #f7fafc; }
.lmls-type-list input[type="radio"] { width: 16px; height: 16px; accent-color: var(--lmls-primary, #1a56db); flex-shrink: 0; cursor: pointer; }
.lmls-type-list label { cursor: pointer; font-size: 13px; flex: 1; }

/* Scrollable list */
.lmls-scrolllist { max-height: 180px; overflow-y: auto; padding-right: 4px; }
.lmls-scrolllist::-webkit-scrollbar { width: 4px; }
.lmls-scrolllist::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }

/* Buttons */
.lmls-btn-filters {
    display: flex; align-items: center; gap: 5px; padding: 8px 14px;
    border: 1px solid #e2e8f0; border-radius: 8px; background: #fff;
    cursor: pointer; font-size: 13px; font-weight: 500; color: #4a5568;
    transition: background .15s; white-space: nowrap;
}
.lmls-btn-filters:hover { background: #f7fafc; border-color: #c4cdd9; color: #4a5568; }
.lmls-btn-search {
    padding: 9px 20px; background: var(--lmls-primary, #1a56db); color: #fff;
    border: none; border-radius: 8px; font-size: 14px; font-weight: 600;
    cursor: pointer; white-space: nowrap; transition: background .15s; flex-shrink: 0;
}
.lmls-btn-search:hover { background: var(--lmls-secondary, #1344c0); }
.lmls-btn-save {
    padding: 9px 14px; background: transparent; color: var(--lmls-primary, #1a56db);
    border: 1px solid var(--lmls-primary, #1a56db); border-radius: 8px; font-size: 13px; font-weight: 600;
    cursor: pointer; white-space: nowrap; transition: background .15s, color .15s;
}
.lmls-btn-save:hover { background: var(--lmls-primary, #1a56db); color: #fff; }

/* Advanced Drawer */
.lmls-drawer-overlay {
    display: none !important;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.35); z-index: 10000;
}
.lmls-drawer-overlay--open { display: block !important; }
.lmls-drawer {
    position: fixed; top: 0; right: -440px;
    width: 420px; max-width: 95vw; height: 100%;
    background: #fff; box-shadow: -4px 0 28px rgba(0,0,0,.12);
    z-index: 10001; display: flex; flex-direction: column;
    transition: right .3s ease; overflow: hidden;
}
.lmls-drawer--open { right: 0 !important; }
.lmls-drawer__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px; border-bottom: 1px solid #f0f0f0; flex-shrink: 0;
}
.lmls-drawer__header h3 { margin: 0; font-size: 17px; font-weight: 700; }
.lmls-drawer__close {
    width: 32px; height: 32px; border: none; background: #f7fafc; border-radius: 50%;
    cursor: pointer; font-size: 18px; color: #4a5568;
    display: flex; align-items: center; justify-content: center;
}
.lmls-drawer__close:hover { background: #e2e8f0; }
.lmls-drawer__body { flex: 1; overflow-y: auto; padding: 22px; }
.lmls-drawer__footer {
    padding: 16px 22px; border-top: 1px solid #f0f0f0;
    flex-shrink: 0; display: flex; gap: 10px;
}
.lmls-drawer__footer button { flex: 1; padding: 10px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.lmls-btn-clear { background: #fff; border: 1px solid #e2e8f0; color: #4a5568; }
.lmls-btn-apply { background: var(--lmls-primary, #1a56db); border: none; color: #fff; }

/* Drawer field groups */
.lmls-field-group { margin-bottom: 22px; }
.lmls-field-group label.lmls-field-label {
    display: block; font-size: 11px; font-weight: 700; color: #718096;
    text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px;
}
.lmls-field-group select,
.lmls-field-group input[type="text"],
.lmls-field-group input[type="number"] {
    width: 100%; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 9px 12px; font-size: 14px; color: #1a202c;
    background: #fff; outline: none;
}
.lmls-field-group select:focus,
.lmls-field-group input:focus { border-color: var(--lmls-primary, #1a56db); }
.lmls-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Autocomplete */
.ui-autocomplete {
    background: #fff !important; border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important; box-shadow: 0 8px 24px rgba(0,0,0,.12) !important;
    padding: 6px 0 !important; z-index: 99999 !important;
}
.ui-autocomplete .ui-menu-item { padding: 0 !important; }
.ui-autocomplete .ui-menu-item div { padding: 8px 14px; font-size: 13px; color: #1a202c; cursor: pointer; }
.ui-autocomplete .ui-menu-item div:hover,
.ui-autocomplete .ui-state-active { background: #f0f6ff !important; color: var(--lmls-primary, #1a56db) !important; border: none !important; }
.ui-autocomplete-category {
    padding: 6px 14px 3px !important; font-size: 11px; font-weight: 700;
    color: #a0aec0; text-transform: uppercase; letter-spacing: .5px; pointer-events: none;
}

/* Save Modal */
.lmls-modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.4); z-index: 20000;
    align-items: center; justify-content: center;
}
.lmls-modal-overlay--open { display: flex !important; }
.lmls-modal-box {
    background: #fff; border-radius: 14px; padding: 28px;
    width: 420px; max-width: 95vw; box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
.lmls-modal-box h3 { margin: 0 0 18px; font-size: 18px; }
.lmls-modal-box input[type="text"] {
    width: 100%; padding: 10px 14px; border: 1px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; outline: none; margin-bottom: 14px;
}
.lmls-modal-box input:focus { border-color: var(--lmls-primary, #1a56db); }
.lmls-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.lmls-btn-cancel { padding: 9px 18px; background: #f7fafc; border: 1px solid #e2e8f0; border-radius: 8px; cursor: pointer; font-size: 13px; }
.lmls-btn-save-confirm { padding: 9px 18px; background: var(--lmls-primary, #1a56db); border: none; border-radius: 8px; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.lmls-btn-save-confirm:hover { background: var(--lmls-secondary, #1344c0); }

/* ═══════════════════════════════════════════
   LISTING GRID CARDS (template-*)
   ═══════════════════════════════════════════ */

/* Classic Grid */
.lmls-template-classic-grid .lmls-grid { display: grid; grid-template-columns: repeat(var(--lmls-cols, 3), 1fr); gap: 24px; padding: 24px 0; }
@media (max-width: 900px) { .lmls-template-classic-grid .lmls-grid { grid-template-columns: repeat(min(var(--lmls-cols, 3), 2), 1fr); } }
@media (max-width: 560px) { .lmls-template-classic-grid .lmls-grid { grid-template-columns: 1fr; } }
.lmls-template-classic-grid .lmls-card { position: relative; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,.08); background: var(--lmls-card-bg, #fff); transition: transform .2s, box-shadow .2s; }
.lmls-template-classic-grid .lmls-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.13); }
.lmls-template-classic-grid .lmls-card__fav { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(255,255,255,.85); border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px; border: none; color: #999; transition: background .2s; }
.lmls-template-classic-grid .lmls-card__fav.active { color: #e53e3e; }
.lmls-template-classic-grid .lmls-card__link { text-decoration: none; color: inherit; display: block; }
.lmls-template-classic-grid .lmls-card__image { position: relative; height: 200px; overflow: hidden; background: #f0f0f0; }
.lmls-template-classic-grid .lmls-card__image img { width: 100%; height: 100%; object-fit: cover; }
.lmls-template-classic-grid .lmls-no-image { height: 100%; display: flex; align-items: center; justify-content: center; color: #999; }
.lmls-template-classic-grid .lmls-badge { position: absolute; bottom: 10px; left: 10px; background: var(--lmls-primary, #1a56db); color: #fff; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.lmls-template-classic-grid .lmls-badge--new { background: #16a34a; }
.lmls-template-classic-grid .lmls-card__body { padding: 16px; }
.lmls-template-classic-grid .lmls-card__price { font-size: 22px; font-weight: 700; color: var(--lmls-primary, #1a56db); margin-bottom: 6px; }
.lmls-template-classic-grid .lmls-card__address { font-size: 15px; font-weight: 600; margin: 0 0 4px; color: #111; }
.lmls-template-classic-grid .lmls-card__location { font-size: 13px; color: #666; margin: 0 0 10px; }
.lmls-template-classic-grid .lmls-card__meta { display: flex; gap: 14px; font-size: 13px; color: #444; border-top: 1px solid #f0f0f0; padding-top: 10px; margin-top: 10px; flex-wrap: wrap; }
.lmls-template-classic-grid .lmls-card__footer { margin-top: 10px; font-size: 12px; color: #888; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px; }
.lmls-template-classic-grid .lmls-mls { font-style: italic; }

/* Horizontal List */
.lmls-template-horizontal-list .lmls-row-card { display: flex; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,.07); background: #fff; margin-bottom: 20px; transition: box-shadow .2s; }
.lmls-template-horizontal-list .lmls-row-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.13); }
.lmls-template-horizontal-list .lmls-row-card__image-wrap { position: relative; width: 260px; min-width: 260px; overflow: hidden; display: block; background: #f0f0f0; flex-shrink: 0; }
.lmls-template-horizontal-list .lmls-row-card__image-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.lmls-template-horizontal-list .lmls-row-card:hover .lmls-row-card__image-wrap img { transform: scale(1.04); }
.lmls-template-horizontal-list .lmls-no-image { min-height: 180px; display: flex; align-items: center; justify-content: center; color: #bbb; }
.lmls-template-horizontal-list .lmls-badge { position: absolute; top: 10px; left: 10px; background: var(--lmls-primary, #1a56db); color: #fff; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.lmls-template-horizontal-list .lmls-badge--new { background: #16a34a; }
.lmls-template-horizontal-list .lmls-row-card__body { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.lmls-template-horizontal-list .lmls-row-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.lmls-template-horizontal-list .lmls-row-card__price { font-size: 22px; font-weight: 700; color: var(--lmls-primary, #1a56db); }
.lmls-template-horizontal-list .lmls-row-card__address { font-size: 15px; font-weight: 600; color: #111; text-decoration: none; display: block; margin: 4px 0; }
.lmls-template-horizontal-list .lmls-row-card__location { font-size: 13px; color: #777; margin: 0; }
.lmls-template-horizontal-list .lmls-row-card__fav { font-size: 22px; cursor: pointer; color: #ccc; flex-shrink: 0; transition: color .2s; border: none; background: none; padding: 0; }
.lmls-template-horizontal-list .lmls-row-card__fav.active, .lmls-template-horizontal-list .lmls-row-card__fav:hover { color: #e53e3e; background: none; text-decoration: none; }
.lmls-template-horizontal-list .lmls-row-card__fav:focus { outline: none; background: none; color: #ccc; text-decoration: none; }
.lmls-template-horizontal-list .lmls-row-card__fav:focus:not(:focus-visible) { color: #ccc; background: none; }
.lmls-template-horizontal-list .lmls-row-card__specs { display: flex; gap: 20px; }
.lmls-template-horizontal-list .lmls-spec { text-align: center; }
.lmls-template-horizontal-list .lmls-spec__val { display: block; font-size: 17px; font-weight: 700; color: #222; }
.lmls-template-horizontal-list .lmls-spec__lbl { font-size: 11px; color: #999; text-transform: uppercase; letter-spacing: .5px; }
.lmls-template-horizontal-list .lmls-row-card__desc { font-size: 13px; color: #555; line-height: 1.5; margin: 0; }
.lmls-template-horizontal-list .lmls-row-card__footer { display: flex; align-items: center; gap: 14px; font-size: 12px; color: #999; flex-wrap: wrap; margin-top: auto; }
.lmls-template-horizontal-list .lmls-row-card__btn { margin-left: auto; background: var(--lmls-primary, #1a56db); color: #fff; padding: 7px 16px; border-radius: 6px; text-decoration: none; font-size: 13px; font-weight: 600; }
@media (max-width: 700px) {
    .lmls-template-horizontal-list .lmls-row-card { flex-direction: column; }
    .lmls-template-horizontal-list .lmls-row-card__image-wrap { width: 100%; min-height: 200px; }
}

/* Minimal */
.lmls-template-minimal .lmls-minimal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; padding: 20px 0; }
@media (max-width: 640px) { .lmls-template-minimal .lmls-minimal-grid { grid-template-columns: 1fr; } }
.lmls-template-minimal .lmls-minimal-card { border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.07); transition: box-shadow .2s, transform .2s; }
.lmls-template-minimal .lmls-minimal-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,.14); transform: translateY(-3px); }
.lmls-template-minimal .lmls-minimal-card__image-wrap { position: relative; display: block; height: 260px; overflow: hidden; background: #e8e8e8; }
.lmls-template-minimal .lmls-minimal-card__image-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.lmls-template-minimal .lmls-minimal-card:hover img { transform: scale(1.06); }
.lmls-template-minimal .lmls-minimal-card__overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.25) 0%, transparent 40%, rgba(0,0,0,.65) 100%); display: flex; flex-direction: column; justify-content: space-between; padding: 14px; }
.lmls-template-minimal .lmls-minimal-card__overlay-top { display: flex; justify-content: space-between; align-items: flex-start; }
.lmls-template-minimal .lmls-badge { background: rgba(26,86,219,.9); color: #fff; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.lmls-template-minimal .lmls-badge--new { background: rgba(22,163,74,.9); }
.lmls-template-minimal .lmls-minimal-fav { font-size: 22px; color: rgba(255,255,255,.8); cursor: pointer; border: none; background: none; padding: 0; line-height: 1; }
.lmls-template-minimal .lmls-minimal-fav.active, .lmls-template-minimal .lmls-minimal-fav:hover { color: #fc8181; background: none; text-decoration: none; }
.lmls-template-minimal .lmls-minimal-fav:focus { outline: none; background: none; color: rgba(255,255,255,.8); text-decoration: none; }
.lmls-template-minimal .lmls-minimal-fav:focus:not(:focus-visible) { color: rgba(255,255,255,.8); background: none; }
.lmls-template-minimal .lmls-minimal-card__price { font-size: 22px; font-weight: 800; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.lmls-template-minimal .lmls-minimal-card__address { font-size: 14px; color: #fff; opacity: .9; }
.lmls-template-minimal .lmls-minimal-card__meta { padding: 12px 16px; }
.lmls-template-minimal .lmls-minimal-card__loc { font-size: 13px; color: #555; }
.lmls-template-minimal .lmls-minimal-card__specs { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.lmls-template-minimal .lmls-minimal-card__specs span { font-size: 13px; color: #444; background: #f4f6fb; padding: 3px 9px; border-radius: 20px; }

/* Compact Table */
.lmls-template-compact .lmls-compact-table-wrap { overflow-x: auto; border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,.08); background: #fff; }
.lmls-template-compact .lmls-compact-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lmls-template-compact .lmls-compact-table thead { background: var(--lmls-primary, #1a56db); color: #fff; }
.lmls-template-compact .lmls-compact-table thead th { padding: 12px 14px; text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.lmls-template-compact .lmls-compact-table tbody tr { border-bottom: 1px solid #f0f2f5; transition: background .15s; }
.lmls-template-compact .lmls-compact-table tbody tr:hover { background: #f7f9fc; }
.lmls-template-compact .lmls-compact-table tbody td { padding: 10px 14px; vertical-align: middle; color: #333; }
.lmls-template-compact .lmls-col-img { width: 72px; padding: 6px 8px 6px 14px !important; }
.lmls-template-compact .lmls-col-img img { width: 64px; height: 48px; object-fit: cover; border-radius: 5px; display: block; }
.lmls-template-compact .lmls-col-address a { font-weight: 600; color: var(--lmls-primary, #1a56db); text-decoration: none; }
.lmls-template-compact .lmls-col-address small { color: #888; font-size: 12px; }
.lmls-template-compact .lmls-col-price { font-weight: 700; color: var(--lmls-primary, #1a56db); white-space: nowrap; }
.lmls-template-compact .lmls-col-center { text-align: center; }
.lmls-template-compact .lmls-status-badge { background: #f0f4ff; color: var(--lmls-primary, #1a56db); padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.lmls-template-compact .lmls-col-actions { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.lmls-template-compact .lmls-compact-fav { font-size: 18px; cursor: pointer; color: #ccc; border: none; background: none; padding: 0; line-height: 1; }
.lmls-template-compact .lmls-compact-fav.active, .lmls-template-compact .lmls-compact-fav:hover { color: #e53e3e; background: none; text-decoration: none; }
.lmls-template-compact .lmls-compact-fav:focus { outline: none; background: none; color: #ccc; text-decoration: none; }
.lmls-template-compact .lmls-compact-fav:focus:not(:focus-visible) { color: #ccc; background: none; }
.lmls-template-compact .lmls-compact-view-btn { background: var(--lmls-primary, #1a56db); color: #fff; padding: 5px 12px; border-radius: 5px; text-decoration: none; font-size: 12px; font-weight: 600; }

/* Featured */
.lmls-template-featured .lmls-featured-card { position: relative; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 14px rgba(0,0,0,.1); }
.lmls-template-featured .lmls-featured-card--hero { margin-bottom: 20px; }
.lmls-template-featured .lmls-featured-secondary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1000px) { .lmls-template-featured .lmls-featured-secondary-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .lmls-template-featured .lmls-featured-secondary-grid { grid-template-columns: 1fr 1fr; } }
.lmls-template-featured .lmls-featured-card__image-wrap { display: block; position: relative; overflow: hidden; }
.lmls-template-featured .lmls-featured-card--hero .lmls-featured-card__image-wrap { height: 440px; }
.lmls-template-featured .lmls-featured-card--small .lmls-featured-card__image-wrap { height: 220px; }
@media (max-width: 560px) {
    .lmls-template-featured .lmls-featured-card--hero .lmls-featured-card__image-wrap { height: 260px; }
    .lmls-template-featured .lmls-featured-card--small .lmls-featured-card__image-wrap { height: 160px; }
}
.lmls-template-featured .lmls-featured-card__image-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.lmls-template-featured .lmls-featured-card:hover img { transform: scale(1.05); }
.lmls-template-featured .lmls-featured-card__gradient { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.15) 0%, transparent 30%, rgba(0,0,0,.7) 100%); display: flex; flex-direction: column; justify-content: space-between; padding: 16px; }
.lmls-template-featured .lmls-badge { background: rgba(26,86,219,.9); color: #fff; padding: 4px 11px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.lmls-template-featured .lmls-badge--new { background: rgba(22,163,74,.9); }
.lmls-template-featured .lmls-featured-card__price { font-size: 28px; font-weight: 800; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.lmls-template-featured .lmls-featured-card--small .lmls-featured-card__price { font-size: 18px; }
.lmls-template-featured .lmls-featured-card__address { font-size: 16px; font-weight: 600; color: #fff; margin: 3px 0; }
.lmls-template-featured .lmls-featured-card--small .lmls-featured-card__address { font-size: 13px; }
.lmls-template-featured .lmls-featured-card__fav { position: absolute; top: 14px; right: 14px; font-size: 22px; color: rgba(255,255,255,.8); cursor: pointer; border: none; background: none; padding: 0; z-index: 2; line-height: 1; }
.lmls-template-featured .lmls-featured-card__fav.active, .lmls-template-featured .lmls-featured-card__fav:hover { color: #fc8181; background: none; text-decoration: none; }
.lmls-template-featured .lmls-featured-card__fav:focus { outline: none; background: none; color: rgba(255,255,255,.8); text-decoration: none; }
.lmls-template-featured .lmls-featured-card__fav:focus:not(:focus-visible) { color: rgba(255,255,255,.8); background: none; }

/* Shared pagination */
.lmls-template-classic-grid .lmls-pagination,
.lmls-template-horizontal-list .lmls-pagination,
.lmls-template-minimal .lmls-pagination,
.lmls-template-compact .lmls-pagination,
.lmls-template-featured .lmls-pagination { text-align: center; padding: 20px 0; }
.lmls-template-classic-grid .lmls-pagination a,
.lmls-template-classic-grid .lmls-pagination span,
.lmls-template-horizontal-list .lmls-pagination a,
.lmls-template-horizontal-list .lmls-pagination span,
.lmls-template-minimal .lmls-pagination a,
.lmls-template-minimal .lmls-pagination span,
.lmls-template-compact .lmls-pagination a,
.lmls-template-compact .lmls-pagination span,
.lmls-template-featured .lmls-pagination a,
.lmls-template-featured .lmls-pagination span {
    margin: 0 4px; padding: 6px 12px; border: 1px solid #ddd;
    border-radius: 4px; text-decoration: none; color: var(--lmls-primary, #1a56db); display: inline-block;
}
.lmls-template-classic-grid .lmls-pagination .current,
.lmls-template-horizontal-list .lmls-pagination .current,
.lmls-template-minimal .lmls-pagination .current,
.lmls-template-compact .lmls-pagination .current,
.lmls-template-featured .lmls-pagination .current { background: var(--lmls-primary, #1a56db); color: #fff; border-color: var(--lmls-primary, #1a56db); }

/* Mobile overrides */
@media (max-width: 600px) {
    .lmls-search-bar { border-radius: 10px; padding: 6px 8px; gap: 6px; }
    .lmls-divider { display: none; }
    .lmls-pill__btn { padding: 6px 9px; font-size: 12px; }
    .lmls-btn-search, .lmls-btn-save { padding: 8px 12px; font-size: 13px; }
    .lmls-btn-filters { padding: 8px 10px; font-size: 12px; }
}

/* ═══════════════════════════════════════════
   GLOBAL LISTING PAGE OVERFLOW FIX
   Prevents any element from causing horizontal scroll
   ═══════════════════════════════════════════ */

/* Applied on all listing pages */
.single-listing img,
.single-listing video,
.post-type-listing img,
body.single-listing img {
    max-width: 100%;
    height: auto;
}

/* Contain any raw image sequences that Elementor or WP outputs */
.entry-content img,
.elementor-widget-container img,
.wp-block-image img {
    max-width: 100%;
    height: auto;
}

/* Prevent ANY element from overflowing the viewport horizontally on listing pages */
.single-listing,
.post-type-listing {
    overflow-x: hidden;
}

/* If images are output in a row (flex/inline), constrain the wrapper */
.lmls-single-classic,
.lmls-single-modern,
.lmls-min,
.lmls-lux,
.lmls-cmp {
    max-width: 100%;
    overflow-x: hidden;
}

/* Gallery grid — never exceed viewport */
.lmls-classic-gallery,
.lmls-lux-gal,
.lmls-cmp-top {
    max-width: 100%;
    overflow: hidden;
}

/* Gallery filmstrip — scroll rather than overflow */
.lmls-modern-gallery-strip,
.lmls-gal-filmstrip-thumbs {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}
.lmls-modern-gallery-strip img,
.lmls-gal-filmstrip-thumbs img {
    flex-shrink: 0;
    width: 150px;
    height: 100px;
    object-fit: cover;
}

/* Lightbox images must never overflow */
.lmls-lightbox img,
.lmls-lightbox-m img,
.lmls-lb2 img,
.lmls-lb3 img,
.lmls-lb4 img,
.lmls-gal-lb-img-wrap img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
}

/* Elementor widget containers on listing pages */
.single-listing .elementor-widget-container,
.post-type-listing .elementor-widget-container {
    max-width: 100%;
    overflow-x: hidden;
}

/* Mobile: ensure single page content doesn't scroll horizontally */
@media (max-width: 768px) {
    .lmls-classic-gallery {
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: 200px 150px !important;
    }
    .lmls-classic-gallery-img:first-child {
        grid-row: 1 / 2 !important;
        grid-column: 1 / 3 !important;
    }
    .lmls-modern-hero { height: 340px !important; }
    .lmls-modern-hero-price { font-size: 28px !important; }
    .lmls-modern-hero-address { font-size: 16px !important; }
    .lmls-modern-body { grid-template-columns: 1fr !important; padding: 20px 16px !important; }
    .lmls-classic-body { grid-template-columns: 1fr !important; }
    .lmls-classic-stats { flex-wrap: wrap; }
    .lmls-classic-stat { flex: 1 1 30%; }
    .lmls-lux-body { grid-template-columns: 1fr !important; padding: 30px 16px !important; }
    .lmls-lux-hero { height: 60vh !important; min-height: 300px !important; }
    .lmls-lux-hero-price { font-size: 34px !important; }
    .lmls-lux-strip { flex-wrap: wrap; }
    .lmls-lux-sstat { flex: 1 1 30%; }
    .lmls-cmp-body { grid-template-columns: 1fr !important; }
}
