/* ============================================

   ============================================ */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; width: 100%; }

body {
    font-family: 'Ubuntu', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    color: #1a1d17;
    max-width: 100vw;
    width: 100%;
}

/* Prevent any element from causing horizontal scroll */
img, video, iframe, table, pre, form, input, select, textarea, button {
    max-width: 100%;
}

::selection { background: rgba(184, 150, 12, 0.15); color: #1a1d17; }

/* ---- Overlays ---- */
.hero-overlay {
    background: linear-gradient(180deg, rgba(0,0,0,0.30) 0%, rgba(0,0,0,0.45) 50%, rgba(0,0,0,0.60) 100%);
}

/* ---- Gradients ---- */
.gradient-dark {
    background: linear-gradient(160deg, #1a1d17 0%, #111310 100%);
}

.gradient-accent {
    background: linear-gradient(135deg, #b8960c 0%, #d4af37 100%);
}

/* ---- Shadows ---- */
.card-shadow {
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 20px rgba(0,0,0,0.06);
}
.card-shadow-lg {
    box-shadow: 0 10px 40px rgba(0,0,0,0.10);
}

/* ---- Split Section ---- */
.split-section { display: flex; min-height: 540px; }
.split-section .split-image { flex: 1; background-size: cover; background-position: center; }
.split-section .split-content { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 60px 80px; }
.split-section.split-flipped .split-content { order: -1; }
@media (max-width: 1023px) {
    .split-section { flex-direction: column; min-height: auto; }
    .split-section .split-image { min-height: 300px; }
    .split-section .split-content { padding: 40px 24px; }
    .split-section.split-flipped .split-content { order: 0; }
}
@media (max-width: 639px) {
    .split-section .split-image { min-height: 240px; }
    .split-section .split-content { padding: 32px 20px; }
    .split-section h2 { font-size: 1.75rem; }
}

/* ---- Image Boxes (AUSMAR-style) ---- */
.image-box {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}
.image-box:hover img {
    transform: scale(1.05);
}
.image-box__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.70) 0%, rgba(0,0,0,0.10) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.image-box:hover .image-box__overlay {
    opacity: 1;
}
.image-box__info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    color: white;
}
.image-box:hover .image-box__info {
    transform: translateY(0);
    opacity: 1;
}

/* ---- CTA Section ---- */
.cta-section {
    position: relative;
    overflow: hidden;
}
.cta-section .cta-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}
.cta-section .cta-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.50);
}

/* ---- Stat Card ---- */
.stat-card {
    text-align: center;
    padding: 40px 20px;
}
.stat-card__number {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    color: #1a1d17;
}
.stat-card__suffix {
    font-size: 28px;
    font-weight: 700;
    color: #b8960c;
}
.stat-card__label {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

@media (max-width: 639px) {
    .stat-card__number {
        font-size: 32px;
    }
    .stat-card {
        padding: 20px 12px;
    }
    .stat-card__label {
        font-size: 11px;
        letter-spacing: 0.05em;
    }
}

/* ---- Property Cards ---- */
.property-card {
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}
.property-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px -12px rgba(0,0,0,0.15);
}
.property-card:hover .property-card-img {
    transform: scale(1.06);
}
.property-card-img {
    transition: transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ---- List View ---- */
.property-card-list {
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}
.property-card-list:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px -12px rgba(0,0,0,0.12);
}

/* ---- Metric Badge ---- */
.metric-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: #f4f4f4;
    font-size: 11px;
    font-weight: 600;
    color: #1a1d17;
    border-radius: 2px;
}
.metric-badge strong {
    font-weight: 700;
}
.metric-badge--accent {
    background: rgba(184, 150, 12, 0.08);
    color: #b8960c;
}

/* ---- Agent Card ---- */
.agent-card {
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}
.agent-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -12px rgba(0,0,0,0.10);
}

/* ---- Scroll Reveal ---- */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.23, 1, 0.32, 1), transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}
.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}
.reveal-on-scroll.delay-1 { transition-delay: 0.1s; }
.reveal-on-scroll.delay-2 { transition-delay: 0.2s; }
.reveal-on-scroll.delay-3 { transition-delay: 0.3s; }
.reveal-on-scroll.delay-4 { transition-delay: 0.4s; }

