/* MOBILE RESPONSIVE IMPROVEMENTS */

/* Hamburger menu toggle for mobile navigation */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle:hover {
    transform: scale(1.1);
}

/* Mobile navigation styles */
.nav.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    padding: 20px;
    gap: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 99;
}

/* Tablet - 768px and below */
@media (max-width: 768px) {
    .header .container {
        flex-wrap: wrap;
    }
    
    .nav {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 15px;
        padding: 0;
    }
    
    .nav.mobile-open {
        display: flex;
    }
    
    .nav-toggle {
        display: flex;
        align-items: center;
    }
    
    .logo-img {
        height: 50px;
        width: 50px;
    }
    
    .logo h1 {
        font-size: 20px;
    }
    
    .tagline {
        font-size: 10px;
    }
    
    .hero-content h2 {
        font-size: 32px;
        margin-bottom: 15px;
    }
    
    .hero-content p {
        font-size: 16px;
    }
    
    .hero {
        padding: 60px 20px;
    }
    
    .listings-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .property-card {
        padding: 15px;
    }
    
    .search-filters {
        flex-direction: column;
        gap: 12px;
    }
    
    .search-input, .filter-select, .reset-btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
    
    .section-title {
        font-size: 28px;
        margin-bottom: 20px;
    }
    
    .contact-content {
        flex-direction: column;
        gap: 30px;
    }
    
    .contact-info {
        flex-direction: column;
        gap: 20px;
    }
    
    .contact-form {
        width: 100%;
    }
    
    .contact-form input,
    .contact-form textarea {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
    
    .submit-btn {
        width: 100%;
        padding: 12px;
    }
    
    .ad-carousel {
        margin: 0 10px;
    }
    
    .ad-content {
        flex-direction: column;
        text-align: center;
    }
    
    .ad-text {
        padding-right: 0;
    }
    
    .ad-text h3 {
        font-size: 18px;
    }
    
    .ad-text p {
        font-size: 13px;
    }
    
    .ad-icon {
        font-size: 40px;
        margin-top: 10px;
    }
    
    .ad-nav-btn {
        font-size: 18px;
        padding: 8px 12px;
    }
    
    .modal-content {
        width: 90%;
        max-width: 500px;
        max-height: 90vh;
        overflow-y: auto;
        padding: 20px;
    }
    
    .whatsapp-btn {
        width: 50px;
        height: 50px;
    }
    
    .whatsapp-label {
        font-size: 10px;
    }
}

/* Small phones - 480px and below */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .header {
        padding: 10px 0;
    }
    
    .header .container {
        padding: 0 10px;
    }
    
    .logo {
        gap: 8px;
    }
    
    .logo-img {
        height: 40px;
        width: 40px;
        padding: 3px;
    }
    
    .logo h1 {
        font-size: 18px;
    }
    
    .tagline {
        font-size: 9px;
    }
    
    .hero {
        padding: 40px 10px;
    }
    
    .hero-content h2 {
        font-size: 24px;
        margin-bottom: 10px;
        line-height: 1.2;
    }
    
    .hero-content p {
        font-size: 13px;
    }
    
    .ad-banner-section {
        padding: 10px 0;
    }
    
    .ad-carousel {
        margin: 0 5px;
        border-radius: 8px;
    }
    
    .ad-slides-container {
        height: 180px;
    }
    
    .ad-slide {
        padding: 20px 10px;
    }
    
    .ad-text {
        padding: 12px 15px;
    }
    
    .ad-text h3 {
        font-size: 15px;
        margin-bottom: 5px;
    }
    
    .ad-text p {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .ad-cta {
        font-size: 11px;
        padding: 6px 12px;
    }
    
    .ad-icon {
        font-size: 32px;
    }
    
    .ad-nav-btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
        padding: 5px;
    }
    
    .ad-dots {
        bottom: 8px;
    }
    
    .ad-dot {
        width: 8px;
        height: 8px;
        margin: 0 3px;
    }
    
    .search-section {
        padding: 15px 0;
    }
    
    .search-filters {
        gap: 10px;
    }
    
    .search-input, .filter-select, .reset-btn {
        padding: 10px;
        font-size: 13px;
    }
    
    .listings-section {
        padding: 30px 0;
    }
    
    .section-title {
        font-size: 22px;
        margin-bottom: 15px;
    }
    
    .listings-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .property-card {
        padding: 12px;
        border-radius: 8px;
    }
    
    .property-card:hover {
        transform: translateY(-4px);
    }
    
    .property-title {
        font-size: 15px;
        margin-bottom: 8px;
    }
    
    .property-location {
        font-size: 12px;
    }
    
    .property-price {
        font-size: 16px;
        margin: 8px 0;
    }
    
    .property-description {
        font-size: 12px;
        line-height: 1.4;
    }
    
    .contact-section {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 22px;
    }
    
    .contact-content {
        flex-direction: column;
        gap: 25px;
    }
    
    .contact-info {
        gap: 15px;
    }
    
    .contact-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .contact-icon {
        font-size: 28px;
        margin-bottom: 8px;
    }
    
    .contact-item h3 {
        font-size: 14px;
        margin-bottom: 4px;
    }
    
    .contact-item p {
        font-size: 12px;
    }
    
    .contact-form {
        width: 100%;
    }
    
    .contact-form input,
    .contact-form textarea {
        padding: 10px;
        font-size: 13px;
        margin-bottom: 10px;
        border-radius: 6px;
    }
    
    .submit-btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
    
    .modal-content {
        width: 95%;
        max-width: 100%;
        padding: 15px;
        border-radius: 10px;
    }
    
    .close {
        font-size: 24px;
        top: 10px;
        right: 10px;
    }
    
    .property-details {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .detail-item {
        padding: 8px;
        font-size: 12px;
    }
    
    .detail-item strong {
        font-size: 13px;
    }
    
    .footer {
        padding: 30px 0;
    }
    
    .footer p {
        font-size: 12px;
        line-height: 1.4;
    }
    
    .whatsapp-btn {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
    }
    
    .whatsapp-icon {
        width: 24px;
        height: 24px;
    }
    
    .whatsapp-label {
        font-size: 9px;
        margin-top: 2px;
    }
}

/* Extra small phones - 360px and below */
@media (max-width: 360px) {
    .hero-content h2 {
        font-size: 20px;
    }
    
    .hero-content p {
        font-size: 12px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .property-title {
        font-size: 14px;
    }
    
    .ad-text h3 {
        font-size: 13px;
    }
    
    .search-input, .filter-select, .reset-btn {
        font-size: 12px;
    }
}

/* Landscape orientation optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 30px 20px;
    }
    
    .hero-content h2 {
        font-size: 24px;
    }
    
    .ad-slides-container {
        height: 150px;
    }
    
    .ad-slide {
        padding: 15px 10px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    button, a, .nav-link, .property-card {
        padding: 12px;
        min-height: 44px;
        min-width: 44px;
    }
    
    button:active, a:active {
        opacity: 0.7;
    }
}

/* High DPI screens */
@media (min-resolution: 2dppx) {
    body {
        -webkit-font-smoothing: subpixel-antialiased;
    }
}

/* Viewport height CSS variable for mobile address bar issue */
html {
    --vh: 1vh;
}

@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        padding: 20px 10px;
    }
    
    .listings-grid {
        gap: 8px;
    }
    
    .property-card {
        padding: 10px;
    }
}

/* Print styles for mobile */
@media print {
    .header, .footer, .nav-toggle, .whatsapp-btn, .ad-banner-section, .search-section {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .listings-grid {
        grid-template-columns: 1fr;
    }
}
