@import url("fonts.css");

:root {
  --accent: #6b2f33;        /* overridden from SHOP config at boot */
  --accent-dark: #4e2124;
  /* Krede's gold. Decorative only — it fails contrast as text on cream
     (~2.4:1), so it is used for rules, borders and the hero hairline. */
  --gold: #c39a4e;
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #2b2523;
  --muted: #7b7270;
  --line: #e9e1da;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "almarai", "Segoe UI", Tahoma, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

a { color: var(--accent-dark); }

.wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px;
}

.wrap.narrow { max-width: 720px; }

.muted { color: var(--muted); font-size: 0.9rem; }

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

header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 247, 241, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-dark);
  text-decoration: none;
}

.brand .mark { flex: none; }

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0; /* or the letterspaced Latin line refuses to shrink and pushes
                   the whole bar wider than the viewport — in RTL that hides
                   the start of every line off the right edge, not the end */
}
.brand-text strong {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.brand-text small {
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  white-space: nowrap;
}

/* Below this the mark + name + nav no longer fit on one line, and the Latin
   line is the part the customer needs least — the Arabic name is right above
   it and the mark is beside it. Measured on a 390px iPhone, not guessed. */
@media (max-width: 460px) {
  .brand-text small { display: none; }
  .brand-text strong { font-size: 1.05rem; }
  header.site nav { gap: 16px; }
}

header.site nav { display: flex; gap: 22px; }

header.site nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

header.site nav a:hover { color: var(--accent-dark); }

.badge {
  display: inline-block;
  min-width: 20px;
  padding: 1px 6px;
  margin-inline-start: 2px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  text-align: center;
}
/* `display: inline-block` above outranks the UA rule for [hidden], so an empty
   basket rendered a badge showing "0". */
.badge[hidden] { display: none; }

/* SYP prices run to eight digits, which does not fit beside its label on a
   360px screen, stack them and keep the figure unbroken. */
.est-label, .est-value { display: block; }
.est-value { white-space: nowrap; }

footer.site {
  margin-top: 64px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.92rem;
}

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

.hero { padding: 44px 0 10px; max-width: 640px; }
.hero h1 { font-size: 2.2rem; margin: 0 0 8px; }
.hero p { margin: 0; color: var(--muted); font-size: 1.05rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 26px; }

.chip {
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.chip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(43, 38, 32, 0.1);
}

.card-body { padding: 12px 16px 16px; }
.card .cat {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.card h3 { margin: 2px 0 4px; font-size: 1.05rem; }
.card .price { margin: 0; color: var(--accent-dark); font-weight: 600; }

/* ---------- Illustrations ---------- */

.illus {
  background:
    radial-gradient(120% 90% at 50% 10%, #fff 0%, #f2ecdf 100%);
  padding: 14px 10px 6px;
}

.illus svg { display: block; width: 100%; height: auto; }

.illus.big {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 24px 16px;
}

.illus.thumb {
  width: 96px;
  flex: none;
  border-radius: 10px;
  padding: 8px 6px 4px;
}

/* ---------- Product page ---------- */

.product {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 36px;
  padding-top: 36px;
  align-items: start;
}

@media (max-width: 760px) {
  .product { grid-template-columns: 1fr; }
}

.preview { position: sticky; top: 84px; }
@media (max-width: 760px) { .preview { position: static; } }

.options .back {
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--muted);
}
.options h1 { margin: 6px 0 8px; font-size: 1.9rem; }
.options .desc { color: var(--muted); margin: 0 0 10px; }
.options h2 { font-size: 1rem; margin: 22px 0 10px; }
.options .picked { font-weight: 400; color: var(--muted); font-size: 0.9rem; }

.sizes { display: flex; flex-wrap: wrap; gap: 8px; }

.size {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.size.on {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--accent-dark);
  font-weight: 600;
}

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

.swatch {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #fff;
  outline: 1px solid var(--line);
  background: var(--sw);
  cursor: pointer;
}

.swatch.on {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.estimate {
  margin-top: 26px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.estimate > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.est-label { font-size: 0.9rem; color: var(--muted); }
.est-value { font-size: 1.7rem; font-weight: 700; color: var(--accent-dark); }

.actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--card);
  color: var(--accent-dark);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.primary:hover { background: var(--accent-dark); }

.added { color: var(--accent-dark); font-weight: 500; }

.empty { padding: 40px 0; color: var(--muted); }

/* ---------- Quote page ---------- */

.wrap.narrow h1 { padding-top: 36px; margin: 0 0 18px; }
.wrap.narrow h2 { font-size: 1.05rem; margin: 28px 0 10px; }

.quote-item {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 10px;
}

.quote-info { flex: 1; }
.quote-info h3 { margin: 0 0 2px; font-size: 1rem; }
.quote-info p { margin: 0; }

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sw);
  outline: 1px solid var(--line);
  vertical-align: -1px;
}

.quote-side { text-align: end; }
.quote-side .price { display: block; font-weight: 700; color: var(--accent-dark); }

.remove {
  border: none;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.quote-total {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: 1.1rem;
  border-top: 2px solid var(--line);
}

.form { display: flex; flex-direction: column; gap: 10px; }

.form input,
.form textarea {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  font: inherit;
  resize: vertical;
}

.form input:focus,
.form textarea:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

#send .actions { margin-bottom: 30px; }

/* ---------- Homepage ----------
   Mobile-first, unlike the legacy blocks above.

   The rule this section is built on: ONE visual moment and one primary action
   per screen. An earlier version gave every band the same weight — five
   illustrated category cards, three illustrated set cards, four bordered
   bullet boxes — and it read as noise. Borders are now the exception; space
   and a single hairline do the separating. */

.home-hero {
  position: relative;
  background: var(--accent-dark);
  color: #fff;
  text-align: center;
  padding: 46px 0 0;
  border-bottom: 3px solid var(--gold);
  overflow: hidden;
  isolation: isolate;
}

/* A hero carrying a photo needs its own height.
   Without this it is only as tall as its text — the silhouette strip used to
   supply the rest, and the strip retires when a photo arrives. The band
   collapsed to 1100×251, an aspect of 4.4 against a 1.79 image, so `cover`
   threw away 59% of the picture's height and left a letterbox sliver of a
   room that was the whole point of shooting it. */
.home-hero.has-photo {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 54px;
  min-height: 56vh;
  min-height: 56svh; /* svh, so mobile browser chrome cannot shrink it mid-scroll */
}

/* Optional photographic ground, switched on by SHOP.heroImage in js/data.js.
   Until a shop supplies one there is no element and no request — the maroon
   and the silhouette strip below carry the hero on their own. */
.home-hero .hero-photo {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  /* Tuned for a DARK, moody source — the shop's own interior look: walnut slat
     walls, grey concrete, pooled warm light. A dark photo held at the 0.3 this
     started on turns to mud against maroon, so it sits much further forward
     and the scrim does correspondingly less work.
     If a bright image is ever used instead, drop this back to ~0.3 and raise
     the gradient, or the headline loses its contrast. */
  opacity: 0.55;
  /* Luminosity keeps the photo's tonal structure but takes the maroon beneath
     as its hue, so a grey-and-walnut room reads as the shop's own colour
     instead of as a grey rectangle pasted behind the name. */
  mix-blend-mode: luminosity;
}

/* Separate element rather than a ::after on the photo: the scrim must NOT be
   caught by the blend mode above, or it tints instead of darkening. */
.home-hero .hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg,
    rgba(78, 33, 36, 0.4) 0%,
    rgba(78, 33, 36, 0.55) 55%,
    rgba(78, 33, 36, 0.85) 100%);
}

