/* ============================================================================
   layout.css — header, machine bar, hero, section furniture, footer,
   mobile bottom navigation
   ========================================================================= */

/* ── utility bar ─────────────────────────────────────────────────────────── */
.util-bar { background: var(--steel-900); color: var(--steel-300); font-size: .78rem; }
.util-bar .wrap { display: flex; gap: 18px; align-items: center; height: 34px; }
.util-bar a:hover { color: var(--white); }
.util-bar .spacer { flex: 1; }
.util-bar b { color: var(--amber); font-weight: 500; }
.util-panel { color: var(--amber); font-weight: 600; border: 1px solid var(--steel-700);
  border-radius: var(--r); padding: 2px 10px; }
.util-panel:hover { background: var(--amber); color: var(--ink); border-color: var(--amber); }

/* ── masthead ────────────────────────────────────────────────────────────── */
/* Sticky so the cart and search stay reachable while the customer scrolls a
   long parts list. Only the masthead sticks — the utility bar scrolls away. */
.masthead { background: var(--white); border-bottom: var(--line); position: sticky; top: 0; z-index: 40;
  transition: box-shadow .2s, padding .2s; }
.masthead.stuck { box-shadow: 0 10px 24px -20px rgba(21,25,28,.85); }
.masthead .wrap { display: flex; gap: 16px; align-items: center; padding: 12px 0; transition: padding .2s; }

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark { color: var(--steel-800); display: grid; place-items: center; flex-shrink: 0;
  transition: color .18s; }
.brand-mark .logo-mark { width: 38px; height: 38px; }
.brand:hover .brand-mark { color: var(--amber-deep); }
.brand-text { line-height: 1.3; }
.brand-text b { display: block; font-weight: 800; font-size: .98rem; }
.brand-text span { font-size: .71rem; color: var(--steel-500); }

.main-nav { display: flex; gap: 2px; }
.main-nav a { padding: 8px 11px; border-radius: var(--r); font-size: .86rem; color: var(--steel-700); }
.main-nav a:hover { background: var(--paper); color: var(--ink); }

.search { flex: 1; position: relative; min-width: 180px; }
.search-field { display: flex; align-items: center; gap: 8px; background: var(--paper);
  border: 1px solid var(--steel-150); border-radius: var(--r); padding-inline-start: 11px;
  transition: border-color .15s, background .15s; }
.search-field:focus-within { border-color: var(--steel-800); background: var(--white); }
.search-icon { width: 17px; height: 17px; flex-shrink: 0; fill: none; stroke: var(--steel-500);
  stroke-width: 1.8; stroke-linecap: round; }
.search-field input { flex: 1; border: 0; background: none; padding: 10px 0; min-width: 0; font-size: .9rem; }
.search-field input:focus { outline: none; }
.search-field button { border: 0; background: var(--steel-800); color: var(--white); align-self: stretch;
  padding-inline: 18px; cursor: pointer; font-weight: 500; font-size: .86rem;
  border-radius: 0 2px 2px 0; }
html[dir="rtl"] .search-field button { border-radius: 2px 0 0 2px; }
.search-field button:hover { background: var(--amber); color: var(--ink); }

.head-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  margin-inline-start: auto; }
.head-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border: var(--line);
  border-radius: var(--r); background: var(--white); cursor: pointer; font-size: .85rem;
  white-space: nowrap; color: var(--ink); }
.head-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }
.head-btn:hover { border-color: var(--steel-800); }
.head-btn.solid { background: var(--steel-900); color: var(--white); border-color: var(--steel-900); }
.head-btn.solid:hover { background: var(--amber); color: var(--ink); border-color: var(--amber); }
.cart-btn { position: relative; }
.cart-count { min-width: 20px; height: 20px; padding-inline: 5px; border-radius: 10px;
  background: var(--amber); color: var(--ink); font-family: var(--mono); font-size: .72rem;
  display: grid; place-items: center; }

