/* custom-realestate.css */
/* Extensions and Overrides for ChennaiBuilders.com */

:root {
    --primary: #C8102E; /* Red/Maroon as requested */
    --primary-light: #E02341;
    --primary-dark: #A00B23;
}

/* Brand Logo */
.brand-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.brand-tagline {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* Search Tabs */
.search-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    width: 100%;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

.tab-btn.active, .tab-btn:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Search Form Grid for Real Estate */
.search-form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
    align-items: center;
}

.search-form-grid .search-input-group {
    flex: 2;
    min-width: 250px;
}

.search-form-grid .filter-group {
    flex: 1;
    min-width: 160px;
}

/* Hero bg adjusted for property */
.property-hero {
    background-color: #f1f5f9;
    /* Optional: add a real background image here later */
    background-image: linear-gradient(rgba(255,255,255,0.85), rgba(255,255,255,0.95)), url('../images/photo-1545324418.jpg');
    background-size: cover;
    background-position: center;
}

/* Quick Actions */
.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: -3rem; /* pull up over hero */
    position: relative;
    z-index: 20;
}

.action-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.action-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.bg-blue { background-color: #E0E7FF; color: #4F46E5; }
.bg-green { background-color: #D1FAE5; color: #059669; }
.bg-orange { background-color: #FEF3C7; color: #D97706; }
.bg-purple { background-color: #EDE9FE; color: #7C3AED; }

.action-card h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.action-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Why Choose Us Features Grid */
.why-us {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-box {
    text-align: center;
    padding: 2rem;
    background: var(--bg-main);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-sm);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.feature-box h4 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.feature-box p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.cta-content p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.cta-section .btn-primary {
    background-color: white;
    color: var(--primary);
}

.cta-section .btn-primary:hover {
    background-color: #f8f9fa;
    transform: scale(1.05);
}

/* Updated Property Card overrides */
.property-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    margin: -1.5rem -1.5rem 1rem -1.5rem;
    width: calc(100% + 3rem);
}

.price-tag {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.property-details {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    padding: 0.8rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.property-detail-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Adjust layout responsively */
@media (max-width: 768px) {
    .search-form-grid {
        flex-direction: column;
        align-items: stretch;
    }
}

/* --- Project Detail Page Styles --- */

.project-hero {
    background-color: var(--bg-main);
    background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.7)), url('../images/photo-1600596542815.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 6rem 0 4rem 0;
}

.project-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.project-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
    margin-top: -3rem; /* overlap hero */
    z-index: 10;
    position: relative;
}

@media (max-width: 992px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }
}

.main-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    border: 1px solid var(--border-color);
}

/* Sections inside main content */
.detail-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-section h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.overview-text {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Pricing Table */
.pricing-table-container {
    overflow-x: auto;
}
.pricing-table {
    width: 100%;
    border-collapse: collapse;
}
.pricing-table th, .pricing-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.pricing-table th {
    background: var(--bg-main);
    color: var(--text-secondary);
    font-weight: 600;
}
.pricing-table tr:hover {
    background: #f8fafc;
}

/* Amenities Grid */
.amenities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}
.amenity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.amenity-icon {
    font-size: 1.5rem;
    background: var(--bg-main);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.gallery-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}
.gallery-grid img:first-child {
    grid-column: 1 / -1;
    height: 300px;
}
.gallery-grid img:hover {
    transform: scale(1.02);
}

/* Map Container */
.map-container iframe {
    width: 100%;
    height: 300px;
    border: none;
    border-radius: var(--radius-md);
}

/* Sidebar */
.sticky-sidebar {
    position: sticky;
    top: 90px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
    align-self: start;
}

.sticky-sidebar h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.sticky-sidebar p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* --- Builder Components --- */

.builder-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-main);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.builder-logo-min {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.builder-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}
.builder-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.builder-card-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem auto;
    border: 2px solid var(--bg-main);
}

.builder-card h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.builder-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Email Modal Styles (Shared) --- */
.modal-overlay-email {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}
.modal-overlay-email.active { display: flex; }
.email-modal {
    background: white;
    width: 100%;
    max-width: 550px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}
