/* AutoSouq website — home page (home.html) and search results (search.html).
 * Uses the colours from site.css (--navy, --orange …). */

@font-face { font-family: "Kufi"; font-weight: 400; font-display: swap; src: url("/assets/assets/fonts/NotoKufiArabic-400.ttf") format("truetype"); }
@font-face { font-family: "Kufi"; font-weight: 600; font-display: swap; src: url("/assets/assets/fonts/NotoKufiArabic-600.ttf") format("truetype"); }
@font-face { font-family: "Kufi"; font-weight: 700; font-display: swap; src: url("/assets/assets/fonts/NotoKufiArabic-700.ttf") format("truetype"); }

body.home, body.results {
  font-family: "Kufi", -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
  background: #f3f5f8; display: block;
}
.home main, .results main { flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lang {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45); border-radius: 6px;
  padding: 5px 12px; font: inherit; font-size: 14px; cursor: pointer;
}
.lang:hover { background: rgba(255,255,255,.1); }

/* ---------- search bar ---------- */
.topsearch { background: #fff; border-bottom: 1px solid #e5e8ee; }
.qform { max-width: 1100px; margin: 0 auto; padding: 14px 16px; display: flex; }
.qform input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 12px 16px;
  border: 1.5px solid #c9d0db; border-inline-end: 0; border-radius: 0; border-start-start-radius: 8px; border-end-start-radius: 8px;
  outline: none; background: #fff;
}
.qform input:focus { border-color: var(--navy); }
.qform button {
  flex: 0 0 64px; border: 0; background: var(--navy); color: #fff; cursor: pointer;
  border-start-end-radius: 8px; border-end-end-radius: 8px; display: grid; place-items: center;
}
.qform button:hover { background: var(--navy-dark); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(253,172,23,.18), transparent 60%),
    linear-gradient(120deg, #031B33 0%, #05294B 45%, #0B4A80 100%);
  color: #fff; min-height: 520px;
}
/* Diagonal photo panel on the far side, like a window onto the newest cars. */
.hero-photos {
  position: absolute; inset: 0; z-index: -1;
  clip-path: polygon(55% 0, 100% 0, 100% 100%, 38% 100%);
}
[dir="rtl"] .hero-photos { clip-path: polygon(0 0, 45% 0, 62% 100%, 0 100%); }
.hero-photos img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.2s ease; transform: scale(1.04);
}
.hero-photos img.on { opacity: 1; animation: drift 9s ease-out forwards; }
@keyframes drift { from { transform: scale(1.1); } to { transform: scale(1.02); } }
.hero-photos::after { /* soft edge + orange stripe on the diagonal */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(5,41,75,.85) 0%, rgba(5,41,75,.25) 45%, rgba(5,41,75,.1) 100%);
}
[dir="rtl"] .hero-photos::after { background: linear-gradient(-100deg, rgba(5,41,75,.85) 0%, rgba(5,41,75,.25) 45%, rgba(5,41,75,.1) 100%); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(var(--orange), var(--orange)) no-repeat;
  clip-path: polygon(54.2% 0, 55% 0, 38% 100%, 37.2% 100%);
}
[dir="rtl"] .hero::before { clip-path: polygon(45% 0, 45.8% 0, 62.8% 100%, 62% 100%); }

.hero-inner {
  max-width: 1200px; margin: 0 auto; padding: 48px 24px 56px;
  display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 40px; align-items: center;
}

