/* ==========================================================================
   Yapishtir V3 Signature Design + Free V4 Smart Layer (Round 342–345)
   Warm Ivory (#faf9f5) + Deep Forest (#14532d) + Corona Amber (#ffc107)
   Photo-first cards with mini-gallery, Quick View drawer, Split-Map,
   Smart Search chips, and Market Price Deal Badges.
   ========================================================================== */

:root {
    --v3-ivory: #faf9f5;
    --v3-ivory-card: #ffffff;
    --v3-forest: #14532d;
    --v3-forest-hover: #0f3f22;
    --v3-forest-soft: rgba(20, 83, 45, 0.09);
    --v3-amber-soft: #fef3c7;
    --v3-amber-ink: #92400e;
    --v3-glass-bg: rgba(15, 23, 42, 0.72);
    --v3-glass-border: rgba(255, 255, 255, 0.22);
}

/* Warm Ivory Canvas in Light Mode for Home & Catalog */
html:not([data-theme="dark"]):not(.dark) body:has(main.home-main-container),
html:not([data-theme="dark"]):not(.dark) body:has(main.catalog-main-container) {
    background-color: var(--v3-ivory);
}

.home-main-container .home-hero {
    background: linear-gradient(135deg, #ffffff 0%, #f5f3ea 100%);
    border-color: rgba(20, 83, 45, 0.14);
}

html[data-theme="dark"] .home-main-container .home-hero,
html.dark .home-main-container .home-hero {
    background: linear-gradient(135deg, #111827 0%, #0f1f17 100%);
    border-color: rgba(34, 197, 94, 0.2);
}

/* ---- V3 Photo-First Borderless Listing Cards ---------------------------- */
.home-main-container .card,
.catalog-main-container .card {
    background: var(--v3-ivory-card);
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.18s ease;
}

.home-main-container .card:hover,
.catalog-main-container .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 26px rgba(20, 83, 45, 0.11);
    border-color: rgba(20, 83, 45, 0.28);
}

html[data-theme="dark"] .home-main-container .card,
html[data-theme="dark"] .catalog-main-container .card,
html.dark .home-main-container .card,
html.dark .catalog-main-container .card {
    background: var(--surface, #111827);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.card-media {
    border-radius: 14px 14px 0 0;
}

/* Mini-gallery dots on multi-photo cards */
.v3-mini-dots {
    position: absolute;
    inset-inline: 0;
    bottom: 8px;
    display: flex;
    justify-content: center;
    gap: 5px;
    z-index: 4;
    pointer-events: auto;
}

.v3-mini-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: width 0.16s ease, background-color 0.16s ease;
}

.v3-mini-dot.is-active {
    width: 16px;
    background: #ffc107;
}

/* Quick View trigger pill on card */
.v3-quick-view-btn {
    position: relative;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(20, 83, 45, 0.22);
    background: var(--v3-forest-soft);
    color: var(--v3-forest);
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.v3-quick-view-btn:hover {
    background: var(--v3-forest);
    color: #ffffff;
}

html[data-theme="dark"] .v3-quick-view-btn,
html.dark .v3-quick-view-btn {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(134, 239, 172, 0.35);
    color: #86efac;
}

/* Free V4 Market Price Deal Badge */
.v4-deal-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #dcfce7;
    color: #14532d;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

html[data-theme="dark"] .v4-deal-badge,
html.dark .v4-deal-badge {
    background: rgba(21, 128, 61, 0.28);
    color: #86efac;
}

/* ---- Free V4 Smart Search Applied Chips Bar ----------------------------- */
.v4-smart-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    padding: 10px 14px;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(20, 83, 45, 0.08), rgba(255, 193, 7, 0.12));
    border: 1px solid rgba(20, 83, 45, 0.2);
    font-size: 0.84rem;
}

.v4-smart-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    color: var(--v3-forest);
}

.v4-smart-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid rgba(20, 83, 45, 0.2);
    color: #0f172a;
    font-weight: 700;
    font-size: 0.78rem;
}

