/* ============================================
   Agence Immobilière Errachidia — Témara
   Landing Page Stylesheet
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a5276;
    --primary-dark: #0e3650;
    --primary-light: #2980b9;
    --accent: #d4ac0d;
    --accent-light: #f1c40f;
    --bg: #ffffff;
    --bg-alt: #f8f9fa;
    --bg-dark: #0b1d2e;
    --text: #2c3e50;
    --text-light: #5d6d7e;
    --text-white: #ffffff;
    --border: #e5e8eb;
    --shadow: 0 4px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s ease;
    --font-fr: 'Poppins', sans-serif;
    --font-ar: 'Noto Kufi Arabic', sans-serif;
    --whatsapp: #25d366;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-fr);
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* RTL Mode */
html[dir="rtl"] body {
    font-family: var(--font-ar);
}

html[dir="rtl"] .logo-text {
    font-family: var(--font-ar);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow var(--transition);
}

.header.scrolled {
    box-shadow: var(--shadow);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo-placeholder {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

/* Navigation */
.nav-list {
    display: flex;
    gap: 8px;
    list-style: none;
}

.nav-list a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    transition: all var(--transition);
}

.nav-list a:hover,
.nav-list a:focus {
    color: var(--primary);
    background: var(--bg-alt);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 2px solid var(--primary);
    border-radius: 50px;
    background: transparent;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    transition: all var(--transition);
    font-family: inherit;
}

html[dir="rtl"] .lang-switch {
    font-family: var(--font-fr);
}

.lang-switch:hover {
    background: var(--primary);
    color: var(--text-white);
}

.lang-icon {
    font-size: 1.1rem;
}

.lang-short {
    display: none;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero --- */
.hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, rgba(26,82,118,0.92) 0%, rgba(14,54,80,0.88) 100%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%231a5276" fill-opacity="0.1" d="M0,192L48,197.3C96,203,192,213,288,229.3C384,245,480,267,576,250.7C672,235,768,181,864,170.7C960,160,1056,192,1152,197.3C1248,203,1344,181,1392,170.7L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom center;
    background-size: cover;
    padding: 120px 0 80px;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(212,172,13,0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(41,128,185,0.12) 0%, transparent 60%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 20px;
    line-height: 1.2;
}

html[dir="rtl"] .hero h1 {
    font-family: var(--font-ar);
    line-height: 1.5;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: rgba(255,255,255,0.85);
    margin-bottom: 36px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    font-family: inherit;
}

html[dir="rtl"] .btn {
    font-family: var(--font-ar);
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-dark);
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(212,172,13,0.4);
}

.btn-whatsapp {
    background: var(--whatsapp);
    color: #fff;
}

.btn-whatsapp:hover {
    background: #20ba5a;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(37,211,102,0.4);
}

/* --- Sections Common --- */
.section-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    margin-bottom: 12px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 48px;
    font-size: 1rem;
    line-height: 1.7;
}

/* --- Services --- */
.services {
    padding: 80px 0;
    background: var(--bg-alt);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.service-card {
    background: var(--bg);
    padding: 36px 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.service-icon {
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
}

.service-card p {
    color: var(--text-light);
    font-size: 0.92rem;
    line-height: 1.7;
}

/* --- About --- */
.about {
    padding: 80px 0;
    background: var(--bg);
}

.about-inner {
    max-width: 800px;
    margin: 0 auto;
}

.about-content .section-title {
    text-align: start;
}

.about-content p {
    color: var(--text-light);
    margin-bottom: 16px;
    font-size: 1rem;
    line-height: 1.8;
}

.about-content strong {
    color: var(--primary);
}

.about-stats {
    display: flex;
    gap: 32px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    flex: 1;
    min-width: 160px;
}

.stat-icon {
    font-size: 1.8rem;
}

.stat strong {
    display: block;
    font-size: 1rem;
    color: var(--primary);
}

.stat span {
    font-size: 0.82rem;
    color: var(--text-light);
}

/* --- Zones --- */
.zones {
    padding: 80px 0;
    background: var(--bg-alt);
}

.zones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.zone-card {
    background: var(--bg);
    padding: 28px 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.zone-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.zone-card.zone-main {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--text-white);
    grid-column: span 2;
}

.zone-card.zone-main h3 {
    color: var(--accent);
}

.zone-card.zone-main p {
    color: rgba(255,255,255,0.85);
}

.zone-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.zone-card p {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* --- Contact --- */
.contact {
    padding: 80px 0;
    background: var(--bg);
}

.contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 36px 24px;
    background: var(--bg-alt);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

a.contact-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
    transform: translateY(-4px);
}

.contact-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eaf2f8;
    border-radius: 50%;
    margin-bottom: 16px;
}

.contact-icon-wa {
    background: #e6f9ed;
}

.contact-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.contact-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    word-break: break-word;
}

