/* =================================================================
   RESPONSIVE DESIGN - MOBILE OPTIMIZED
   ================================================================= */

/* Smartphones - Portrait (320px - 576px) */
@media (max-width: 576px) {
    
    /* Base Typography */
    html {
        font-size: 14px;
    }
    
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.35rem;
        line-height: 1.3;
    }
    
    /* Container adjustments */
    .container {
        padding: 0 1rem;
        max-width: 100%;
    }
    
    .container-wide {
        padding: 0 1rem;
    }
    
    .container-full {
        padding: 0;
    }
    
    /* Navigation Mobile */
    .navbar {
        padding: 1rem 0;
        height: auto;
    }
    
    .navbar .container {
        padding: 0 1rem;
    }
    
    .nav-brand .logo {
        font-size: 1.5rem;
    }
    
    .nav-brand .tagline {
        font-size: 0.65rem;
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px;
        flex-direction: column;
        background: var(--color-primary);
        width: 100%;
        height: calc(100vh - 60px);
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        z-index: 998;
        overflow-y: auto;
    }
    
    .nav-menu.mobile-open {
        left: 0;
    }
    
    .nav-item {
        margin: 0.5rem 0;
        width: 100%;
    }
    
    .nav-link {
        padding: 1rem;
        color: white;
        width: 100%;
        display: block;
    }
    
    .dropdown-menu {
        position: static;
        display: none;
        background: rgba(255,255,255,0.1);
        box-shadow: none;
        padding: 0.5rem 0;
    }
    
    .nav-item.mobile-open .dropdown-menu {
        display: block;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
        color: white;
    }
    
    .nav-toggle {
        display: block;
        z-index: 999;
        cursor: pointer;
    }
    
    .nav-actions {
        display: none;
    }
    
    /* Hero Section Mobile */
    .hero {
        min-height: 80vh;
        padding: 4rem 1rem;
    }
    
    .hero-content {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
        text-align: center;
        padding: 1rem;
    }
    
    /* Buttons Mobile */
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
        width: 100%;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        text-align: center;
    }
    
    /* Page Headers Mobile */
    .page-header {
        padding: 3rem 1rem;
        text-align: center;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }
    
    .page-header p {
        font-size: 0.9rem;
    }
    
    /* Features Grid Mobile */
    .main-features {
        padding: 3rem 0;
    }
    
    .features-layout {
        flex-direction: column;
        gap: 2rem;
    }
    
    .features-intro {
        width: 100%;
        padding: 0 1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .feature-card.large {
        grid-column: 1;
    }
    
    .intro-highlights {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Collaboration Section Mobile */
    .collaboration-section {
        padding: 3rem 0;
    }
    
    .collaboration-layout {
        padding: 0 1rem;
    }
    
    .pathways-modern {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .pathway-card {
        padding: 2rem 1.5rem;
    }
    
    /* Properties Grid Mobile */
    .properties-section {
        padding: 3rem 0;
    }
    
    .properties-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .property-card {
        margin: 0;
    }
    
    .property-image {
        height: 200px;
    }
    
    .property-details {
        flex-wrap: wrap;
    }
    
    .property-details span {
        font-size: 0.85rem;
    }
    
    /* Filters Mobile */
    .filters-section {
        padding: 2rem 0;
    }
    
    .filters-wrapper {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .filter-buttons {
        width: 100%;
        overflow-x: auto;
        display: flex;
        gap: 0.5rem;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .filter-btn {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .location-select {
        width: 100%;
    }
    
    /* Forms Mobile */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-group {
        width: 100%;
        margin-bottom: 1.5rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 0.875rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Contact Page Mobile */
    .contact-content {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }
    
    .contact-form-section,
    .contact-info-section {
        width: 100%;
    }
    
    .contact-info-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .contact-info-card {
        padding: 1.5rem;
    }
    
    /* Process Steps Mobile */
    .process-steps {
        flex-direction: column;
        gap: 2rem;
        padding: 0 1rem;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .step::after {
        display: none;
    }
    
    .step-icon {
        margin-bottom: 1rem;
    }
    
    /* Application Container Mobile */
    .application-container {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }
    
    .application-form-section,
    .application-info-section {
        width: 100%;
        padding: 0 1rem;
    }
    
    .info-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    /* Benefits Grid Mobile */
    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .benefit-card {
        padding: 1.5rem;
    }
    
    /* Footer Mobile */
    .footer {
        padding: 3rem 0 2rem;
        margin-top: 3rem;
    }
    
    .footer-content {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }
    
    .footer-brand {
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .footer-brand .logo {
        font-size: 1.75rem;
    }
    
    .footer-links {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-column {
        margin-bottom: 1.5rem;
    }
    
    .footer-column h4 {
        margin-bottom: 1rem;
        font-size: 1.1rem;
    }
    
    .footer-column ul {
        list-style: none;
    }
    
    .footer-column li {
        margin: 0.5rem 0;
    }
    
    .footer-bottom {
        padding-top: 1.5rem;
        text-align: center;
    }
    
    .footer-bottom p {
        font-size: 0.85rem;
        margin: 0.25rem 0;
    }
    
    /* Tables Mobile */
    table {
        font-size: 0.85rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Legal Sections Mobile */
    .legal-section {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }
    
    .legal-section h2 {
        font-size: 1.5rem;
    }
    
    .legal-section h3 {
        font-size: 1.1rem;
        margin-top: 1rem;
    }
    
    .legal-content {
        font-size: 0.9rem;
    }
    
    .legal-content ul {
        margin-left: 1.5rem;
    }
    
    /* Newsletter Section Mobile */
    .newsletter-section {
        padding: 3rem 1rem;
    }
    
    .newsletter-content {
        padding: 0;
    }
    
    .newsletter-content h2 {
        font-size: 1.75rem;
    }
    
    .newsletter-form {
        flex-direction: column;
        gap: 1rem;
    }
    
    .newsletter-form input[type="email"] {
        width: 100%;
        padding: 1rem;
    }
    
    .newsletter-form button {
        width: 100%;
        padding: 1rem;
    }
    
    /* Alert Messages Mobile */
    .alert {
        flex-direction: row;
        padding: 1rem;
        margin: 1rem;
    }
    
    .alert i {
        font-size: 1.25rem;
    }
    
    /* Section spacing adjustments */
    section {
        padding: 3rem 0;
    }
    
    .content-section {
        padding: 2rem 0;
    }
    
    .section-header {
        margin-bottom: 2rem;
        text-align: center;
        padding: 0 1rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .section-subtitle {
        font-size: 0.95rem;
    }
    
    /* RGPD Notice Mobile */
    .rgpd-notice {
        font-size: 0.75rem;
        padding: 0.75rem;
    }
    
    /* Overflow prevention */
    * {
        max-width: 100%;
    }
    
    img {
        max-width: 100%;
        height: auto;
    }
}

/* Tablets - Portrait (577px - 768px) */
@media (min-width: 577px) and (max-width: 768px) {
    
    /* Container */
    .container {
        padding: 0 2rem;
    }
    
    /* Navigation Tablet */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--color-primary);
        width: 100%;
        height: calc(100vh - 70px);
        text-align: center;
        transition: 0.3s;
        padding: 2rem 0;
        z-index: 998;
        overflow-y: auto;
    }
    
    .nav-menu.mobile-open {
        left: 0;
    }
    
    .nav-link {
        color: white;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .nav-actions {
        display: none;
    }
    
    /* Hero Tablet */
    .hero {
        min-height: 70vh;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        flex-direction: row;
        justify-content: center;
    }
    
    .hero-buttons .btn {
        width: auto;
        min-width: 150px;
    }
    
    /* Grids Tablet */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .properties-grid {
        grid-template-columns: 1fr;
    }
    
    .pathways-modern {
        grid-template-columns: 1fr;
    }
    
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-info-grid {
        grid-template-columns: 1fr;
    }
    
    /* Footer Tablet */
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
        text-align: left;
    }
    
    /* Forms Tablet */
    .form-row {
        flex-direction: row;
    }
}

/* Landscape phones and small tablets */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 3rem 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .nav-menu {
        padding: 1rem 0;
        max-height: calc(100vh - 60px);
    }
}

/* High resolution phones */
@media (max-width: 414px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Extra small devices (iPhone SE, etc.) */
@media (max-width: 360px) {
    html {
        font-size: 13px;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .nav-brand .logo {
        font-size: 1.25rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px; /* Apple's recommended touch target */
    }
    
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .filter-btn {
        min-height: 44px;
    }
    
    input, select, textarea {
        min-height: 44px;
    }
    
    .dropdown-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Additional mobile menu styles */
@media (max-width: 768px) {
    /* Show toggle button */
    .nav-toggle {
        display: flex !important;
        width: 48px;
        height: 48px;
        position: relative;
        cursor: pointer;
        z-index: 10001;
        background: white;
        border-radius: 8px;
        justify-content: center;
        align-items: center;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        border: 2px solid var(--color-primary);
    }
    
    /* Hide desktop menu */
    .nav-menu {
        position: fixed !important;
        left: -100% !important;
        top: 70px !important;
        width: 100% !important;
        height: calc(100vh - 70px) !important;
        background: #1a365d !important;
        flex-direction: column !important;
        padding: 2rem 0 !important;
        transition: left 0.3s ease !important;
        z-index: 10000 !important;
        overflow-y: auto !important;
        display: flex !important;
    }
    
    /* Show menu when active */
    .nav-menu.mobile-open {
        left: 0 !important;
        display: flex !important;
    }
    
    /* Style nav items for mobile */
    .nav-item {
        width: 100%;
        margin: 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-link {
        color: white !important;
        padding: 1rem 2rem;
        display: block;
        width: 100%;
    }
    
    .nav-link:hover {
        background: rgba(255,255,255,0.1);
    }
    
    /* Dropdown styles for mobile */
    .dropdown-menu {
        position: static !important;
        display: none !important;
        background: rgba(0,0,0,0.2) !important;
        box-shadow: none !important;
        width: 100% !important;
        padding: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }
    
    .nav-item.mobile-open .dropdown-menu {
        display: block !important;
    }
    
    .dropdown-item {
        padding: 1rem 3rem !important;
        color: white !important;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    
    .dropdown-item:hover {
        background: rgba(255,255,255,0.1) !important;
    }
    
    .dropdown-content {
        text-align: left;
    }
    
    .dropdown-content strong {
        color: white;
    }
    
    .dropdown-content span {
        color: rgba(255,255,255,0.7);
        font-size: 0.85rem;
    }
    
    /* Hide desktop nav actions */
    .nav-actions {
        display: none !important;
    }
    
    /* Hamburger animation */
    .nav-toggle span {
        display: block !important;
        position: absolute;
        height: 3px;
        width: 26px;
        background: #1a365d !important;
        border-radius: 3px;
        opacity: 1;
        left: 50%;
        margin-left: -13px;
        transform: rotate(0deg);
        transition: .25s ease-in-out;
    }
    
    .nav-toggle span:nth-child(1) {
        top: 14px;
    }
    
    .nav-toggle span:nth-child(2) {
        top: 23px;
    }
    
    .nav-toggle span:nth-child(3) {
        top: 32px;
    }
    
    .nav-toggle.active span:nth-child(1) {
        top: 23px;
        transform: rotate(135deg);
        background: #b8860b !important;
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
        left: -60px;
    }
    
    .nav-toggle.active span:nth-child(3) {
        top: 23px;
        transform: rotate(-135deg);
        background: #b8860b !important;
    }
}

/* Prevent horizontal scroll */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .container-wide,
    .container-full {
        overflow-x: hidden;
    }
}