/* --- GLOBAL CSS FOR LOCALITY THEME --- */

/* --- BASE --- */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-color);
    background: var(--app-bg);
    line-height: 1.5;
}

/* --- MOBILE OPTIMIZATIONS --- */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    h1 { font-size: 22px !important; }
    h2 { font-size: 20px !important; }
    h3 { font-size: 18px !important; }
    
    /* Réduire les espacements sur mobile */
    section {
        padding: 20px 0 !important;
    }
    
    .container, .content {
        padding: 0 10px !important;
    }
    
    /* Réduire les marges */
    .section-header {
        margin-bottom: 15px !important;
    }
    
    .card, .property-card, .service-card {
        margin-bottom: 15px !important;
    }
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 300;
    line-height: 1.2;
}

h1 { font-size: 28px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }

/* --- COLORS --- */
:root {
    --primary-color: #071C3B;
    --secondary-color: #DD8462;
    --accent-color: #071C3B;
    --gold-color: #DD8462;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --medium-gray: #ddd;
    --dark-gray: #333;
    --border-color: #eee;
    --app-bg: #f6f7fb;
    --surface: #ffffff;
    --text-color: #0f172a;
    --muted-color: #64748b;
    --border: #e5e7eb;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px rgba(7, 28, 59, 0.08);
    --shadow-sm: 0 4px 14px rgba(7, 28, 59, 0.08);
    --on-primary: #ffffff;
    --on-secondary: #071C3B;
    --focus-ring: rgba(221, 132, 98, 0.35);
}

/* --- HEADER --- */
header { 
    background: var(--primary-color); 
    color: var(--white); 
    padding: 20px 0; 
}

