/* Base Container Styles */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Extra Large Screens (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
    .hero-title {
        font-size: 5rem;
    }
    .hero-subtitle {
        font-size: 1.8rem;
    }
    .section-header h2 {
        font-size: 3.5rem;
    }
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktop and Large Tablets (1025px - 1400px) */
@media (max-width: 1400px) {
    .container {
        max-width: 1200px;
    }
}

/* Tablets (769px - 1024px) */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 0 20px;
    }
    .hero-title {
        font-size: 3rem;
    }
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .gallery-item.large {
        grid-column: span 2;
        grid-row: span 1;
    }
    /* Added: Ensure navigation is responsive for tablets */
    .nav-menu {
        display: none; /* Hide by default on smaller screens */
    }
    .nav-menu.active {
        display: flex; /* Show when active */
    }
    .nav-toggle {
        display: flex; /* Ensure hamburger is visible */
    }
}

/* Mobile and Small Tablets (577px - 768px) */
@media (max-width: 768px) {
    .container, section {
        padding-left: 8px;
        padding-right: 8px;
    }
    .features-grid, .stats-grid, .property-grid, .gallery-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .about-grid, .location-grid {
        display: block !important;
    }
    .hero-content, .section-header, .cta-content, .newsletter-content {
        text-align: center !important;
    }
    .btn, .nav-link, .nav-cta {
        font-size: 1rem !important;
        padding: 1em 1.5em !important;
    }
    .footer-content, .footer-section {
        display: block !important;
        text-align: center !important;
    }
    .footer-section {
        margin-bottom: 24px !important;
    }
    .whatsapp-float, .back-to-top {
        right: 12px !important;
        bottom: 12px !important;
    }
    .footer {
        padding-bottom: 80px; /* Space for floating buttons */
    }

    /* Navigation */
    .nav-container {
        padding: 1rem;
        position: relative; /* Added: Ensure proper positioning for nav elements */
    }
    .nav-logo h2 {
        font-size: 1.2rem;
    }
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        width: 100%;
        text-align: center;
        transition: left 0.3s ease;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        padding: 2rem 0;
        height: calc(100vh - 60px);
        overflow-y: auto;
        display: none; /* Added: Hide by default to ensure responsiveness at load */
        z-index: 1000; /* Added: Ensure menu appears above other elements */
    }
    .nav-menu.active {
        display: flex; /* Added: Show when active */
        left: 0;
    }
    .nav-link {
        padding: 1rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid #e5e5e5;
    }
    .nav-link:last-child {
        border-bottom: none;
    }
    .nav-toggle {
        display: flex; /* Ensure hamburger is visible */
    }
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Hero Section */
    .hero {
        height: auto;
        min-height: 500px; /* Updated: Consistent with your value */
        padding: 80px 0 40px;
    }
    .hero-content {
        padding: 0 1rem;
        margin-top: 60px;
    }
    .hero-title {
        font-size: 2rem;
        line-height: 1.3;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .hero-description {
        font-size: 0.9rem;
    }
    .hero-buttons {
        gap: 0.5rem;
        flex-direction: column; /* Added: Stack buttons vertically */
    }
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    .hero-social {
        display: none; /* Added: Hide social links on mobile */
    }
    .slide-controls {
        bottom: 20px; /* Added: Ensure slide controls are positioned correctly */
    }

    /* Other Sections */
    .stats, .features, .gallery-preview, .cta-section {
        padding: 2rem 0;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr); /* Updated: Keep your 2-column layout */
        gap: 15px;
    }
    .features-grid {
        grid-template-columns: repeat(2, 1fr); /* Updated: Keep your 2-column layout */
        gap: 20px;
    }
    .section-header h2 {
        font-size: 1.8rem;
    }
    .section-header p {
        font-size: 1rem;
    }
    .feature-card {
        padding: 1.5rem;
    }
    .feature-icon {
        font-size: 2.5rem;
    }
    .feature-card h3 {
        font-size: 1.3rem;
    }
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    .gallery-item {
        aspect-ratio: 4/3;
    }
    .cta-content h2 {
        font-size: 1.8rem;
    }
    .cta-content p {
        font-size: 1rem;
    }
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    /* Added: Ensure other grids are single-column for consistency */
    .about-grid {
        grid-template-columns: 1fr;
    }
    .property-grid {
        grid-template-columns: 1fr;
    }
    .amenity-slide {
        flex-direction: column;
    }
    .amenity-image {
        height: 300px;
    }
}

