/* Soqy — small site stylesheet. Bootstrap does the layout; this file only
   adds what Bootstrap has no class for. Keep it short. */

:root {
    --brand: #0F4C5C;          /* deep teal: header + primary */
    --brand-dark: #0B3742;
    --accent: #F2B705;         /* amber: sell / search */
    --brand-soft: #E6F1FB;     /* light blue tint for panels */
    --line: #C3DDF1;           /* borders */
    /* White cards and fields on a light-blue page background. */
    --page-bg: #EAF2FA;        /* light blue page background */
    --card-bg: #FFFFFF;        /* cards, panels, pop-ups */
    --field-bg: #FFFFFF;       /* inputs, selects, table cells */
    --field-border: #B5D5EE;
    --field-text: #0B2530;
    --btn-soft: #D9EBFA;       /* light buttons */
    --btn-soft-hover: #C4DFF6;
    --bs-primary: #0F4C5C;
    --bs-primary-rgb: 15, 76, 92;
    --bs-link-color: #0F4C5C;
    --bs-link-color-rgb: 15, 76, 92;
    --bs-body-bg: var(--page-bg);
    --bs-font-sans-serif: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
    --bs-body-font-size: .95rem;
}
body { font-family: var(--bs-font-sans-serif); }

/* Language switching (setAppLang toggles .hidden).
   Arabic spans are authored with .hidden. A later single-class rule would
   keep them blank, so the active language has to outrank .hidden. */
.hidden { display: none !important; }
html[lang="ar"] .lang-ar.hidden,
html[lang="en"] .lang-en.hidden { display: inline !important; }

/* Brand colours on Bootstrap components */
.btn-primary {
    --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand);
}
.btn-warning {
    --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: #D9A404; --bs-btn-hover-border-color: #D9A404;
}
.nav-pills { --bs-nav-pills-link-active-bg: var(--brand); }

