/* =====================================================================
   محجوز — نظام التصميم (Design System)
   هوية خضراء نظيفة، RTL، متجاوب مع كل الشاشات. لا يحتاج أي خطوة بناء.
   ===================================================================== */

:root {
    /* الألوان الأساسية */
    --brand:        #1faa4c;
    --brand-600:    #189a44;
    --brand-700:    #14823a;
    --brand-050:    #eaf8ef;
    --brand-100:    #d6f0de;
    --brand-200:    #b7e6c5;

    --accent-red:   #e23b3b;
    --accent-amber: #f6b21b;
    --whatsapp:     #25d366;
    --call:         #1f2937;

    --ink:          #16241c;
    --muted:        #6b7b71;
    --line:         #e7efe9;
    --bg:           #f4f8f5;
    --card:         #ffffff;

    --radius:       18px;
    --radius-sm:    12px;
    --radius-lg:    26px;
    --shadow-sm:    0 2px 8px rgba(20, 80, 45, .06);
    --shadow:       0 8px 26px rgba(20, 90, 50, .10);
    --shadow-lg:    0 16px 40px rgba(20, 90, 50, .16);
    --container:    1180px;
    --header-h:     68px;
}

* { box-sizing: border-box; }

[x-cloak] { display: none !important; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Tajawal', 'Cairo', system-ui, 'Segoe UI', Tahoma, sans-serif;
    color: var(--ink);
    background: var(--bg);
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    padding-bottom: env(safe-area-inset-bottom);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 18px;
}

/* ===================== الهيدر ===================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
    height: var(--header-h);
}
.site-header .container {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 18px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.45rem;
    color: var(--brand-700);
}
.brand .logo-mark {
    width: 38px; height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), var(--brand-700));
    display: grid; place-items: center;
    color: #fff; font-size: 1.2rem;
    box-shadow: var(--shadow-sm);
}
.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-inline-start: auto;
}
.main-nav a {
    padding: 9px 14px;
    border-radius: 12px;
    font-weight: 600;
    color: var(--muted);
    transition: .18s;
    font-size: .98rem;
}
.main-nav a:hover { background: var(--brand-050); color: var(--brand-700); }
.main-nav a.active { background: var(--brand); color: #fff; }

.header-search {
    display: flex; align-items: center; gap: 8px;
    background: var(--brand-050);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 8px 14px;
    min-width: 230px;
    color: var(--muted);
}
.header-search input {
    border: 0; background: transparent; outline: none;
    font-family: inherit; width: 100%; color: var(--ink);
}

/* ===================== أزرار عامة ===================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    border: 0; border-radius: 14px;
    padding: 12px 20px;
    font-weight: 700; font-size: 1rem;
    transition: .18s; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary  { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-600); }
.btn-ghost    { background: #fff; color: var(--brand-700); border: 1.5px solid var(--brand-200); }
.btn-ghost:hover { background: var(--brand-050); }
.btn-danger   { background: var(--accent-red); color: #fff; }
.btn-dark     { background: var(--call); color: #fff; }
.btn-whatsapp { background: var(--whatsapp); color: #fff; }
.btn-block    { width: 100%; }
.btn-sm       { padding: 8px 14px; font-size: .9rem; border-radius: 11px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ===================== الهيرو ===================== */
.hero {
    background: linear-gradient(160deg, var(--brand) 0%, var(--brand-700) 100%);
    color: #fff;
    padding: 34px 0 64px;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: '';
    position: absolute; inset: auto -10% -40% -10%;
    height: 220px;
    background: radial-gradient(closest-side, rgba(255,255,255,.16), transparent);
}
.hero h1 { margin: 0 0 6px; font-size: 2rem; font-weight: 800; }
.hero h1 .hl { color: #d8ffe4; }
.hero p { margin: 0 0 22px; opacity: .92; font-size: 1.05rem; }
.hero-search {
    background: #fff; border-radius: 16px;
    display: flex; align-items: center; gap: 10px;
    padding: 8px 8px 8px 16px;
    box-shadow: var(--shadow);
    max-width: 640px;
}
.hero-search input {
    flex: 1; border: 0; outline: none;
    font-family: inherit; font-size: 1.02rem;
    color: var(--ink); background: transparent;
}
.hero-search .icon { color: var(--brand); font-size: 1.2rem; }

/* ===================== الأقسام ===================== */
.section {
    margin: 30px 0;
}
.section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.section-head h2 {
    margin: 0; font-size: 1.3rem; font-weight: 800;
    display: flex; align-items: center; gap: 10px;
}
.section-head h2::before {
    content: ''; width: 6px; height: 22px; border-radius: 6px;
    background: var(--brand); display: inline-block;
}
.section-head .more {
    color: var(--brand-700); font-weight: 700; font-size: .95rem;
    display: inline-flex; align-items: center; gap: 4px;
}
.section-head .more:hover { text-decoration: underline; }

/* تمرير أفقي للمعاينات */
.scroller {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 290px;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}
.scroller > * { scroll-snap-align: start; }

/* شبكة عامة */
.grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.grid-cats {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* ===================== بطاقة المزرعة ===================== */
.farm-card {
    position: relative;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: .2s;
    border: 1px solid var(--line);
    display: flex; flex-direction: column;
}
.farm-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.farm-media {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--brand-050);
}
.farm-media img { width: 100%; height: 100%; object-fit: cover; }
.farm-badges {
    position: absolute; top: 10px; inset-inline-start: 10px;
    display: flex; gap: 6px;
}
.badge {
    font-size: .72rem; font-weight: 800;
    padding: 4px 9px; border-radius: 9px;
    color: #fff; box-shadow: var(--shadow-sm);
}
.badge-vip   { background: var(--accent-amber); color: #4a3500; }
.badge-offer { background: var(--accent-red); }
.fav-btn {
    position: absolute; top: 10px; inset-inline-end: 10px;
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,.92);
    display: grid; place-items: center;
    border: 0; color: var(--muted);
    box-shadow: var(--shadow-sm); transition: .15s;
    font-size: 1.05rem;
}
.fav-btn:hover { transform: scale(1.08); }
.fav-btn.is-fav { color: var(--accent-red); }
.farm-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.farm-name { font-weight: 800; font-size: 1.05rem; margin: 0; }
.farm-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: .85rem; }
.farm-meta span { display: inline-flex; align-items: center; gap: 5px; }
.farm-foot {
    margin-top: auto; display: flex; align-items: center; justify-content: space-between;
    padding-top: 10px; border-top: 1px dashed var(--line);
}
.price-tag { font-weight: 800; color: var(--brand-700); font-size: 1.05rem; }
.price-tag small { color: var(--muted); font-weight: 500; font-size: .75rem; }

