/* LFM Sourcing, Shop Example 2: storefront layer on the Kraft design system (css/kraft.css).
   Shop pages: a solid ink header with search and order, a department bar, label-card products. */

:root { --line: rgba(28,26,22,.18); --shadow: 0 10px 24px -12px rgba(28,26,22,.45); }
::selection { background: var(--ink); color: var(--kraft); }
html { scroll-padding-top: 150px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.shop > main { padding-top: 0; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Header ---------- */
header.shop-head { position: sticky; top: 0; background: var(--ink); color: var(--label); }
header.shop-head .bar .wrap { height: 76px; gap: 28px; justify-content: flex-start; }
header.shop-head .logo { font-size: 28px; white-space: nowrap; }
.search { position: relative; flex: 1; max-width: 640px; display: flex; align-items: center; height: 46px; padding: 0 6px 0 16px; gap: 10px;
  background: var(--label); color: var(--ink); border-radius: 4px; }
.search:focus-within { outline: 3px solid var(--kraft); outline-offset: 2px; }
.search input { flex: 1; min-width: 0; height: 100%; font: inherit; font-size: 15px; color: var(--ink); background: none; border: 0; outline: 0; }
.search input::placeholder { color: #6E6354; }
.search input::-webkit-search-cancel-button { display: none; }
.search button { height: 36px; padding: 0 14px; font: inherit; font-size: 14px; font-weight: 700; color: var(--label); background: var(--ink); border: 0; border-radius: 3px; cursor: pointer; }
.search button:hover { background: var(--stamp); }
.suggest { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 70; background: var(--label); color: var(--ink); border: 2px solid var(--ink); border-radius: 6px; box-shadow: var(--shadow); overflow: hidden; }
.suggest a { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; padding: 8px 12px; text-decoration: none; font-size: 14px; line-height: 1.3; }
.suggest a + a { border-top: 1px solid var(--line); }
.suggest a:hover, .suggest a.active { background: #EFE6D6; }
.suggest .thumb { width: 48px; height: 48px; }
.suggest small { display: block; color: var(--muted); font-size: 12px; }
.suggest .all { display: block; padding: 10px 12px; font-weight: 700; background: #F3EEE3; }
.suggest .none { padding: 14px; font-size: 14px; color: var(--muted); }
.acct { margin-left: auto; gap: 22px; font-size: 14px; }
.acct a { white-space: nowrap; }
.order-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; font: inherit; font-weight: 700; font-size: 14px;
  color: var(--ink); background: var(--kraft); border: 0; border-radius: 4px; cursor: pointer; }
.order-btn:hover { background: var(--label); }
.order-btn .count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--ink); color: var(--label); font-size: 12px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.order-btn .count.bump { animation: bump .4s cubic-bezier(.2,.8,.2,1); }
@keyframes bump { 40% { transform: scale(1.4); background: var(--stamp); } }

.aisles { background: var(--kraft); color: var(--ink); border-bottom: 3px solid var(--ink); font-size: 15px; }
.aisles .wrap { display: flex; justify-content: flex-start; height: auto; gap: 4px; overflow-x: auto; scrollbar-width: none; }
header.shop-head nav { width: auto; }
header.shop-head .aisles .wrap { flex-wrap: nowrap; height: auto; padding: 0; }
header.shop-head .aisles { display: block; }
.aisles a { flex: none; padding: 13px 14px 12px; font-weight: 700; text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -3px; }
.aisles a:first-child { padding-left: 0; }
.aisles a:hover { text-decoration: none; border-color: var(--stamp); }
.aisles a[aria-current="page"] { border-color: var(--ink); text-decoration: none; }


/* ---------- Departments: the top of the shop home ---------- */
.section.dept-top { padding: clamp(32px, 4vw, 56px) 0; }
.section-title.small { font-size: clamp(40px, 4.4vw, 64px); margin-bottom: 0; }
.dept-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dept { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 250px; padding: 22px; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 6px; text-decoration: none; overflow: hidden; isolation: isolate; transition: box-shadow .25s ease, transform .25s ease; }

.dept h3 { font-family: "Big Shoulders Display"; font-weight: 900; font-size: clamp(40px, 3.6vw, 56px); text-transform: uppercase; line-height: .9; max-width: 7ch; }

.dept .n { font-size: 14px; font-weight: 700; color: var(--muted); }
.dept .fan { position: absolute; right: 8px; bottom: 6px; z-index: -1; display: flex; align-items: flex-end; width: 62%; height: 64%; }
.dept .fan .thumb { flex: 1; height: 100%; display: flex; align-items: flex-end; transition: transform .35s cubic-bezier(.16,1,.3,1); }
.dept .fan .thumb:nth-child(2) { height: 82%; margin-left: -12%; }
.dept .fan .thumb:nth-child(3) { height: 68%; margin-left: -12%; }
.dept .fan img, .dept .fan svg { width: 100%; max-height: 100%; object-fit: contain; }
.dept:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.dept:hover h3 { color: var(--stamp); }
.dept:hover .fan .thumb { transform: translateY(-6px); }
.dept:hover .fan .thumb:nth-child(2) { transform: translateY(-10px); }

/* ---------- Product rails and cards ---------- */
.rail-block { padding: 0 0 clamp(48px, 5vw, 72px); }
.rail-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-top: 22px; border-top: 3px solid var(--ink); margin-bottom: 22px; }
.rail-head a { font-weight: 700; font-size: 15px; white-space: nowrap; text-underline-offset: 4px; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 5 * 16px) / 6); gap: 16px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--ink) transparent; }
.rail .card { scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }

