/* =====================================================================
   Auto Listings Manager — Public CSS
   ===================================================================== */

:root {
    --alm-primary:      #1a1a2e;
    --alm-accent:       #e94560;
    --alm-accent-dark:  #c73652;
    --alm-surface:      #ffffff;
    --alm-bg:           #f4f6f8;
    --alm-border:       #e2e6ea;
    --alm-text:         #1a1a2e;
    --alm-muted:        #6c757d;
    --alm-radius:       10px;
    --alm-radius-sm:    6px;
    --alm-shadow-sm:    0 1px 3px rgba(0,0,0,.08);
    --alm-shadow:       0 4px 16px rgba(0,0,0,.10);
    --alm-shadow-hover: 0 8px 28px rgba(0,0,0,.15);
    --alm-font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Shared icon sizing ─────────────────────────────────────────── */
.alm-icon {
    width: 1em !important;
    height: 1em !important;
    max-width: 1em !important;
    max-height: 1em !important;
    vertical-align: -.15em;
    flex-shrink: 0;
    display: inline-block;
}

/* ── Container ──────────────────────────────────────────────────── */
.alm-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ── Back link ──────────────────────────────────────────────────── */
.alm-back-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--alm-muted); font-size: 14px; text-decoration: none;
    margin: 16px 0 24px; transition: color .2s;
}
.alm-back-link:hover { color: var(--alm-accent); }

/* ── Breadcrumbs ────────────────────────────────────────────────── */
.alm-breadcrumbs {
    font-size: 13px; color: var(--alm-muted); margin-bottom: 8px;
    display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
}
.alm-breadcrumbs a { color: var(--alm-muted); text-decoration: none; }
.alm-breadcrumbs a:hover { color: var(--alm-accent); }

