/* Dr. Bicycle. See DESIGN.md for the reasoning behind these tokens. */

:root {
  --paper: #F7F4F1;
  --surface: #FFFFFF;
  --ink: #2A1D15;
  --ink-soft: #6B5548;
  --scrub: #C2410C;
  --scrub-deep: #9A3412;
  --mint: #FFEDE0;
  --tag: #F4C430;
  --line: #E2D3C7;
  --danger: #B3261E;
  /* The two colours of the Dr.Bicycle logo, for the Arabic name beside it. */
  --logo-blue: #125A7C;
  --logo-orange: #F6720E;

  --font-ui: "Changa", "Segoe UI", Tahoma, sans-serif;
  --font-text: "Markazi Text", "Noto Naskh Arabic", serif;

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1240px;

  /* Bike drawings. --frame is set per bike. */
  --frame: #8D9A97;
  --outline: var(--ink);
  --tire: var(--ink);
  --metal: #8D9A97;
  --spoke: #AEB9B6;
  --saddle: var(--ink);
  --fender: #8D9A97;
  --basket: #8A6A43;
  --dim: var(--ink-soft);
  --label: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}
html:has(dialog[open]) { overflow: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 20px;
  line-height: 1.75;
}

h1, h2, h3 { margin: 0; font-family: var(--font-ui); line-height: 1.25; }
p, ul, dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--scrub); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -80px; inset-inline-start: 16px; z-index: 50;
  padding: 10px 18px; border-radius: 0 0 10px 10px;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-ui); text-decoration: none;
}
.skip-link:focus { top: 0; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* The home page's text can't be selected or copied (js/app.js also blocks copy, cut and dragging);
   the search box still takes typing. -webkit-touch-callout stops the long-press menu on iPhones. */
.no-copy { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.no-copy input, .no-copy textarea { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px;
  border: 1.5px solid transparent; border-radius: 999px;
  font-family: var(--font-ui); font-size: 18px; font-weight: 600; line-height: 1;
  text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--scrub); color: var(--paper); }
.btn-primary:hover { background: var(--scrub-deep); }
.btn-paper { background: var(--paper); color: var(--ink); }
.btn-paper:hover { background: var(--mint); }
.btn-ghost { border-color: var(--ink); background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--mint); }
.btn-block { width: 100%; }
.btn[hidden] { display: none; }

.link-button {
  padding: 0; border: 0; background: none;
  font: inherit; color: inherit;
  text-decoration: underline; text-underline-offset: 5px; cursor: pointer;
}

.icon-button {
  display: inline-grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer;
}
.icon-button:hover { border-color: var(--ink); }
.icon-button svg { width: 18px; height: 18px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 16px 36px; min-height: 70px; }

.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; text-decoration: none; }
.brand-logo { display: block; flex: none; width: auto; height: 40px; }
/* The bike from the shop's logo, left of the name (img/logo-bike.webp, cut from the logo). */
.brand-bike { display: block; flex: none; width: auto; height: 50px; }
.brand-text { display: grid; line-height: 1; }
.brand-name { font-family: var(--font-ui); font-size: 25px; font-weight: 800; }
.brand-blue { color: var(--logo-blue); }
.brand-orange { color: var(--logo-orange); }

.site-nav {
  display: flex; gap: 30px; margin-inline-start: auto;
  font-family: var(--font-ui); font-size: 17px; font-weight: 500;
}
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.site-nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 9px; }