/* ---- Filter Chips ---- */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 600;
    background: #f4f4f4;
    color: #333;
    transition: all 0.2s ease;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.filter-chip.active { background: #1a1d17; color: white; }
.filter-chip:hover { background: #e5e5e5; }
.filter-chip.active:hover { background: #2a2e24; }

/* ---- Buttons ---- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 14px 28px;
    background: #1a1d17;
    color: white;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}
.btn-primary:hover { background: #2a2e24; }

.btn-accent {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 14px 28px;
    background: #b8960c;
    color: white;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}
.btn-accent:hover { background: #d4af37; }

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 14px 28px;
    background: transparent;
    color: white;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 2px solid rgba(255,255,255,0.4);
    transition: all 0.3s ease;
    cursor: pointer;
}
.btn-outline:hover { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.6); }

.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #1a1d17;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    padding-bottom: 4px;
}
.btn-link:hover { border-bottom-color: #b8960c; color: #b8960c; }

/* ---- Focus States ---- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid #b8960c;
    outline-offset: 2px;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f4f4f4; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ---- Gallery ---- */
.gallery-thumb {
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}
.gallery-thumb:hover, .gallery-thumb.active { border-color: #b8960c; }

/* ---- Hero Search ---- */
.hero-search {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ---- Skeleton Loading ---- */
.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal-on-scroll { opacity: 1; transform: none; }
    .hero-fade-in > * { opacity: 1; transform: none; animation: none; }
    .img-load { filter: none; }
    [data-count] { opacity: 1; }
}

/* ---- Nav Glassmorphism ---- */
.nav-glass {
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    background: rgba(255, 255, 255, 0.92) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* ---- Button Active & Disabled ---- */
.btn-primary:active, .btn-accent:active, .btn-outline:active {
    transform: scale(0.97);
}
.btn-primary:disabled, .btn-accent:disabled,
.btn-primary.disabled, .btn-accent.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ---- Gold-on-White Contrast ---- */
.text-accent-dark {
    color: #8a7209;
}

/* ---- Hero Entrance ---- */
.hero-fade-in > * {
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeUp 0.7s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}
.hero-fade-in > :nth-child(1) { animation-delay: 0.15s; }
.hero-fade-in > :nth-child(2) { animation-delay: 0.35s; }
.hero-fade-in > :nth-child(3) { animation-delay: 0.55s; }
.hero-fade-in > :nth-child(4) { animation-delay: 0.75s; }

@keyframes heroFadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Image Loading Blur-up ---- */
.img-load {
    filter: blur(10px) scale(1.02);
    transition: filter 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}
.img-loaded {
    filter: blur(0) scale(1);
}

/* ---- Card Top Accent ---- */
.card-accent-top {
    position: relative;
}
.card-accent-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    right: 50%;
    height: 2px;
    background: #b8960c;
    transition: left 0.35s cubic-bezier(0.23, 1, 0.32, 1),
                right 0.35s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 1;
}
.card-accent-top:hover::before {
    left: 0;
    right: 0;
}

/* ---- Form Focus Ring ---- */
input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(184, 150, 12, 0.15);
}

/* ---- Print ---- */
@media print {
    nav, .no-print { display: none !important; }
    body { font-size: 12pt; }
}

/* ---- Mobile Responsive Improvements ---- */

/* Better touch targets on mobile */
@media (max-width: 767px) {
    /* Increase tap targets for interactive elements */
    .filter-chip { padding: 0.5rem 1rem; min-height: 40px; }
    .btn-primary, .btn-accent, .btn-outline { min-height: 48px; padding: 12px 24px; }

    /* Hero adjustments */
    .hero-fade-in h1 { line-height: 1.1; }

    /* Property card image - slightly shorter on mobile */
    .property-card .relative.h-60,
    .property-card-list .relative.h-56 { height: 200px; }

    /* Gallery thumbnails - better mobile scroll */
    .gallery-thumb { width: 72px; height: 64px; flex-shrink: 0; }

    /* Stat cards - tighter spacing */
    .stat-card { padding: 16px 8px; }

    /* CTA section - reduce vertical padding */
    .cta-section { min-height: auto; }

    /* Form inputs - bigger on mobile for touch */
    input[type="text"], input[type="email"], input[type="tel"],
    input[type="number"], input[type="url"], input[type="password"],
    select, textarea {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }

    /* Reduce footer padding on mobile */
    footer .py-16 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
    footer .py-10 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

    /* Hero search form stacking */
    .hero-search select { width: 100%; }

    /* Contact card grid on mobile - 2 cols instead of 4 */
    .card-accent-top { text-align: left; }
}

/* Prevent horizontal overflow globally */
html, body { overflow-x: hidden; max-width: 100vw; }

/* Smoother scrolling on iOS */
@supports (-webkit-touch-callout: none) {
    body { -webkit-overflow-scrolling: touch; }
}

/* ---- Header Mobile Lock ---- */
#site-header {
    max-width: 100vw;
    overflow: hidden;
}
#site-header > div {
    overflow: hidden;
}
