/* Responsive Design */

/* Mobile First Approach */
@media screen and (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 10px;
    }

    .nav ul {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero {
        padding: 100px 0 60px;
        margin-top: 120px;
        background-attachment: scroll;
        background-size: cover;
        background-position: center;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .price-box {
        margin: 1rem;
        padding: 1.5rem;
    }

    .price-usd {
        font-size: 2rem;
    }

    .price-zar {
        font-size: 1.5rem;
    }

    .container {
        padding: 0 15px;
    }

    .features h2,
    .location h2,
    .gallery h2,
    .all-images h2,
    .contact h2,
    .other-listings h2 {
        font-size: 2rem;
    }

    .features-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .feature-item {
        padding: 1.5rem;
    }

    .gallery-featured {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .image-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .contact-methods {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .contact-item {
        padding: 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-description {
        justify-content: center;
    }

    /* Carousel responsive styles */
    .carousel-main-img {
        height: 300px;
    }
    
    .carousel-controls {
        gap: 0.5rem;
    }
    
    .prev-btn, .next-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        padding: 0.5rem;
    }
    
    .carousel-thumbnails {
        gap: 0.3rem;
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding: 0.5rem;
    }
    
    .thumbnail {
        width: 60px;
        height: 45px;
        flex-shrink: 0;
    }
    
    .carousel-counter {
        font-size: 1rem;
        padding: 0 0.5rem;
    }
}

/* Tablet Styles */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .features-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-featured {
        grid-template-columns: repeat(2, 1fr);
    }

    .image-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .contact-methods {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large Screen Optimizations */
@media screen and (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }

    .hero-content h1 {
        font-size: 3.5rem;
    }

    .features-list {
        grid-template-columns: repeat(4, 1fr);
    }

    .image-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .gallery-item:hover,
    .feature-item:hover,
    .image-grid img:hover {
        transform: none;
    }

    .nav a:hover,
    .contact-email a:hover,
    .footer-contact a:hover {
        text-decoration: underline;
    }

    .contact-action,
    .prev-btn,
    .next-btn {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
}

/* High DPI/Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .map-image,
    .gallery-item img,
    .image-grid img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print Styles */
@media print {
    .header,
    .gallery-navigation,
    .contact-action,
    .carousel-controls,
    .carousel-thumbnails {
        display: none;
    }

    .hero {
        background: none;
        color: #333;
        margin-top: 0;
        padding: 2rem 0;
    }

    .main-content {
        padding: 1rem 0;
    }

    .image-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .footer {
        background: none;
        color: #333;
        border-top: 1px solid #ddd;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }

    .header {
        background-color: #2d2d2d;
    }

    .nav a {
        color: #e0e0e0;
    }

    .main-content {
        background: #2d2d2d;
    }

    .features,
    .contact {
        background: #1a1a1a;
    }

    .feature-item,
    .gallery-item,
    .contact-item {
        background: #3d3d3d;
        color: #e0e0e0;
    }

    .description p,
    .features-description p,
    .location p {
        color: #b0b0b0;
    }

    .address p {
        color: #888;
    }
}