.email-header {
    background: #1F2937;
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.email-body { padding: 2rem; }
.email-preview-box {
    background: #F9FAFB;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
}

/* ── Admin Sidebar — overflow & text clipping ──────────────── */
.admin-layout .sidebar {
    overflow: hidden;          /* clip anything wider than 250 px */
    flex-shrink: 0;            /* never compress the panel itself */
}

/* Nav links only — exclude the brand logo */
.admin-layout .sidebar a:not(.brand-logo),
aside.sidebar a:not(.brand-logo) {
    display: flex !important;  /* override inline display:block    */
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;              /* allow flex children to shrink   */
}

/* Brand logo — allow normal wrapping, never clip */
.admin-layout .sidebar .brand-logo,
aside.sidebar .brand-logo {
    white-space: normal;
    overflow: visible;
    display: flex;
}

/* Scale down logo text slightly to fit the 250px panel */
aside.sidebar .brand-logo .logo-text {
    font-size: 1.25rem !important;
}

/* ============================================================
   RESPONSIVE DESIGN — ChennaiBuilders.com
   Breakpoints:
     ≤1024px  Desktop-small / large tablet landscape
     ≤768px   Tablet / mobile landscape
     ≤640px   Small tablet / large phone
     ≤480px   Mobile portrait
   ============================================================ */

/* ── 1024px ── Large tablet / small desktop ──────────────── */
@media (max-width: 1024px) {
    /* Listings grid: 2 columns */
    .listings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    /* Project detail: sidebar drops below main */
    .detail-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .sticky-sidebar {
        position: static;
    }

    /* Admin / Builder-Admin sidebar: narrower */
    .sidebar {
        width: 220px;
    }

    .admin-content {
        padding: 2rem 1.5rem;
    }

    /* Hero title */
    .hero-title {
        font-size: 3rem;
    }

    /* CTA heading */
    .cta-content h2 {
        font-size: 2rem;
    }

    /* Project hero heading */
    .project-hero h1 {
        font-size: 2.5rem;
    }
}

/* ── 768px ── Tablet / landscape phone ───────────────────── */
@media (max-width: 768px) {

    /* ── Navbar ── */
    .navbar-content {
        position: relative;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 0.5rem 0 1rem;
        box-shadow: var(--shadow-md);
        border-bottom: 1px solid var(--border-color);
        z-index: 200;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links .nav-link,
    .nav-links .btn {
        width: 100%;
        padding: 0.85rem 1.5rem;
        border-radius: 0;
        margin: 0;
        text-align: left;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links .btn {
        border-radius: 0;
        justify-content: flex-start;
    }

    .menu-toggle {
        display: flex;
    }

    /* Hamburger → X animation */
    .menu-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-toggle.open span:nth-child(2) { opacity: 0; }
    .menu-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* ── Hero ── */
    .hero {
        padding: 3.5rem 0;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    /* ── Search panel ── */
    .glass-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .search-form-grid {
        flex-direction: column;
    }

    .search-form-grid .search-input-group,
    .search-form-grid .filter-group,
    #searchBtn {
        width: 100%;
        min-width: unset;
    }

    /* ── Action cards: 1 column on tablet ── */
    .action-cards {
        grid-template-columns: repeat(2, 1fr);
        margin-top: -1.5rem;
    }

    /* ── Listings grid: 1 column ── */
    .listings-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    /* ── Features grid: 2 cols ── */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
        margin-top: 2rem;
    }

    /* ── Section headers ── */
    .section-title {
        font-size: 1.8rem;
    }

    .section-desc {
        font-size: 1rem;
    }

    /* ── Project hero ── */
    .project-hero {
        padding: 4rem 0 3rem;
    }

    .project-hero h1 {
        font-size: 2rem;
    }

    /* ── Detail layout already 1-col via ≤992px rule in file ── */
    .main-content {
        padding: 1.5rem;
    }

    /* ── Gallery: single column ── */
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid img:first-child {
        height: 220px;
    }

    /* ── Admin / Builder-Admin: sidebar collapses to top bar ── */
    .admin-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
        padding: 1rem;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        overflow-x: auto;
    }

    .sidebar a {
        margin-bottom: 0;
        padding: 0.5rem 0.9rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* Hide sidebar label text on mobile */
    .sidebar > div {
        display: none;
    }

    .admin-content {
        padding: 1.5rem 1rem;
    }

    /* Dashboard stat grid: 2 cols */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin-bottom: 2rem;
    }

    /* ── Forms ── */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-card {
        padding: 1.5rem;
    }

    /* ── CTA ── */
    .cta-content h2 {
        font-size: 1.75rem;
    }

    .cta-content p {
        font-size: 1rem;
    }

    /* ── Footer ── */
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
    }

    .footer-brand {
        max-width: 100%;
    }

    /* ── Page header ── */
    .page-title {
        font-size: 1.75rem;
    }

    /* ── Email modal ── */
    .email-modal {
        width: 95%;
    }

    .email-body {
        padding: 1.5rem;
    }
}