html[data-theme="dark"] .v4-smart-bar,
html.dark .v4-smart-bar {
    background: rgba(20, 83, 45, 0.22);
    border-color: rgba(134, 239, 172, 0.28);
}

html[data-theme="dark"] .v4-smart-title,
html.dark .v4-smart-title {
    color: #86efac;
}

html[data-theme="dark"] .v4-smart-chip,
html.dark .v4-smart-chip {
    background: #1e293b;
    border-color: rgba(134, 239, 172, 0.3);
    color: #f8fafc;
}

/* ---- V3 Live Split-Map Layout (Desktop >= 1024px) ----------------------- */
.v3-split-map-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

@media (min-width: 1024px) {
    .v3-split-map-shell {
        grid-template-columns: minmax(0, 54%) minmax(0, 46%);
    }

    .v3-split-map-pane {
        position: sticky;
        top: 86px;
    }

    .v3-split-list-pane .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Airbnb-style emerald/amber price pins on Split-Map */
.v3-map-pin-wrap {
    background: transparent !important;
    border: none !important;
}

.v3-map-pin {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--v3-forest);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.28);
    border: 2px solid #ffffff;
    transition: transform 0.14s ease, background-color 0.14s ease, color 0.14s ease;
    font-variant-numeric: tabular-nums;
}

.v3-map-pin:hover,
.v3-map-pin.is-highlighted {
    background: #ffc107;
    color: #0f172a;
    transform: scale(1.14);
    z-index: 999;
}

/* ---- V3 Airbnb-style Single-Row Category Rail (Catalog) ----------------- */
.v3-cat-rail {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 2px 12px;
    margin-bottom: 10px;
}

.v3-cat-rail::-webkit-scrollbar {
    display: none;
}

.v3-cat-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    color: #1e293b;
    font-size: 0.83rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.14s ease;
}

.v3-cat-pill:hover {
    border-color: var(--v3-forest);
    color: var(--v3-forest);
    transform: translateY(-1px);
}

.v3-cat-pill.is-active {
    background: var(--v3-forest);
    border-color: var(--v3-forest);
    color: #ffc107;
}

html[data-theme="dark"] .v3-cat-pill,
html.dark .v3-cat-pill {
    background: #111827;
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

html[data-theme="dark"] .v3-cat-pill.is-active,
html.dark .v3-cat-pill.is-active {
    background: #15803d;
    border-color: #15803d;
    color: #ffffff;
}

/* ---- Free V4 Smart Search Hint Chips (Home Hero) ------------------------ */
.v4-hero-hints {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
}

.v4-hero-hint-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted, #475569);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.v4-hero-hint-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(20, 83, 45, 0.08);
    border: 1px solid rgba(20, 83, 45, 0.18);
    color: var(--v3-forest);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.v4-hero-hint-chip:hover {
    background: var(--v3-forest);
    color: #ffffff;
}

html[data-theme="dark"] .v4-hero-hint-chip,
html.dark .v4-hero-hint-chip {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(134, 239, 172, 0.3);
    color: #86efac;
}

/* ---- V3 Quick View Slide-Over Drawer ------------------------------------ */
.v3-qv-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.54);
    backdrop-filter: blur(3px);
    z-index: 1200;
    display: flex;
    justify-content: flex-end;
}

.v3-qv-backdrop[hidden] {
    display: none;
}

.v3-qv-drawer {
    width: min(460px, 100vw);
    height: 100%;
    background: #ffffff;
    color: #0f172a;
    display: flex;
    flex-direction: column;
    box-shadow: -12px 0 36px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

html[data-theme="dark"] .v3-qv-drawer,
html.dark .v3-qv-drawer {
    background: #0f172a;
    color: #f8fafc;
}

.v3-qv-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border, #e2e8f0);
}

.v3-qv-close {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--border, #e2e8f0);
    background: transparent;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
}

.v3-qv-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 18px;
}

.v3-qv-hero {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 14px;
    background: #e2e8f0;
}

.v3-qv-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    overflow-x: auto;
}

.v3-qv-thumb {
    width: 56px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.75;
}

