/* ═══════════════════════════════════════════════════════════════════
   VDP Detail Page Styles
   Extracted from detail.html inline <style> + Zillow-pattern additions.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Page wrapper ────────────────────────────────────────────────── */
.vdp-page-wrap {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

.vdp-page-card {
    background: var(--card-bg, #ffffff);
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* ── Breadcrumbs ─────────────────────────────────────────────────── */
.detail-breadcrumbs {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 12px;
}
.detail-breadcrumbs a { color: var(--gray-500); }
.detail-breadcrumbs a:hover { color: var(--red-accent); }
.detail-breadcrumbs__sep { margin: 0 4px; }

/* ── Expired banner ──────────────────────────────────────────────── */
.listing-expired-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ── SVG sizing inside action/map buttons ────────────────────────── */
.vdp-seller__map svg { width: 14px; height: 14px; flex-shrink: 0; }
.vdp-footer__source svg { width: 14px; height: 14px; flex-shrink: 0; }
.vdp-footer__report svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Gallery overrides for full-page context ─────────────────────── */
.vdp-page-card .vdp-gallery { max-height: 480px; margin-top: 8px; }
.vdp-page-card .vdp-gallery__hero { max-height: 480px; }
.vdp-page-card .vdp-gallery__thumbstrip { max-height: 480px; }

/* ── Description original ad (details/summary) ──────────────────── */
.vdp-desc-original { margin-top: 10px; }
.vdp-desc-original summary {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.vdp-desc-original summary:hover { color: var(--red-accent); }
.vdp-desc-original p {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--gray-600);
    white-space: pre-line;
    margin-top: 6px;
}

/* ── Related listings ────────────────────────────────────────────── */
.vdp-related {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}
.vdp-related__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}
.vdp-related__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.vdp-related-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.vdp-related-card:hover {
    border-color: var(--gray-400);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.vdp-related-card__img {
    width: 100%;
    height: 120px;
    background: var(--warm-white);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.vdp-related-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.vdp-related-card__img--empty { color: var(--gray-300); }
.vdp-related-card__info {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.vdp-related-card__price {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--red-accent);
    margin-bottom: 2px;
}
.vdp-related-card__title {
    font-size: 0.75rem;
    color: var(--gray-700);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.vdp-related-card__loc {
    font-size: 0.6875rem;
    color: var(--gray-400);
}

/* ── Mobile sticky CTA ───────────────────────────────────────────── */
.vdp-mobile-cta { display: none; }

/* ── QA Debug Panel ──────────────────────────────────────────────── */
.qa-panel {
    background: #1a1a2e;
    color: #e0e0e0;
    border-radius: 4px;
    padding: 20px;
    margin-top: 24px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.8125rem;
}
.qa-panel__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #333;
}
.qa-panel__title { font-size: 0.9375rem; font-weight: 600; color: #ffd93d; }
.qa-panel__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.qa-panel__item { display: flex; flex-direction: column; gap: 4px; }
.qa-panel__label { color: #888; font-size: 0.6875rem; text-transform: uppercase; }
.qa-panel__value { color: #4fd1c5; }
.qa-panel__value--success { color: #68d391; }
.qa-panel__value--warning { color: #f6ad55; }
.qa-panel__value--error { color: #fc8181; }
.qa-panel__section { margin-top: 16px; padding-top: 16px; border-top: 1px solid #333; }
.qa-panel__section-title { color: #888; font-size: 0.6875rem; text-transform: uppercase; margin-bottom: 8px; }
.qa-panel__json { background: #0d0d1a; padding: 12px; border-radius: 4px; overflow-x: auto; max-height: 200px; }
.qa-panel__json pre { margin: 0; white-space: pre-wrap; word-break: break-all; }


/* ═══════════════════════════════════════════════════════════════════
   DECISION ROW — Zillow-pattern "decision moment"
   Price + magic three pills + primary CTA in one scannable row.
   ═══════════════════════════════════════════════════════════════════ */

.vdp-decision-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    flex-wrap: wrap;
}

.vdp-decision-row__left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
    flex: 1;
}

.vdp-decision-row .vdp-price {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-900, #1a1a1a);
    letter-spacing: -0.02em;
    line-height: 1;
    white-space: nowrap;
}

.vdp-decision-row .vdp-deal-badge {
    white-space: nowrap;
}

/* Magic Three pills — pipe-separated key specs */
.vdp-magic-three {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 0.9375rem;
    color: var(--gray-600, #555);
}

.vdp-magic-three__item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.vdp-magic-three__icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
    color: var(--gray-400, #999);
}
.vdp-magic-three__icon svg {
    width: 16px;
    height: 16px;
}

.vdp-magic-three__sep {
    color: var(--gray-300, #ccc);
    margin: 0 2px;
    user-select: none;
}

/* Decision row CTA */
.vdp-decision-row__cta {
    flex-shrink: 0;
}

.vdp-cta--primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
}
.vdp-cta--primary:active { transform: scale(0.97); }

.vdp-cta--primary svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* CTA variants */
.vdp-cta--whatsapp {
    background: #25D366;
    color: white;
}
.vdp-cta--whatsapp:hover { background: #1da851; }

.vdp-cta--call {
    background: var(--red-accent, #e53935);
    color: white;
}
.vdp-cta--call:hover { background: #c62828; }

.vdp-cta--source-link {
    background: var(--gray-100, #f5f5f5);
    color: var(--gray-700, #333);
    border: 1px solid var(--gray-300, #ccc);
}
.vdp-cta--source-link:hover { background: var(--gray-200, #eee); }

.vdp-cta--email-relay {
    background: var(--gray-100, #f5f5f5);
    color: var(--gray-700, #333);
    border: 1px solid var(--gray-300, #ccc);
}
.vdp-cta--email-relay:hover { background: var(--gray-200, #eee); }

/* Title demoted to subtitle below the decision row */
.vdp-title--subtitle {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-700, #333);
    padding: 0 20px;
    margin: 0 0 4px;
    line-height: 1.3;
}

/* Meta row below subtitle */
.vdp-meta--sub {
    padding: 0 20px 12px;
}

/* Market delta inline with decision row */
.vdp-decision-row .vdp-market-delta {
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}


/* ═══════════════════════════════════════════════════════════════════
   GALLERY 1+4 GRID — Zillow-style hero + 4 thumbnails
   ═══════════════════════════════════════════════════════════════════ */

.vdp-gallery--grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 4px;
    max-height: 480px;
    overflow: hidden;
    position: relative;
}

.vdp-gallery--grid .vdp-gallery__hero {
    max-height: 480px;
    position: relative;
    overflow: hidden;
}

.vdp-gallery--grid .vdp-gallery__hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vdp-gallery__grid-thumbs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
}

.vdp-gallery__grid-cell {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.vdp-gallery__grid-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.15s;
}

.vdp-gallery__grid-cell:hover img {
    opacity: 0.85;
}

/* "+N photos" overlay on last cell */
.vdp-gallery__grid-cell--more .vdp-gallery__see-all {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.45);
    color: white;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background 0.15s;
}
.vdp-gallery__grid-cell--more .vdp-gallery__see-all:hover {
    background: rgba(0,0,0,0.6);
}

/* Source badge overlay on gallery */
.vdp-gallery__source-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    padding: 3px 8px;
    background: rgba(0,0,0,0.55);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 4px;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    pointer-events: none;
}

/* Fullscreen gallery overlay */
.vdp-fullscreen-gallery {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.vdp-fullscreen-gallery__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
    line-height: 1;
    padding: 8px;
}

.vdp-fullscreen-gallery__img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
}

.vdp-fullscreen-gallery__counter {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    margin-top: 12px;
}

.vdp-fullscreen-gallery__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 4px;
}
.vdp-fullscreen-gallery__nav:hover { background: rgba(255,255,255,0.25); }
.vdp-fullscreen-gallery__nav--prev { left: 16px; }
.vdp-fullscreen-gallery__nav--next { right: 16px; }


/* ── Category placeholder SVGs (0 images) ────────────────────────── */
.vdp-no-photo--category {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 2rem;
    color: var(--gray-300);
    min-height: 200px;
}
.vdp-no-photo--category svg {
    opacity: 0.35;
}
.vdp-no-photo--category span {
    font-size: 0.875rem;
    color: var(--gray-400);
}


/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .vdp-related__grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 8px;
    }
    .vdp-related-card__img { height: 100px; }
}

@media (max-width: 768px) {
    .vdp-page-wrap { padding: 0 0 80px; }
    .vdp-page-card { border-radius: 0; box-shadow: none; }
    .vdp-page-card .vdp-gallery { border-radius: 0; max-height: 280px; }
    .vdp-page-card .vdp-gallery__hero { max-height: 280px; }
    .vdp-page-card .vdp-gallery__thumbstrip { max-height: none; }

    /* Grid gallery reverts to single-column hero on mobile */
    .vdp-gallery--grid {
        display: block;
        max-height: 280px;
    }
    .vdp-gallery--grid .vdp-gallery__grid-thumbs {
        display: none;
    }
    .vdp-gallery--grid .vdp-gallery__hero {
        max-height: 280px;
    }

    /* Decision row stacks vertically on mobile */
    .vdp-decision-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 16px;
        gap: 8px;
    }
    .vdp-decision-row__cta {
        width: 100%;
    }
    .vdp-decision-row__cta .vdp-cta--primary {
        width: 100%;
        justify-content: center;
    }
    .vdp-decision-row .vdp-price {
        font-size: 1.5rem;
    }

    .vdp-title--subtitle {
        padding: 0 16px;
        font-size: 1rem;
    }
    .vdp-meta--sub {
        padding: 0 16px 10px;
    }

    /* Mobile sticky CTA */
    .vdp-mobile-cta {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 90;
        background: var(--white);
        border-top: 1px solid var(--gray-200);
        padding: 10px 16px;
        align-items: center;
        gap: 12px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    }
    .vdp-mobile-cta__info { flex-shrink: 0; }
    .vdp-mobile-cta__price {
        font-size: 1.125rem;
        font-weight: 700;
        color: var(--red-accent);
        line-height: 1.2;
    }
    .vdp-mobile-cta__deal {
        font-size: 0.6875rem;
        font-weight: 600;
    }
    .vdp-mobile-cta__btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px 16px;
        color: white;
        border: none;
        border-radius: 8px;
        font-family: var(--font-body);
        font-size: 0.9375rem;
        font-weight: 600;
        text-decoration: none;
    }
    .vdp-mobile-cta__btn svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }
    .vdp-mobile-cta__btn:hover { opacity: 0.9; }
    .vdp-mobile-cta__btn--whatsapp { background: #25D366; }
    .vdp-mobile-cta__btn--call { background: var(--red-accent, #e53935); }
    .vdp-mobile-cta__btn--source-link {
        background: var(--gray-100, #f5f5f5);
        color: var(--gray-700, #333);
        border: 1px solid var(--gray-300, #ccc);
    }
}