.cart-button {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding-inline: 18px 8px;
  border: 1.5px solid var(--ink); border-radius: 999px; background: transparent;
  font-family: var(--font-ui); font-size: 17px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.cart-button[aria-current="page"] { background: var(--mint); }
.cart-button:hover { background: var(--mint); }
.cart-count {
  display: inline-grid; place-items: center;
  min-width: 28px; height: 28px; padding-inline: 7px; border-radius: 14px;
  background: var(--tag); color: var(--ink);
  font-size: 15px; font-weight: 700; line-height: 1;
}
.cart-count[hidden] { display: none; }
.cart-icon { display: block; width: 22px; height: 22px; flex: none; }
.cart-button { gap: 8px; padding-inline: 14px 8px; }
.cart-button:has(.cart-count[hidden]) { padding-inline: 14px 18px; }
.cart-count.is-bumped { animation: bump 0.4s ease; }

/* ---------- Search ---------- */

/* The magnifier before the cart button drops the search panel under the header (js/search.js). */
.search-button, .cart-button, .menu-button { flex: none; }
.search-button {
  display: inline-grid; place-items: center; flex: none;
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer;
}
.search-button:hover, .search-button[aria-expanded="true"] { background: var(--mint); }
.search-button svg { width: 21px; height: 21px; }

.search-panel {
  position: absolute; inset-inline: 0; top: 100%;
  max-height: calc(100dvh - 72px); overflow-y: auto; overscroll-behavior: contain;
  padding-block: 18px 24px;
  background: var(--paper); border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 30px rgba(42, 29, 21, 0.16);
  animation: drop 0.22s ease-out;
}
.search-panel[hidden] { display: none; }
.search-open .wa-float { display: none; }
.search-form { position: relative; max-width: 760px; }
.search-form input {
  width: 100%; min-height: 52px; padding-inline: 50px 16px;
  border: 1.5px solid var(--ink); border-radius: 999px; background: var(--surface); color: var(--ink);
  font-family: var(--font-ui); font-size: 18px;
}
.search-form input:focus { outline: 3px solid var(--scrub); outline-offset: 2px; }
.search-form input::-webkit-search-cancel-button { cursor: pointer; }
.search-form-icon {
  position: absolute; inset-inline-start: 18px; top: 50%; transform: translateY(-50%);
  width: 21px; height: 21px; color: var(--ink-soft); pointer-events: none;
}
.search-status { margin-top: 12px; font-family: var(--font-ui); font-size: 16px; color: var(--ink-soft); }
.search-status:empty { display: none; }
.search-pages { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.search-pages:empty { display: none; }
.search-pages .chip { text-decoration: none; }
.search-hits { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.search-hits:empty { display: none; }
@media (min-width: 900px) { .search-hits { grid-template-columns: 1fr 1fr; } }
.search-hit {
  display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 8px 8px 8px 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none;
}
.search-hit:hover { border-color: var(--ink); }
.search-hit-art { flex: none; width: 60px; height: 60px; overflow: hidden; border-radius: 8px; background: #fff; }
.search-hit-art > * { width: 100%; height: 100%; aspect-ratio: auto; }
.search-hit-art svg { display: block; width: 100%; height: 100%; }
.search-hit-art .photo-art img { object-fit: cover; }
.search-hit-art .ph-art span { display: none; }
.search-hit-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.search-hit-name { font-family: var(--font-ui); font-size: 17px; font-weight: 700; line-height: 1.35; }
.search-hit-where { font-family: var(--font-ui); font-size: 14px; color: var(--ink-soft); }
.search-hit-out { color: var(--scrub-deep); font-weight: 600; }
.search-hit-price { flex: none; font-family: var(--font-ui); font-size: 15px; white-space: nowrap; }
.search-hit-price b { font-size: 18px; }
@media (max-width: 520px) {
  .search-hit { flex-wrap: wrap; row-gap: 0; }
  .search-hit-price { flex-basis: 100%; padding-inline-start: 74px; margin-top: -6px; }
}
.search-more { margin-top: 14px; min-height: 44px; padding-inline: 20px; font-size: 16px; }
.search-more[hidden] { display: none; }

/* ---------- Phone and tablet menu ---------- */

/* Below 980 px (phones, and tablets held upright) the link bar doesn't fit: a menu button opens a
   panel under the header instead (built by js/store.js). */
.menu-button {
  display: none; align-items: center; gap: 8px;
  min-height: 44px; padding-inline: 14px 16px;
  border: 1.5px solid var(--ink); border-radius: 999px; background: var(--ink); color: var(--paper);
  font-family: var(--font-ui); font-size: 17px; font-weight: 600; cursor: pointer;
}
.menu-button svg { width: 20px; height: 20px; flex: none; }
.menu-button .menu-icon-close, .menu-button[aria-expanded="true"] .menu-icon-open { display: none; }
.menu-button[aria-expanded="true"] .menu-icon-close { display: block; }

.site-menu {
  position: absolute; inset-inline: 0; top: 100%;
  max-height: calc(100dvh - 72px); overflow-y: auto; overscroll-behavior: contain;
  padding-block: 8px 24px;
  background: var(--paper); border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 30px rgba(42, 29, 21, 0.16);
  animation: fade 0.18s ease-out;
}
.site-menu[hidden] { display: none; }
.menu-open .wa-float { display: none; }
.menu-list { padding: 0; list-style: none; }
.menu-list > li { border-bottom: 1px solid var(--line); }
.menu-link {
  display: flex; align-items: center; min-height: 56px;
  font-family: var(--font-ui); font-size: 21px; font-weight: 700; text-decoration: none;
}
.menu-link[aria-current="page"], .menu-sub[aria-current="page"] { color: var(--scrub-deep); }
.menu-subs { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 14px; }
.menu-sub {
  display: inline-flex; align-items: center; min-height: 40px; padding-inline: 14px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface);
  font-family: var(--font-ui); font-size: 16px; text-decoration: none;
}
.menu-sub[aria-current="page"] { border-color: var(--scrub); }
.menu-contact { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 18px; font-family: var(--font-ui); font-size: 17px; }
.menu-contact a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 6px; }

@media (max-width: 980px) {
  .site-nav { display: none; }
  .menu-button { display: inline-flex; }
  .search-button { margin-inline-start: auto; }
  .header-row { gap: 12px; }
  .brand-name { font-size: 22px; }
  .brand-logo { height: 34px; }
  .brand-bike { height: 44px; }
}
/* Tablets on their side (981–1100 px): the full link bar is tight, so the logo stands alone. */
@media (min-width: 981px) and (max-width: 1100px) {
  .site-header .brand-text { display: none; }
}
/* Up to 1200 px the link bar, search and a full cart need tighter spacing to fit on one line. */
@media (min-width: 981px) and (max-width: 1200px) {
  .header-row { gap: 16px 20px; }
  .site-nav { gap: 22px; }
}
/* Up to 760 px the logo stands alone (the link's label still says the shop's name). */
@media (max-width: 760px) {
  .site-header .brand-text { display: none; }
}
/* Up to 640 px the cart is a round bag button with the count on its corner (its label stays for screen
   readers), so the logo, search, cart and menu fit with a full cart. */
@media (max-width: 640px) {
  .cart-button, .cart-button:has(.cart-count[hidden]) { position: relative; width: 44px; padding: 0; justify-content: center; }
  .cart-count {
    position: absolute; top: -6px; inset-inline-end: -6px;
    min-width: 22px; height: 22px; padding-inline: 5px; border: 2px solid var(--paper); border-radius: 11px; font-size: 12px;
  }
  .cart-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* Phones: an icon-only menu button (its label stays for screen readers). */
@media (max-width: 520px) {
  .header-row, .brand { gap: 8px; }
  .menu-button { width: 44px; padding: 0; justify-content: center; }
  .menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* Small phones (320–380 px): a smaller logo and a tighter cart button, so the header fits. */
/* Phones under 420 px: the logo, the bike, the menu and the cart don't fit side by side, so the cart
   button shows a bag icon and the count (its label stays for screen readers), and the logo and bike shrink. */
@media (max-width: 420px) {
  .header-row { gap: 8px; }
  .brand { gap: 6px; }
  .brand-logo { height: 28px; }
  .brand-bike { height: 36px; }
  .admin .brand-bike { display: none; }
}
/* Small phones (320–380 px): the logo, the bike, search, cart and menu share as little as 288 px, so
   the logo and the buttons shrink. */
@media (max-width: 380px) {
  .header-row, .brand { gap: 6px; }
  .brand-logo { height: 22px; }
  .brand-bike { height: 28px; }
  .search-button, .menu-button, .cart-button, .cart-button:has(.cart-count[hidden]) { width: 40px; height: 40px; min-height: 40px; }
}

/* ---------- Hero ---------- */

/* Dark-to-orange like the live drbicycle1.com hero. */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #17120F 0%, #4A2412 42%, var(--scrub) 100%); color: var(--paper);
  --frame: var(--paper);
  --outline: var(--ink);
  --metal: #F7B78F;
  --spoke: rgba(247, 244, 241, 0.42);
  --fender: #F7B78F;
  --dim: var(--mint);
  --label: var(--paper);
}
.hero :focus-visible { outline-color: var(--paper); }

.hero-grid { padding-top: clamp(40px, 6vw, 84px); }
.hero-title {
  font-size: clamp(40px, 4.4vw, 64px); font-weight: 800; line-height: 1.2;
  text-wrap: balance;
}
.hero-lead { max-width: 25em; margin-top: 22px; font-size: 22px; color: var(--mint); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 30px; margin-top: 32px; }
.hero-link { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--font-ui); font-size: 18px; font-weight: 500; text-underline-offset: 8px; }
.hero-art { margin-top: 40px; }
.hero-art svg { display: block; width: 100%; height: auto; }
/* Phones and upright tablets: title and line, then the bike, then the button under it on the right (start). */
@media (max-width: 899px) {
  .hero-grid { display: flex; flex-direction: column; }
  .hero-copy { display: contents; }
  .hero-art { order: 1; }
  .hero-actions { order: 2; margin-top: 0; padding-block: 20px 28px; }
}

@media (min-width: 900px) {
  .hero-grid { display: grid; }
  .hero-copy, .hero-art { grid-area: 1 / 1; }
  .hero-copy {
    position: relative; z-index: 1;
    width: 44%; justify-self: start; align-self: start;
    padding-bottom: calc(var(--floor, 5%) + 56px);
  }
  .hero-art { align-self: end; margin-top: 0; }
}

/* ---------- Perks strip (shipping, support) ---------- */

.perks { background: var(--scrub-deep); color: var(--paper); }
.perks-row {
  display: grid; gap: 14px 40px; margin-block: 0; padding-block: 22px; list-style: none;
}
@media (min-width: 700px) { .perks-row { grid-template-columns: 1fr 1fr; } }
.perk { display: flex; align-items: center; gap: 14px; font-family: var(--font-ui); font-size: 16px; color: var(--mint); }
.perk svg { width: 34px; height: 34px; flex: none; color: var(--paper); }
.perk b { display: block; font-size: 19px; font-weight: 700; color: var(--paper); }

/* ---------- Sections ---------- */

.section { padding-block: clamp(56px, 8vw, 104px); }
.section-title { font-size: clamp(30px, 3.6vw, 44px); font-weight: 700; }
/* "تخفيضات" sits right above "منتجات جديدة": one gap between them, not two. */
#sale:not([hidden]) + #new { padding-top: 0; }

/* ---------- Categories ---------- */

/* Four photo tiles. Each photo fills its tile; the name and product count sit in white over a dark fade.
   Phones and tablets: bikes full width, clothing and helmets side by side, accessories full width.
   Desktop (6-column grid): the bike photo large (4 columns, 2 rows), the clothing mannequin tall beside it
   (2 columns, 2 rows), helmets and accessories side by side underneath (3 columns each). */
.categories { padding-bottom: 0; }
.category-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; padding: 0; list-style: none; }
.category-bikes, .category-accessories { grid-column: 1 / -1; }
.category { display: flex; }
.category-open {
  position: relative; isolation: isolate; display: block; width: 100%; aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: 14px; background: #2A1D15; color: #fff; font-family: var(--font-ui); text-decoration: none;
}
.category-bikes .category-open { aspect-ratio: 4 / 3; }
.category-accessories .category-open { aspect-ratio: 16 / 10; }
.category-art { position: absolute; inset: 0; z-index: -2; }
.category-art img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.category-clothing .category-art img { object-position: 50% 30%; }
.category-helmets .category-art img { object-position: 52% 28%; }
.category-open::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(23, 18, 15, 0) 45%, rgba(23, 18, 15, 0.82) 100%);
}
.category-open:hover .category-art img { transform: scale(1.04); }
.category-text { position: absolute; inset-inline: 0; bottom: 0; display: grid; gap: 2px; padding: 16px 18px; }
.category-name { font-size: 24px; font-weight: 800; line-height: 1.2; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35); }
.category-bikes .category-name { font-size: clamp(28px, 3.2vw, 40px); }
.category-count { font-size: 15px; color: rgba(255, 255, 255, 0.86); }
@media (max-width: 520px) {
  .category-text { padding: 12px 14px; }
  .category-name { font-size: 20px; }
  .category-count { font-size: 14px; }
}
@media (min-width: 900px) {
  .category-grid { grid-template-columns: repeat(6, 1fr); grid-auto-rows: clamp(220px, 23vw, 300px); gap: 18px; }
  .category-open { aspect-ratio: auto; height: 100%; }
  .category-bikes { grid-column: 1 / 5; grid-row: 1 / 3; }
  .category-clothing { grid-column: 5 / 7; grid-row: 1 / 3; }
  .category-helmets { grid-column: 1 / 4; }
  .category-accessories { grid-column: 4 / 7; }
}
@media (prefers-reduced-motion: reduce) { .category-art img { transition: none; } }