/* Mobile Portrait (320px - 576px) */
@media (max-width: 576px) {
    html {
        font-size: 14px;
    }
    .container {
        padding: 0 15px;
    }
    section {
        padding: 40px 0;
    }
    .hero-title, .section-title {
        font-size: 1.3rem !important;
    }
    .hero-subtitle, .section-description {
        font-size: 1rem !important;
    }
    .property-specs, .property-price, .feature-content, .stat-content {
        font-size: 0.95rem !important;
    }
    .form-group input, .newsletter-form input {
        font-size: 1rem !important;
        padding: 0.8em !important;
    }

    /* Navigation */
    .nav-menu {
        padding: 80px 20px 30px;
        display: none; /* Added: Reinforce hidden state */
    }
    .nav-menu.active {
        display: flex; /* Added: Show when active */
    }
    .nav-link {
        font-size: 1rem;
        padding: 12px 0;
    }

    /* Hero Section */
    .hero {
        min-height: 100vh;
        padding-bottom: 60px;
    }
    .hero-content {
        margin-top: 70px;
    }
    .hero-title {
        font-size: 1.8rem;
    }
    .hero-features {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .hero-buttons {
        flex-direction: column;
        gap: 10px;
    }
    .btn {
        width: 100%;
        padding: 12px;
    }

    /* Stats Section */
    .stats-grid {
        grid-template-columns: 1fr; /* Updated: Single column for smaller screens */
    }
    .stat-item {
        padding: 1.5rem;
    }
    .stat-icon {
        font-size: 2rem;
    }
    .stat-number {
        font-size: 2rem;
    }
    .stat-label {
        font-size: 0.9rem;
    }

    /* Other Sections */
    .about-grid {
        flex-direction: column;
        gap: 2rem;
    }
    .image-badge {
        width: 80px;
        height: 80px;
        bottom: -10px;
        right: -10px;
    }
    .badge-number {
        font-size: 1.5rem;
    }
    .badge-textFamily {
        font-size: 0.7rem;
    }
    .property-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }
    .tab {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    .property-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .amenity-slide {
        flex-direction: column;
    }
    .amenity-image {
        height: 250px;
    }
    .amenity-content {
        padding: 1.5rem;
    }
    .amenity-features {
        flex-direction: column;
    }
    .gallery-grid {
        grid-template-rows: repeat(5, 200px);
    }
    .gallery-item.large {
        grid-column: span 1;
    }
    .testimonial-slide {
        padding: 1.5rem;
    }
    .testimonial-author {
        flex-direction: column;
        text-align: center;
    }
    .cta-content {
        flex-direction: column;
        text-align: center;
    }
    .cta-form {
        width: 100%;
    }
    .location-grid {
        flex-direction: column;
    }
    .map-container iframe {
        min-height: 300px;
    }
    .newsletter-content {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    .newsletter-form {
        width: 100%;
    }
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    .footer-section h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
    .social-links {
        justify-content: center;
    }
    .instagram-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .whatsapp-float {
        right: 15px;
        bottom: 15px;
    }
    .whatsapp-float a {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        padding: 0;
        justify-content: center;
    }
    .whatsapp-float span {
        display: none;
    }
    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        bottom: 80px;
        right: 15px;
    }
}

/* Very Small Devices (320px - 375px) */
@media (max-width: 375px) {
    .container, section {
        padding-left: 2px;
        padding-right: 2px;
    }
    .btn, .nav-link, .nav-cta {
        font-size: 0.95rem !important;
        padding: 0.7em 1em !important;
    }
    .hero-title {
        font-size: 1.6rem;
    }
    .hero-subtitle {
        font-size: 0.9rem;
    }
    .property-card {
        min-width: 100%;
    }
    .amenity-content h4 {
        font-size: 1.5rem;
    }
    .testimonial-quote p {
        font-size: 1rem;
    }
    .cta-text h3 {
        font-size: 1.5rem;
    }
}

/* Mobile Landscape (up to 768px) */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: 400px;
        padding: 80px 0 40px;
    }
    .nav-menu {
        height: calc(100vh - 60px);
        top: 60px;
        display: none; /* Added: Reinforce hidden state */
    }
    .nav-menu.active {
        display: flex; /* Added: Show when active */
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .feature-card:hover,
    .stat-item:hover,
    .gallery-item:hover,
    .btn:hover,
    .social-links a:hover,
    .whatsapp-float a:hover,
    .back-to-top:hover {
        transform: none;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-background img,
    .gallery-item img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .whatsapp-float,
    .back-to-top,
    .nav-toggle {
    z-index: 1000;
    }
    .scroll-indicator {
        display: none !important;
    }
    .hero {
        height: auto;
        min-height: auto;
    }
    .hero-background {
        display: none;
    }
    .hero-overlay {
        background: #1a73e8;
    }
    .btn {
        border: 1px solid #333;
        background: none;
        color: #333;
    }
    .stats,
    .features,
    .gallery-preview,
    .cta-section {
        page-break-inside: avoid;
    }
}

/* Accessibility: 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-indicator {
        animation: none;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --white: #000000;
        --light-gray: #2d2d2d;
        --text-color: #E49E22;
        --border-color: #5D4A1F;
    }
    .navbar {
        background: var(--dark-gray);
    }
    .feature-card {
        background: var(--light-gray);
        border-color: var(--border-color);
    }
    .feature-card:hover {
        background: var(--white);
    }
}

/* Added: Desktop Navigation (min-width: 769px) to ensure menu is visible */
@media (min-width: 769px) {
    .nav-menu {
        display: flex; /* Ensure menu is visible on desktop */
    }
    .nav-toggle {
        display: none; /* Hide hamburger on desktop */
    }
}
/* Add to responsive.css */
.nav-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

/* Responsive: Call Floating Button - match WhatsApp */
@media (max-width: 600px) {
  .call-float {
    right: 16px;
    bottom: 110px;
  }
}
