/* MotoFırsat — design tokens + catalog page styles.
   Recovered from Gülden's design system. Fonts load via Google Fonts (see <head>).
   "Instrument panel" palette: brass is the single hero accent, steel secondary,
   green means "best price" only. */

/* ============================ COLOR TOKENS ============================ */
:root {
  --night:        #0F141B; /* Gece Mavisi — app background */
  --navy-deep:    #161D27; /* Derin Lacivert — raised surface */
  --line:         #27313F; /* Çizgi — borders / hairlines */
  --line-soft:    #1E2733;

  --brass:        #C9A24B; /* Pusula Pirinci — primary accent */
  --steel:        #6E8CA8; /* Çelik Mavi — secondary accent */
  --price-green:  #3FA37A; /* Doğru Fiyat — price / savings ONLY */

  --snow:         #EEF2F6; /* Kar — primary text on dark */
  --fog:          #9AA7B4; /* Sis — secondary text / muted */
  --paper:        #F5F2EC; /* Kâğıt — light surface (paper mode) */

  --brass-bright: #D9B665;
  --brass-press:  #B68C39;
  --brass-wash:   rgba(201, 162, 75, 0.12);
  --brass-line:   rgba(201, 162, 75, 0.40);

  --steel-bright: #87A1B9;
  --steel-wash:   rgba(110, 140, 168, 0.14);

  --green-wash:   rgba(63, 163, 122, 0.14);
  --green-line:   rgba(63, 163, 122, 0.40);

  --bg-page:        var(--night);
  --surface-card:   var(--navy-deep);
  --surface-raised: #1B2330;
  --surface-sunken: #0B0F15;
  --border:         var(--line);
  --border-strong:  #354254;
  --border-subtle:  var(--line-soft);

  --text-strong:    var(--snow);
  --text-body:      #C7D0DA;
  --text-muted:     var(--fog);
  --text-on-brass:  #1A1206;
  --text-on-steel:  #0E141B;

  --accent:         var(--brass);
  --accent-hover:   var(--brass-bright);
  --accent-press:   var(--brass-press);
  --focus-ring:     rgba(201, 162, 75, 0.55);

  /* ============================ TYPE TOKENS ============================ */
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-numeric: 'Plus Jakarta Sans', system-ui, sans-serif;

  --w-regular: 400;
  --w-medium:  500;
  --w-semibold:600;
  --w-bold:    700;
  --w-extra:   800;

  --fs-display:  44px;
  --fs-h1:       34px;
  --fs-h2:       26px;
  --fs-h3:       20px;
  --fs-title:    17px;
  --fs-body:     15px;
  --fs-sm:       13px;
  --fs-xs:       12px;
  --fs-price:    20px;

  --lh-tight:   1.1;
  --lh-snug:    1.25;
  --lh-normal:  1.5;

  --ls-tight:   -0.02em;
  --ls-snug:    -0.01em;
  --ls-normal:  0;
  --ls-label:   0.06em;
  --ls-wide:    0.18em;

  /* ======================= SPACING / RADIUS TOKENS ===================== */
  --radius-xs:  4px;
  --radius-sm:  8px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-chip:999px;
  --radius-full:999px;

  /* ============================ EFFECTS TOKENS ========================= */
  --shadow-none: none;
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.40);
  --shadow-md:  0 6px 20px rgba(0,0,0,0.45);
  --shadow-lg:  0 18px 48px rgba(0,0,0,0.55);
  --glow-brass: 0 0 0 1px var(--brass-line), 0 4px 18px rgba(201,162,75,0.20);
  --edge-top: inset 0 1px 0 rgba(255,255,255,0.04);

  --ease-out:   cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out:cubic-bezier(0.4, 0.0, 0.2, 1);
  --dur-fast:   120ms;
  --dur-base:   180ms;
  --dur-slow:   280ms;
}