/* Product photos sit in the same wide box as the bike drawings, so every row keeps one floor line. */
.photo-art { aspect-ratio: 2200 / 1180; background: #fff; }
.photo-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ci-art .photo-art { aspect-ratio: 1; }
/* Dark stand-in picture for a helmet or accessory with no photo yet (js/placeholders.js). */
.generic-art { display: grid; place-items: center; }
.generic-art svg { display: block; width: 72%; height: auto; }
.bd-art .photo-art { aspect-ratio: 1; max-height: 70dvh; margin-inline: auto; border-radius: 10px; }

/* Placeholder art for products with neither a drawing nor a photo. */
.ph-art {
  display: grid; place-items: center; align-content: center; gap: 8px;
  aspect-ratio: 2200 / 1180;
  background: var(--mint);
}
.ph-art .ph-icon {
  width: 30%; max-width: 120px; height: auto;
  fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.ph-art .ph-fill { fill: var(--frame); }
.ph-art span { font-family: var(--font-ui); font-size: 14px; color: var(--ink-soft); }
.ci-art .ph-art span { display: none; }
.ci-art .ph-art .ph-icon { width: 55%; }

/* ---------- Catalogue ---------- */

.catalogue-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 40px; }

.filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 32px;
  margin-top: 28px; padding-block: 18px 14px;
  border-block: 1px solid var(--line);
}
.type-filter { flex: 1 1 auto; min-width: 0; margin: 0; padding: 0; border: 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px; padding: 4px; }
/* Phones: one swipeable row instead of a wrapped block of chips. */
@media (max-width: 640px) {
  .type-filter { flex-basis: 100%; }
  .chip-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .chip-row::-webkit-scrollbar { display: none; }
}