.card { position: relative; display: flex; flex-direction: column; background: var(--label); border: 2px solid var(--ink); border-radius: 6px; transition: box-shadow .25s ease, transform .25s ease; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card .pic { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; background: #fff; border: 0; border-bottom: 2px solid var(--ink); border-radius: 4px 4px 0 0; overflow: hidden; }
.thumb { display: block; }
.card .pic .thumb { position: absolute; inset: 9%; }
.thumb img, .thumb svg { width: 100%; height: 100%; object-fit: contain; display: block; }
.tags { position: absolute; z-index: 1; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 4px 9px; background: var(--ink); color: var(--label); font-size: 12px; font-weight: 700; border-radius: 3px; }
.card .body { display: flex; flex-direction: column; flex: 1; padding: 14px 14px 16px; }
.card h3 { font-size: 15px; line-height: 1.3; font-weight: 700; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }

.card .meta { margin-top: 6px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.card .item { font-variant-numeric: tabular-nums; }
.card .price { margin-top: auto; padding-top: 12px; }
.now { font-family: "Big Shoulders Display"; font-weight: 800; font-size: 28px; line-height: 1; color: var(--stamp); font-variant-numeric: tabular-nums; }
s { margin-left: 8px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.buy { margin-top: 10px; }
.buy .btn { width: 100%; min-height: 42px; font-size: 14px; }
.qty { display: grid; grid-template-columns: 42px 1fr 42px; height: 42px; border: 2px solid var(--ink); border-radius: 4px; background: var(--ink); color: var(--label); overflow: hidden; }
.qty button { display: grid; place-items: center; background: none; border: 0; color: inherit; cursor: pointer; }
.qty button:hover { background: var(--stamp); }
.qty output { display: grid; place-items: center; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.qty .ico { width: 16px; height: 16px; stroke-width: 2.5; }

/* ---------- Department page ---------- */
.crumbs { display: flex; gap: 8px; padding-top: 24px; font-size: 14px; color: var(--muted); }
.crumbs a { font-weight: 700; color: var(--ink); text-underline-offset: 3px; }
.dept-head { padding: 18px 0 40px; }
.dept-head .wrap { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px 48px; flex-wrap: wrap; }
.dept-head h1 { font-size: clamp(64px, 9vw, 150px); }
.dept-head p { font-size: 18px; line-height: 1.5; max-width: 40ch; color: #3E362B; padding-bottom: 6px; }
.listing { padding: 0 0 clamp(64px, 7vw, 104px); }
.list-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; border-top: 3px solid var(--ink); padding-top: 24px; }
.filters { position: sticky; top: 150px; display: grid; gap: 28px; }
.filters h2 { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.filters ul { list-style: none; display: grid; gap: 2px; }
.filters button, .filters a { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 10px; font: inherit; font-size: 15px; color: var(--ink); text-align: left; text-decoration: none; background: none; border: 0; border-radius: 4px; cursor: pointer; }
.filters button:hover, .filters a:hover { background: rgba(251,250,245,.45); }
.filters button[aria-pressed="true"], .filters a[aria-current="page"] { background: var(--ink); color: var(--label); }
.filters span { font-variant-numeric: tabular-nums; opacity: .7; }
.list-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.list-bar p { font-weight: 700; font-size: 15px; }
.list-bar label { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; }
.list-bar select { font: inherit; font-size: 14px; padding: 8px 10px; background: var(--label); color: var(--ink); border: 2px solid var(--ink); border-radius: 4px; }
.empty { padding: 48px 0; font-size: 17px; line-height: 1.5; }
.empty a { font-weight: 700; }

/* ---------- Supplier and about bands ---------- */
.about-band .lede { font-size: clamp(20px, 2vw, 26px); line-height: 1.45; max-width: 46ch; color: #E4DCCD; margin-bottom: 64px; }
.cta.supplier p { margin-top: 18px; font-size: 18px; line-height: 1.5; max-width: 40ch; color: rgba(251,250,245,.88); }
.cta.supplier .links { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.cta.supplier .links a:not(.btn) { color: var(--label); font-weight: 700; text-underline-offset: 4px; }

/* ---------- Dialogs: quick view and order ---------- */
dialog { border: 0; padding: 0; color: var(--ink); background: var(--label); }
dialog::backdrop { background: rgba(20,18,15,.55); }
.x { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 40px; height: 40px; background: var(--label); border: 2px solid var(--ink); border-radius: 50%; cursor: pointer; color: var(--ink); }
.x:hover { background: var(--ink); color: var(--label); }
/* ---------- Product page ---------- */
.pd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: start; padding: 18px 0 clamp(56px, 6vw, 88px); }
.pd-art { position: sticky; top: 150px; aspect-ratio: 1; background: #fff; border: 3px solid var(--ink); border-radius: 8px; }
.pd-art .thumb { position: absolute; inset: 9%; }
.pd-art .tags { top: 16px; left: 16px; }
.pd-art .tag { font-size: 14px; padding: 5px 11px; }
.pd-info { display: flex; flex-direction: column; gap: 18px; }
.pd-info h1 { font-family: "Big Shoulders Display"; font-weight: 900; font-size: clamp(40px, 4.4vw, 68px); line-height: .92; text-transform: uppercase; text-wrap: balance; }
.pd-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 0; }
.pd-price .now { font-size: 54px; }
.pd-price s { font-size: 18px; margin-left: 12px; }
.pd-info .desc { font-size: 17px; line-height: 1.55; color: #3E362B; max-width: 52ch; }
.pd-info .buy .btn, .pd-info .buy .qty { min-height: 52px; height: 52px; font-size: 16px; }
.pd-info dl { display: grid; grid-template-columns: auto 1fr; border-top: 2px solid var(--ink); font-size: 14px; }
.pd-info dt, .pd-info dd { padding: 10px 0; border-bottom: 1px solid var(--line); }
.pd-info dt { font-weight: 700; padding-right: 24px; }
.pd-info dd { font-variant-numeric: tabular-nums; }
.pd-info dd a { font-weight: 700; text-underline-offset: 3px; }
.opts { border: 0; display: grid; gap: 8px; }
.opts legend { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.opt { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 6px; cursor: pointer; background: #fff; }
.opt:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opt:has(input:focus-visible) { outline: 3px solid var(--stamp); outline-offset: 2px; }
.opt input { position: absolute; opacity: 0; }
.o-name { font-weight: 700; font-size: 15px; }
.o-name small { display: block; margin-top: 2px; font-weight: 400; font-size: 13px; color: var(--muted); }
.o-price { text-align: right; white-space: nowrap; }
.o-price .now { font-size: 26px; }

.drawer { position: fixed; inset: 0 0 0 auto; width: min(440px, 100%); height: 100%; max-height: none; margin: 0 0 0 auto; border-left: 3px solid var(--ink); }
.drawer[open] { display: flex; flex-direction: column; animation: slide .4s cubic-bezier(.16,1,.3,1); }
@keyframes slide { from { transform: translateX(100%); } }
.drawer .top { padding: 26px 24px 18px; border-bottom: 3px solid var(--ink); }
.drawer .top h2 { font-size: 48px; }
.drawer .top p { margin-top: 8px; font-size: 14px; color: var(--muted); }
.drawer .lines { flex: 1; overflow-y: auto; list-style: none; padding: 6px 24px; }
.drawer .lines li { display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.drawer .lines .thumb { width: 64px; height: 64px; background: #fff; border: 2px solid var(--ink); border-radius: 4px; padding: 6px; }
.drawer .lines b { display: block; font-size: 14px; line-height: 1.3; }
.drawer .lines small { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.drawer .lines .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.drawer .lines .qty { width: 128px; height: 36px; grid-template-columns: 36px 1fr 36px; }
.drawer .line-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.drawer .lines .rm { margin-top: 8px; padding: 0;  font: inherit; font-size: 13px; font-weight: 700; background: none; border: 0; color: var(--stamp); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.drawer .foot { padding: 20px 24px 24px; border-top: 3px solid var(--ink); background: #F3EEE3; display: grid; gap: 12px; }
.drawer .foot .sum { display: flex; justify-content: space-between; font-weight: 700; font-variant-numeric: tabular-nums; }
.drawer .foot p { font-size: 13px; line-height: 1.5; color: var(--muted); }
.drawer .foot .btn { width: 100%; }
.drawer .foot .new { text-align: center; }
.drawer .foot .new a { color: var(--ink); font-weight: 700; }
.drawer .foot .sum { font-size: 18px; }
.drawer .lines .empty-order { display: block; padding: 40px 0; border-bottom: 0; line-height: 1.55; color: var(--muted); }
.drawer .lines .empty-order a { color: var(--ink); font-weight: 700; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; display: flex; align-items: center; gap: 14px; transform: translate(-50%, 160%); visibility: hidden; padding: 12px 12px 12px 18px; background: var(--ink); color: var(--label);
  border-radius: 6px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow); max-width: calc(100% - 32px); transition: transform .35s cubic-bezier(.16,1,.3,1), visibility .35s; }
.toast.show { transform: translate(-50%, 0); visibility: visible; }
.toast button { flex: none; height: 34px; padding: 0 12px; font: inherit; font-size: 13px; font-weight: 700; background: var(--kraft); color: var(--ink); border: 0; border-radius: 3px; cursor: pointer; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .rail { grid-auto-columns: calc((100% - 3 * 16px) / 4); }
}
@media (max-width: 1100px) {
  .acct a { display: none; }
  .dept-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
  .list-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .filters { position: static; display: block; }
  .filters > div:not(:first-child) { display: none; }
  .filters ul { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .filters li { flex: none; }
  .filters button { border: 2px solid var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 14px; }
  .filters h2 { display: none; }
  .pd { grid-template-columns: 1fr; }
  .pd-art { position: relative; top: 0; max-width: 520px; }
  .pd-price .now { font-size: 44px; }
}
@media (max-width: 640px) {
  header.shop-head .bar .wrap { flex-wrap: wrap; height: auto; padding: 12px 0; row-gap: 10px; gap: 12px; }
  header.shop-head .logo { font-size: 24px; }
  .acct { gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .order-btn { height: 40px; padding: 0 12px; }
  .dept-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dept { min-height: 180px; padding: 16px; }
  .dept h3 { font-size: 30px; }
  .rail { grid-auto-columns: 62%; gap: 12px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card .body { padding: 10px 10px 12px; }
  .card h3 { font-size: 14px; }
  html { scroll-padding-top: 190px; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .dept, .dept .fan .thumb, .toast { transition: none; }
  .card:hover { transform: none; }
}
.bulk-link { margin-top: 8px; padding: 0; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; }
.bulk-link:hover { color: var(--stamp); }