.v3-qv-thumb.is-active {
    border-color: var(--v3-forest);
    opacity: 1;
}

.v3-qv-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--v3-forest);
    margin: 12px 0 4px;
    font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .v3-qv-price,
html.dark .v3-qv-price {
    color: #86efac;
}

.v3-qv-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 700;
}

.v3-qv-meta {
    font-size: 0.85rem;
    color: var(--muted, #475569);
    margin-bottom: 10px;
}

.v3-qv-desc {
    font-size: 0.88rem;
    line-height: 1.6;
    white-space: pre-line;
    margin: 10px 0 14px;
}

.v3-qv-intermediary {
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--v3-forest-soft);
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--v3-forest);
}

html[data-theme="dark"] .v3-qv-intermediary,
html.dark .v3-qv-intermediary {
    background: rgba(21, 128, 61, 0.18);
    color: #bbf7d0;
}

.v3-qv-foot {
    display: flex;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid var(--border, #e2e8f0);
}

.v3-qv-foot a {
    flex: 1 1 0;
    text-align: center;
    padding: 11px 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
}

.v3-qv-btn-primary {
    background: var(--v3-forest);
    color: #ffffff;
}

.v3-qv-btn-outline {
    border: 1.5px solid var(--v3-forest);
    color: var(--v3-forest);
}

html[data-theme="dark"] .v3-qv-btn-outline,
html.dark .v3-qv-btn-outline {
    border-color: #86efac;
    color: #86efac;
}

/* Free V4 Short Video Preview on Cards (Round 345) */
.v4-video-pill {
    position: absolute;
    inset-inline-end: 8px;
    bottom: 8px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    color: #ffc107;
    font-size: 0.7rem;
    font-weight: 800;
}

.v4-card-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.card:hover .v4-card-video.is-playing {
    opacity: 1;
}

/* Free V4 Quick View Inline Offer & Voice Search (Round 347) */
.v4-qv-offer-box {
    margin: 12px 0;
    padding: 12px;
    border-radius: 12px;
    background: var(--v3-ivory, #faf9f5);
    border: 1px solid rgba(20, 83, 45, 0.18);
}

.v4-qv-offer-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--v3-forest);
    margin-bottom: 6px;
}

.v4-qv-offer-row {
    display: flex;
    gap: 8px;
}

.v4-qv-offer-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border, #cbd5e1);
    background: #ffffff;
    color: #0f172a;
    font-size: 0.88rem;
}

.v4-qv-offer-btn {
    flex: 0 0 auto;
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    background: #ffc107;
    color: #0f172a;
    font-weight: 800;
    font-size: 0.84rem;
    cursor: pointer;
}

.v4-qv-offer-msg {
    margin: 6px 0 0;
    font-size: 0.78rem;
    font-weight: 700;
}
.v4-qv-offer-msg.is-ok { color: #15803d; }
.v4-qv-offer-msg.is-err { color: #dc2626; }

html[data-theme="dark"] .v4-qv-offer-box,
html.dark .v4-qv-offer-box {
    background: #111827;
    border-color: rgba(134, 239, 172, 0.25);
}
html[data-theme="dark"] .v4-qv-offer-label,
html.dark .v4-qv-offer-label { color: #86efac; }
html[data-theme="dark"] .v4-qv-offer-input,
html.dark .v4-qv-offer-input {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

.v4-voice-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.v4-voice-wrap input {
    width: 100%;
    padding-inline-end: 38px;
}

.v4-voice-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--v3-forest);
    cursor: pointer;
    flex: 0 0 auto;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.v4-voice-wrap .v4-voice-btn {
    position: absolute;
    inset-inline-end: 4px;
}

.v4-voice-btn:hover {
    background: var(--v3-forest-soft);
}

.v4-voice-btn.is-listening {
    background: #dc2626;
    color: #ffffff;
    animation: v4PulseMic 1s infinite;
}

html[data-theme="dark"] .v4-voice-btn,
html.dark .v4-voice-btn {
    color: #86efac;
}

@keyframes v4PulseMic {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); }
    50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}
