/* Areed public website — RTL first, no external fonts or scripts (strict CSP). */
:root {
    --brand: #0b7a6e;
    --brand-dark: #075a51;
    --text: #1c2321;
    --muted: #5b6766;
    --bg: #f5f7f6;
    --surface: #ffffff;
    --border: #e1e7e5;
    --featured: #b7791f;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 24, 22, .06), 0 4px 16px rgba(16, 24, 22, .05);
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --text: #e7eceb;
        --muted: #a3b0ae;
        --bg: #101514;
        --surface: #182120;
        --border: #26302f;
        --shadow: none;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Kufi Arabic", "Geeza Pro", "SF Arabic", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
}

img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 20px; padding-bottom: 40px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.ltr { direction: ltr; unicode-bidi: embed; text-align: start; }
.empty { color: var(--muted); padding: 24px 0; }

/* Header / footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.25rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: #fff; }
.tagline { color: var(--muted); font-size: .9rem; flex: 1; }
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 28px 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; margin: 16px 0 8px; }
.copyright { color: var(--muted); font-size: .85rem; margin: 0; }

/* Buttons & badges */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px;
    border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: .95rem; cursor: pointer; }
.btn:hover { text-decoration: none; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .875rem; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { border-color: var(--brand); color: var(--brand); background: transparent; }
.btn-dark { background: #111; color: #fff; }
.btn[hidden] { display: none; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; background: var(--bg); border: 1px solid var(--border); }
.badge-featured { background: var(--featured); color: #fff; border-color: transparent; }
.badge-soft { background: rgba(11, 122, 110, .1); color: var(--brand); border-color: transparent; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

/* Hero & sections */
.hero { padding: 28px 0 12px; }
.hero p { color: var(--muted); max-width: 640px; }
.section-title { margin: 20px 0 12px; }

/* Listing cards */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; color: var(--text); box-shadow: var(--shadow); }
.card:hover { text-decoration: none; border-color: var(--brand); }
.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--bg); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .badge { position: absolute; top: 8px; inset-inline-start: 8px; }
.card-noimg { width: 100%; height: 100%; }
.card-body { padding: 10px 12px 12px; }
.card-title { font-size: .95rem; font-weight: 600; margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-price { color: var(--brand); font-weight: 700; margin: 0; }
.card-meta { color: var(--muted); font-size: .8rem; margin: 2px 0 0; }

/* Listing page */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: .875rem; margin-bottom: 12px; }
.listing { display: grid; gap: 20px; }
@media (min-width: 900px) { .listing { grid-template-columns: 3fr 2fr; align-items: start; } }
.gallery-main { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.gallery-main img { width: 100%; height: auto; max-height: 560px; object-fit: contain; margin: 0 auto; }
.gallery-thumbs { list-style: none; display: flex; gap: 8px; padding: 0; margin: 10px 0 0; overflow-x: auto; }
.gallery-thumbs img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.gallery-empty { display: grid; place-items: center; min-height: 220px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); }
.listing-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.listing-title { font-size: 1.45rem; }
.listing-price { color: var(--brand); font-size: 1.4rem; font-weight: 700; margin: 0 0 10px; }
.facts { margin: 0 0 8px; }
.facts div { display: flex; gap: 8px; }
.facts dt { color: var(--muted); min-width: 70px; }
.facts dd { margin: 0; }
.cta { margin-top: 14px; }
.cta .btn { width: 100%; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-top: 16px; }
.description { white-space: normal; overflow-wrap: anywhere; }
.specs { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin: 0; }
.spec { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; background: var(--bg); border-radius: 10px; }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; font-weight: 600; }
.seller-name { font-weight: 700; margin: 0; }
.safety ul { margin: 0; padding-inline-start: 20px; }

/* Store & user pages */
.profile { display: flex; align-items: center; gap: 16px; margin: 8px 0 12px; }
.profile-image { width: 96px; height: 96px; object-fit: cover; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); }
.profile-image.round { border-radius: 50%; }

/* Pagination, messages, legal pages */
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 20px; }
.message { text-align: center; padding: 60px 0; }
.lang-switch { text-align: end; margin: 0; }
.prose { max-width: 820px; }
.prose h1 { font-size: 1.5rem; }
.prose h2 { font-size: 1.15rem; margin-top: 1.4rem; }
.prose ul { padding-inline-start: 22px; }
.get-app-title { font-weight: 700; margin: 0; }
.store-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
