/* ============================================
   WILLIAMS CONNECT HOMES — Real Estate
   v7 — Tight mobile, zero wasted space
   ============================================ */

@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- Hero Desktop --- */
.hero { min-height: 100vh; padding-top: 120px; padding-bottom: 100px; }
.hero-content { max-width: 700px; }
.hero-label { animation: fadeIn 0.6s ease 0.2s both; }
.hero h1 { animation: fadeInUp 0.7s ease 0.3s both; }
.hero-text { animation: fadeInUp 0.7s ease 0.5s both; }
.hero-buttons { animation: fadeInUp 0.7s ease 0.7s both; }
.hero-buttons .btn { min-width: 220px; justify-content: center; color: #FFF !important; }
.hero-buttons .btn-secondary { border-color: var(--secondary); }
.hero-buttons .btn-secondary:hover { background: var(--secondary); }

/* --- Search Bar Desktop --- */
.property-search { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 28px 32px; margin: -50px auto 50px; position: relative; z-index: 10; max-width: 1100px; box-shadow: var(--shadow-lg); }
.property-search-form { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 12px; align-items: end; }
.property-search-form .form-group { margin-bottom: 0; }
.property-search-form .form-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 6px; }
.property-search-form .form-control { padding: 12px 14px; font-size: 0.9rem; min-height: 46px; }
.property-search-form .btn { height: 46px; min-width: 46px; padding: 0 20px; display: flex; align-items: center; justify-content: center; }

/* --- Property Grid --- */
.properties-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }

/* --- Property Card --- */
.property-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; }
.property-card:hover { transform: translateY(-6px); border-color: var(--border-accent); box-shadow: var(--shadow-glow); }
.property-card-image { position: relative; height: 220px; overflow: hidden; background: #0a0a14; }
.property-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.property-card:hover .property-card-image img { transform: scale(1.08); }
.property-card-badge { position: absolute; top: 12px; left: 12px; padding: 5px 12px; border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; z-index: 2; }
.badge-sale { background: var(--primary); color: white; }
.badge-rent { background: var(--secondary); color: white; }
.badge-shortlet { background: var(--accent); color: white; }
.badge-lease { background: #9C27B0; color: white; }
.property-card-featured { position: absolute; top: 12px; right: 12px; background: rgba(243,112,33,0.9); color: white; padding: 4px 10px; border-radius: var(--radius-sm); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; z-index: 2; }
.property-card-photos { position: absolute; bottom: 12px; right: 12px; background: rgba(0,0,0,0.7); color: white; padding: 4px 10px; border-radius: var(--radius-sm); font-size: 0.78rem; display: flex; align-items: center; gap: 4px; z-index: 2; }
.property-card-body { padding: 20px; }
.property-card-price { font-size: 1.35rem; font-weight: 700; color: var(--primary); font-family: var(--font-heading); margin-bottom: 6px; }
.property-card-price .price-freq { font-size: 0.8rem; color: var(--text-muted); font-weight: 400; }
.property-card-title { font-size: 1.05rem; font-weight: 600; color: var(--text-white); margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.property-card-title a { color: inherit; }
.property-card-title a:hover { color: var(--primary); }
.property-card-location { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 0.85rem; margin-bottom: 14px; }
.property-card-location i { color: var(--secondary); }
.property-card-specs { display: flex; gap: 16px; padding-top: 14px; border-top: 1px solid var(--border-color); flex-wrap: wrap; }
.property-card-spec { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 0.82rem; }
.property-card-spec i { color: var(--primary); }
.property-card-footer { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-top: 1px solid var(--border-color); background: rgba(0,0,0,0.15); }
.property-card-agent { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 0.82rem; }
.property-card-agent-avatar { width: 28px; height: 28px; border-radius: 50%; background: rgba(243,112,33,0.15); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; overflow: hidden; flex-shrink: 0; }
.property-card-agent-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* --- Property Detail --- */
.property-gallery { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; border-radius: var(--radius-md); overflow: hidden; height: 450px; }
.property-gallery-main { height: 100%; overflow: hidden; }
.property-gallery-main img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; transition: transform 0.3s; }
.property-gallery-main img:hover { transform: scale(1.02); }
.property-gallery-side { display: grid; grid-template-rows: 1fr 1fr; gap: 8px; }
.property-gallery-side div { overflow: hidden; position: relative; cursor: pointer; }
.property-gallery-side img { width: 100%; height: 100%; object-fit: cover; }
.property-gallery-more { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.6); color: white; text-align: center; padding: 8px; font-size: 0.85rem; font-weight: 600; }
.property-detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; margin-top: 30px; }
.property-specs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 16px; margin: 24px 0; }
.property-spec-item { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 16px; text-align: center; transition: border-color 0.3s; }
.property-spec-item:hover { border-color: var(--border-accent); }
.property-spec-item i { color: var(--primary); font-size: 1.2rem; margin-bottom: 6px; display: block; }
.property-spec-item .spec-value { font-size: 1.1rem; font-weight: 700; color: var(--text-white); }
.property-spec-item .spec-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.property-amenities { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.property-amenity { display: flex; align-items: center; gap: 6px; background: rgba(0,163,224,0.08); border: 1px solid rgba(0,163,224,0.15); padding: 6px 14px; border-radius: 20px; font-size: 0.82rem; color: var(--text-light); transition: background 0.2s; }
.property-amenity:hover { background: rgba(0,163,224,0.15); }
.property-amenity i { color: var(--accent); }
.inquiry-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 24px; position: sticky; top: 100px; }
.inquiry-card-price { font-size: 1.6rem; font-weight: 700; color: var(--primary); font-family: var(--font-heading); margin-bottom: 16px; }
.inquiry-card .btn { margin-bottom: 10px; }
.agent-card-sidebar { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 24px; text-align: center; margin-bottom: 20px; }
.agent-card-sidebar-avatar { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 12px; background: rgba(243,112,33,0.15); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 700; overflow: hidden; }
.agent-card-sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.agent-profile-header { display: flex; align-items: center; gap: 24px; margin-bottom: 30px; padding: 30px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.agent-profile-avatar { width: 100px; height: 100px; border-radius: 50%; background: rgba(243,112,33,0.15); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.agent-profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.lightbox-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.95); z-index: 9999; justify-content: center; align-items: center; }
.lightbox-overlay.active { display: flex; }
.lightbox-overlay img { max-width: 90%; max-height: 85vh; object-fit: contain; }
.lightbox-close { position: absolute; top: 16px; right: 16px; color: white; font-size: 2rem; cursor: pointer; background: none; border: none; width: 48px; height: 48px; z-index: 10000; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); color: white; font-size: 2rem; cursor: pointer; background: rgba(255,255,255,0.1); border: none; width: 48px; height: 48px; border-radius: 50%; }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.agent-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.agent-stat-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 20px; text-align: center; }
.agent-stat-value { font-size: 1.8rem; font-weight: 700; color: var(--primary); font-family: var(--font-heading); }
.agent-stat-label { color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }
.properties-pagination { display: flex; justify-content: center; gap: 4px; margin-top: 32px; }