/* ---- White cards and fields on a light-blue page ---- */
.form-control, .form-select, .input-group-text,
:where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="hidden"], [type="submit"], [type="button"], [type="reset"]), select, textarea) {
    background-color: var(--field-bg);
    border-color: var(--field-border);
    color: var(--field-text);
}
.form-control:focus, .form-select:focus {
    background-color: var(--field-bg);
    color: var(--field-text);
    border-color: #6FAEDB;
    box-shadow: 0 0 0 .2rem rgba(15, 76, 92, .15);
}
.form-control::placeholder { color: #6A8796; opacity: 1; }
.form-check-input:not(:checked) { background-color: var(--field-bg); border-color: var(--field-border); }
.card { --bs-card-bg: var(--card-bg); --bs-card-cap-bg: var(--card-bg); --bs-card-border-color: var(--line); }
.modal-content { --bs-modal-bg: var(--card-bg); }
.dropdown-menu { --bs-dropdown-bg: var(--card-bg); --bs-dropdown-link-hover-bg: var(--btn-soft); }
.list-group { --bs-list-group-bg: var(--card-bg); }
.accordion { --bs-accordion-bg: var(--card-bg); }
.nav-tabs { --bs-nav-tabs-link-active-bg: var(--card-bg); }
.toast { --bs-toast-bg: var(--card-bg); }
.table { --bs-table-bg: var(--card-bg); --bs-table-striped-bg: #F5F9FD; --bs-table-hover-bg: var(--btn-soft); --bs-table-border-color: var(--line); }
.table-light { --bs-table-bg: var(--btn-soft); --bs-table-color: var(--brand-dark); --bs-table-border-color: var(--field-border); }
.btn-light, .btn-outline-secondary, .btn-outline-primary {
    --bs-btn-bg: var(--btn-soft); --bs-btn-color: var(--brand); --bs-btn-border-color: var(--field-border);
    --bs-btn-hover-bg: var(--btn-soft-hover); --bs-btn-hover-color: var(--brand-dark); --bs-btn-hover-border-color: #8EC0E6;
    --bs-btn-active-bg: var(--btn-soft-hover); --bs-btn-active-color: var(--brand-dark); --bs-btn-active-border-color: #8EC0E6;
}
.btn-outline-light { --bs-btn-hover-bg: var(--btn-soft); --bs-btn-hover-color: var(--brand); --bs-btn-active-bg: var(--btn-soft); --bs-btn-active-color: var(--brand); }
.pagination { --bs-pagination-bg: var(--btn-soft); --bs-pagination-border-color: var(--field-border); --bs-pagination-hover-bg: var(--btn-soft-hover); --bs-pagination-focus-bg: var(--btn-soft-hover); --bs-pagination-disabled-bg: var(--field-bg); }
.text-bg-light { background-color: var(--btn-soft) !important; color: var(--brand-dark) !important; }
.bg-white, .bg-body, .bg-light, .bg-body-tertiary, .bg-slate-50, .bg-gray-50 { background-color: var(--card-bg) !important; }
button.bg-white, a.bg-white, label.bg-white, .btn.bg-white { background-color: var(--btn-soft) !important; }
input.bg-white, select.bg-white, textarea.bg-white, .input-group-text.bg-white, .bg-\[\#FAF5FF\] { background-color: var(--field-bg) !important; }

/* ---- Searchable drop-down (components/form/combobox): wide, scrollable, A–Z ---- */
.soqy-combo { position: relative; }
.soqy-combo-toggle { display: block; width: 100%; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.soqy-combo-current-name { font-weight: 600; }
.soqy-combo-current-hint, .soqy-combo-hint { color: #557584; font-size: .85em; margin-inline-start: .4rem; }
.soqy-combo-placeholder { color: #6A8796; }
.soqy-combo-feedback { display: none !important; }
.soqy-combo.is-missing .soqy-combo-feedback { display: block !important; }
.soqy-combo-panel {
    position: absolute; top: calc(100% + .35rem); inset-inline-start: 0; z-index: 1060;
    width: min(38rem, calc(100vw - 1.5rem)); min-width: 100%;
    display: flex; flex-direction: column;
    background: var(--card-bg); border: 1px solid var(--field-border); border-radius: .85rem;
    box-shadow: 0 .75rem 2rem rgba(15, 76, 92, .2);
    animation: soqy-drop .15s ease-out;
}
.soqy-combo-up .soqy-combo-panel { top: auto; bottom: calc(100% + .35rem); }
.modal .soqy-combo-panel { position: static; width: 100%; margin-top: .35rem; box-shadow: none; }
.soqy-combo-search { display: flex; align-items: center; gap: .5rem; padding: .6rem .75rem; border-bottom: 1px solid var(--field-border); color: var(--brand); }
.soqy-combo-search .form-control { flex: 1 1 auto; min-width: 0; }
.soqy-combo-count { font-size: .75rem; font-weight: 700; color: var(--brand); white-space: nowrap; direction: ltr; }
.soqy-combo-letters { display: flex; flex-wrap: wrap; gap: .2rem; padding: .4rem .75rem; border-bottom: 1px solid var(--field-border); direction: ltr; }
.soqy-combo-letters:empty { display: none; }
.soqy-combo-letters button { min-width: 1.7rem; padding: .1rem .3rem; border: 1px solid var(--field-border); border-radius: .4rem; background: var(--btn-soft); color: var(--brand); font-size: .75rem; font-weight: 700; line-height: 1.4; }
.soqy-combo-letters button:hover { background: var(--btn-soft-hover); }
.soqy-combo-list { position: relative; max-height: 18rem; overflow-y: auto; overscroll-behavior: contain; padding: 0 .5rem .5rem; }
.soqy-combo-sm .soqy-combo-list { max-height: 15rem; }
.soqy-combo-letter { position: sticky; top: 0; z-index: 1; padding: .4rem .4rem .2rem; background: var(--card-bg); color: var(--brand); font-weight: 800; font-size: .8rem; border-bottom: 1px dashed var(--field-border); direction: ltr; text-align: left; }
.soqy-combo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: .2rem .35rem; padding: .3rem 0; }
.soqy-combo-sm .soqy-combo-grid { grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); }
.soqy-combo-option { display: flex; align-items: baseline; justify-content: space-between; gap: .4rem; min-width: 0; padding: .4rem .6rem; border-radius: .5rem; background: var(--brand-soft); color: var(--field-text); cursor: pointer; }
.soqy-combo-option .soqy-combo-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soqy-combo-option .soqy-combo-hint { margin-inline-start: 0; white-space: nowrap; }
.soqy-combo-option.is-active { background: var(--btn-soft-hover); outline: 2px solid #8EC0E6; outline-offset: -2px; }
.soqy-combo-option[aria-selected="true"] { background: var(--brand); color: #fff; }
.soqy-combo-option[aria-selected="true"] .soqy-combo-hint { color: rgba(255, 255, 255, .8); }
.soqy-combo-option-all, .soqy-combo-option-custom { margin-top: .5rem; }
.soqy-combo-option-custom { border: 1px dashed #8EC0E6; }
.soqy-combo-empty { padding: .9rem; text-align: center; color: #557584; }

/* Header */
.site-header { background: var(--brand); }
.site-subnav { background: var(--brand-dark); }
.site-subnav .nav-link { color: rgba(255,255,255,.8); }
.site-subnav .nav-link:hover { color: #fff; }
.site-subnav .nav-link.active { background: rgba(255,255,255,.15); color: #fff; }
.brand-mark { width: 36px; height: 36px; }
.hdr-name { max-width: 6rem; }
@media (min-width: 576px) { .hdr-name { max-width: 10rem; } }

/* Header bar (not fixed). Phones: logo + account/language on row 1, then a full-width row of
   equal action buttons that wraps step by step, so no button is pushed off-screen. */
.site-header-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.site-header-brand { order: 0; flex: 0 0 auto; }
.site-header-account { order: 1; margin-inline-start: auto; min-width: 0; }
.site-header-actions { order: 2; flex: 1 1 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); gap: .4rem; }
.site-header-actions > .btn,
.site-header-actions > form,
.site-header-actions > form > .btn { width: 100%; }
@media (min-width: 768px) {
    .site-header-bar { flex-wrap: nowrap; }
    .site-header-search { order: 1; flex: 1 1 auto; margin-inline: .75rem; }
    .site-header-actions { order: 2; flex: 0 0 auto; display: flex; align-items: center; gap: .25rem; }
    .site-header-actions > .btn,
    .site-header-actions > form,
    .site-header-actions > form > .btn { width: auto; }
    .site-header-account { order: 3; margin-inline-start: 0; }
}

/* Mobile number field: on phones the country box stays narrow so the number itself has room. */
.input-group > .phone-country { width: auto; min-width: 7rem; max-width: 8.5rem; }
@media (min-width: 576px) { .input-group > .phone-country { min-width: 9.5rem; max-width: 12rem; } }

/* Sign-in / sign-up forms: a field's message shows above the field (under its label), not below it.
   The message stays after the input in the HTML, which Bootstrap needs to show it. */
.feedback-above .input-group > .invalid-feedback { order: -1; margin: 0 0 .3rem; }

/* Main links: rows of equal pills on phones (no sideways scrolling), one row from tablets up. */
.site-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.75rem, 1fr)); }
.site-nav .nav-link { text-align: center; white-space: nowrap; }
@media (min-width: 768px) { .site-nav { display: flex; flex-wrap: wrap; } }

/* Back-to-top button */
.back-to-top { width: 44px; height: 44px; z-index: 1030; }
.back-to-top:not(.hidden) { display: inline-flex; align-items: center; justify-content: center; }

/* Side drawer: off-canvas on the correct side, hidden until opened */
#mainSidebar { visibility: hidden; box-shadow: none; }
#mainSidebar[style*="translateX(0)"] { visibility: visible; box-shadow: var(--bs-box-shadow-lg); }
[dir="rtl"] #mainSidebar { right: 0; left: auto; transform: translateX(100%); }

/* Listing feeds: responsive card grid */
.feed-wrapper:not(.hidden) {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
}
@media (min-width: 1200px) {
    .feed-wrapper:not(.hidden) { grid-template-columns: 1fr 1fr; }
}
.feed-wrapper > * { margin: 0 !important; }
.feed-wrapper > :not(.ad-post-card) { grid-column: 1 / -1; }

/* Listing row: thumbnail beside the details */
.ad-thumb { width: 220px; aspect-ratio: 4 / 3; }
.ad-thumb::before {
    content: "\F42A"; font-family: bootstrap-icons; font-size: 2rem; color: #adb5bd;
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.ad-thumb img { position: relative; object-fit: cover !important; }
.ad-post-card { transition: transform .18s ease, box-shadow .18s ease; border-radius: .75rem !important; }
.ad-post-card:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1.25rem rgba(15, 76, 92, .12) !important; }
.ad-price-text, .ad-price-green { color: #16A34A !important; line-height: 1.2; font-weight: 800; font-size: 1.15rem; }
.ad-title-purple {
    color: #6B21A8 !important;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    transition: color .15s;
}
.ad-title-purple:hover { color: #9333EA !important; }
.ad-specs-red { color: #DC2626 !important; font-weight: 600; }
.min-w-0 { min-width: 0; }
@media (max-width: 575.98px) {
    .ad-thumb { width: 128px; aspect-ratio: auto; min-height: 128px; }
    .ad-price-text, .ad-price-green { font-size: 1.05rem !important; }
    .ad-title-purple { font-size: .95rem; }
}

/* Toast Pop-up slide-down */
@keyframes slideDownToast {
    from { opacity: 0; transform: translateY(-40px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-slide-down {
    animation: slideDownToast 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Phone numbers / codes stay left-to-right inside Arabic text */
.font-monospace, .font-mono, .phone-ltr { direction: ltr; unicode-bidi: isolate; }

/* Small hooks still used by individual pages */
.ad-toolbar { background: var(--card-bg); }
.ad-price { color: var(--bs-success); font-weight: 700; }
.ad-dept { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }
.post-view-panel { background: var(--bs-tertiary-bg); }
.lang-active { background: var(--btn-soft); color: var(--bs-primary); box-shadow: var(--bs-box-shadow-sm); }
.dropdown-panel { animation: soqy-drop .15s ease-out; }
@keyframes soqy-drop { from { opacity: 0; transform: translateY(-4px); } }
.speech-listening::placeholder { color: var(--bs-danger); font-weight: 700; }
.font-segoe { font-family: 'Segoe UI', Tahoma, sans-serif; }
.filter-select { padding-inline-end: 1.75rem; }
.ad-thumb-wide { width: 100%; aspect-ratio: 4 / 3; }
.pagination { --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-color: var(--brand); margin: 0; }

/* ---- Colour bridge (generated): old Tailwind accent colours -> site palette.
   Lets pages not yet rebuilt in Bootstrap match the rest of the site. ---- */
html body .bg-\[\#512DA8\],
html body .bg-blue-600,
html body .bg-emerald-500,
html body .bg-emerald-500\/20,
html body .bg-emerald-600,
html body .bg-purple-500,
html body .bg-purple-600 { background-color: var(--brand) !important; color: #fff !important; border-color: var(--brand) !important; }
html body .bg-blue-100,
html body .bg-blue-50,
html body .bg-purple-100,
html body .bg-purple-50,
html body .bg-purple-50\/50,
html body .bg-purple-50\/60,
html body .bg-sky-100,
html body .bg-sky-50,
html body .bg-sky-50\/60,
html body .bg-violet-50,
html body .hover\:bg-blue-50\/50:hover,
html body .hover\:bg-purple-100:hover,
html body .hover\:bg-purple-50:hover,
html body .hover\:bg-sky-100:hover,
html body .hover\:bg-sky-50:hover,
html body .hover\:bg-violet-100:hover { background-color: var(--brand-soft) !important; }
html body .bg-amber-500,
html body .bg-amber-600,
html body .hover\:bg-amber-600:hover,
html body .hover\:bg-amber-700:hover,
html body .peer:checked ~ .peer-checked\:bg-amber-500 { background-color: var(--accent) !important; color: #1C1917 !important; border-color: var(--accent) !important; }
html body .border-\[\#512DA8\],
html body .border-purple-500,
html body .border-purple-600,
html body .border-purple-700,
html body .border-purple-800\/60,
html body .focus\:border-violet-500:focus { border-color: var(--brand) !important; }
html body .border-\[\#D9CDEF\],
html body .border-\[\#E6E8EF\],
html body .border-blue-100,
html body .border-purple-100,
html body .border-purple-100\/50,
html body .border-purple-200,
html body .border-purple-300,
html body .border-sky-100,
html body .border-sky-200,
html body .border-sky-200\/60,
html body .border-sky-300,
html body .border-violet-200,
html body .hover\:border-blue-200:hover,
html body .hover\:border-purple-300:hover,
html body .hover\:border-purple-400:hover,
html body .hover\:border-sky-300:hover,
html body .hover\:border-sky-400:hover { border-color: var(--line) !important; }
html body .group:hover .group-hover\:bg-emerald-600,
html body .group:hover .group-hover\:bg-purple-600,
html body .hover\:bg-\[\#673AB7\]:hover,
html body .hover\:bg-blue-700:hover,
html body .hover\:bg-emerald-600:hover,
html body .hover\:bg-emerald-700:hover,
html body .hover\:bg-purple-600:hover,
html body .hover\:bg-purple-700:hover,
html body .peer:checked ~ .peer-checked\:bg-emerald-600,
html body .peer:checked ~ .peer-checked\:bg-purple-600 { background-color: var(--brand-dark) !important; color: #fff !important; }
html body .hover\:text-purple-600:hover,
html body .hover\:text-purple-700:hover,
html body .text-\[\#512DA8\],
html body .text-blue-600,
html body .text-blue-700,
html body .text-purple-600,
html body .text-purple-700,
html body .text-sky-600,
html body .text-sky-700 { color: var(--brand) !important; }
html body .hover\:text-purple-800:hover,
html body .text-purple-800,
html body .text-purple-900,
html body .text-purple-950,
html body .text-sky-800,
html body .text-violet-800 { color: var(--brand-dark) !important; }
html body .text-purple-400 { color: #5c7a82 !important; }
html body .from-\[\#F3EBF9\],
html body .from-amber-50,
html body .from-sky-50 { background-image: none !important; background-color: var(--brand-soft) !important; }
html body .from-indigo-600,
html body .from-indigo-900 { background-image: none !important; background-color: var(--brand) !important; color: #fff !important; }
html body .font-black, html body .font-extrabold { font-weight: 700 !important; }
html body .rounded-3xl { border-radius: 1rem !important; }

/* "Post an ad" window (partials/sell-side-button): car or property, for sale or wanted — one click. */
.ad-chooser .modal-content { border: 0; border-radius: 1.25rem; overflow: hidden; box-shadow: 0 1.5rem 3rem rgba(11, 55, 66, .35); }
.ad-chooser-head { flex: 0 0 auto; display: flex; align-items: center; gap: .85rem; padding: 1rem 1.25rem; background: var(--brand); color: #fff; }
.ad-chooser-head h2 { margin: 0; font-size: 1.15rem; font-weight: 800; }
.ad-chooser-head p { margin: .1rem 0 0; font-size: .8rem; opacity: .85; }
.ad-chooser-badge { flex: 0 0 auto; width: 2.6rem; height: 2.6rem; border-radius: .8rem; background: var(--accent); color: #1C1917; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.ad-chooser-close { flex: 0 0 auto; margin-inline-start: auto; width: 2.25rem; height: 2.25rem; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .16); color: #fff; }
.ad-chooser-close:hover, .ad-chooser-close:focus-visible { background: rgba(255, 255, 255, .3); }
.ad-chooser-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 1rem; padding: 1.25rem; background: var(--page-bg); }
.ad-kind { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 1rem; overflow: hidden; background: var(--field-bg); box-shadow: 0 .35rem 1rem rgba(15, 76, 92, .08); }
.ad-kind-cover { position: relative; aspect-ratio: 16 / 9; background: var(--brand-soft) center / cover no-repeat; }
.ad-kind-cover-car { background-image: url("../images/ad-popup-concept-car.jpg"); }
.ad-kind-cover-property { background-image: url("../images/ad-popup-concept-palace.jpg"); }
.ad-kind-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(11, 37, 48, .82) 0%, rgba(11, 37, 48, .25) 45%, rgba(11, 37, 48, 0) 70%); }
.ad-kind-caption { position: absolute; inset-inline: 1rem; bottom: .75rem; z-index: 1; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.ad-kind-caption h3 { margin: 0; display: flex; align-items: center; gap: .5rem; font-size: 1.35rem; font-weight: 800; }
.ad-kind-caption p { margin: .1rem 0 0; font-size: .8rem; opacity: .92; }
.ad-kind-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; padding: .85rem; }
.ad-action { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-height: 5.25rem; padding: .65rem .5rem; border-radius: .85rem; text-align: center; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease; }
.ad-action i { font-size: 1.4rem; line-height: 1; margin-bottom: .15rem; }
.ad-action-label { font-size: 1rem; font-weight: 800; line-height: 1.2; }
.ad-action small { font-size: .72rem; font-weight: 600; opacity: .85; }
.ad-action-sell { background: var(--brand); color: #fff; border: 1px solid var(--brand); }
.ad-action-sell:hover { background: var(--brand-dark); color: #fff; }
.ad-action-buy { background: var(--btn-soft); color: var(--brand); border: 1px solid var(--field-border); }
.ad-action-buy:hover { background: var(--btn-soft-hover); color: var(--brand-dark); }
.ad-action:hover { transform: translateY(-2px); box-shadow: 0 .3rem .7rem rgba(15, 76, 92, .2); }
.ad-action:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ad-chooser-foot { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .35rem .5rem; padding: 0 1.25rem 1.1rem; font-size: .8rem; color: #557584; text-align: center; }
@media (max-width: 575.98px) {
    .ad-chooser .modal-content { border-radius: 0; }
    .ad-chooser-body { grid-template-columns: 1fr; gap: .75rem; padding: .85rem; }
    .ad-kind-cover { aspect-ratio: 21 / 9; }
    .ad-action { min-height: 4.5rem; }
}
@media (prefers-reduced-motion: reduce) {
    .ad-action { transition: none; }
    .ad-action:hover { transform: none; }
}

/* Google AdSense box under the header. Sizes come from the admin dashboard (Settings tab). */
.site-ad-slot { padding-top: var(--ad-box-top, 8px); }
.site-ad-slot + main { padding-top: var(--ad-box-bottom, 8px) !important; }
.site-ad-slot-box { display: block; width: 100%; height: var(--ad-box-height, 90px); overflow: hidden; text-align: center; }
.site-ad-slot-preview {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
    border: 2px dashed #c9bfae; border-radius: .75rem; background: #fbf8f2;
    color: #6b6257; font-size: .85rem; font-weight: 700; text-decoration: none;
}
.site-ad-slot-preview small { font-size: .72rem; font-weight: 600; opacity: .8; }
.site-ad-slot-preview:hover { border-color: var(--brand, #6d28d9); color: var(--brand, #6d28d9); }

/* Car / property ad forms on phones: labels and notes wrap instead of being cut, every field is
   full width, the Sell / Buy switch stays inside the screen and nothing scrolls sideways. */
.soqy-ad-form label,
.soqy-ad-form .form-label,
.soqy-ad-form .form-text,
.soqy-ad-form header p { white-space: normal; overflow-wrap: break-word; }
.soqy-ad-form select,
.soqy-ad-form textarea,
.soqy-ad-form input:not([type=radio]):not([type=checkbox]) { max-width: 100%; min-width: 0; }
@media (max-width: 767.98px) {
    .soqy-ad-form .grid > *,
    .soqy-ad-form .row > * { min-width: 0; }
    .soqy-ad-form select,
    .soqy-ad-form textarea,
    .soqy-ad-form input:not([type=radio]):not([type=checkbox]):not([type=file]) { width: 100%; }
    /* Bootstrap's p-5 / px-5 (3rem, !important) beat Tailwind's on these cards and squeezed the fields */
    .soqy-ad-form section > header,
    .soqy-ad-form section > header + div { padding-inline: 1rem !important; }
    .soqy-ad-form section > header + div { padding-block: 1rem !important; }
}
@media (max-width: 639.98px) {
    .soqy-ad-type { width: 100%; }
    .soqy-ad-type > label { flex: 1 1 0; min-width: 0; }
    .soqy-ad-type > label > span { height: 100%; padding-inline: .5rem !important; text-align: center; white-space: normal; }
}

/* Listing table on phones: smaller text, titles on up to 4 lines, and every column stays visible —
   the table scrolls sideways inside its card instead of squeezing the ad column. */
@media (max-width: 767.98px) {
    .ad-table { min-width: 640px; font-size: .78rem; }
    .ad-table > :not(caption) > * > * { padding: .45rem .5rem; }
    .ad-table td:first-child { min-width: 190px; }
    .ad-table td:first-child img { width: 48px; height: 36px; }
    .ad-table .ad-col-location { min-width: 120px; }
    .ad-table .ad-col-specs { min-width: 170px; }
    .ad-table .ad-title-purple { -webkit-line-clamp: 4; font-size: .82rem; line-height: 1.35; }
    .ad-table .ad-price-green { font-size: .9rem !important; }
    .ad-table .badge { font-size: .65rem; }
    .ad-table .btn-sm { padding: .2rem .4rem; font-size: .75rem; }
}

/* Posts view on phones: like the table, each post keeps room for its full details and the list
   scrolls sideways (the page itself does not) instead of cutting the specs / location lines. */
@media (max-width: 767.98px) {
    .feed-wrapper:not(.hidden) { grid-template-columns: minmax(560px, 1fr); overflow-x: auto; padding-bottom: .5rem; }
    .feed-wrapper .ad-post-card .text-truncate { white-space: normal; overflow: visible; text-overflow: clip; }
}