.chip {
  position: relative; flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding-inline: 16px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface);
  font-family: var(--font-ui); font-size: 17px; font-weight: 500; white-space: nowrap;
  cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.chip-count { font-size: 14px; color: var(--ink-soft); }
.chip:has(input:checked) { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.chip:has(input:checked) .chip-count { color: var(--mint); }
.chip:has(input:focus-visible) { outline: 3px solid var(--scrub); outline-offset: 2px; }
/* Category links on the category pages share the chip look. */
a.chip { color: inherit; text-decoration: none; }
a.chip[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
a.chip[aria-current="page"] .chip-count { color: var(--mint); }
/* Bike-type links (/الدراجات/هجين …) sit under the bikes heading; the current type is orange. */
.subtype-nav { margin-top: 24px; }
.subtype-nav[hidden] { display: none; }
@media (max-width: 640px) {
  .subtype-nav .chip-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .subtype-nav .chip-row::-webkit-scrollbar { display: none; }
}
.subtype-nav a.chip[aria-current="page"] { border-color: var(--scrub); background: var(--scrub); color: #fff; }
.subtype-nav a.chip[aria-current="page"] .chip-count { color: var(--mint); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 9px; }

.category-page { min-height: calc(100dvh - 71px); padding-top: clamp(32px, 5vw, 56px); }
.section-link { color: var(--ink); }

.filter-fields { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.field-inline[hidden] { display: none; }
.field-inline { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-ui); font-size: 17px; }
.field-inline select {
  min-height: 42px;
  border: 1.5px solid var(--ink-soft); border-radius: 10px; background-color: var(--surface);
  font-family: var(--font-ui); font-size: 17px;
  appearance: none; padding-inline: 14px 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%232A1D15' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 14px center; background-size: 12px;
}

.result-count { margin-top: 22px; font-family: var(--font-ui); font-size: 16px; color: var(--ink-soft); }

/* Each product is an outlined card with a little space around it, so one item is clearly told from the next. */
.bike-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; padding: 0; list-style: none; }
@media (max-width: 639px) { .bike-grid { gap: 10px; } }
@media (min-width: 1040px) { .bike-grid { grid-template-columns: repeat(3, 1fr); } }

.bike {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bike:hover { border-color: var(--ink-soft); box-shadow: 0 6px 18px rgba(42, 29, 21, 0.08); }
/* Scroll-in: js/products.js adds .reveal (cards start faded and 18 px low) and then .is-in as each card comes
   into view. Only the entrance waits for --reveal-delay; hover stays instant. */
.bike.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.55s ease var(--reveal-delay, 0ms), transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) var(--reveal-delay, 0ms),
    border-color 0.15s, box-shadow 0.15s;
}
.bike.reveal.is-in { opacity: 1; transform: none; }
/* Sold out: the photo fades and a badge sits in its corner; the tile still links to the product. */
.bike-art { position: relative; }
.is-sold-out .bike-art > :not(.sold-out-badge) { opacity: 0.55; }
/* A bike's frame size, in the photo's other top corner. */
.size-badge {
  position: absolute; top: 10px; inset-inline-end: 10px; min-width: 32px;
  padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-family: var(--font-ui); font-size: 13px; font-weight: 700; text-align: center;
}
.is-sold-out .bike-art > .size-badge { opacity: 1; }
.sold-out-badge {
  position: absolute; top: 10px; inset-inline-start: 10px;
  padding: 3px 10px; border-radius: 999px; background: var(--ink); color: var(--paper);
  font-family: var(--font-ui); font-size: 13px; font-weight: 600;
}
/* Every tile's picture box is upright 3:4, the shape of most of the shop's photos (taken with the phone held
   upright), so the white bars beside or above a photo stay small. Bike drawings stand on its bottom edge
   (the floor line); photos and placeholders fill it. */
.bike-art {
  display: flex; flex-direction: column; justify-content: flex-end;
  aspect-ratio: 3 / 4; border-bottom: 1px solid var(--line);
}
.bike-art svg { display: block; width: 100%; height: auto; }
.bike-art > .photo-art, .bike-art > .ph-art { flex: 1; aspect-ratio: auto; min-height: 0; }
.bike-text {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0 16px;
  padding: 14px 16px 16px;
}
.bike-name { font-size: 23px; font-weight: 700; }
/* Phones: two tiles per row are narrow, so the price goes under the name and the text is smaller. */
@media (max-width: 520px) {
  .bike-text { grid-template-columns: 1fr; padding: 10px 10px 12px; }
  .bike-name { font-size: 16px; line-height: 1.4; }
  .bike-text > * { min-width: 0; }
  .bike-price { margin-top: 4px; font-size: 13px; white-space: normal; }
  .bike-price b { font-size: clamp(15px, 4.7vw, 18px); }
}
.bike-open { color: inherit; text-decoration: none; }
.bike-open::after { content: ""; position: absolute; inset: 0; }
.bike-open:focus-visible { outline: none; }
.bike:has(.bike-open:focus-visible) { outline: 3px solid var(--scrub); outline-offset: 3px; }
.bike:hover .bike-name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 7px; }
.bike-price { font-family: var(--font-ui); font-size: 16px; white-space: nowrap; }
.bike-price b { font-size: 24px; font-weight: 700; }