/* ============================ PAGE CSS ============================ */
body { margin: 0; }
::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-thumb { background: #27313F; border-radius: 8px; }
.mp-rail::-webkit-scrollbar { height: 6px; }
select.mp-sel { appearance: none; -webkit-appearance: none; }
@keyframes mpfade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Reserve first-paint height for the JS-rendered featured panel and product
   grid. Both start empty in the HTML and are filled only after catalog.json
   (~700KB) lands, so without a reservation the footer paints inside the
   viewport and is then shoved ~5000px down when content arrives — a large
   CLS anchored on <footer> (issue #24). The classes are removed in render()
   once real content (which is >= the reserved height on load) is injected. */
.mp-reserve-feat { min-height: 492px; }
.mp-reserve-grid { min-height: 900px; }

.mp-catalog { display: grid; grid-template-columns: 248px 1fr; gap: 30px; align-items: start; }
.mp-side { position: sticky; top: 80px; align-self: start; }
.mp-side-toggle { display: none; }
.mp-pano { display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px; align-items: start; }
.mp-rail-v { display: flex; flex-direction: column; gap: 14px; max-height: 488px; overflow-y: auto; padding: 2px 8px 2px 2px; scrollbar-width: thin; scrollbar-color: #27313F transparent; }
.mp-rail-v::-webkit-scrollbar { width: 7px; }
.mp-prodgrid a > div > div:first-child { background: radial-gradient(120% 118% at 50% 36%, #FCFAF4 0%, #F1EBDD 52%, #E3DACA 100%) !important; }
.mp-search:focus-within { box-shadow: 0 0 0 3px rgba(201,162,75,0.12); }
.mp-emailin:focus { border-color: #C9A24B !important; box-shadow: 0 0 0 3px rgba(201,162,75,0.12); }
.mp-sel:focus { border-color: #C9A24B !important; box-shadow: 0 0 0 3px rgba(201,162,75,0.12); outline: none; }
.mp-press { transition: background .15s, transform .12s; }
.mp-press:active { transform: scale(0.985) translateY(0.5px); }
.mp-seg { display: inline-flex; flex-wrap: wrap; background: #0B0F15; border: 1px solid #27313F; border-radius: 10px; padding: 3px; gap: 2px; }
.mp-segbtn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border: none; border-radius: 7px; background: transparent; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 600; font-size: 13px; cursor: pointer; transition: background .14s, color .14s; }

/* Product card — hover handled in CSS (original did it in React state). */
.mp-card { transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out); box-shadow: var(--shadow-sm); }
.mp-card:hover { border-color: var(--border-strong) !important; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.mp-card:hover .mp-card-go { color: var(--brass-bright); }
.mp-card .mp-card-go span { transition: transform var(--dur-fast) var(--ease-out); }
.mp-card:hover .mp-card-go span { transform: translateX(2px); }

/* Search focus border (original bound border-color to focus state). */
.mp-search:focus-within { border-color: #C9A24B; }

/* ===================== Detaylı Ara — search & filter sheet ===================== */
/* Backdrop: dims the page; click closes. Fixed over the whole viewport. */
.mp-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(5, 8, 12, 0.62);
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
.mp-backdrop.open { opacity: 1; pointer-events: auto; }

/* Sheet: bottom sheet on mobile (full width), centered max-840px on desktop.
   Slides up via transform; nothing on the page behind it changes until Uygula. */
.mp-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  display: flex; flex-direction: column;
  max-height: 88vh;
  background: #161D27; border: 1px solid #27313F; border-bottom: none;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.55);
  /* Hidden offset uses vh (a stable, box-independent unit) rather than a % of the
     sheet's own height — % transforms don't interpolate reliably while the sheet's
     flex content height settles on open, and can freeze mid-transition. 100vh always
     clears the bottom-anchored sheet fully off-screen. */
  transform: translateY(100vh);
  transition: transform .32s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.mp-sheet.open { transform: translateY(0); }

.mp-sheet-head { flex: none; padding: 10px 16px 0; }
.mp-sheet-grip { width: 36px; height: 4px; background: #354254; border-radius: 999px; margin: 0 auto 12px; }
.mp-sheet-search:focus-within { border-color: #C9A24B !important; box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.12); }

.mp-sheet-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 14px 16px 18px;
  display: flex; flex-direction: column; gap: 20px;
}
.mp-sheet-label {
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: #6E8CA8; margin-bottom: 9px;
}
.mp-sheet-seg { display: flex; background: #0B0F15; border: 1px solid #27313F; border-radius: 11px; padding: 3px; gap: 2px; }
.mp-sheet-top2 { display: flex; flex-direction: column; gap: 20px; }

/* Filter form row (#113): label stacked on mobile, label-left / control-right on desktop. */
.mp-form-row { display: flex; flex-direction: column; gap: 8px; }
.mp-form-label {
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: #6E8CA8;
}

.mp-sheet-bar {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 13px 16px 18px; background: #161D27; border-top: 1px solid #27313F;
}

/* Desktop: center the sheet (left/right 0 + margin auto + max-width keeps the
   transform a pure translateY so it interpolates reliably), roomier padding. */
@media (min-width: 760px) {
  .mp-sheet { margin: 0 auto; max-width: 840px; max-height: 86vh; }
  .mp-sheet-head { padding: 10px 24px 0; }
  .mp-sheet-body { padding: 14px 24px 18px; }
  .mp-sheet-bar { padding: 13px 24px 18px; }
  .mp-sheet-top2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .mp-form-row { display: grid; grid-template-columns: 120px 1fr; align-items: start; gap: 16px; }
  .mp-form-row .mp-form-label { padding-top: 14px; }
}
@media (prefers-reduced-motion: reduce) { .mp-sheet { transition: none; } }

@media (max-width: 880px) {
  .mp-catalog { grid-template-columns: 1fr; gap: 6px; }
  .mp-side { position: static; top: auto; }
  .mp-side-toggle { display: flex; }
  .mp-side-list { display: none; }
  .mp-side-list.open { display: block; }
  .mp-h1 { font-size: 33px !important; }
  .mp-hero { padding: 30px 22px 28px !important; }
  .mp-upd { display: none !important; }
  .mp-wrap { padding: 18px 16px 56px !important; }
  .mp-header-inner { padding: 11px 16px !important; gap: 12px !important; }
  .mp-head-count { display: none !important; }
}
@media (max-width: 760px) {
  .mp-pano { grid-template-columns: 1fr; }
  /* Mobile shows the hero carousel only — the duplicate vertical top-deals list
     below it is removed (issue #29). Reserve height drops to a single card. */
  .mp-rail-v { display: none; }
  .mp-reserve-feat { min-height: 560px; }
}