/* ── machine bar ─────────────────────────────────────────────────────────── */
.machine-bar { background: var(--steel-800); color: var(--steel-100); border-bottom: 3px solid var(--amber); }
.machine-bar .wrap { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.machine-bar svg { width: 20px; height: 20px; fill: var(--amber); flex-shrink: 0; }
.machine-bar .label { font-size: .82rem; color: var(--steel-300); }
.machine-bar .tag { display: inline-flex; align-items: center; gap: 7px; background: var(--amber);
  color: var(--ink); padding: 5px 12px; border-radius: var(--r); font-weight: 700; font-size: .86rem; }
.machine-bar .link { background: none; border: 0; color: var(--steel-300); cursor: pointer;
  font-size: .8rem; text-decoration: underline; padding: 0; }
.machine-bar .link:hover { color: var(--white); }
.machine-bar .pick { background: transparent; border: 1px solid var(--amber); color: var(--amber);
  padding: 5px 14px; border-radius: var(--r); cursor: pointer; font-size: .84rem; font-weight: 500; }
.machine-bar .pick:hover { background: var(--amber); color: var(--ink); }
.machine-bar .spacer { flex: 1; }

/* ── hero ────────────────────────────────────────────────────────────────── */
.hero { background: var(--steel-900); color: var(--white); position: relative; overflow: hidden;
  isolation: isolate; }
/* hazard stripe — the one ornament on the page */
.hero::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 10px;
  background: repeating-linear-gradient(135deg, var(--amber) 0 10px, var(--steel-900) 10px 20px); z-index: 3; }
/* photo layer: blurred and scaled up so the blur has no soft edge to show */
.hero.has-photo::after {
  content: ""; position: absolute; inset: -6%; z-index: 0;
  background-image: var(--hero-image, none);
  background-size: cover; background-position: center 40%; background-repeat: no-repeat;
  /* light blur only — enough to keep text calm, not enough to erase the photo */
  filter: blur(2px) saturate(.9) brightness(.82) contrast(1.05);
  transform: scale(1.04);
}
/* veil keeps the headline readable whatever photo the owner uploads */
.hero-veil { position: absolute; inset: 0; z-index: 1; display: none; }
.hero.has-photo .hero-veil { display: block;
  background:
    linear-gradient(to left, rgba(26,32,36,.92) 0%, rgba(26,32,36,.66) 45%, rgba(26,32,36,.18) 100%),
    linear-gradient(to top, rgba(26,32,36,.55) 0%, rgba(26,32,36,0) 60%); }
/* the text carries its own contrast, so the veil can stay light */
.hero.has-photo h1, .hero.has-photo p, .hero.has-photo .hero-points b,
.hero.has-photo .hero-points span { text-shadow: 0 1px 14px rgba(10,14,16,.75); }
.hero .wrap { padding: 40px 0 36px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 38px;
  align-items: center; position: relative; z-index: 2; }
.hero h1 { margin: 0 0 12px; font-size: clamp(1.45rem, 3.4vw, 2.25rem); font-weight: 900; line-height: 1.5; }
.hero h1 em { font-style: normal; color: var(--amber); }
.hero p { margin: 0; color: var(--steel-300); max-width: 46ch; }
.hero-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hero-points li { border-inline-start: 2px solid var(--amber); padding-inline-start: 13px; }
.hero-points b { display: block; font-size: .95rem; }
.hero-points span { font-size: .82rem; color: var(--steel-300); }

/* ── sections ────────────────────────────────────────────────────────────── */
.section { padding: 36px 0; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-head h2 { margin: 0; font-size: 1.12rem; font-weight: 800; }
.section-head .rule { flex: 1; height: 1px; background: var(--steel-150); }
.section-head .more { font-size: .82rem; color: var(--steel-500); white-space: nowrap; }
.section-head .more:hover { color: var(--amber-deep); }
.shop-layout { display: grid; grid-template-columns: 262px 1fr; gap: 26px; align-items: start; }

.trust { background: var(--white); border-block: var(--line); }
.trust .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; padding: 24px 0;
  align-items: start; }
/* short fixed accent instead of a full-height border: stacked cells used to
   line their borders up into one long stripe down the page edge */
.trust div { padding-inline-start: 13px; position: relative; }
.trust div::before { content: ""; position: absolute; inset-inline-start: 0; top: 4px;
  width: 3px; height: 20px; background: var(--amber); border-radius: 2px; }
.trust b { display: block; font-size: .92rem; }
.trust span { font-size: .8rem; color: var(--steel-500); }

/* ── footer ──────────────────────────────────────────────────────────────── */
.site-footer { background: var(--steel-900); color: var(--steel-300); margin-top: 40px; font-size: .86rem; }
.site-footer .wrap { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 26px; padding: 34px 0 26px; }
.site-footer h4 { color: var(--white); font-size: .95rem; margin: 0 0 10px; }
.site-footer p { margin: 0 0 8px; line-height: 1.9; }
.site-footer nav a { display: block; padding: 4px 0; }
.site-footer nav a:hover { color: var(--amber); }
.footer-end { border-top: 1px solid var(--steel-800); }
.footer-end .wrap { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; font-size: .76rem; }

/* ── mobile bottom navigation (app-like) ─────────────────────────────────── */
.bottom-nav { display: none; }

@media (max-width: 1000px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 24px; padding: 30px 0; }
  .trust .wrap { grid-template-columns: repeat(2, 1fr); }
  .site-footer .wrap { grid-template-columns: 1fr 1fr; }
  .main-nav { display: none; }
}