/* Sale prices (salePrice from /admin): the new price in the shop's dark orange, the old one struck through
   under or beside it, and the discount ("خصم 20%") as an orange tag, on the product page and the photo. */
.price-now.is-sale { color: var(--scrub-deep); }
.price-was {
  color: var(--ink-soft); font-size: 0.85em; white-space: nowrap;
  text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--ink);
}
.price-off, .sale-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--scrub); color: #fff;
  font-family: var(--font-ui); font-size: 14px; font-weight: 700; line-height: 1.5; white-space: nowrap;
}
.sale-badge { position: absolute; bottom: 10px; inset-inline-start: 10px; font-size: 13px; }
.bike-price:has(.price-was), .ci-price:has(.price-was), .search-hit-price:has(.price-was) { display: grid; justify-items: end; }
.bd-price:has(.price-was), .added-price:has(.price-was) { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.bd-price .price-was { font-size: 20px; }
.bd-price .price-off { font-size: 16px; padding: 3px 12px; align-self: center; }
.added-price .price-off { align-self: center; font-size: 13px; }
@media (max-width: 520px) {
  .bike-price:has(.price-was), .search-hit-price:has(.price-was) { justify-items: start; }
  .search-hit-price:has(.price-was) { display: flex; gap: 10px; align-items: baseline; }
}

.empty { margin-top: 24px; padding-top: 36px; border-top: 2px solid var(--ink); }
.empty p { max-width: 28em; font-size: 22px; }

/* ---------- Visit ---------- */

.visit { padding-block: clamp(48px, 7vw, 88px) 32px; background: var(--ink); color: var(--paper); }
/* Room under the last footer line so the floating WhatsApp button (58 px, 20 px from the edge) doesn't cover it. */
.visit { padding-bottom: 96px; }
.visit :focus-visible { outline-color: var(--tag); }
.visit-grid { display: grid; gap: 32px 48px; }
@media (min-width: 760px) { .visit-grid { grid-template-columns: 1.3fr 1fr; } }
.visit-title { font-size: clamp(30px, 3.6vw, 44px); font-weight: 700; }
.visit-sub { font-size: 21px; font-weight: 600; }
.visit p { margin-top: 10px; color: #EDE2DA; }
.visit a { display: inline-block; padding-block: 8px; text-underline-offset: 6px; }
/* The shop's location on Google Maps, as a button under the address and hours. */
.visit .visit-map { margin-top: 18px; }
.visit .map-button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px 0 16px;
  border-radius: 999px; background: var(--paper); color: var(--ink);
  font-family: var(--font-ui); font-size: 16px; font-weight: 600; text-decoration: none;
}
.visit .map-button:hover { background: var(--mint); }
.map-button svg { width: 20px; height: 20px; flex: none; color: var(--scrub); }
/* WhatsApp, Instagram and Facebook as round icon buttons under the phone number. */
.social { display: flex; gap: 12px; margin: 14px 0 0; padding: 0; list-style: none; }
.visit .social-link {
  display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0;
  border: 1.5px solid rgba(247, 244, 241, 0.35); border-radius: 50%; color: var(--paper);
}
.visit .social-link:hover { border-color: var(--paper); background: var(--paper); color: var(--ink); }
.social-link svg { width: 24px; height: 24px; }
.fine {
  grid-column: 1 / -1; padding-top: 22px;
  border-top: 1px solid rgba(247, 244, 241, 0.2);
  font-family: var(--font-ui); font-size: 14px;
}
.visit .fine { color: #C9B4A6; }

/* ---------- Bike drawings ---------- */

.bike-svg { overflow: visible; }
.bike-svg path, .bike-svg circle { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.bike-svg .fr { stroke: var(--frame); transition: stroke 0.35s ease; }
.bike-svg .ol { stroke: var(--outline); }
.bike-svg .tr, .bike-svg .bt { stroke: var(--tire); }
.bike-svg .mt { stroke: var(--metal); }
.bike-svg .sp { stroke: var(--spoke); }
.bike-svg .ch { stroke: var(--tire); opacity: 0.5; }
.bike-svg .fn { stroke: var(--fender); }
.bike-svg .bk { stroke: var(--basket); }
.bike-svg .led { stroke: var(--tag); }
.bike-svg .fl { stroke: none; }
.bike-svg .sd { fill: var(--saddle); }
.bike-svg .hub { fill: var(--metal); }
.bike-svg .dm { stroke: var(--dim); stroke-linecap: butt; }
.bike-svg .gd { stroke: var(--ink); }
.bike-svg .dl { fill: var(--label); font-family: var(--font-ui); font-weight: 600; }
.bike-svg .flr { fill: var(--scrub-deep); }
.bike-svg .gl { stroke: var(--mint); }

/* The hero bike draws itself in once, wheels first. */
.is-drawing [pathLength] {
  stroke-dasharray: 1 1;
  animation: draw 1s cubic-bezier(0.55, 0.1, 0.25, 1) both;
  animation-delay: calc(var(--i, 0) * 170ms + 200ms);
}
.is-drawing .fl, .is-drawing text {
  animation: fade 0.5s ease both;
  animation-delay: calc(var(--i, 0) * 170ms + 700ms);
}

/* ---------- Product page (/product/<slug>) ---------- */

.product-page { padding-top: clamp(20px, 3vw, 32px); }
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 20px;
  font-family: var(--font-ui); font-size: 16px; color: var(--ink-soft);
}
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; }
.crumbs [aria-current] { color: var(--ink); }

.bd-layout { display: grid; gap: 28px clamp(32px, 5vw, 64px); }
.bd-media {
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(16px, 3vw, 40px); border-radius: 16px;
  background: var(--surface);
}
.bd-art svg { display: block; width: 100%; height: auto; }
@media (min-width: 880px) {
  .bd-layout { grid-template-columns: 1.2fr 1fr; align-items: start; }
  .bd-media { position: sticky; top: 96px; min-height: 420px; }
}

/* Several photos: arrows on the picture and a row of thumbnails under it. */
.bd-stage { position: relative; }
.gallery-step { position: absolute; top: 50%; transform: translateY(-50%); box-shadow: 0 2px 8px rgba(42, 29, 21, 0.15); }
.gallery-step[hidden], .gallery-thumbs[hidden] { display: none; }
.gallery-prev { inset-inline-start: 4px; }
.gallery-next { inset-inline-end: 4px; }
.gallery-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.gallery-thumb {
  width: 68px; height: 68px; padding: 3px; overflow: hidden;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
}
.gallery-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.gallery-thumb:hover { border-color: var(--ink-soft); }
.gallery-thumb[aria-current="true"] { border-color: var(--scrub); box-shadow: 0 0 0 1.5px var(--scrub); }

/* The product's YouTube video, between the product and "قد يعجبك أيضًا". */
.bd-video { margin-top: clamp(56px, 8vw, 96px); }
.bd-video[hidden] { display: none; }
.video-frame {
  max-width: 960px; margin-top: 20px; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 16px; background: #000;
}
.video-frame iframe { display: block; width: 100%; height: 100%; border: 0; }

.related { margin-top: clamp(56px, 8vw, 96px); }
.related[hidden] { display: none; }

.bd-name { margin-top: 2px; font-size: clamp(32px, 3.4vw, 44px); font-weight: 800; }
.bd-size { margin-top: 6px; font-family: var(--font-ui); font-size: 17px; font-weight: 600; color: var(--ink-soft); }
.bd-size[hidden] { display: none; }

.bd-buy {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line);
}
.bd-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.bd-price { font-family: var(--font-ui); font-size: 18px; }
.bd-price b { font-size: 34px; font-weight: 700; }
.bd-sold-out { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: #ECE6E1; font-family: var(--font-ui); font-size: 16px; }
.bd-sold-out[hidden] { display: none; }
/* "Added to the cart" popup: under the cart button on wide screens, rising from the bottom on phones. */
.added-pop {
  position: fixed; z-index: 40; top: 84px; inset-inline-end: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  width: min(380px, calc(100vw - 32px)); padding: 16px 18px 18px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  box-shadow: 0 20px 44px rgba(42, 29, 21, 0.22);
  animation: pop-in 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.added-pop[hidden] { display: none; }
.added-head { display: flex; align-items: center; gap: 10px; }
.added-check { width: 26px; height: 26px; flex: none; color: #1F9D55; }
.added-title { flex: 1; font-size: 19px; font-weight: 700; }
.added-close { width: 38px; height: 38px; }
.added-close svg { width: 15px; height: 15px; }
.added-item { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.added-art { flex: none; width: 72px; height: 72px; overflow: hidden; border-radius: 10px; background: #fff; }
.added-art > * { width: 100%; height: 100%; aspect-ratio: auto; }
.added-art svg { display: block; width: 100%; height: 100%; }
.added-art .photo-art img { object-fit: cover; }
.added-art .ph-art span { display: none; }
.added-text { display: grid; gap: 4px; min-width: 0; }
.added-name { font-family: var(--font-ui); font-size: 17px; font-weight: 700; line-height: 1.35; }
.added-price { font-family: var(--font-ui); font-size: 15px; }
.added-price b { font-size: 18px; }
.added-sum { margin-top: 12px; font-family: var(--font-ui); font-size: 15px; color: var(--ink-soft); }
.added-sum b { color: var(--ink); }
.added-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.added-actions .btn { min-height: 48px; padding: 0 12px; font-size: 16px; }
@media (max-width: 640px) {
  .added-pop {
    top: auto; bottom: 12px; inset-inline: 12px; width: auto;
    animation-name: pop-up;
  }
  .added-open .wa-float { display: none; }
}
@media (max-width: 350px) { .added-actions { grid-template-columns: 1fr; } }

.bd-desc-title { margin-top: 20px; font-size: 18px; font-weight: 700; }
.desc-lines { margin-top: 6px; padding: 0; list-style: none; }
.desc-lines li { padding-block: 9px; border-bottom: 1px solid var(--line); font-family: var(--font-ui); font-size: 16px; line-height: 1.6; }

/* ---------- Cart page (/cart) ---------- */

.cart-page { min-height: calc(100dvh - 71px); padding-top: clamp(32px, 5vw, 56px); }
.cart-page h1:focus { outline: none; }
.back-link {
  display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 4px;
  font-family: var(--font-ui); font-size: 16px; color: var(--ink-soft); text-decoration: none;
}
.back-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; }
.cart-layout { display: grid; gap: 40px; margin-top: 12px; }
.cart-layout[hidden], .cart-empty[hidden] { display: none; }
@media (min-width: 900px) {
  .cart-layout { grid-template-columns: 1.35fr 1fr; gap: 64px; align-items: start; }
  .cart-layout .order { position: sticky; top: 100px; margin-top: 8px; }
}
.cart-empty { padding-top: 24px; }
.cart-empty p { margin-bottom: 20px; font-size: 21px; }

.cart-items { padding: 0; list-style: none; }
.cart-item {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 14px; align-items: start;
  padding-block: 18px; border-bottom: 1px solid var(--line);
}
.ci-art { padding-top: 4px; border-bottom: 1.5px solid var(--ink); }
.ci-art svg { display: block; width: 100%; height: auto; }
.ci-name { font-family: var(--font-ui); font-size: 18px; font-weight: 700; line-height: 1.3; }
.ci-name a { color: inherit; text-decoration: none; }
.ci-name a:hover { text-decoration: underline; text-underline-offset: 6px; }
.ci-row { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; }
.qty button {
  width: 36px; height: 36px; border: 0; border-radius: 50%; background: none;
  font-family: var(--font-ui); font-size: 20px; line-height: 1; cursor: pointer;
}
.qty button:disabled { color: var(--line); cursor: default; }
.qty output { min-width: 22px; font-family: var(--font-ui); font-size: 16px; font-weight: 600; text-align: center; }
.ci-remove { min-height: 44px; padding-inline: 6px; font-family: var(--font-ui); font-size: 15px; color: var(--ink-soft); }
.ci-price { font-family: var(--font-ui); font-size: 15px; white-space: nowrap; }
.ci-price b { font-size: 19px; }
.ci-money { display: grid; justify-items: end; gap: 4px; text-align: end; }
.ci-deposit {
  display: grid; padding: 3px 10px; border-radius: 8px; background: var(--mint);
  font-family: var(--font-ui); font-size: 14px; line-height: 1.5; color: var(--scrub-deep); white-space: nowrap;
}
.ci-deposit b { font-weight: 700; }
.ci-deposit-each { font-size: 13px; color: var(--ink-soft); }
.cart-layout > * { min-width: 0; }
/* Phones: the price and deposit go under the name instead of beside it, so the line fits the screen. */
@media (max-width: 520px) {
  .cart-item { grid-template-columns: 72px minmax(0, 1fr); }
  .ci-money { grid-column: 2; justify-items: start; text-align: start; }
  .ci-price:has(.price-was) { justify-items: start; }
}

.cart-total {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-block: 18px; font-family: var(--font-ui); font-size: 18px; font-weight: 600;
}
.cart-total b { font-size: 28px; }

.order { padding-top: 22px; border-top: 2px solid var(--ink); }
.order-title { margin-bottom: 4px; font-size: 22px; font-weight: 700; }
.field { margin-top: 14px; }
.field label { display: block; margin-bottom: 6px; font-family: var(--font-ui); font-size: 16px; font-weight: 600; }
.field-optional { font-weight: 400; color: var(--ink-soft); }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1.5px solid var(--ink-soft); border-radius: 10px; background: var(--surface);
  font-family: var(--font-ui); font-size: 17px; line-height: 1.5;
}
.field input[dir="ltr"] { text-align: right; }
.field textarea { min-height: 84px; resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field-error { margin-top: 6px; font-family: var(--font-ui); font-size: 15px; color: var(--danger); }
.field-error:empty { display: none; }
.order .btn-block { margin-top: 24px; }
.order-note { margin-top: 12px; font-family: var(--font-ui); font-size: 15px; color: var(--ink-soft); }
.order-status { margin-top: 14px; font-family: var(--font-ui); font-size: 16px; font-weight: 600; color: var(--scrub-deep); }
.order-status:empty { display: none; }

/* ---------- Floating WhatsApp button ---------- */

.wa-float {
  position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 30;
  display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%;
  background: #25D366; color: #fff;
  box-shadow: 0 6px 18px rgba(42, 29, 21, 0.3);
}
.wa-float:hover { background: #1EBE5A; }
.wa-float svg { width: 32px; height: 32px; }

/* ---------- Motion ---------- */

@keyframes draw {
  from { stroke-dashoffset: 1; opacity: 0; }
  8% { opacity: 1; }
  to { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-10px) scale(0.96); } }
@keyframes pop-up { from { opacity: 0; transform: translateY(24px); } }
@keyframes drop { from { opacity: 0; transform: translateY(-14px); } }
@keyframes bump { 40% { transform: scale(1.3); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