/* --- Map --- */
.map-container {
    margin-top: 48px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.map-container iframe {
    display: block;
    width: 100%;
    min-height: 400px;
}

@media (max-width: 768px) {
    .map-container iframe {
        min-height: 280px;
    }
}

/* --- Footer --- */
.footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.7);
    padding: 40px 0;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.footer-brand strong {
    color: var(--text-white);
    font-size: 1.1rem;
}

.footer-brand p {
    font-size: 0.85rem;
    margin-top: 4px;
}

.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-copy {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

/* --- Floating WhatsApp --- */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: var(--whatsapp);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37,211,102,0.4);
    z-index: 999;
    transition: all var(--transition);
    animation: whatsapp-pulse 2s infinite;
}

html[dir="rtl"] .whatsapp-float {
    right: auto;
    left: 24px;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37,211,102,0.5);
}

@keyframes whatsapp-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37,211,102,0.5); }
    70% { box-shadow: 0 0 0 15px rgba(37,211,102,0); }
    100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .nav {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border);
        padding: 24px;
        transform: translateY(-120%);
        opacity: 0;
        transition: all var(--transition);
        z-index: 999;
    }

    .nav.open {
        transform: translateY(0);
        opacity: 1;
    }

    .nav-list {
        flex-direction: column;
        gap: 4px;
    }

    .nav-list a {
        display: block;
        padding: 12px 16px;
        font-size: 1rem;
    }

    .mobile-menu-btn {
        display: flex;
    }
}

@media (max-width: 768px) {
    .hero {
        min-height: 75vh;
        padding: 100px 0 60px;
    }

    .hero h1 {
        font-size: clamp(1.6rem, 6vw, 2.2rem);
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .services,
    .about,
    .zones,
    .contact {
        padding: 60px 0;
    }

    .about-stats {
        flex-direction: column;
        gap: 16px;
    }

    .zone-card.zone-main {
        grid-column: span 1;
    }

    .contact-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header-inner {
        height: 64px;
    }

    .logo-text {
        font-size: 0.75rem;
    }

    .lang-label {
        display: none;
    }

    .lang-icon {
        display: none;
    }

    .lang-short {
        display: inline;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .zones-grid {
        grid-template-columns: 1fr;
    }

    .whatsapp-float {
        bottom: 16px;
        right: 16px;
        width: 54px;
        height: 54px;
    }

    html[dir="rtl"] .whatsapp-float {
        right: auto;
        left: 16px;
    }
}

/* --- Scroll Animations --- */
.animate-target {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.animate-target.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.service-card.animate-target:nth-child(2) { transition-delay: 0.1s; }
.service-card.animate-target:nth-child(3) { transition-delay: 0.2s; }
.service-card.animate-target:nth-child(4) { transition-delay: 0.3s; }

.zone-card.animate-target:nth-child(2) { transition-delay: 0.05s; }
.zone-card.animate-target:nth-child(3) { transition-delay: 0.1s; }
.zone-card.animate-target:nth-child(4) { transition-delay: 0.15s; }
.zone-card.animate-target:nth-child(5) { transition-delay: 0.2s; }
.zone-card.animate-target:nth-child(6) { transition-delay: 0.25s; }