/* finder card */
.finder {
  background: #fff; color: #1b1b1b; border-radius: 14px; padding: 26px 24px 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.finder h1 { margin: 0 0 16px; text-align: center; color: var(--navy); font-size: 26px; font-weight: 700; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); border: 2px solid var(--navy); border-radius: 8px; overflow: hidden; margin-bottom: 18px; }
.tabs button {
  font: inherit; font-size: 15px; padding: 10px 6px; border: 0; background: #fff; color: var(--navy); cursor: pointer; position: relative;
}
.tabs button + button { border-inline-start: 2px solid var(--navy); }
.tabs button[aria-pressed="true"] { background: var(--navy); color: #fff; font-weight: 700; }
.tabs button:not([aria-pressed="true"]):hover { background: #eef3f9; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.fields label { display: block; }
select {
  width: 100%; font: inherit; font-size: 15px; color: #1b1b1b; background-color: #fff;
  border: 1.5px solid #b9c2cf; border-radius: 8px; padding: 11px 12px; padding-inline-end: 34px;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #333 50%), linear-gradient(135deg, #333 50%, transparent 50%);
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
  background-position: calc(100% - 18px) 52%, calc(100% - 12px) 52%;
}
[dir="rtl"] select { background-position: 12px 52%, 18px 52%; }
select:focus { outline: 2px solid var(--orange-light); outline-offset: 1px; border-color: var(--navy); }
select:disabled { background-color: #f1f3f6; color: #8a93a0; cursor: not-allowed; }
.go {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  font: inherit; font-size: 18px; font-weight: 700; color: #fff; background: var(--orange);
  border: 0; border-radius: 8px; padding: 13px; cursor: pointer; box-shadow: 0 6px 16px rgba(233,106,0,.35);
  transition: background .15s, transform .15s;
}
.go:hover { background: #ff7a0d; transform: translateY(-1px); }
.helpme {
  margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #0d1b2a; color: #fff; text-decoration: none; border-radius: 8px; padding: 11px 12px; font-weight: 600; font-size: 15px;
}
.helpme:hover { background: #000; }

/* slogan */
.slogan { align-self: center; padding-inline-start: 4%; }
.slogan h2 {
  margin: 0; white-space: pre-line; font-size: clamp(30px, 4vw, 48px); line-height: 1.35; font-weight: 700;
  text-shadow: 0 3px 18px rgba(0,0,0,.45);
}
.slogan p { margin: 14px 0 0; font-size: 17px; max-width: 30em; opacity: .92; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.dots { display: flex; gap: 8px; margin-top: 28px; }
.dots button { width: 26px; height: 6px; border: 0; border-radius: 3px; background: rgba(255,255,255,.45); cursor: pointer; padding: 0; transition: background .3s, width .3s; }
.dots button[aria-current="true"] { background: var(--orange); width: 40px; }

/* ---------- let us help you ---------- */
.help { max-width: 1200px; margin: 0 auto; padding: 40px 24px 8px; text-align: center; }
.help h2 { margin: 0 0 18px; color: var(--navy); font-size: 24px; }
.help-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 760px; margin: 0 auto; }
.tile {
  display: flex; align-items: center; justify-content: center; gap: 14px; padding: 24px; border-radius: 14px;
  text-decoration: none; font-size: 20px; font-weight: 700; transition: transform .15s, box-shadow .15s;
}
.tile.buy { background: var(--navy); color: #fff; }
.tile.sell { background: #fff; color: var(--navy); border: 2px solid var(--navy); }
.tile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(5,41,75,.18); }

/* ---------- rails (sliders) ---------- */
.rail { max-width: 1200px; margin: 0 auto; padding: 36px 24px 8px; }
.rail:last-of-type { padding-bottom: 48px; }
.rail-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.rail-head h2 { margin: 0; color: var(--navy); font-size: 24px; position: relative; padding-inline-start: 14px; }
.rail-head h2::before { content: ""; position: absolute; inset-inline-start: 0; top: 18%; bottom: 18%; width: 5px; border-radius: 3px; background: var(--orange); }
.rail-head p { margin: 4px 0 0; color: #5b6573; font-size: 14px; padding-inline-start: 14px; }
.rail-head .all { color: var(--orange); font-weight: 700; text-decoration: none; white-space: nowrap; }
.rail-head .all:hover { text-decoration: underline; }

.slider { position: relative; }
.track {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * 16px) / 4); gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 6px 2px 14px;
  scrollbar-width: none;
}
.track::-webkit-scrollbar { display: none; }
.track > * { scroll-snap-align: start; }
.arrow {
  position: absolute; top: calc(50% - 30px); z-index: 2; width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: #fff; color: var(--navy); font-size: 28px; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.18); display: grid; place-items: center; padding-bottom: 4px;
}
.arrow:hover { background: var(--navy); color: #fff; }
.arrow:disabled { opacity: 0; pointer-events: none; }
.arrow.prev { inset-inline-start: -18px; }
.arrow.next { inset-inline-end: -18px; }

/* ---------- car card ---------- */
.card {
  display: flex; flex-direction: column; background: #fff; border-radius: 12px; overflow: hidden;
  text-decoration: none; color: inherit; box-shadow: 0 2px 10px rgba(16,30,54,.08);
  transition: transform .15s, box-shadow .15s; min-width: 0;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(16,30,54,.16); }
.card .ph { position: relative; aspect-ratio: 4 / 3; background: #e4e8ee; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .ph.empty::after {
  content: ""; position: absolute; inset: 30%;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23b3bcc8' d='M5 16l1.6-5.2A2 2 0 0 1 8.5 9.4h7a2 2 0 0 1 1.9 1.4L19 16v3a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1v-1H8v1a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1z'/%3E%3C/svg%3E");
}
.badge {
  position: absolute; top: 10px; inset-inline-start: 10px; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.badge.featured { background: var(--orange); }
.badge.drop { background: #1f8a4c; }
.card .body { padding: 12px 14px 14px; display: grid; gap: 4px; }
.card h3 { margin: 0; font-size: 16px; font-weight: 700; color: #16202c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .price { color: var(--orange); font-size: 18px; font-weight: 800; }
.card .price s { color: #8a93a0; font-size: 14px; font-weight: 500; }
.card .meta { color: #5b6573; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.skeleton .ph, .card.skeleton .body { background: linear-gradient(90deg, #e6e9ee 25%, #f2f4f7 50%, #e6e9ee 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.card.skeleton .body { height: 86px; background-color: #fff; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.msg { color: #5b6573; padding: 24px; text-align: center; grid-column: 1 / -1; }

/* ---------- results page ---------- */
.results-wrap { max-width: 1200px; margin: 0 auto; padding: 20px 24px 48px; display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.results .finder { position: sticky; top: 16px; box-shadow: 0 2px 10px rgba(16,30,54,.08); padding: 20px; }
.results .finder h1 { font-size: 20px; }
.results .fields { grid-template-columns: 1fr; }
.results .clear { display: block; text-align: center; margin-top: 12px; color: #5b6573; font-size: 14px; }
.res-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.res-head h2 { margin: 0; color: var(--navy); font-size: 22px; }
.res-head h2 small { color: #5b6573; font-size: 15px; font-weight: 500; margin-inline-start: 8px; }
.res-head select { width: auto; min-width: 180px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.more { display: block; margin: 24px auto 0; font: inherit; font-weight: 700; color: var(--navy); background: #fff; border: 2px solid var(--navy); border-radius: 8px; padding: 10px 28px; cursor: pointer; }
.more:hover { background: var(--navy); color: #fff; }

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) { .track { grid-auto-columns: calc((100% - 2 * 16px) / 3); } }
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 24px; padding: 28px 16px 36px; }
  .slogan { order: -1; text-align: center; padding: 0; }
  .slogan p { margin-inline: auto; }
  .dots { justify-content: center; margin-top: 16px; }
  .hero-photos, [dir="rtl"] .hero-photos { clip-path: none; opacity: .35; }
  .hero::before { display: none; }
  .finder { max-width: 520px; width: 100%; margin: 0 auto; }
  .results-wrap { grid-template-columns: 1fr; padding: 16px; }
  .results .finder { position: static; }
  .results .fields { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .track { grid-auto-columns: 72%; }
  .arrow { display: none; }
  .rail, .help { padding-inline: 16px; }
  .help-tiles { grid-template-columns: 1fr; }
  .finder h1 { font-size: 22px; }
  .site-nav a.hide-sm { display: none; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card .body { padding: 10px; }
  .card h3 { font-size: 14px; }
  .card .price { font-size: 16px; }
}
