/* ALSearch - Custom Styles */

/* ─── Site accent ───
   Fallback = the default theme accent; the real value is emitted by _SiteChromeHead's
   :root (rendered after this stylesheet) from the site's selected theme + color overrides. */
:root {
    --accent: #B4552D;
}

/* Accent-driven UI: primary CTAs and interactive highlights follow the site's accent
   while neutral grays/whites stay put. Hover shades derive via color-mix. */
.al-accent-btn {
    background: var(--accent);
    color: #fff;
}
.al-accent-btn:hover {
    background: color-mix(in srgb, var(--accent) 85%, #000);
}
.al-accent-link {
    color: var(--accent);
}
.al-accent-link:hover {
    color: color-mix(in srgb, var(--accent) 75%, #000);
}
.al-accent-chip {
    background: color-mix(in srgb, var(--accent) 8%, #fff);
    color: color-mix(in srgb, var(--accent) 70%, #000);
    border-color: color-mix(in srgb, var(--accent) 30%, #fff);
}
.al-accent-chip-icon {
    color: color-mix(in srgb, var(--accent) 55%, #fff);
}
.al-accent-pill {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.al-accent-focus:focus {
    --tw-ring-color: var(--accent);
}
.al-accent-icon-tile {
    background: color-mix(in srgb, var(--accent) 10%, #fff);
    color: var(--accent);
}

/* Scrollbar styling */
.al-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.al-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.al-scrollbar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}
.al-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Modal scrollbar */
.al-modal-scroll::-webkit-scrollbar {
    width: 4px;
}
.al-modal-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.al-modal-scroll::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 2px;
}

/* Dual range slider */
.al-range-track {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

/* Fade in animation */
@keyframes al-fade-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.al-fade-in {
    animation: al-fade-in 0.2s ease-out;
}

@keyframes al-slide-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.al-slide-up {
    animation: al-slide-up 0.15s ease-out;
}

/* Map marker tooltip arrow */
.al-marker-arrow {
    width: 8px;
    height: 8px;
    transform: rotate(45deg);
    margin-top: -4px;
}

/* Placeholder image background */
.al-img-placeholder {
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
}

/* Smooth transitions for filter chips */
.al-chip {
    transition: all 0.15s ease-out;
}

/* Toggle switch */
.al-toggle {
    transition: background-color 0.2s ease;
}
.al-toggle-dot {
    transition: transform 0.2s ease;
}

/* Loading skeleton pulse */
@keyframes al-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.al-skeleton {
    animation: al-pulse 1.5s ease-in-out infinite;
    background: #e5e7eb;
    border-radius: 8px;
}

/* Property card hover lift */
.al-card-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.al-card-lift:hover {
    transform: translateY(-2px);
}

/* Hide scrollbar (for mobile horizontal scroll) */
.scrollbar-none {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-none::-webkit-scrollbar {
    display: none;
}

/* Smooth touch scrolling */
.touch-scroll {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

/* Bottom sheet slide up */
@keyframes al-sheet-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.al-sheet-up {
    animation: al-sheet-up 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

/* Full-screen overlay slide up */
@keyframes al-overlay-up {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.al-overlay-up {
    animation: al-overlay-up 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

/* Sub-screen slide in from right (for mobile overlay transitions) */
@keyframes al-screen-right-in {
    from { transform: translateX(30%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.al-screen-right {
    animation: al-screen-right-in 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

/* Hamburger drawer slide in from left */
@keyframes al-slide-right {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}
.al-slide-right {
    animation: al-slide-right 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

/* Draw mode cursor */
.al-draw-cursor {
    cursor: crosshair !important;
}
.al-draw-cursor * {
    cursor: crosshair !important;
}

/* ─── Listing Detail: Photo Grid ─── */
.al-photo-grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    grid-template-rows: 210px 210px;
    gap: 4px;
    height: 420px;
    border-radius: 12px;
    overflow: hidden;
}
.al-photo-grid .al-photo-main {
    grid-row: 1 / 3;
}
.al-photo-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

/* ─── Listing Detail: Description Clamp ─── */
.al-desc-clamp {
    max-height: 6em;
    overflow: hidden;
    position: relative;
}
.al-desc-clamp.al-expanded {
    max-height: none;
}
.al-desc-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3em;
    background: linear-gradient(transparent, white);
    pointer-events: none;
}

/* ─── Listing Detail: 7-Photo Grid (GoodView 4-column layout) ─── */
.al-photo-grid-7 {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4px;
    height: 440px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}
.al-photo-grid-7 .al-photo-grid-7-main {
    height: 100%;
}
.al-photo-grid-7-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: 100%;
}
.al-photo-grid-7-cell {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    cursor: pointer;
}
.al-photo-grid-7 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: filter 0.15s ease;
}
.al-photo-grid-7 img:hover {
    filter: brightness(0.92);
}
/* Overlay button containers */
.al-photo-grid-7-buttons-left {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 10;
}
.al-photo-grid-7-buttons-right {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 10;
}
.al-photo-grid-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.al-photo-grid-btn:hover {
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* ─── Listing Detail: Lazy Photo Placeholder ─── */
.al-lazy-photo {
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    min-height: 120px;
}

/* ─── Listing Detail: Gallery Scroll Area ─── */
.al-gallery-scroll::-webkit-scrollbar {
    width: 8px;
}
.al-gallery-scroll::-webkit-scrollbar-track {
    background: #f9fafb;
}
.al-gallery-scroll::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}
.al-gallery-scroll::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
.al-gallery-scroll {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f9fafb;
}

/* ─── Listing Detail: Street View Container ─── */
#gallery-streetview-container {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

/* ─── Listing Detail: Tab Bar (GoodView-style) ─── */
.al-tab-item {
    position: relative;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    background: none;
    flex-shrink: 0;
    transition: color 0.15s ease;
}
.al-tab-item:hover {
    color: #374151;
}
.al-tab-item--active {
    color: #111827;
}
.al-tab-item--active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px 2px 0 0;
}

/* ─── Listing Detail: Sticky Header Slide ─── */
.al-sticky-header {
    transform: translateY(-100%);
    transition: transform 0.25s ease;
}
.al-sticky-header.al-visible {
    transform: translateY(0);
}

/* ─── Listing Detail: Share Toast ─── */
/* "Link copied" flash on a listing card's share button (PropertyCard / MobileBottomSheet) */
.al-copied-tip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    background: #111827;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 5px 8px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 5;
    animation: al-toast-in 0.15s ease-out;
}
.al-copied-tip-below {
    bottom: auto;
    top: calc(100% + 6px);
}
@keyframes al-toast-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.al-toast {
    animation: al-toast-in 0.2s ease-out;
}

/* Floating Map button fade transition */
.al-fade-map-btn-enter-active,
.al-fade-map-btn-leave-active {
    transition: opacity 0.2s ease;
}
.al-fade-map-btn-enter-from,
.al-fade-map-btn-leave-to {
    opacity: 0;
}

/* ─── Safari safe-area / dynamic viewport ─── */
/* Use dvh so the app height accounts for Safari's collapsible toolbar.
   The first declaration is the fallback for browsers without dvh support. */
.al-app-shell {
    height: 100vh;
    height: 100dvh;
}

/* Utility: add safe-area padding at the bottom (for scrollable content areas) */
.al-safe-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Mobile: lift floating controls above browser UI */
.al-mobile-bottom-controls {
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px) + 56px);
}

/* Body scroll lock for lightbox */
body.al-no-scroll {
    overflow: hidden;
}

/* ─── VOW / sold blur gate (platform "vowsold" parity) ───
   Sold listing data shown to anonymous/unconfirmed visitors is CSS-blurred with a
   register overlay, matching the live platform's blur8/blur5 + vowsold-* classes.
   The values remain in the DOM — same as the platform. */
.al-vow-blur {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
}
.al-vow-blur-sm {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
}
/* Blur every image inside a container (photo grids / carousels) */
.al-vow-blur-imgs img {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
}
.al-vow-tint {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(to bottom, rgba(0,0,0,0.75), rgba(0,0,0,0.35) 55%, rgba(0,0,0,0.15));
    pointer-events: none;
    z-index: 2;
}
.al-vow-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff;
    text-align: center;
    padding: 12px;
    z-index: 3;
}
.al-vow-overlay .al-vow-lock {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.al-vow-overlay .al-vow-msg {
    font-size: 13px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.al-vow-overlay .al-vow-cta {
    background: #fff;
    color: #222;
    font-weight: 700;
    font-size: 13px;
    border-radius: 6px;
    padding: 7px 18px;
    min-width: 170px;
    cursor: pointer;
    border: none;
}
.al-vow-overlay .al-vow-cta:hover {
    background: color-mix(in srgb, var(--accent) 12%, #fff);
}

/* ═══ Themed site footer inside the list view's scroll container ═══
   The container has p-3 (12px) / sm:p-4 (16px) padding — negative margins let the
   footer bleed edge-to-edge like on the shell pages. */
.al-list-footer { margin: 24px -12px -12px; }
@media (min-width: 640px) { .al-list-footer { margin: 32px -16px -16px; } }
.al-list-footer .site-footer { margin-top: 0; }

/* Split/List/Map view-toggle labels: icons only ≤1070px (the desktop header
   disappears entirely at mobile widths, so mobile is unaffected). */
@media (max-width: 1070px) { .al-vt-label { display: none; } }