/* ============================================
   TABLET — 1024px
   ============================================ */
@media (max-width: 1024px) {
    .property-search-form { grid-template-columns: 1fr 1fr; }
    .property-search-form .btn { grid-column: 1 / -1; width: 100%; }
    .property-detail-grid { grid-template-columns: 1fr; }
    .agent-profile-header { flex-direction: column; text-align: center; }
}

/* ============================================
   MOBILE — 768px
   ============================================ */
@media (max-width: 768px) {
    /* Hero: compact, content starts immediately */
    .hero {
        min-height: auto !important;
        padding-top: 72px !important;
        padding-bottom: 32px !important;
    }
    .hero-content {
        padding-top: 16px;
    }
    .hero-label {
        font-size: 0.68rem;
        letter-spacing: 2px;
        padding: 5px 10px;
        margin-bottom: 12px;
    }
    .hero h1 {
        font-size: 1.5rem !important;
        margin-bottom: 12px !important;
    }
    .hero-text {
        font-size: 0.88rem;
        margin-bottom: 20px;
        line-height: 1.6;
    }
    .hero-buttons {
        gap: 10px;
    }
    .hero-buttons .btn {
        min-width: unset;
        padding: 12px 24px;
        font-size: 0.85rem;
        width: 100%;
    }

    /* Search bar: clean block below hero */
    .property-search {
        margin: 20px 16px 28px !important;
        padding: 16px;
        border-radius: var(--radius-md);
    }
    .property-search-form {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .property-search-form .form-control {
        min-height: 46px;
        padding: 12px 14px;
        font-size: 0.92rem;
    }
    .property-search-form .btn {
        width: 100%;
        height: 46px;
    }
    .property-search-form .form-label {
        font-size: 0.68rem;
        margin-bottom: 3px;
    }

    /* Property cards */
    .properties-grid { grid-template-columns: 1fr; gap: 14px; }
    .property-card-image { height: 190px; }
    .property-card-body { padding: 14px; }
    .property-card-price { font-size: 1.15rem; }
    .property-card-title { font-size: 0.92rem; }

    /* Property detail */
    .property-gallery { grid-template-columns: 1fr; height: 220px; }
    .property-gallery-side { display: none; }
    .property-detail-grid { grid-template-columns: 1fr; gap: 16px; }
    .property-specs-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .property-spec-item { padding: 10px 4px; }
    .property-spec-item .spec-value { font-size: 0.95rem; }
    .property-spec-item .spec-label { font-size: 0.6rem; }
    .inquiry-card { position: static; padding: 18px; }
    .inquiry-card-price { font-size: 1.3rem; }

    /* Agent */
    .agent-profile-header { flex-direction: column; text-align: center; padding: 18px; gap: 12px; }
    .agent-profile-avatar { width: 70px; height: 70px; font-size: 1.8rem; }
    .agent-stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .agent-stat-card { padding: 12px; }
    .agent-stat-value { font-size: 1.2rem; }

    /* Features 2-col on mobile */
    .features-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .feature-item { padding: 16px 10px; }
    .feature-item-icon { width: 44px; height: 44px; font-size: 1rem; margin-bottom: 10px; }
    .feature-item h4 { font-size: 0.88rem; margin-bottom: 4px; }
    .feature-item p { font-size: 0.78rem; line-height: 1.5; }
}

/* ============================================
   SMALL MOBILE — 480px
   ============================================ */
@media (max-width: 480px) {
    .hero {
        padding-top: 68px !important;
        padding-bottom: 24px !important;
    }
    .hero-content { padding-top: 12px; }
    .hero h1 { font-size: 1.35rem !important; }
    .hero-text { font-size: 0.84rem; margin-bottom: 16px; }
    .hero-label { font-size: 0.62rem; }
    .hero-buttons .btn { padding: 11px 18px; font-size: 0.82rem; }

    .property-search { margin: 16px 12px 20px !important; padding: 12px; }

    .property-card-image { height: 170px; }
    .property-card-body { padding: 12px; }
    .property-card-price { font-size: 1.05rem; }
    .property-card-spec { font-size: 0.72rem; }
    .property-specs-grid { grid-template-columns: 1fr 1fr; }

    .features-grid { grid-template-columns: 1fr; }
    .division-card { padding: 18px !important; }
}