/* ── 640px ── Small tablet / large phone ─────────────────── */
@media (max-width: 640px) {

    /* ── Hero ── */
    .hero {
        padding: 2.5rem 0;
    }

    .hero-title {
        font-size: 1.9rem;
    }

    /* ── Action cards: single column ── */
    .action-cards {
        grid-template-columns: 1fr;
        margin-top: -1rem;
    }

    /* ── Features: single column ── */
    .features-grid {
        grid-template-columns: 1fr;
    }

    /* ── Section headers ── */
    .section-title {
        font-size: 1.6rem;
    }

    /* ── Builder card (builders.php) ── */
    .builder-card {
        padding: 1.5rem;
    }

    /* ── Project hero ── */
    .project-hero h1 {
        font-size: 1.75rem;
    }

    .project-hero {
        padding: 3rem 0 2rem;
    }

    /* ── Sticky sidebar becomes static ── */
    .sticky-sidebar {
        padding: 1.5rem;
    }

    /* ── Amenities: 2 columns ── */
    .amenities-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* ── Dashboard stats: single column ── */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    /* ── Admin content ── */
    .admin-content {
        padding: 1.25rem 0.75rem;
    }

    /* ── Upload zone ── */
    .upload-zone {
        padding: 2rem 1rem;
    }

    /* ── Property card image ── */
    .property-card-img {
        height: 170px;
    }

    /* ── Buttons: full width on small screens ── */
    .btn-lg {
        width: 100%;
        font-size: 1.1rem !important;
        padding: 0.85rem 1.25rem !important;
    }
}

/* ── 480px ── Mobile portrait ────────────────────────────── */
@media (max-width: 480px) {

    /* ── Container padding ── */
    .container {
        padding: 0 0.75rem;
    }

    /* ── Brand logo ── */
    .logo-text {
        font-size: 1.4rem;
    }

    .brand-tagline {
        font-size: 0.65rem;
    }

    /* ── Hero ── */
    .hero-title {
        font-size: 1.6rem;
        letter-spacing: -0.01em;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    /* ── Search ── */
    .search-input-group input {
        font-size: 0.9rem;
        padding: 0.85rem 0.85rem 0.85rem 2.75rem;
    }

    /* ── Section headers ── */
    .section-title {
        font-size: 1.4rem;
    }

    .section-desc {
        font-size: 0.9rem;
    }

    /* ── Action cards ── */
    .action-card {
        padding: 1.25rem;
    }

    .action-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }

    /* ── Business / builder cards ── */
    .business-card,
    .builder-card {
        padding: 1.25rem;
    }

    .card-logo {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    /* ── Project hero ── */
    .project-hero h1 {
        font-size: 1.5rem;
    }

    .project-hero p {
        font-size: 1rem;
    }

    /* ── Detail sections ── */
    .detail-section h2 {
        font-size: 1.25rem;
    }

    .main-content {
        padding: 1.25rem;
    }

    /* ── Amenities: single column ── */
    .amenities-grid {
        grid-template-columns: 1fr;
    }

    /* ── Gallery image height ── */
    .gallery-grid img:first-child {
        height: 180px;
    }

    /* ── Pricing table: smaller font ── */
    .pricing-table th,
    .pricing-table td {
        padding: 0.6rem 0.5rem;
        font-size: 0.85rem;
    }

    /* ── CTA ── */
    .cta-content h2 {
        font-size: 1.5rem;
    }

    /* ── Page header ── */
    .page-header {
        padding: 2rem 0;
    }

    .page-title {
        font-size: 1.5rem;
    }

    /* ── Form card ── */
    .form-card {
        padding: 1.25rem;
        border-radius: var(--radius-md);
    }

    /* ── Footer ── */
    .footer {
        padding: 2rem 0 0;
    }

    .footer-links h4 {
        font-size: 1rem;
    }

    .footer-bottom {
        padding: 1rem 0;
        font-size: 0.8rem;
    }

    /* ── Sidebar nav wraps nicely ── */
    .sidebar a {
        font-size: 0.8rem;
        padding: 0.45rem 0.75rem;
    }

    /* ── Email modal ── */
    .email-modal {
        width: 98%;
    }

    .email-header {
        padding: 1rem 1.25rem;
    }

    .email-body {
        padding: 1.25rem;
    }

    .email-preview-box {
        font-size: 0.8rem;
        padding: 1rem;
    }
}