/* ===================== بطاقة قسم ===================== */
.cat-card {
    position: relative; border-radius: var(--radius);
    overflow: hidden; aspect-ratio: 16 / 10;
    box-shadow: var(--shadow-sm); border: 1px solid var(--line);
    transition: .2s;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.cat-card img { width: 100%; height: 100%; object-fit: cover; }
.cat-card .overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(20,130,58,.82), rgba(20,130,58,.15) 60%, transparent);
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 14px;
}
.cat-card .overlay span {
    color: #fff; font-weight: 800; font-size: 1.15rem;
    text-shadow: 0 2px 8px rgba(0,0,0,.35);
}

/* ===================== السلايدر/الإعلان ===================== */
.promo {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    aspect-ratio: 21 / 7;
    background: var(--brand-100);
    position: relative;
}
.promo img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) { .promo { aspect-ratio: 16 / 9; } }

/* ===================== صفحة التفاصيل ===================== */
.detail-hero {
    position: relative; border-radius: var(--radius-lg);
    overflow: hidden; box-shadow: var(--shadow);
    aspect-ratio: 16 / 9; background: var(--brand-050);
}
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero .fav-btn { width: 44px; height: 44px; font-size: 1.2rem; }
.gallery-thumbs {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px; margin-top: 14px;
}
.gallery-thumbs img {
    aspect-ratio: 1; object-fit: cover; border-radius: 12px;
    cursor: pointer; border: 2px solid transparent; transition: .15s;
}
.gallery-thumbs img:hover { border-color: var(--brand); }

.detail-card {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); border: 1px solid var(--line);
    padding: 18px;
}

/* التبويبات */
.tabs {
    display: flex; gap: 6px; border-bottom: 2px solid var(--line);
    margin-bottom: 18px; overflow-x: auto;
}
.tab {
    padding: 10px 16px; font-weight: 700; color: var(--muted);
    border: 0; background: transparent; position: relative;
    white-space: nowrap; transition: .15s;
}
.tab.active { color: var(--brand-700); }
.tab.active::after {
    content: ''; position: absolute; bottom: -2px; inset-inline: 8px;
    height: 3px; border-radius: 3px; background: var(--brand);
}

