/*
 * The site's shared UI set: one look for buttons, chips, tabs, segments, pagination, slider arrows, form fields,
 * headings, cards, FAQ rows, badges and icons. Every class starts with "ui-", so loading this file never changes
 * anything that does not use it; pages move onto it one at a time.
 *
 * Shown, with every state, on the local page /ui-style-guide (resources/views/frontend/ui-style-guide.blade.php).
 *
 * Two traps from the site's older CSS are answered here on purpose:
 *   - style.css paints every <span> near-black (span { color: var(--black-font-color) }), which made dark chips
 *     unreadable on sale/rent; text inside these components inherits its colour instead.
 *   - style.css turns every link grey on hover with !important (a:hover { color: var(--primary-color) !important }),
 *     so a link styled as a dark button keeps its own colour on hover here, also with !important.
 *
 * Logical properties (inline-start/end) throughout, so Arabic (right to left) needs nothing extra.
 */

:root {
    /* Colours. Text colours are at least 4.5:1 on white, borders of fields at least 2:1. */
    --ui-ink: #171617;          /* primary buttons, active chips/tabs, headings */
    --ui-ink-hover: #000000;
    --ui-text: #1c2430;         /* body text */
    --ui-muted: #5b6677;        /* secondary text, inactive tabs (5.8:1, the old #c0bfbf was 1.8:1) */
    --ui-line: #e3e7ed;         /* dividers, card borders */
    --ui-field: #b9c1cc;        /* borders of inputs, chips, outline buttons */
    --ui-subtle: #f4f5f7;       /* soft backgrounds, hover on white */
    --ui-surface: #ffffff;
    --ui-gold: #e2b93b;         /* highlight only: Golden Visa, featured */
    --ui-gold-soft: #fbf4dc;
    --ui-gold-ink: #6b4f00;
    --ui-whatsapp: #15803d;     /* white text on it is 5:1 (the brand's light green is 2:1) */
    --ui-whatsapp-hover: #116a32;
    --ui-success: #157347;
    --ui-success-soft: #e6f4ec;
    --ui-danger: #b42318;
    --ui-danger-soft: #fdecea;
    --ui-focus: 0 0 0 3px rgba(23, 22, 23, .22);

    /* Shape and size: one corner for buttons, fields and cards (cards a little rounder), chips are pills. */
    --ui-r: 10px;
    --ui-r-card: 14px;
    --ui-h-lg: 48px;            /* main buttons and form fields */
    --ui-h-md: 40px;            /* smaller buttons */
    --ui-h-chip: 36px;          /* chips, filters, segments */
    --ui-h-xs: 32px;            /* toolbars (map) */
    --ui-shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
    --ui-shadow-md: 0 6px 18px rgba(16, 24, 40, .10);
    --ui-font: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Text ---------- */
.ui-h1, .ui-h2, .ui-h3 { font-family: var(--ui-font); color: var(--ui-ink); margin: 0; letter-spacing: -.01em; }
.ui-h1 { font-size: 32px; line-height: 1.2; font-weight: 700; }
.ui-h2 { font-size: 24px; line-height: 1.25; font-weight: 700; }
.ui-h3 { font-size: 18px; line-height: 1.35; font-weight: 600; }
.ui-eyebrow { font: 700 12px/1.4 var(--ui-font); letter-spacing: .08em; text-transform: uppercase; color: var(--ui-muted); margin: 0; }
.ui-lead { font: 400 16px/1.6 var(--ui-font); color: var(--ui-muted); margin: 0; text-align: start; }
.ui-body { font: 400 15px/1.65 var(--ui-font); color: var(--ui-text); text-align: start; }
.ui-small { font: 400 13px/1.5 var(--ui-font); color: var(--ui-muted); }
.ui-link { color: var(--ui-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.ui-link:hover { color: var(--ui-ink-hover) !important; text-decoration-thickness: 2px; }
@media (max-width: 767.98px) {
    .ui-h1 { font-size: 26px; }
    .ui-h2 { font-size: 21px; }
    .ui-h3 { font-size: 17px; }
}

/* ---------- Icons ----------
   jQuery UI (loaded on many pages) owns a class of the same name: a 16px box with its sprite sheet as background,
   text pushed off-screen and a -.25em nudge. All of that is undone here, or the sprite shows behind every icon. */
.ui-icon {
    width: 20px; height: 20px; flex: 0 0 auto; display: inline-block; vertical-align: middle;
    background: none !important; text-indent: 0 !important; overflow: visible !important;
    margin-top: 0;
}
.ui-icon--sm { width: 16px; height: 16px; }
.ui-icon--lg { width: 24px; height: 24px; }

/* ---------- Buttons ---------- */
.ui-btn {
    --_bg: var(--ui-ink); --_fg: #fff; --_bd: var(--ui-ink);
    --_bg-h: var(--ui-ink-hover); --_fg-h: #fff; --_bd-h: var(--ui-ink-hover);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--ui-h-lg); padding: 0 22px; box-sizing: border-box;
    font: 600 15px/1.2 var(--ui-font); letter-spacing: 0; text-transform: none; text-align: center; white-space: nowrap;
    color: var(--_fg) !important; background: var(--_bg); border: 1px solid var(--_bd); border-radius: var(--ui-r);
    text-decoration: none !important; cursor: pointer; user-select: none;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.ui-btn span, .ui-btn small, .ui-btn strong { color: inherit; }
.ui-btn:hover { background: var(--_bg-h); border-color: var(--_bd-h); color: var(--_fg-h) !important; }
.ui-btn:active { transform: translateY(1px); }
.ui-btn:focus-visible { outline: none; box-shadow: var(--ui-focus); }
.ui-btn[disabled], .ui-btn.is-disabled, .ui-btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.ui-btn--secondary { --_bg: var(--ui-surface); --_fg: var(--ui-ink); --_bd: var(--ui-field); --_bg-h: var(--ui-subtle); --_fg-h: var(--ui-ink); --_bd-h: var(--ui-ink); }
.ui-btn--ghost { --_bg: transparent; --_fg: var(--ui-ink); --_bd: transparent; --_bg-h: var(--ui-subtle); --_fg-h: var(--ui-ink); --_bd-h: transparent; padding-inline: 14px; }
.ui-btn--gold { --_bg: var(--ui-gold); --_fg: var(--ui-ink); --_bd: var(--ui-gold); --_bg-h: #d4aa2a; --_fg-h: var(--ui-ink); --_bd-h: #d4aa2a; }
.ui-btn--whatsapp { --_bg: var(--ui-whatsapp); --_fg: #fff; --_bd: var(--ui-whatsapp); --_bg-h: var(--ui-whatsapp-hover); --_fg-h: #fff; --_bd-h: var(--ui-whatsapp-hover); }
.ui-btn--on-dark { --_bg: #fff; --_fg: var(--ui-ink); --_bd: #fff; --_bg-h: #eceef1; --_fg-h: var(--ui-ink); --_bd-h: #eceef1; }
.ui-btn--sm { min-height: var(--ui-h-md); padding: 0 16px; font-size: 14px; }
.ui-btn--block { display: flex; width: 100%; }
.ui-btn--icon { width: var(--ui-h-lg); padding: 0; }
.ui-btn--icon.ui-btn--sm { width: var(--ui-h-md); }
.ui-btn.is-loading { pointer-events: none; color: transparent !important; position: relative; }
.ui-btn.is-loading::after {
    content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid var(--_fg); border-inline-end-color: transparent; animation: ui-spin .7s linear infinite;
}
@keyframes ui-spin { to { transform: rotate(360deg); } }

/* ---------- Chips and filters ---------- */
.ui-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ui-chip {
    display: inline-flex; align-items: center; gap: 6px; min-height: var(--ui-h-chip); padding: 0 14px; box-sizing: border-box;
    font: 500 14px/1.2 var(--ui-font); color: var(--ui-text) !important; background: var(--ui-surface);
    border: 1px solid var(--ui-field); border-radius: 999px; cursor: pointer; white-space: nowrap; text-decoration: none !important;
    transition: background-color .15s, border-color .15s, color .15s;
}
.ui-chip span, .ui-chip small { color: inherit; }
.ui-chip:hover { border-color: var(--ui-ink); color: var(--ui-ink) !important; }
.ui-chip:focus-visible { outline: none; box-shadow: var(--ui-focus); }
.ui-chip.is-active, .ui-chip[aria-pressed="true"], .ui-chip[aria-selected="true"] { background: var(--ui-ink); border-color: var(--ui-ink); color: #fff !important; }
.ui-chip__count { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--ui-subtle); color: var(--ui-muted) !important; }
.ui-chip.is-active .ui-chip__count { background: rgba(255, 255, 255, .18); color: #fff !important; }
.ui-chip--gold { background: var(--ui-gold-soft); border-color: #ecd68f; color: var(--ui-gold-ink) !important; }
.ui-chip--gold:hover { border-color: var(--ui-gold); color: var(--ui-gold-ink) !important; }
.ui-chip__x { width: 16px; height: 16px; margin-inline-end: -4px; opacity: .7; }

/* ---------- Tabs (underline) ---------- */
.ui-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--ui-line); overflow-x: auto; scrollbar-width: none; }
.ui-tabs::-webkit-scrollbar { display: none; }
.ui-tab {
    position: relative; padding: 12px 2px; background: none; border: 0; cursor: pointer; white-space: nowrap;
    font: 600 15px/1.2 var(--ui-font); color: var(--ui-muted) !important; text-decoration: none !important;
}
.ui-tab span { color: inherit; }
.ui-tab::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2px; background: transparent; border-radius: 2px; }
.ui-tab:hover { color: var(--ui-ink) !important; }
.ui-tab.is-active, .ui-tab[aria-selected="true"] { color: var(--ui-ink) !important; }
.ui-tab.is-active::after, .ui-tab[aria-selected="true"]::after { background: var(--ui-ink); }
.ui-tab:focus-visible { outline: none; box-shadow: var(--ui-focus); border-radius: 6px; }

/* ---------- Segmented switch (List | Split, Grid | Table) ---------- */
.ui-segment { display: inline-flex; padding: 3px; gap: 2px; background: var(--ui-subtle); border: 1px solid var(--ui-line); border-radius: var(--ui-r); }
.ui-segment__item {
    display: inline-flex; align-items: center; gap: 6px; min-height: calc(var(--ui-h-chip) - 8px); padding: 0 12px;
    font: 600 13px/1.2 var(--ui-font); color: var(--ui-muted) !important; background: transparent; border: 0;
    border-radius: calc(var(--ui-r) - 3px); cursor: pointer; text-decoration: none !important;
}
.ui-segment__item span { color: inherit; }
.ui-segment__item:hover { color: var(--ui-ink) !important; }
.ui-segment__item.is-active, .ui-segment__item[aria-pressed="true"] { background: var(--ui-surface); color: var(--ui-ink) !important; box-shadow: var(--ui-shadow-sm); }

/* ---------- Pagination and "load more" ---------- */
.ui-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ui-pager__item {
    display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 10px; box-sizing: border-box;
    font: 600 14px/1 var(--ui-font); color: var(--ui-text) !important; background: var(--ui-surface);
    border: 1px solid var(--ui-line); border-radius: var(--ui-r); text-decoration: none !important;
}
.ui-pager__item span { color: inherit; }
.ui-pager__item:hover { border-color: var(--ui-ink); color: var(--ui-ink) !important; }
.ui-pager__item.is-active, .ui-pager__item[aria-current="page"] { background: var(--ui-ink); border-color: var(--ui-ink); color: #fff !important; }
.ui-pager__item.is-disabled { opacity: .4; pointer-events: none; }
.ui-pager__gap { color: var(--ui-muted); padding: 0 4px; }

/* ---------- Slider arrows and dots ---------- */
.ui-arrow {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
    color: var(--ui-ink) !important; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: 50%;
    box-shadow: var(--ui-shadow-sm); cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
.ui-arrow:hover { border-color: var(--ui-ink); box-shadow: var(--ui-shadow-md); }
.ui-arrow:focus-visible { outline: none; box-shadow: var(--ui-focus); }
.ui-arrow[disabled], .ui-arrow.is-disabled { opacity: .35; pointer-events: none; }
.ui-arrow--sm { width: 36px; height: 36px; }
[dir="rtl"] .ui-arrow .ui-icon { transform: scaleX(-1); }
.ui-dots { display: flex; align-items: center; gap: 6px; }
.ui-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: #c9cfd8; cursor: pointer; transition: width .2s, background-color .2s; }
.ui-dot.is-active { width: 22px; background: var(--ui-ink); }
.ui-dots--on-dark .ui-dot { background: rgba(255, 255, 255, .5); }
.ui-dots--on-dark .ui-dot.is-active { background: #fff; }

/* ---------- Form fields ---------- */
.ui-field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.ui-label { font: 600 13px/1.3 var(--ui-font); color: var(--ui-ink); }
.ui-label .ui-req { color: var(--ui-danger); }
.ui-input, .ui-select, .ui-textarea {
    width: 100%; min-height: var(--ui-h-lg); box-sizing: border-box; padding: 0 14px;
    font: 400 15px/1.3 var(--ui-font); color: var(--ui-text); background: var(--ui-surface);
    border: 1px solid var(--ui-field); border-radius: var(--ui-r); box-shadow: none; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.ui-textarea { min-height: 112px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.ui-select {
    appearance: none; -webkit-appearance: none; padding-inline-end: 40px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231c2430' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
}
[dir="rtl"] .ui-select { background-position: left 14px center; }
.ui-input::placeholder, .ui-textarea::placeholder { color: #7a8494; opacity: 1; }
.ui-input:hover, .ui-select:hover, .ui-textarea:hover { border-color: #8c96a4; }
.ui-input:focus, .ui-select:focus, .ui-textarea:focus { border-color: var(--ui-ink); box-shadow: var(--ui-focus); }
.ui-input[disabled], .ui-select[disabled], .ui-textarea[disabled] { background: var(--ui-subtle); color: var(--ui-muted); cursor: not-allowed; }
.ui-help { font: 400 12.5px/1.4 var(--ui-font); color: var(--ui-muted); }
.ui-field.is-error .ui-input, .ui-field.is-error .ui-select, .ui-field.is-error .ui-textarea { border-color: var(--ui-danger); }
.ui-field.is-error .ui-help { color: var(--ui-danger); }
.ui-input-group { position: relative; display: flex; }
.ui-input-group > .ui-icon { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--ui-muted); pointer-events: none; }
.ui-input-group > .ui-input { padding-inline-start: 42px; }
.ui-check { display: inline-flex; align-items: flex-start; gap: 10px; font: 400 14px/1.45 var(--ui-font); color: var(--ui-text); cursor: pointer; }
.ui-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ui-ink); flex: 0 0 auto; cursor: pointer; }

/* ---------- Cards ---------- */
.ui-card { background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-r-card); box-shadow: var(--ui-shadow-sm); padding: 20px; }
.ui-card--hover { transition: box-shadow .2s, transform .2s; }
.ui-card--hover:hover { box-shadow: var(--ui-shadow-md); transform: translateY(-2px); }
.ui-card--soft { background: var(--ui-subtle); box-shadow: none; }

/* ---------- Badges ---------- */
.ui-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 6px; font: 600 12px/1.3 var(--ui-font); background: var(--ui-subtle); color: var(--ui-text); }
.ui-badge span { color: inherit; }
.ui-badge--dark { background: var(--ui-ink); color: #fff; }
.ui-badge--gold { background: var(--ui-gold-soft); color: var(--ui-gold-ink); }
.ui-badge--success { background: var(--ui-success-soft); color: var(--ui-success); }

/* ---------- FAQ / accordion (details + summary) ---------- */
.ui-accordion { display: flex; flex-direction: column; gap: 10px; }
.ui-acc { background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-r); overflow: hidden; }
.ui-acc > summary {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; cursor: pointer; list-style: none;
    font: 600 15px/1.4 var(--ui-font); color: var(--ui-ink);
}
.ui-acc > summary::-webkit-details-marker { display: none; }
.ui-acc > summary .ui-icon { transition: transform .2s; color: var(--ui-muted); }
.ui-acc[open] { border-color: #cfd5dd; box-shadow: var(--ui-shadow-sm); }
.ui-acc[open] > summary .ui-icon { transform: rotate(180deg); color: var(--ui-ink); }
.ui-acc > summary:focus-visible { outline: none; box-shadow: inset var(--ui-focus); }
.ui-acc__body { padding: 0 18px 18px; font: 400 15px/1.65 var(--ui-font); color: var(--ui-text); text-align: start; }

/* ---------- Scrollbars ----------
   One scrollbar everywhere, across and down: thin, rounded, light grey, darker under the pointer. The site had the
   browser's thick default in most places and four hand-made styles elsewhere.
   - scrollbar-color is forced (!important) so the hand-made ones follow; scrollbar-width is not, so a strip a page
     hides on purpose (scrollbar-width: none on chip rows and sliders) stays hidden.
   - Chrome and Firefox use the two standard properties; Safari only knows the ::-webkit-scrollbar ones below, where
     a page's own "display: none" is more specific and still wins. */
* {
    scrollbar-width: thin;
    scrollbar-color: #c4cad3 transparent !important;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background-color: #c4cad3; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #9aa3af; }
::-webkit-scrollbar-corner { background: transparent; }