/* ── Status pill ────────────────────────────────────────────────── */
.alm-status-pill {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .04em; background: var(--alm-border); color: var(--alm-muted);
}
.alm-status-pill.alm-status-available  { background: #d4edda; color: #155724; }
.alm-status-pill.alm-status-sold       { background: #f8d7da; color: #721c24; }
.alm-status-pill.alm-status-reserved   { background: #fff3cd; color: #856404; }

/* ── Badge chips ────────────────────────────────────────────────── */
.alm-badge {
    font-size: 11px; font-weight: 600; padding: 2px 9px;
    border-radius: 20px; border: 1.5px solid var(--alm-accent);
    color: var(--alm-accent); white-space: nowrap;
}

/* =====================================================================
   GRID / ARCHIVE
   ===================================================================== */
.alm-archive { padding: 32px 0 48px; background: var(--alm-bg); min-height: 60vh; }
.alm-archive-title { font-size: 28px; font-weight: 700; margin: 0 0 24px; color: var(--alm-primary); }

.alm-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
@media (max-width: 1100px) { .alm-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .alm-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (max-width: 480px)  { .alm-grid { grid-template-columns: 1fr; } }

.alm-no-results {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: var(--alm-muted); font-size: 16px;
}

/* ── Pagination ─────────────────────────────────────────────────── */
.alm-pagination { text-align: center; margin: 36px 0; }
.alm-pagination a,
.alm-pagination span {
    display: inline-block; margin: 0 3px; padding: 8px 14px;
    border-radius: var(--alm-radius-sm); border: 1px solid var(--alm-border);
    color: var(--alm-primary); text-decoration: none; font-size: 14px;
    transition: background .15s, color .15s;
}
.alm-pagination a:hover { background: var(--alm-bg); }
.alm-pagination .current { background: var(--alm-primary); color: #fff; border-color: var(--alm-primary); }

/* =====================================================================
   CARD
   ===================================================================== */
.alm-card {
    background: var(--alm-surface);
    border-radius: var(--alm-radius);
    box-shadow: var(--alm-shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .25s, transform .25s;
    border: 1px solid var(--alm-border);
}
.alm-card:hover {
    box-shadow: var(--alm-shadow-hover);
    transform: translateY(-3px);
}

/* Image zone */
.alm-card-img {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 2;
    background: var(--alm-bg);
}
.alm-card-img a { display: block; height: 100%; }
.alm-card-img img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform .4s ease;
}
.alm-card:hover .alm-card-img img { transform: scale(1.05); }

.alm-card-no-img {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--alm-border); font-size: 48px;
}

.alm-card-counter {
    position: absolute; bottom: 8px; left: 8px;
    background: rgba(0,0,0,.55); color: #fff;
    font-size: 11px; padding: 2px 7px; border-radius: 4px;
    display: flex; align-items: center; gap: 4px;
}
.alm-card-counter .alm-icon { width: .85em; height: .85em; }

.alm-card-ribbon {
    position: absolute; top: 12px; left: 0;
    background: var(--alm-accent); color: #fff;
    font-size: 11px; font-weight: 700; padding: 4px 12px 4px 10px;
    border-radius: 0 20px 20px 0;
    box-shadow: 0 2px 6px rgba(233,69,96,.4);
}

.alm-heart-btn {
    position: absolute; top: 10px; right: 10px;
    background: rgba(255,255,255,.92);
    border: none; border-radius: 50%;
    width: 34px; height: 34px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--alm-muted);
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
    transition: color .2s, background .2s, transform .15s;
}
.alm-heart-btn:hover { background: #fff; transform: scale(1.1); }
.alm-heart-btn.is-active { color: var(--alm-accent); }
.alm-heart-btn .alm-icon { width: 16px; height: 16px; }

/* Card body */
.alm-card-body {
    padding: 14px 16px 16px;
    flex: 1; display: flex; flex-direction: column; gap: 8px;
    font-family: var(--alm-font);
}

.alm-card-title-link { text-decoration: none; color: inherit; }
.alm-card-title {
    font-size: 15px; font-weight: 700; margin: 0;
    color: var(--alm-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.alm-card-title-link:hover .alm-card-title { color: var(--alm-accent); }

.alm-card-trim { font-size: 12px; color: var(--alm-muted); margin: 0; }

.alm-card-badges { display: flex; flex-wrap: wrap; gap: 5px; }

/* Spec chips row */
.alm-card-specs {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 8px 0; border-top: 1px solid var(--alm-border);
    margin-top: 2px;
}
.alm-card-spec {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; color: var(--alm-muted);
    background: var(--alm-bg);
    padding: 3px 8px; border-radius: 20px;
    white-space: nowrap;
}
.alm-card-spec .alm-icon { width: 12px; height: 12px; color: var(--alm-accent); }

/* Footer row: price + rating */
.alm-card-footer {
    display: flex; align-items: baseline;
    justify-content: space-between;
    margin-top: auto; padding-top: 6px;
}
.alm-card-price {
    font-size: 20px; font-weight: 800;
    color: var(--alm-primary);
}
.alm-card-rating {
    display: flex; align-items: center; gap: 3px;
    font-size: 12px; color: var(--alm-muted);
}
.alm-card-rating .alm-icon { color: #f4a623; width: 13px; height: 13px; }

/* View details button */
.alm-card-view-btn {
    display: block; text-align: center;
    margin-top: 10px; padding: 9px 0;
    background: var(--alm-primary); color: #fff;
    border-radius: var(--alm-radius-sm);
    font-size: 13px; font-weight: 600; text-decoration: none;
    transition: background .2s;
}
.alm-card-view-btn:hover { background: var(--alm-accent); color: #fff; }

/* Loading state during AJAX */
.alm-loading { opacity: .5; pointer-events: none; transition: opacity .3s; }

/* =====================================================================
   SINGLE LISTING
   ===================================================================== */
.alm-single { padding: 32px 0 56px; background: var(--alm-bg); }

/* Two-column layout: gallery left (55%) + details right (45%) */
.alm-single-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 36px;
    align-items: start;
    margin-top: 8px;
}
@media (max-width: 960px) {
    .alm-single-layout { grid-template-columns: 1fr; }
}

/* ── Single gallery ──────────────────────────────────────────────── */
.alm-single-gallery { background: var(--alm-surface); border-radius: var(--alm-radius); overflow: hidden; box-shadow: var(--alm-shadow-sm); }
.alm-gallery-main { position: relative; aspect-ratio: 16 / 10; background: #000; overflow: hidden; cursor: zoom-in; }
.alm-gallery-main img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.alm-gallery-main:hover img { transform: scale(1.02); }

.alm-gallery-thumbs {
    display: flex; gap: 4px; padding: 8px;
    overflow-x: auto; scrollbar-width: thin;
    background: #f0f0f0;
}
.alm-gallery-thumb {
    flex-shrink: 0; width: 76px; height: 56px;
    border: 2px solid transparent; border-radius: 5px;
    overflow: hidden; cursor: pointer; padding: 0;
    transition: border-color .2s, opacity .2s;
    opacity: .7;
}
.alm-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.alm-gallery-thumb:hover,
.alm-gallery-thumb.is-active { border-color: var(--alm-accent); opacity: 1; }

/* ── Details panel ───────────────────────────────────────────────── */
.alm-single-details-col {
    background: var(--alm-surface);
    border-radius: var(--alm-radius);
    padding: 28px;
    box-shadow: var(--alm-shadow-sm);
    position: sticky; top: 20px;
}

.alm-single-ribbon {
    display: inline-block;
    background: var(--alm-accent); color: #fff;
    font-size: 11px; font-weight: 700; padding: 3px 12px;
    border-radius: 20px; margin-bottom: 10px;
    text-transform: uppercase; letter-spacing: .05em;
}

.alm-single-make { font-size: 13px; font-weight: 600; color: var(--alm-accent); margin: 0 0 4px; text-transform: uppercase; letter-spacing: .06em; }
.alm-single-title { font-size: 24px; font-weight: 800; color: var(--alm-primary); margin: 0 0 6px; line-height: 1.25; }
.alm-single-trim  { font-size: 14px; color: var(--alm-muted); margin: 0 0 12px; }
.alm-single-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

.alm-single-price-row {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--alm-border);
}
.alm-single-price {
    font-size: 32px; font-weight: 800; color: var(--alm-primary); line-height: 1;
}

/* ── Specs grid (on single page) ─────────────────────────────────── */
.alm-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--alm-border);
    border: 1px solid var(--alm-border);
    border-radius: var(--alm-radius-sm);
    overflow: hidden;
    margin-bottom: 20px;
}
.alm-spec-item {
    background: var(--alm-surface);
    padding: 12px 14px;
    display: flex; flex-direction: column; gap: 3px;
}
.alm-spec-icon { color: var(--alm-accent); font-size: 18px; line-height: 1; }
.alm-spec-icon .alm-icon { width: 18px; height: 18px; }
.alm-spec-label { font-size: 11px; color: var(--alm-muted); text-transform: uppercase; letter-spacing: .05em; }
.alm-spec-value { font-size: 14px; font-weight: 700; color: var(--alm-primary); }

/* ── Description ─────────────────────────────────────────────────── */
.alm-single-description {
    font-size: 14px; line-height: 1.7; color: #444;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--alm-border);
}
.alm-single-description h3 { font-size: 16px; font-weight: 700; margin: 0 0 10px; color: var(--alm-primary); }

/* ── CTA button ──────────────────────────────────────────────────── */
.alm-single-cta { margin-top: 4px; }
.alm-enquire-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 14px 24px;
    background: var(--alm-accent); color: #fff;
    border-radius: var(--alm-radius); font-size: 16px; font-weight: 700;
    text-decoration: none; text-align: center;
    box-shadow: 0 4px 14px rgba(233,69,96,.35);
    transition: background .2s, transform .15s, box-shadow .2s;
}
.alm-enquire-btn:hover {
    background: var(--alm-accent-dark); color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(233,69,96,.45);
}
.alm-enquire-btn .alm-icon { width: 18px; height: 18px; }

/* ── Related listings ────────────────────────────────────────────── */
.alm-related { margin-top: 48px; }
.alm-related h2 { font-size: 20px; font-weight: 700; margin: 0 0 20px; color: var(--alm-primary); }

/* ── Lightbox ────────────────────────────────────────────────────── */
#alm-lightbox {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.88);
    z-index: 99999;
    display: none;
    align-items: center; justify-content: center;
    cursor: zoom-out;
}
#alm-lightbox.is-open { display: flex; }
#alm-lb-img { max-width: 92vw; max-height: 88vh; border-radius: 6px; object-fit: contain; box-shadow: 0 8px 40px rgba(0,0,0,.5); }

/* ── Filter bar ──────────────────────────────────────────────────── */
.alm-filter-bar {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
    background: var(--alm-surface); padding: 20px;
    border-radius: var(--alm-radius); margin-bottom: 24px;
    box-shadow: var(--alm-shadow-sm); border: 1px solid var(--alm-border);
}
.alm-filter-bar input[type="text"],
.alm-filter-bar input[type="number"],
.alm-filter-bar select {
    padding: 9px 12px; border: 1px solid var(--alm-border);
    border-radius: var(--alm-radius-sm); font-size: 14px;
    color: var(--alm-text); background: var(--alm-bg);
    min-width: 130px; flex: 1;
    transition: border-color .2s, box-shadow .2s;
}
.alm-filter-bar input:focus,
.alm-filter-bar select:focus {
    outline: none; border-color: var(--alm-accent);
    box-shadow: 0 0 0 3px rgba(233,69,96,.12);
}
.alm-btn-filter, .alm-btn-reset {
    padding: 9px 18px; border-radius: var(--alm-radius-sm);
    font-size: 14px; font-weight: 600; cursor: pointer;
    text-decoration: none; white-space: nowrap;
}
.alm-btn-filter { background: var(--alm-primary); color: #fff; border: none; transition: background .2s; }
.alm-btn-filter:hover { background: var(--alm-accent); }
.alm-btn-reset { background: transparent; border: 1px solid var(--alm-border); color: var(--alm-muted); }
.alm-btn-reset:hover { border-color: var(--alm-primary); color: var(--alm-primary); }

/* =====================================================================
   ELEMENTOR WIDGET
   ===================================================================== */
.alm-elementor-widget { font-family: var(--alm-font); }

/* ── Section header ──────────────────────────────────────────────── */
.alm-section-header { margin-bottom: 32px; }
.alm-section-header--left   { text-align: left; }
.alm-section-header--center { text-align: center; }
.alm-section-header--right  { text-align: right; }

.alm-section-header--center .alm-section-title::after { left: 50%; transform: translateX(-50%); }
.alm-section-header--right  .alm-section-title::after { left: auto; right: 0; }

.alm-section-title {
    font-size: 28px; font-weight: 800;
    color: var(--alm-primary); margin: 0 0 6px;
    line-height: 1.2;
    position: relative; display: inline-block; padding-bottom: 12px;
}
/* Signature element: 3-segment accent bar */
.alm-section-title::after {
    content: '';
    position: absolute; bottom: 0; left: 0;
    width: 44px; height: 4px;
    background: var(--alm-accent);
    border-radius: 2px;
}
.alm-section-subtitle {
    margin: 8px 0 0; font-size: 15px;
    color: var(--alm-muted); line-height: 1.6;
    max-width: 540px;
}
.alm-section-header--center .alm-section-subtitle { margin-left: auto; margin-right: auto; }

/* ── Results bar ─────────────────────────────────────────────────── */
.alm-results-bar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; padding: 10px 16px;
    background: var(--alm-surface); border: 1px solid var(--alm-border);
    border-radius: var(--alm-radius-sm);
}
.alm-results-count { font-size: 13px; color: var(--alm-muted); }
.alm-results-count strong { color: var(--alm-primary); font-weight: 700; }

/* ── Showcase layout ─────────────────────────────────────────────── */
.alm-grid--showcase {
    grid-template-columns: repeat(3, 1fr);
}
/* Featured card spans 2 cols × 2 rows */
.alm-grid--showcase .alm-card--featured {
    grid-column: span 2;
    grid-row: span 2;
    position: relative;
}
/* Image taller on featured */
.alm-grid--showcase .alm-card--featured .alm-card-img {
    aspect-ratio: 16 / 11;
}
/* Featured card title larger */
.alm-grid--showcase .alm-card--featured .alm-card-title {
    font-size: 18px; white-space: normal; line-height: 1.3;
}
.alm-grid--showcase .alm-card--featured .alm-card-price {
    font-size: 24px;
}
/* Accent left border on featured */
.alm-grid--showcase .alm-card--featured {
    border-left: 3px solid var(--alm-accent);
}
@media (max-width: 768px) {
    .alm-grid--showcase .alm-card--featured {
        grid-column: span 1; grid-row: span 1;
        border-left: none;
    }
    .alm-grid--showcase .alm-card--featured .alm-card-img { aspect-ratio: 3 / 2; }
    .alm-grid--showcase .alm-card--featured .alm-card-title { font-size: 15px; }
    .alm-grid--showcase .alm-card--featured .alm-card-price { font-size: 20px; }
}

/* ── List layout ─────────────────────────────────────────────────── */
.alm-list {
    display: flex; flex-direction: column; gap: 16px;
}
.alm-card-list {
    background: var(--alm-surface);
    border: 1px solid var(--alm-border);
    border-radius: var(--alm-radius);
    box-shadow: var(--alm-shadow-sm);
    display: grid;
    grid-template-columns: 280px 1fr auto;
    gap: 0;
    overflow: hidden;
    transition: box-shadow .25s, transform .25s;
}
.alm-card-list:hover {
    box-shadow: var(--alm-shadow-hover);
    transform: translateY(-2px);
}
.alm-card-list-img {
    display: block;
    position: relative;
    overflow: hidden;
    background: var(--alm-bg);
}
.alm-card-list-img img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform .4s ease;
}
.alm-card-list:hover .alm-card-list-img img { transform: scale(1.04); }
.alm-card-list-no-img {
    width: 100%; height: 100%; min-height: 140px;
    display: flex; align-items: center; justify-content: center;
    font-size: 40px; color: var(--alm-border);
}
.alm-card-list-body {
    padding: 20px 24px;
    display: flex; flex-direction: column; gap: 6px;
    justify-content: center;
}
.alm-card-list-meta-top {
    display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.alm-card-list-make {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--alm-accent);
}
.alm-card-list-title-link { text-decoration: none; color: inherit; }
.alm-card-list-title {
    font-size: 18px; font-weight: 800; margin: 0;
    color: var(--alm-primary); line-height: 1.3;
}
.alm-card-list-title-link:hover .alm-card-list-title { color: var(--alm-accent); }
.alm-card-list-trim {
    font-size: 13px; color: var(--alm-muted); margin: 0;
}
.alm-card-list-specs {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px;
}
.alm-card-list-cta {
    padding: 20px 24px;
    display: flex; flex-direction: column; align-items: flex-end;
    justify-content: center; gap: 10px;
    border-left: 1px solid var(--alm-border);
    min-width: 170px;
}
.alm-card-list-price {
    font-size: 22px; font-weight: 800; color: var(--alm-primary);
    white-space: nowrap;
}
.alm-card-list .alm-card-view-btn {
    padding: 9px 18px; font-size: 13px; border-radius: var(--alm-radius-sm);
    width: auto;
}
.alm-heart-btn--inline {
    position: static; background: transparent;
    box-shadow: none; border-radius: 0;
    width: auto; height: auto; padding: 4px;
    color: var(--alm-muted);
}
.alm-heart-btn--inline:hover { background: transparent; color: var(--alm-accent); transform: scale(1.15); }
.alm-heart-btn--inline .alm-icon { width: 18px; height: 18px; }

@media (max-width: 960px) {
    .alm-card-list {
        grid-template-columns: 200px 1fr;
        grid-template-rows: auto auto;
    }
    .alm-card-list-cta {
        grid-column: 1 / -1; flex-direction: row;
        border-left: none; border-top: 1px solid var(--alm-border);
        padding: 14px 20px; min-width: 0;
        align-items: center; justify-content: space-between;
    }
}
@media (max-width: 600px) {
    .alm-card-list { grid-template-columns: 1fr; }
    .alm-card-list-img { aspect-ratio: 16 / 9; }
    .alm-card-list-img img { height: 100%; width: 100%; }
}