.home-hero-inner { max-width: 620px; position: relative; }

/* No monogram here. The header renders it ~60px above, and two rings that
   close together read as a rendering bug rather than as branding. */
.home-hero h1 { margin: 0; font-size: 1.95rem; line-height: 1.2; }

.home-hero .latin {
  margin: 5px 0 16px;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: var(--gold);
}

.home-hero .lede {
  margin: 0 0 22px;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.85);
}

/* One button. WhatsApp is already floating over every page; putting it here
   too made the hero ask two questions at once. */
.home-hero .btn.primary {
  background: #fff;
  border-color: #fff;
  color: var(--accent-dark);
}
.home-hero .btn.primary:hover { background: #f3ece4; }

.btn.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}
.btn.ghost:hover { border-color: #fff; }

/* Three pieces ghosted along the foot, cropped so they read as a room
   continuing past the edge rather than three clip-art items in a row. */
.hero-strip {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 8px;
  margin: 20px -20px -14px;
  opacity: 0.2;
  pointer-events: none;
  position: relative;
}

.hero-strip .illus { background: none; padding: 0; flex: 1 1 0; max-width: 190px; }

/* ---- one quiet line, where three boxes used to be ---- */

.fact-line {
  margin: 0;
  padding: 14px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  border-bottom: 1px solid var(--line);
}
.fact-line span + span { margin-inline-start: 6px; }
.fact-line span + span::before { content: "·"; margin-inline-end: 6px; opacity: 0.6; }

/* ---- bands ---- */

.band { padding: 30px 0 6px; }
.band h2 { font-size: 1.25rem; margin: 0 0 14px; }
.band-lede { margin: 0 0 20px; color: var(--muted); }

/* ---- categories as a list ----
   The catalogue is one tap away and that is where the big artwork belongs. A
   52px thumbnail is enough to tell a chair from a desk, and rows read as a
   list of departments, which is what they are. */

.cat-list {
  border-top: 1px solid var(--line);
}

.cat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  min-height: 56px; /* tap target */
}
.cat-row:hover { background: var(--card); }