.header-content {
    max-width: 1200px; 
    margin: 0 auto; 
    display: flex;
    justify-content: space-between; 
    align-items: center; 
    padding: 0 20px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    width: 25px;
    height: 25px;
    border-radius: 0px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text h1 {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
}

.logo-text p {
    margin: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.logo-icon {
    width: 40px; 
    height: 40px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    color: var(--secondary-color); 
    font-size: 24px;
}

.logo-text h1 { 
    font-size: 28px; 
    font-style: italic; 
    font-weight: 300; 
}

.logo-text p { 
    font-size: 11px; 
    color: rgba(255, 255, 255, 0.9); 
}

.contact-info { 
    text-align: right; 
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.contact-info h2 { 
    font-size: 20px; 
    margin-bottom: 5px; 
}

.contact-info p { 
    font-size: 12px; 
    color: rgba(255, 255, 255, 0.9); 
}

.social-icons { 
    display: flex; 
    gap: 10px; 
    margin-top: 5px; 
    justify-content: flex-end; 
}

.social-icon {
    width: 25px; 
    height: 25px; 
    color: var(--white);
    background: var(--secondary-color);
    border-radius: 50%;
    display: flex; 
    align-items: center; 
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-icon:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

/* --- NAVBAR --- */
nav {
    background: var(--white);
    border-bottom: 1px solid var(--medium-gray);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    position: relative;
}

/* Menu Burger */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 15px 0;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--dark-gray);
    transition: 0.3s;
}

.nav-links {
    display: flex;
    gap: 12px;
    list-style: none;
    align-items: center;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark-gray);
    padding: 15px 12px;
    display: block;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
    border-radius: 0px;
}

.nav-links a:hover { 
    color: var(--primary-color);
    background: rgba(2, 6, 23, 0.05);
}

.nav-links a.active {
    color: var(--primary-color);
    font-weight: bold;
}

/* Dropdown Styles */
.dropdown-toggle {
    position: relative;
    padding-right: 20px !important;
}

.dropdown-toggle i {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle i {
    transform: translateY(-50%) rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 220px;
    box-shadow: var(--shadow);
    border-radius: var(--radius-sm);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid var(--border);
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 400;
    text-transform: none;
    color: var(--dark-gray);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.dropdown-menu a:hover {
    background: var(--primary-color);
    color: var(--white);
    padding-left: 25px;
}

.dropdown-menu a i {
    width: 16px;
    text-align: center;
    color: var(--secondary-color);
}

.dropdown-menu a:hover i {
    color: var(--white);
}

.dropdown-header {
    padding: 15px 20px 10px;
    font-size: 12px;
    font-weight: bold;
    color: var(--white);
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    background: var(--primary-color);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 5px 0;
}

/* Mega Menu Styles */
.mega-dropdown {
    left: 50%;
    transform: translateX(-50%);
    min-width: 600px;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.mega-menu-column {
    padding: 0;
}

.mega-menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 2px solid var(--secondary-color);
    margin-bottom: 15px;
    background: var(--primary-color);
    border-radius: 0px;
}

.mega-menu-header i {
    font-size: 20px;
    color: var(--secondary-color);
}

.mega-menu-header h4 {
    margin: 0;
    font-size: 14px;
    color: var(--white);
    font-weight: bold;
}

.mega-menu-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-menu-links li {
    margin: 0;
}

.mega-menu-links a {
    padding: 8px 0;
    font-size: 13px;
    color: var(--dark-gray);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.mega-menu-links a:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateX(5px);
}

.mega-menu-links a:hover i {
    color: var(--white);
}

.mega-menu-links a i {
    font-size: 12px;
    color: var(--secondary-color);
    width: 20px;
}

/* User Menu */
.user-menu .dropdown-menu {
    min-width: 200px;
    right: 0;
    left: auto;
}

.logout-btn {
    width: 100%;
    padding: 10px 20px;
    background: none;
    border: none;
    text-align: left;
    font-size: 13px;
    color: var(--dark-gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: var(--secondary-color);
    color: white;
}

/* Search Box */
.search-box { 
    display: flex; 
    gap: 5px; 
    align-items: center;
}

.search-box input { 
    padding: 8px 12px; 
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm);
    width: 150px; 
    font-size: 12px;
    transition: all 0.3s ease;
    background: var(--surface);
    color: var(--text-color);
}

.search-box input:focus {
    width: 200px;
    border-color: var(--primary-color);
    outline: none;
}

.search-box button { 
    padding: 8px 12px; 
    background: #DD8462; 
    color: var(--white); 
    border: none; 
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box button:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

/* Login Button */
.btn-login {
    background: var(--primary-color) !important;
    color: var(--white) !important;
    padding: 8px 20px !important;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    border: none !important;
}

.btn-login:hover {
    background: var(--primary-color) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--secondary-color);
}

/* --- HERO SECTION --- */
.hero-section { 
    position: relative; 
    max-width: 1200px; 
    margin: 30px auto; 
    display: flex; 
    gap: 20px; 
    padding: 0 20px; 
}

.hero-slider { 
    flex: 1; 
    position: relative; 
    height: 400px; 
    border-radius: var(--radius);
    overflow: hidden; 
    box-shadow: var(--shadow);
}

.slide { 
    width: 100%; 
    height: 100%; 
    display: flex; 
    align-items: flex-end; 
    padding: 30px;
    background: var(--primary-color);
    background-size: cover;
}

.slide-content { 
    color: var(--white); 
}

.price { 
    font-size: 32px; 
    font-weight: bold; 
    color: var(--gold-color); 
    margin-bottom: 10px; 
}

.read-more { 
    background: var(--primary-color); 
    color: var(--white); 
    padding: 10px 25px; 
    border: none; 
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.3s ease;
}

.read-more:hover {
    background: var(--secondary-color);
}

/* --- SEARCH PANEL --- */
.search-panel { 
    width: 300px; 
    background: var(--accent-color); 
    color: var(--white); 
    padding: 20px; 
    border-radius: var(--radius);
}

.search-field { 
    margin-bottom: 15px; 
}

.search-field label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.search-field select, 
.search-field input { 
    width: 100%; 
    padding: 8px; 
    border-radius: var(--radius-sm); 
    border: none; 
    background: var(--surface);
    color: var(--text-color);
}

.search-btn { 
    width: 100%; 
    padding: 12px; 
    background: var(--primary-color); 
    color: var(--white); 
    border: none; 
    border-radius: var(--radius-sm);
    font-weight: bold; 
    cursor: pointer; 
    margin-top: 10px;
    transition: background 0.3s ease;
}

.search-btn:hover {
    background: var(--secondary-color);
}

/* --- SECTIONS --- */
.section-title { 
    max-width: 1200px; 
    margin: 50px auto 20px; 
    padding: 0 20px; 
    color: var(--primary-color); 
    font-size: 24px; 
    border-bottom: 2px solid var(--primary-color); 
    padding-bottom: 10px; 
}

/* --- PROPERTIES GRID --- */
.properties-grid { 
    max-width: 1200px; 
    margin: 0 auto; 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 30px; 
    padding: 0 20px 50px; 
}

.property-card { 
    background: var(--white); 
    border-radius: var(--radius);
    overflow: hidden; 
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.property-image { 
    height: 200px; 
    background: var(--medium-gray); 
    position: relative; 
    padding: 15px; 
    display: flex; 
    align-items: flex-end;
}

.property-badge { 
    position: absolute; 
    top: 10px; 
    right: 10px; 
    background: var(--primary-color); 
    color: var(--white); 
    padding: 4px 10px; 
    border-radius: var(--radius-sm); 
    font-size: 11px; 
    font-weight: bold;
}

.property-price { 
    background: var(--primary-color); 
    color: var(--white); 
    padding: 5px 10px; 
    border-radius: var(--radius-sm); 
    font-weight: bold; 
}

.property-info { 
    padding: 15px; 
}

.property-info h3 {
    margin-bottom: 10px;
    font-size: 16px;
    color: var(--dark-gray);
}

.property-details { 
    display: flex; 
    gap: 15px; 
    margin-top: 10px; 
    font-size: 12px; 
    color: var(--dark-gray); 
    border-top: 1px solid var(--border); 
    padding-top: 10px; 
}

/* --- AGENT SECTION --- */
.agent-section { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 30px; 
    display: flex; 
    gap: 20px; 
    background: var(--white); 
    border-radius: var(--radius);
    align-items: center; 
    box-shadow: var(--shadow-sm);
}

.agent-photo { 
    width: 100px; 
    height: 100px; 
    background: var(--medium-gray); 
    border-radius: var(--radius);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 40px; 
    flex-shrink: 0; 
}

.agent-info h3 {
    margin-bottom: 5px;
    color: var(--dark-gray);
}

.agent-bio {
    color: #666;
    line-height: 1.5;
}

/* --- FOOTER --- */
.footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 70px 0 20px;
    font-size: 14px;
}

.footer-container {
    max-width: 1200px;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    padding: 0 20px;
}

.footer-col {
    margin-bottom: 20px;
}

.footer-col h4 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 16px;
}

.footer-col p,
.footer-col a {
    color: #cbd5e1;
    line-height: 1.7;
}

.footer-col a:hover {
    color: var(--secondary-color);
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-logo {
    width: 80px;
    margin-bottom: 15px;
}

.social-links {
    margin-top: 15px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    color: var(--on-secondary);
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background-color: var(--secondary-color);
}

.social-links a:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    background-color: var(--primary-color);
    color: var(--on-primary);
}

.newsletter input {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: none;
    margin-bottom: 10px;
    background: var(--surface);
    color: var(--text-color);
}

.newsletter button {
    width: 100%;
    padding: 10px;
    background: var(--secondary-color);
    color: var(--on-secondary);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
}

.newsletter button:hover {
    background: var(--primary-color);
    color: var(--on-primary);
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #1e293b;
    color: #94a3b8;
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 992px) {
    .menu-toggle { display: flex; }
    
    .nav-links {
        display: none; /* Masqué par défaut */
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background: var(--white);
        padding: 20px;
        border-bottom: 2px solid var(--primary-color);
        gap: 0;
        box-shadow: 0 10px 15px var(--primary-color);
        z-index: 999;
    }

    /* Cette classe est ajoutée par le JS */
    .nav-links.active {
        display: flex !important; 
    }

    .nav-links a {
        padding: 15px 0;
        border-bottom: 1px solid var(--medium-gray);
    }

    .nav-links a:last-child {
        border-bottom: none;
        flex-direction: column;
        gap: 20px;
    }

    .search-panel {
        width: 100%;
    }

    .agent-section {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .contact-info {
        text-align: center;
        align-items: center;
    }

    .brand-name-header {
        font-size: 16px;
        margin-bottom: 5px;
        display: flex;
        align-items: center;
        color: var(--white);
        font-weight: 600;
        margin-left: 10px;
    }

    .header-logo {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .social-icons {
        justify-content: center;
    }

    .properties-grid {
        grid-template-columns: 1fr;
        padding: 0 15px 30px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .logo-text h1 {
        font-size: 24px;
    }

    .section-title {
        font-size: 20px;
    }

    .property-details {
        flex-direction: column;
        gap: 5px;
    }
}

/* --- UTILITIES --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.p-20 { padding: 20px; }

/* --- ANIMATIONS --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* --- FORM ELEMENTS --- */
input, select, textarea, button {
    font-family: inherit;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-color);
}

input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--focus-ring);
}

/* --- LINKS --- */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

/* --- MENU MOBILE FIX --- */
@media (max-width: 992px) {
    .menu-toggle { 
        display: flex !important; 
        z-index: 1001;
        position: relative;
        cursor: pointer;
    }
    
    .nav-links {
        display: none !important;
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        padding: 20px 0;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }
    
    .nav-links.active,
    .nav-links.show {
        display: flex !important;
        right: 0;
    }
    
    .nav-links li {
        width: 100%;
        margin: 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-links a {
        padding: 20px;
        font-size: 16px;
        text-align: left;
        display: flex;
        justify-content: space-between;
        align-items: center;
        color: var(--dark-gray);
        transition: all 0.3s ease;
    }
    
    .nav-links a:hover {
        background: var(--secondary-color);
        color: var(--primary-color);
        padding-left: 25px;
    }
    
    .nav-links a.active {
        background: var(--primary-color);
        color: var(--white);
        font-weight: bold;
    }
    
    /* Dropdowns mobile - Enhanced */
    .dropdown-menu {
        position: static !important;
        display: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        background: #f8f9fa !important;
        width: 100% !important;
        min-width: 100% !important;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
    }
    
    .dropdown.open .dropdown-menu,
    .dropdown-menu.show {
        display: block !important;
        max-height: 500px;
        padding: 10px 0;
    }
    
    .dropdown-menu li {
        background: transparent !important;
        margin: 0 !important;
        padding: 0 !important;
        border-bottom: 1px solid #e9ecef !important;
    }
    
    .dropdown-menu li:last-child {
        border-bottom: none !important;
    }
    
    .dropdown-menu a {
        padding: 15px 20px 15px 30px !important;
        font-size: 14px !important;
        border-bottom: none !important;
        background: transparent !important;
        color: var(--dark-gray) !important;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .dropdown-menu a:hover {
        background: var(--secondary-color) !important;
        color: var(--primary-color) !important;
        padding-left: 35px !important;
    }
    
    .dropdown-header {
        background: var(--primary-color) !important;
        color: white !important;
        padding: 12px 20px !important;
        font-size: 12px !important;
        margin: 0 !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    
    .dropdown-divider {
        background: var(--border-color) !important;
        margin: 5px 0 !important;
        height: 1px !important;
    }
    
    /* Dropdown toggle arrows for mobile */
    .dropdown-toggle svg {
        transition: transform 0.3s ease;
    }
    
    .dropdown.open .dropdown-toggle svg {
        transform: rotate(180deg);
    }
    
    /* Mega menu mobile */
    .mega-dropdown {
        position: static !important;
        transform: none !important;
        min-width: 100% !important;
        padding: 0 !important;
        background: #f8f9fa !important;
        display: none;
    }
    
    .mega-menu.open .mega-dropdown,
    .mega-dropdown.show {
        display: block;
    }
    
    /* Search box mobile */
    .search-box {
        margin: 20px;
        padding: 15px;
        background: #f8f9fa;
        border-radius: var(--radius-sm);
    }
    
    .search-box input {
        width: 100% !important;
        margin-bottom: 10px;
    }
    
    .search-box button {
        width: 100%;
    }
    
    .mega-menu-links a {
        padding: 15px 20px 15px 30px;
        font-size: 14px;
        border-bottom: 1px solid var(--border-color);
    }
    
    .mega-menu-links a:hover {
        background: var(--secondary-color);
        color: var(--primary-color);
        padding-left: 35px;
    }
    
    .logo img {
        max-height: 40px;
    }
}

/* Animation bouton burger */
.menu-toggle.active span:nth-child(1) { 
    transform: rotate(45deg) translate(5px, 5px); 
}

.menu-toggle.active span:nth-child(2) { 
    opacity: 0; 
}

.menu-toggle.active span:nth-child(3) { 
    transform: rotate(-45deg) translate(7px, -6px); 
}