@media (max-width: 820px) {
  .masthead .wrap { flex-wrap: wrap; gap: 9px; padding: 9px 0; }
  .search { order: 3; flex-basis: 100%; }
  /* labels drop away, so every action button is the same 42px square and the
     row stays symmetrical whatever is in it */
  .head-btn .btn-label { display: none; }
  .head-btn { width: 48px; height: 48px; padding: 0; justify-content: center; position: relative; }
  .head-btn svg { width: 23px; height: 23px; }
  .cart-btn .cart-count { position: absolute; top: -7px; inset-inline-end: -7px;
    border: 2px solid var(--white); height: 22px; min-width: 22px; font-size: .74rem; }
  .search-field button .btn-label { display: none; }
  .search-field button::after { content: "→"; }
  /* once scrolled, drop the strapline and tighten up so the sticky bar keeps
     roughly one thumb-row of height */
  .masthead.stuck .wrap { padding: 6px 0; }
  .masthead.stuck .brand-text span { display: none; }
  .masthead.stuck .brand-mark .logo-mark { width: 28px; height: 28px; }
  .shop-layout { grid-template-columns: 1fr; }
  .util-bar .hide-sm { display: none; }

  body { padding-bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom, 0px)); }
  .site-footer { margin-bottom: 0; }

  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
    background: var(--white); border-top: var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -8px 24px -20px rgba(0,0,0,.6);
  }
  .bottom-nav a, .bottom-nav button {
    background: none; border: 0; cursor: pointer; padding: 8px 2px 7px;
    display: grid; justify-items: center; gap: 3px; font-size: .68rem; color: var(--steel-500);
    position: relative;
  }
  .bottom-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; }
  .bottom-nav .active { color: var(--ink); }
  .bottom-nav .active::before { content: ""; position: absolute; top: 0; inset-inline: 22%;
    height: 2px; background: var(--amber); }
  .bottom-nav .dot { position: absolute; top: 5px; inset-inline-end: 22%; min-width: 16px; height: 16px;
    padding-inline: 4px; border-radius: 8px; background: var(--amber); color: var(--ink);
    font-family: var(--mono); font-size: .62rem; display: grid; place-items: center; }
}

@media (max-width: 560px) {
  .brand-text span { display: none; }
  .brand-text b { font-size: .9rem; }
  .brand-mark .logo-mark { width: 34px; height: 34px; }
  .head-actions { gap: 9px; }
  .head-btn { width: 46px; height: 46px; }
  .head-actions { gap: 6px; }
  .icon-btn { padding: 8px 10px; font-size: .8rem; }
  .icon-btn .label-sm { display: none; }
  .machine-bar .wrap { padding: 8px 0; gap: 8px; }
  .machine-bar .label { font-size: .74rem; }
  .hero .wrap { padding: 24px 0 22px; }
  .hero::before { width: 6px; }
  /* one column on a phone: the text sits over the whole photo, so the veil
     becomes uniform and a touch heavier */
  .hero.has-photo::after { filter: blur(2px) saturate(.9) brightness(.78) contrast(1.05); }
  /* phone: text runs full width, so shade from the bottom up and leave the top
     of the photo readable */
  .hero.has-photo .hero-veil { background:
    linear-gradient(to top, rgba(26,32,36,.9) 0%, rgba(26,32,36,.7) 45%, rgba(26,32,36,.42) 100%); }
  .hero h1 { font-size: 1.3rem; line-height: 1.6; }
  .hero p { font-size: .88rem; }
  .section { padding: 24px 0; }
  .trust .wrap { grid-template-columns: 1fr 1fr; gap: 14px; padding: 18px 0; }
  .trust span { font-size: .74rem; }

  /* Phones: two tight columns, every line flush to the right (start) edge. */
  /* Single column on phones: two columns left a ragged gap and pushed the
     third block onto a lonely row. */
  .site-footer .wrap { grid-template-columns: 1fr; gap: 20px; padding: 24px 0 18px; text-align: start; }
  .site-footer .footer-brand { grid-column: auto; }
  .site-footer > .wrap > div { border-top: 1px solid var(--steel-800); padding-top: 14px; }
  .site-footer > .wrap > div:first-child { border-top: 0; padding-top: 0; }
  .site-footer nav { display: grid; gap: 2px; }
  .site-footer .footer-brand p { font-size: .82rem; text-align: start; }
  .site-footer h4 { text-align: start; }
  .site-footer nav a { font-size: .84rem; text-align: start; }
  .footer-end .wrap { flex-direction: column; align-items: flex-start; text-align: start; gap: 4px; }
}
