/* ===== STICKY HEADER FIX ===== */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    position: relative;
    width: 100%;
}

html {
    scroll-behavior: smooth;
}

body {
    display: block;
    width: 100%;
    overflow-x: hidden;
}

/* CRITICAL: Override parent's flex and positioning */
body > div.group\\/design-root,
div.group\\/design-root {
    position: static !important;
    display: block !important;
    width: 100% !important;
    min-height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    flex-direction: column !important;
}

/* Fixed header container - BREAK IT OUT OF FLEX */
#header-placeholder {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    z-index: 9999 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    display: block !important;
    overflow: visible !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    flex-basis: auto !important;
}

/* Ensure header element displays properly and keep its centering */
#header-placeholder header {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Mobile menu stays inside header-placeholder but also fixed */
#header-placeholder #mobile-menu {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 40 !important;
}

/* Push content down to make room for fixed header */
main,
#property-details-container-wrapper {
    padding-top: 100px !important;
    margin-top: 0 !important;
    position: relative !important;
    z-index: 1 !important;
}

.layout-container {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}


nav a.active {
    color: #eda75a;
}

select.appearance-none {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* --- Nearby Places Styles --- */
#nearby-filters-container .swiper-slide {
    width: auto; /* Let the slide size to its content */
}

#nearby-filters-container label {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb; /* dark:border-gray-700 */
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10+ */
    user-select: none; /* Standard syntax */
}

#nearby-filters-container input[type="checkbox"] {
    display: none; /* Hide the actual checkbox */
}

#nearby-filters-container input[type="checkbox"]:checked + span {
    /* The span is a sibling, so we can't directly style the label. We rely on JS to add a class, or style the span inside */
}

/* A better approach is to not hide the checkbox but style it. However, to match the example, we hide it. Let's style the label when the input inside is checked. */
#nearby-filters-container label:has(input:checked) {
    background-color: #eda75a; /* Primary color */
    border-color: #eda75a;
    color: white;
}

/* Custom Scrollbar for Nearby List */
#nearby-places-list::-webkit-scrollbar {
  width: 6px;
}
#nearby-places-list::-webkit-scrollbar-track {
  background: transparent;
}
#nearby-places-list::-webkit-scrollbar-thumb {
  background-color: #e5e7eb; /* A light gray */
  border-radius: 20px;
}
.dark #nearby-places-list::-webkit-scrollbar-thumb {
    background-color: #4b5563; /* A darker gray for dark mode */
}

/* LINE Green */
.bg-line-green {
    background-color: #00B900;
}

/* ===== LOADING ANIMATION ===== */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.dark #loading-overlay {
    background-color: rgba(30, 30, 30, 0.95);
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: #eda75a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.dark .spinner {
    border-color: #4b5563;
    border-top-color: #eda75a;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 0.95rem;
    color: #666;
    font-weight: 500;
}

.dark .loading-text {
    color: #ccc;
}

/* ===== PROPERTY CARD LAYOUT FIXES ===== */
.property-card-title {
    line-height: 1.25;
    min-height: 2.5em;
}

.price-original {
    min-height: 1.25em;
}

.price-original--placeholder {
    visibility: hidden;
}
