:root {
  color-scheme: light;
  --ink: #131b35;
  --muted: #59647b;
  --blue: #2342d5;
  --line: #e4e8f2;
  --paper: #f7f8fc;
  --lime: #dfff83;
  font-family: "IBM Plex Sans Arabic", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #5575f2; outline-offset: 3px; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
i[data-icon] { display: inline-flex; flex: none; vertical-align: middle; }
svg { width: 20px; height: 20px; }
.wrap { width: min(1320px, calc(100% - 80px)); margin-inline: auto; }
.header { background: white; border-bottom: 1px solid var(--line); }
.header-inner { min-height: 77px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 28px; font-weight: 700; line-height: .95; }
.brand small { display: block; font-size: 10px; font-weight: 600; color: var(--muted); margin-top: 7px; }
.header-nav, .header-actions { display: flex; align-items: center; gap: 29px; }
.header-nav { color: var(--muted); font-size: 15px; font-weight: 600; }
.header-nav button, .login, .text-button { border: 0; background: none; padding: 0; }
.header-nav .current, .header-nav :hover, .text-button { color: var(--blue); }
.header-nav .current { position: relative; }
.header-nav .current::after { content: ""; height: 3px; border-radius: 3px 3px 0 0; background: var(--blue); position: absolute; inset: auto 0 -27px; }
.header-actions { gap: 18px; }
.login, .primary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 700; white-space: nowrap; }
.login { min-height: 44px; }
.primary { border: 0; border-radius: 10px; background: var(--blue); color: white; padding: 11px 17px; }
.primary:hover { filter: brightness(.92); }
.hero { position: relative; isolation: isolate; overflow: hidden; margin-top: 27px; min-height: 346px; border-radius: 23px; background: #142b96; color: white; }
.hero-art { position: absolute; z-index: -1; inset: 0 auto 0 0; width: min(64%, 600px); background: url("assets/hero.webp") left center / auto 107% no-repeat; mask-image: linear-gradient(90deg, #000 57%, transparent 93%); }
.hero-copy { padding: 28px 42px 32px; width: min(58%, 600px); }
.hero-eyebrow { display: inline-flex; gap: 7px; align-items: center; background: #ffffff17; border: 1px solid #ffffff35; border-radius: 30px; padding: 5px 11px; font-size: 13px; font-weight: 600; }
.hero-eyebrow svg { color: var(--lime); width: 15px; height: 15px; }
.hero h1 { font-size: clamp(43px, 5.1vw, 72px); line-height: 1.04; font-weight: 700; margin-block: 12px 9px; }
.hero h1 em { font-style: normal; color: var(--lime); }
.hero p { color: #e6eaff; font-size: 15px; font-weight: 500; }
#search-form { display: flex; align-items: center; gap: 10px; border-radius: 12px; padding: 6px 12px 6px 6px; max-width: 425px; background: white; color: var(--muted); margin-top: 19px; }
#search-form input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); padding-block: 7px; }
#search-form .primary { background: var(--lime); color: #172627; padding: 8px 22px; }
.categories { padding-block: 25px 28px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 10px; margin-bottom: 13px; }
.kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--blue); }
h2 { font-size: 28px; line-height: 1.2; margin-top: 3px; }
.category-list { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; }
.category { display: grid; justify-items: center; gap: 7px; border: 1px solid var(--line); background: white; border-radius: 14px; padding: 11px 3px 9px; font-size: 14px; font-weight: 600; transition: background .18s, border-color .18s; white-space: nowrap; }
.category i { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 10px; background: var(--tint); color: var(--tone); }
.category:is(:hover,[aria-pressed=true]) { border-color: #91a0fa; background: #edf0ff; color: #1e36aa; }
.market { display: grid; grid-template-columns: 223px minmax(0, 1fr); align-items: start; gap: 23px; border-top: 1px solid var(--line); padding-block: 25px 57px; }
.filters { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.filter-title { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.filter-title strong { display: flex; align-items: center; gap: 7px; }
.text-button { font-size: 12px; font-weight: 700; }
.text-button:hover { text-decoration: underline; }
.filter-group { border: 0; padding: 0; margin: 17px 0 0; min-inline-size: 0; }
.filter-group > label:first-child, legend { font-weight: 700; font-size: 13px; margin-bottom: 6px; padding: 0; }
.select-field, .sort { display: flex; align-items: center; gap: 7px; position: relative; border: 1px solid var(--line); border-radius: 9px; background: white; padding-inline: 9px; }
.select-field { margin-top: 6px; }
.select-field select, .sort select { appearance: none; width: 100%; min-height: 39px; border: 0; background: transparent; color: var(--ink); padding: 0; font-weight: 600; font-size: 13px; }
.select-field i, .sort i { color: var(--muted); pointer-events: none; }
.select-field svg, .sort svg { width: 15px; height: 15px; }
.choice { display: flex; align-items: center; gap: 6px; min-height: 28px; font-size: 13px; color: var(--muted); }
.choice input { accent-color: var(--blue); }
.results-heading { margin-bottom: 14px; }
.results-heading p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #268256; box-shadow: 0 0 0 3px #ddf2e8; }
.sort { width: 136px; flex: none; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.card { background: white; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; min-width: 0; transition: box-shadow .2s, border-color .2s; }
.card:hover { box-shadow: 0 8px 25px #17285a12; border-color: #b8c3ec; }
.photo { position: relative; background: #e9ecf3; }
.photo img { width: 100%; height: auto; aspect-ratio: 1.3; object-fit: cover; }
.photo-link { display: block; border: 0; padding: 0; background: transparent; width: 100%; }
.badge { position: absolute; inset: 9px 9px auto auto; background: #effbd8; color: #27411d; border-radius: 20px; padding: 3px 8px; font-size: 10px; font-weight: 700; pointer-events: none; }
.favorite { position: absolute; inset: 8px auto auto 8px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: white; display: grid; place-items: center; box-shadow: 0 2px 8px #0001; }
.favorite svg { width: 17px; height: 17px; }
.favorite[aria-pressed=true] { color: #a61d48; }
.favorite[aria-pressed=true] svg { fill: #ed9fb8; }
.card-body { padding: 10px 11px 12px; }
.card-body h3 { font-size: 15px; font-weight: 700; line-height: 1.4; }
.card-body h3 button { display: block; text-align: start; width: 100%; border: 0; background: none; padding: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: inherit; }
.card-body h3 button:hover { color: var(--blue); }
.price { font-size: 20px; font-weight: 700; color: #1a37b4; margin-block: 3px 7px; }
.price small { font-size: 11px; }
.meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 6px; border-top: 1px solid var(--line); padding-top: 8px; color: var(--muted); font-size: 11px; }
.meta span { display: flex; align-items: center; gap: 3px; }
.meta svg { width: 13px; height: 13px; }
.empty { grid-column: 1 / -1; padding: 40px 16px; text-align: center; background: white; border: 1px dashed var(--line); border-radius: 12px; }
.empty p { color: var(--muted); margin-top: 5px; }
.footer { border-top: 1px solid var(--line); background: white; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 23px; color: var(--muted); font-size: 13px; }
.footer .brand { color: var(--ink); }
dialog { position: relative; border: 1px solid var(--line); width: min(470px, calc(100% - 32px)); border-radius: 17px; padding: 20px; color: var(--ink); box-shadow: 0 15px 50px #15245b39; }
dialog::backdrop { background: #111d42a8; }
dialog img { width: 100%; border-radius: 10px; max-height: 310px; object-fit: cover; margin-bottom: 13px; }
dialog p { margin-block: 8px; }
.close { position: absolute; inset: 10px auto auto 10px; border: 1px solid var(--line); background: white; border-radius: 50%; width: 37px; height: 37px; font-size: 23px; line-height: 1; }
@media (max-width: 1120px) {
  .wrap { width: calc(100% - 48px); }
  .market { grid-template-columns: 185px minmax(0, 1fr); gap: 16px; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { gap: 12px; min-height: 64px; }
  .header-nav { gap: 12px; font-size: 13px; }
  .header-nav .current::after { display: none; }
  .header-nav a { display: none; }
  .header-actions { gap: 10px; }
  .hero-copy { padding-inline: 23px; width: 65%; }
  .category-list { grid-template-columns: repeat(4, 1fr); }
  .market { grid-template-columns: 1fr; }
  .filters { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: end; }
  .filter-title { width: 100%; }
  .filter-group { margin: 0; }
  fieldset.filter-group label { display: inline-flex; margin-inline-end: 6px; }
}
@media (max-width: 500px) {
  .brand { font-size: 23px; }
  .brand img { width: 35px; height: 35px; }
  .brand small { font-size: 9px; margin-top: 5px; }
  .add { padding-inline: 8px; font-size: 12px; }
  .add svg, .login svg { width: 16px; height: 16px; }
  .login span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .hero { margin-top: 15px; border-radius: 17px; }
  .hero-art { width: 100%; height: 210px; mask-image: none; background: linear-gradient(0deg, #142b96 1%, transparent 49%), url("assets/hero.webp") 30% center / auto 100% no-repeat; }
  .hero-copy { width: 100%; padding: 142px 16px 20px; }
  .hero h1 { font-size: 42px; }
  .hero p { font-size: 13px; }
  .category-list { gap: 6px; }
  .category { font-size: 12px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card-body { padding-inline: 8px; }
  .footer-inner { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* Night-market palette */
:root {
  color-scheme: dark;
  --ink: #f3f4fc;
  --muted: #a8b1ca;
  --blue: #a6b5ff;
  --line: #303750;
  --paper: #101322;
  --lime: #dcff7d;
  background: radial-gradient(ellipse at 80% 1%, #252a4a 0, transparent 48rem), var(--paper);
}
.header, .footer { background: #111524; }
.header-inner { min-height: 73px; }
.header-nav .current::after { background: var(--lime); inset-block-end: -25px; }
.header-nav .current, .header-nav [aria-pressed=true], .text-button:hover { color: var(--lime); }
.primary { background: var(--lime); color: #182112; }
.add { box-shadow: 0 0 24px #befe4824; }
.hero {
  min-height: 438px;
  border-radius: 27px;
  background: radial-gradient(ellipse at 38% 90%, #283bd9, transparent 52%), #111939;
  border: 1px solid #5266dd;
  box-shadow: 0 22px 75px #05071975, 0 0 44px #5368ff22;
}
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle, #9bacff55 1px, transparent 1.4px) 0 0 / 16px 16px;
  mask-image: linear-gradient(270deg, #0007, transparent 43%);
}
.hero-art {
  width: 69%;
  height: 100%;
  background: url("assets/hero.webp") 24% 55% / cover no-repeat;
  mask-image: linear-gradient(90deg, #000 53%, transparent 96%);
}
.hero-copy { width: min(58%, 650px); padding: 34px 43px 32px; }
.hero-eyebrow {
  border-color: #bdcaf45c;
  background: #0e173a78;
  color: #f2f4ff;
}
.hero h1 { font-size: clamp(58px, 6.6vw, 104px); line-height: .94; margin-block: 14px 16px; }
.hero h1 em { text-shadow: 0 0 35px #c8ff6138; }
.hero p { max-width: 370px; line-height: 1.7; }
#search-form { background: #f7f8ff; color: #43516f; margin-top: 15px; }
#search-form input { color: #131b35; color-scheme: light; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 11px; color: #c5d0f9; font-size: 11px; }
.hero-tags button { padding: 3px 9px; border: 1px solid #b7c7ff61; border-radius: 20px; background: #131c4b9e; color: white; }
.hero-tags button:hover { border-color: var(--lime); }
.hero-caption { position: absolute; inset: auto auto 16px 21px; display: flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 30px; border: 1px solid #adbdff61; background: #111a49c9; font-size: 11px; color: #f0f2ff; }
.hero-caption span:first-child { color: var(--lime); font-weight: 700; }
.caption-line { width: 13px; height: 1px; background: #a5b7ff; }
.category, .filters, .card, .select-field, .sort, .empty, dialog { background: #1a2034; }
.category { border-radius: 14px; padding-block: 12px; }
.category i { background: color-mix(in srgb, var(--tint) 17%, #1a2034); color: var(--tint); }
.category:is(:hover,[aria-pressed=true]) { background: #303c69; border-color: #91a7fb; color: white; }
.category[aria-pressed=true] i { color: #172219; background: var(--lime); }
.kicker { color: #bac6ff; }
.card:hover { box-shadow: 0 12px 28px #0006; border-color: #758adc; }
.photo { background: #292f47; }
.photo img { transition: scale .25s ease; }
.photo-link { overflow: hidden; }
.card:hover .photo img { scale: 1.04; }
.favorite, .close { background: #151a2bdd; color: white; }
.favorite[aria-pressed=true] { color: #ffc4d5; }
.price { color: var(--lime); }
.live-dot { background: var(--lime); box-shadow: 0 0 0 3px #caff6930; }
:focus-visible { outline-color: #b3c4ff; }
@media (max-width: 800px) {
  .hero-copy { padding-inline: 24px; width: 60%; }
  .hero-art { width: 72%; background-position: 27% center; }
}
@media (max-width: 600px) {
  .header-inner { min-height: 64px; }
  .hero { min-height: 0; border-radius: 19px; }
  .hero-art { width: 100%; height: 244px; background-position: 20% 60%; mask-image: linear-gradient(#000 56%, transparent 100%); }
  .hero-copy { width: 100%; padding: 164px 16px 20px; }
  .hero h1 { font-size: clamp(52px, 14vw, 76px); }
  .hero-caption { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .card:hover .photo img { scale: 1; }
}