.cat-row .illus {
  width: 52px;
  flex: none;
  padding: 0;
  background: none;
}

.cat-row-name { flex: 1; font-weight: 600; font-size: 1rem; }

.cat-row-count {
  color: var(--muted);
  font-size: 0.85rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  min-width: 26px;
  text-align: center;
  padding: 1px 7px;
}

.cat-row-go { color: var(--accent); font-size: 1.05rem; }

/* ---- the page's one visual moment ---- */

.set-band {
  margin-top: 30px;
  padding: 8px 0 34px;
  background: var(--card);
  border-block: 1px solid var(--line);
  text-align: center;
}

/* The three pieces sit on one shared ground rather than in three boxes, so
   they read as a room being furnished instead of three products for sale. */
.set-scene {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  margin: 0 -8px 4px;
  background: radial-gradient(120% 90% at 50% 20%, #fff 0%, #f4ede3 100%);
  border-radius: var(--radius);
  padding: 10px 4px 0;
}
.set-scene .illus { background: none; padding: 0; flex: 1 1 0; max-width: 200px; }
.set-band .band-lede { max-width: 420px; margin-inline: auto; }

/* ---- why us: lines, not boxes ---- */

.points { margin: 0; padding: 0; list-style: none; }

.points li {
  padding: 12px 0 12px 0;
  padding-inline-start: 16px;
  border-bottom: 1px solid var(--line);
  position: relative;
  color: var(--muted);
}
.points li:last-child { border-bottom: 0; }
.points li strong { color: var(--ink); display: block; font-weight: 700; }

/* A short gold tick rather than a full border box */
.points li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 17px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

/* ---- where ---- */

.where { padding-bottom: 8px; }
.where-grid { display: grid; gap: 16px; }
.where h2 { font-size: 1.25rem; margin: 0 0 8px; }
.where-line { margin: 0 0 4px; }
.where-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* Drawn, not embedded: nothing loads from Google, so the page still renders
   where Google does not. Tapping it opens the real thing. */
.map-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  line-height: 0;
}
.map-card svg { display: block; width: 100%; height: auto; }

@media (min-width: 761px) {
  .home-hero { padding-top: 62px; }
  /* Fixed rather than viewport-relative on a wide screen: a 56vh hero on a
     short laptop is a strip and on a tall monitor is a wall. 480px puts the
     band at ~2.3:1 against a 1.79 image, so ~78% of the room survives the
     crop instead of 41%. */
  .home-hero.has-photo { min-height: 480px; padding-block: 64px; }
  .home-hero h1 { font-size: 2.5rem; }
  .home-hero .lede { font-size: 1.15rem; }
  .hero-strip { gap: 28px; margin-inline: 0; }

  .cat-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 30px; }
  .set-scene { padding: 16px 10px 0; }
  .points { columns: 2; column-gap: 30px; }
  .points li { break-inside: avoid; }
  .where-grid { grid-template-columns: 1fr 1fr; align-items: center; gap: 30px; }
}


/* ---------- Floating WhatsApp button ----------
   Rendered by js/app.js on every page except the quote basket. */

.wa-fab {
  position: fixed;
  inset-block-end: 16px;
  /* inline-end resolves to the LEFT edge in RTL, which is deliberate: the
     product page's estimate card and the sticky admin footer both anchor to
     the reading side, and a button sitting on top of the price is worse than
     one the thumb has to travel for. */
  inset-inline-end: 16px;
  z-index: 40;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  transition: transform 0.12s ease;
}
.wa-fab:hover { transform: scale(1.06); }
.wa-fab svg { display: block; }

/* The button floats over the end of the page, so the footer gets room to
   clear it rather than having its last line sit underneath. */
footer.site { padding-bottom: 86px; }

@media (prefers-reduced-motion: reduce) {
  .wa-fab, .cat-card, .card { transition: none; }
}


/* ---------- Product photos ---------- */

/* Photos are cut out on transparency and sit on the same warm panel as the
   drawings, so a half-photographed catalogue still reads as one set. Fixed
   aspect + contain: a chair and a 3m meeting table must occupy the same card
   height or the grid combs. */
.illus.has-photo { display: block; }

.illus.has-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 240 / 160;
  object-fit: contain;
}

/* The real-stock photo under the configurator. Deliberately smaller than the
   drawing above it: the drawing is the thing being configured. */
.from-shop {
  margin: 12px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}

.from-shop img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: radial-gradient(120% 90% at 50% 10%, #fff 0%, #f4eee6 100%);
}

.from-shop figcaption {
  padding: 8px 14px 10px;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}