/* الأكورديون (تفاصيل العقار) */
.acc-item { border-bottom: 1px solid var(--line); }
.acc-head {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    padding: 14px 4px; background: transparent; border: 0;
    font-weight: 700; font-size: 1.02rem; color: var(--ink);
}
.acc-head .lead { display: inline-flex; align-items: center; gap: 10px; }
.acc-head .chev { transition: .2s; color: var(--muted); }
.acc-item.open .chev { transform: rotate(180deg); }
.acc-body { padding: 0 8px 14px; color: var(--muted); }

/* جدول الأسعار */
.price-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.price-table th, .price-table td {
    border: 1px solid var(--line); padding: 9px 6px; text-align: center;
}
.price-table thead th { background: var(--brand-050); color: var(--brand-700); font-weight: 800; }
.price-table tbody th { background: var(--brand-050); font-weight: 800; }
.price-note {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--brand-050); color: var(--brand-700);
    padding: 8px 12px; border-radius: 12px; font-weight: 700; font-size: .9rem;
    margin: 6px 6px 0 0;
}

/* لوحة التواصل/الحجز اللاصقة */
.booking-bar {
    position: sticky; bottom: 0; z-index: 30;
    background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(20,90,50,.08);
    padding: 12px 0; margin-top: 24px;
}
.booking-bar .container { display: flex; gap: 10px; align-items: center; }
.contact-round {
    width: 50px; height: 50px; border-radius: 50%;
    display: grid; place-items: center; color: #fff; font-size: 1.3rem;
    box-shadow: var(--shadow-sm); flex: 0 0 auto;
}

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.stat {
    background: var(--brand-050); border-radius: 14px; padding: 14px 6px;
}
.stat .num { font-weight: 800; font-size: 1.2rem; color: var(--brand-700); }
.stat .lbl { color: var(--muted); font-size: .8rem; }

/* ===================== شريط التنقل السفلي (الموبايل) ===================== */
.bottom-nav { display: none; }
@media (max-width: 860px) {
    .main-nav, .header-search { display: none; }
    .bottom-nav {
        position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
        background: #fff; border-top: 1px solid var(--line);
        display: flex; justify-content: space-around;
        padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
        box-shadow: 0 -6px 20px rgba(20,90,50,.08);
    }
    .bottom-nav a {
        display: flex; flex-direction: column; align-items: center; gap: 3px;
        color: var(--muted); font-size: .72rem; font-weight: 700; flex: 1;
    }
    .bottom-nav a .ic { font-size: 1.3rem; }
    .bottom-nav a.active { color: var(--brand); }
    body { padding-bottom: 70px; }
    .booking-bar { bottom: 66px; }
}

/* ===================== متفرقات ===================== */
.skeleton {
    background: linear-gradient(90deg, #eef4f0 25%, #e2ece6 37%, #eef4f0 63%);
    background-size: 400% 100%; animation: shimmer 1.4s infinite;
    border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 100% 0 } 100% { background-position: -100% 0 } }

.empty-state {
    text-align: center; padding: 60px 20px; color: var(--muted);
}
.empty-state .ic { font-size: 3rem; opacity: .5; }

.chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--brand-050); color: var(--brand-700);
    border: 1px solid var(--brand-100);
    padding: 7px 13px; border-radius: 999px; font-weight: 700; font-size: .88rem;
    cursor: pointer; transition: .15s;
}
.chip.active, .chip:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: .92rem; }
.field input, .field select {
    width: 100%; padding: 11px 14px; border: 1.5px solid var(--line);
    border-radius: 12px; font-family: inherit; outline: none; background: #fff;
    transition: .15s; color: var(--ink);
}
.field input:focus, .field select:focus { border-color: var(--brand); }

.toast {
    position: fixed; bottom: 90px; inset-inline-start: 50%; transform: translateX(50%);
    background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 14px;
    box-shadow: var(--shadow-lg); z-index: 100; font-weight: 700;
}

.site-footer {
    background: #0f1c14; color: #cfe6d6; margin-top: 40px;
    padding: 30px 0; text-align: center; font-size: .9rem;
}
.site-footer .brand { color: #fff; justify-content: center; margin-bottom: 8px; }

/* لوحة فلترة جانبية */
.filter-panel {
    background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm);
    position: sticky; top: calc(var(--header-h) + 14px);
}

.two-col { display: grid; grid-template-columns: 300px 1fr; gap: 22px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

@media (max-width: 640px) {
    .hero h1 { font-size: 1.6rem; }
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
    .booking-bar .btn span.txt { display: none; }
}
