:root {
  --bg: #ffffff;
  --bg-strong: #edf6fb;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --text: #20354c;
  --muted: #657489;
  --primary: #20354c;
  --primary-strong: #17283b;
  --accent: #3482b6;
  --danger: #b71c1c;
  --line: rgba(32, 53, 76, 0.14);
  --shadow: 0 18px 46px rgba(32, 53, 76, 0.12);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Tajawal", sans-serif;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(52, 130, 182, 0.11), transparent 34%),
    linear-gradient(180deg, var(--bg) 0%, #f7fbfe 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  width: 100%;
}

[hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 34px rgba(32, 53, 76, 0.18);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 78px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
}

.brand span {
  display: none;
}

.brand img {
  width: 230px;
  height: 52px;
  object-fit: contain;
  padding: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.nav-link.is-active {
  color: var(--primary);
  background: #fff;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.18);
}

.menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.app-download-strip {
  position: relative;
  z-index: 10;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(237, 246, 251, 0.96)),
    linear-gradient(90deg, rgba(52, 130, 182, 0.14), rgba(32, 53, 76, 0.08));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 14px 30px rgba(32, 53, 76, 0.08);
}

.app-download-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 82px;
  padding: 14px 0;
}

.app-download-copy {
  display: grid;
  gap: 4px;
}

.app-download-copy strong {
  font-size: 1.15rem;
  color: var(--primary-strong);
}

.app-download-copy span {
  color: var(--muted);
  font-weight: 600;
}

.app-store-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.store-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 166px;
  height: 56px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--primary-strong);
  color: #fff;
  box-shadow: 0 14px 26px rgba(32, 53, 76, 0.18);
}

.store-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(32, 53, 76, 0.22);
}

.store-button small,
.store-button strong {
  display: block;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
}

.store-button small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 600;
}

.store-button strong {
  margin-top: 3px;
  font-size: 0.95rem;
}

.store-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  flex: 0 0 30px;
}

.store-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.store-icon-play {
  background: #fff;
}

.store-icon-play svg {
  width: 21px;
  height: 23px;
}

.store-icon-apple {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
}

.store-icon-apple svg {
  width: 21px;
  height: 24px;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(16, 28, 42, 0.42);
  backdrop-filter: blur(3px);
}

.right-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 41;
  width: min(360px, calc(100% - 34px));
  height: 100vh;
  padding: 18px;
  background: rgba(255, 255, 255, 0.96);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px rgba(32, 53, 76, 0.24);
  transform: translateX(105%);
  transition: transform 0.22s ease;
}

.right-drawer.is-open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.drawer-head img {
  width: 190px;
  height: 46px;
  object-fit: contain;
}

.drawer-close {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: rgba(32, 53, 76, 0.08);
  color: var(--primary);
  font-size: 1.5rem;
}

.drawer-menu {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.drawer-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--primary-strong);
  text-align: right;
  box-shadow: 0 10px 24px rgba(32, 53, 76, 0.08);
}

.drawer-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.drawer-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
}

.about-modal {
  position: fixed;
  inset: 0;
  z-index: 42;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 28, 42, 0.48);
}

.about-dialog {
  width: min(520px, 100%);
  position: relative;
  padding: 24px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.about-dialog h2 {
  margin: 0 0 12px;
  color: var(--primary-strong);
}

.about-dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

.menu-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 60;
  transform: translateX(-50%);
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--primary-strong);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.menu-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

.hero {
  padding: 28px 0 22px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 26px;
  align-items: center;
  padding: 22px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.eyebrow {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(52, 130, 182, 0.12);
  color: var(--primary);
  font-weight: 800;
}

.hero-copy h1 {
  margin: 14px 0 10px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.1;
}

.hero-copy p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.9;
  font-size: 1.08rem;
}

.hero-image img {
  height: 340px;
  max-height: 390px;
  border-radius: var(--radius-xl);
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  padding: 12px;
}

.segment-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.segment-link,
.chip,
.badge,
.action-button,
.inline-form button,
.search-grid button,
.favorite-button {
  transition: 0.2s ease;
}

.segment-link {
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
}

.segment-link.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.section {
  padding: 16px 0 24px;
}

.section-head,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.5rem;
}

.section-head a,
.toolbar a {
  color: var(--primary);
  font-weight: 700;
}

.inline-form,
.search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-form input,
.inline-form select,
.search-grid input,
.search-grid select {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
}

.inline-form button,
.search-grid button {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
}

.chip-row,
.badges,
.thumb-row,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  min-height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  font-weight: 700;
  color: var(--text);
}

.chip.is-active,
.action-button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.cards-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.cars-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.markets-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.card-image {
  display: block;
  position: relative;
  aspect-ratio: 1.2 / 0.88;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(52, 130, 182, 0.14), transparent 42%),
    #fff;
  overflow: hidden;
}

.card-image::before,
.hero-image::before,
.car-gallery::before {
  content: "";
  position: absolute;
  width: 64px;
  height: 64px;
  top: 14px;
  right: 14px;
  border-top: 5px solid var(--accent);
  border-right: 5px solid var(--accent);
  border-radius: 0 var(--radius-xl) 0 0;
  pointer-events: none;
  opacity: 0.9;
}

.card-image::after,
.hero-image::after,
.car-gallery::after {
  content: "";
  position: absolute;
  width: 54px;
  height: 54px;
  left: 14px;
  bottom: 14px;
  border-bottom: 5px solid var(--primary);
  border-left: 5px solid var(--primary);
  border-radius: 0 0 0 var(--radius-xl);
  pointer-events: none;
  opacity: 0.28;
}

.card-image img,
.hero-image img,
.main-detail-image,
.market-hero-card img {
  clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%, 0 22px);
}

.card-image img {
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(32, 53, 76, 0.08);
}

.market-card .card-image {
  display: grid;
  place-items: center;
  aspect-ratio: 831 / 300;
  padding: 8px;
  background: #fff;
}

.market-card .card-image img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  padding: 0;
}

.card-content {
  padding: 16px;
}

.card-content h3 {
  margin: 0 0 6px;
  font-size: 1.12rem;
}

.card-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.badge {
  min-height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(52, 130, 182, 0.12);
  color: var(--primary-strong);
  font-size: 0.92rem;
  font-weight: 700;
}

.car-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.car-meta strong {
  color: var(--primary);
  font-size: 1.1rem;
}

.car-meta span {
  color: var(--muted);
  font-weight: 700;
}

.favorite-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: rgba(52, 130, 182, 0.12);
  color: var(--primary);
  font-size: 1.2rem;
}

.share-button,
.badge-button {
  border: 0;
}

.share-button {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 20px rgba(32, 53, 76, 0.18);
}

.badge-button {
  font: inherit;
  cursor: pointer;
}

.favorite-button.is-active {
  background: var(--danger);
  color: #fff;
}

.favorite-button.large {
  width: 52px;
  height: 52px;
  font-size: 1.4rem;
}

.market-hero-card,
.car-detail,
.favorites-box {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 22px;
  padding: 22px;
  border-radius: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.market-hero-card img,
.main-detail-image {
  width: 100%;
  border-radius: var(--radius-xl);
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  padding: 12px;
}

.hero-image,
.car-gallery {
  position: relative;
}

.hero-image {
  position: relative;
}

.city-chip-row {
  justify-content: center;
  align-items: center;
  max-width: 980px;
  margin: 18px auto 0;
  padding: 14px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(32, 53, 76, 0.08);
}

.city-chip-row .chip {
  min-width: 118px;
  background:
    linear-gradient(135deg, rgba(52, 130, 182, 0.12), transparent 55%),
    rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 22px rgba(32, 53, 76, 0.08);
}

.city-chip-row .chip.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: transparent;
  box-shadow: 0 14px 26px rgba(32, 53, 76, 0.2);
}

.city-chip-row .chip.is-active .chip-icon {
  background: rgba(255, 255, 255, 0.2);
}

.city-chip-row + .section-head,
.section:has(.city-chip-row) .section-head {
  justify-content: center;
  text-align: center;
}

.chip-icon {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.86rem;
}

.filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.filter-pill {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--primary);
  font-weight: 800;
}

.filter-pill.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 12px 24px rgba(32, 53, 76, 0.18);
}

.search-grid-extra {
  margin-top: 12px;
}

.market-hero-card img {
  height: 260px;
  object-fit: contain;
  background: #fff;
}

.car-gallery {
  display: grid;
  gap: 12px;
}

.main-detail-image {
  height: 420px;
}

.thumb-button {
  width: 92px;
  height: 78px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.thumb-button img {
  height: 100%;
  object-fit: contain;
  padding: 6px;
  border-radius: var(--radius-sm);
}

.car-summary,
.market-hero-card > div {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-head h2 {
  margin: 0;
  font-size: 1.9rem;
}

.car-summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.price-box {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--primary);
  font-size: 1.3rem;
  font-weight: 800;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.spec-item {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
}

.spec-item span {
  display: block;
  color: var(--muted);
  margin-bottom: 4px;
}

.spec-item strong {
  display: block;
}

.action-button {
  min-height: 46px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  color: var(--primary);
  font-weight: 700;
}

.search-panel {
  padding: 20px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.top-gap {
  margin-top: 22px;
}

.favorites-box {
  grid-template-columns: 1fr;
}

.empty-state {
  width: 100%;
  padding: 26px 20px;
  text-align: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px dashed var(--line);
  color: var(--muted);
}

.site-footer {
  padding: 26px 0 40px;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 1100px) {
  .cars-grid,
  .markets-grid,
  .search-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-grid,
  .market-hero-card,
  .car-detail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  body {
    padding-bottom: 82px;
  }

  .menu-button {
    min-width: 44px;
  }

  .site-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    background: var(--primary-strong);
    box-shadow: 0 -14px 34px rgba(32, 53, 76, 0.2);
  }

  .site-nav .nav-link {
    display: grid;
    place-items: center;
    min-height: 44px;
    padding: 8px 4px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.72);
    text-align: center;
    font-size: 0.9rem;
  }

  .site-nav .nav-link.is-active {
    color: var(--primary-strong);
    background: #fff;
    box-shadow: none;
  }

  .header-row {
    position: relative;
  }

  .app-download-row {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
  }

  .app-store-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .store-button {
    width: 100%;
    justify-content: center;
    padding: 8px 10px;
  }

  .cars-grid,
  .markets-grid,
  .search-grid,
  .spec-grid {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .section-head,
  .footer-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .inline-form,
  .search-form {
    width: 100%;
  }

  .inline-form input,
  .inline-form select,
  .inline-form button {
    width: 100%;
  }

  .main-detail-image {
    height: 300px;
  }

  .brand img {
    width: 180px;
    height: 44px;
  }
}
