/* ============================================================================
   Fox Custom Woodworks — B2B platform · the catalogue storefront (STOREFRONT-1)
   ----------------------------------------------------------------------------
   The signed-in Products page of a catalogue shop: the header's tabs, account
   menu and basket; the order specifications; the search row; the grid.
   Every rule is a class on a token (tokens.css) — the page carries no inline
   style for any of it (the house rule; CSP-2). A classic shop renders none of
   this markup, so nothing here can touch it. Depends on tokens.css and
   components.css.
   ============================================================================ */

/* ── Header: the three tabs, the account menu, the basket ───────────────── */
.sf-tabs{ display:flex; align-items:center; gap:4px; }
.sf-tab{ border:1px solid transparent; border-radius:var(--radius-sm); padding:6px 12px;
  font-size:var(--fs-small); font-weight:600; letter-spacing:.01em; cursor:pointer; font-family:inherit;
  background:transparent; color:var(--muted-soft); white-space:nowrap; }
.sf-tab:hover{ color:var(--ink); }
.sf-tab.is-active{ color:var(--brand); background:var(--surface); border-color:var(--hairline); }

.sf-right{ display:flex; align-items:center; gap:12px; }
.sf-account{ position:relative; }
.sf-account-btn{ display:inline-flex; align-items:center; gap:7px; background:none; border:1px solid transparent;
  border-radius:var(--radius-sm); padding:6px 10px; font-family:inherit; font-size:13px; color:var(--muted); cursor:pointer; }
.sf-account-btn:hover, .sf-account-btn[aria-expanded="true"]{ border-color:var(--hairline); background:var(--surface); color:var(--ink); }
.sf-chevron{ font-size:10px; color:var(--muted-soft); }
.sf-menu-backdrop{ position:fixed; inset:0; z-index:40; background:transparent; }
.sf-menu{ position:absolute; right:0; top:calc(100% + 6px); z-index:41; min-width:180px; display:flex; flex-direction:column;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:0 10px 30px rgba(43,42,40,.12); padding:6px; }
.sf-menu-item{ text-align:left; background:none; border:none; border-radius:var(--radius-sm); padding:9px 12px;
  font-family:inherit; font-size:var(--fs-small); color:var(--ink); cursor:pointer; white-space:nowrap; }
.sf-menu-item:hover{ background:var(--surface-tint); color:var(--brand); }

.sf-basket{ position:relative; display:inline-flex; align-items:center; justify-content:center; width:38px; height:38px;
  border:1px solid var(--hairline); border-radius:var(--radius); background:var(--surface); color:var(--ink); cursor:pointer; padding:0; }
.sf-basket:hover{ border-color:var(--brand); color:var(--brand); }
.sf-basket svg{ display:block; }
.sf-basket-count{ position:absolute; top:-7px; right:-7px; min-width:19px; height:19px; padding:0 5px; box-sizing:border-box;
  border-radius:var(--radius-pill); background:var(--brand); color:#fff; font-size:11px; font-weight:700; line-height:19px; text-align:center; }

/* ── The Products page ──────────────────────────────────────────────────── */
.sf-page{ padding:18px 36px 90px; }

/* the order specifications: the order page's own card (its heading, its caption) around the one specGroupList —
   the same cards, the same buttons (SPEC-SECTION-1). Matches the builder's .default-specs box. */
/* STICKY-FILTERS-1 (the owner, 14 Oct): the order specifications and the search row stay in view — one block, under the
   site bar and the acting banner (both MEASURED by _measureChrome), on the page's own background so cards pass beneath it */
.sf-pin{ position:sticky; top:calc(var(--nav-h, 65px) + var(--pin-above-h, 0px)); z-index:20; background:var(--bg);
  margin-top:-18px; padding:18px 0 12px; }
.sf-spec-section{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-card); overflow:hidden; }
.sf-spec-head{ padding:14px 20px 4px; display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; }
.sf-spec-title{ color:var(--ink); font-size:16px; font-weight:600; }
.sf-spec-caption{ font-size:12px; color:var(--muted-faint); }

/* the search row: the search box (wider) and the three filters on ONE line */
.sf-toolbar{ display:flex; align-items:center; gap:8px; margin-top:14px; }
.sf-search{ flex:2 1 220px; min-width:140px; padding:9px 13px; border:1px solid var(--border-input); border-radius:var(--radius-sm);
  font-size:var(--fs-small); font-family:inherit; color:var(--ink); background:var(--surface-tint); outline:none; box-sizing:border-box; }
.sf-search:focus{ border-color:var(--brand); background:var(--surface); }
.sf-filter{ position:relative; flex:1 1 140px; min-width:120px; }
.sf-select{ width:100%; appearance:none; -webkit-appearance:none; padding:9px 26px 9px 11px; border:1px solid var(--border-input); border-radius:var(--radius-sm);
  font-size:13px; font-family:inherit; color:var(--ink); background:var(--surface-tint); cursor:pointer; outline:none; box-sizing:border-box; text-overflow:ellipsis; }
.sf-select:focus{ border-color:var(--brand); background:var(--surface); }
/* a level with one value: a greyed DISPLAY of that value (UI-1), nothing to press */
.sf-filter.is-fixed .sf-select{ background:var(--hairline-faint); color:var(--muted); cursor:default; border-color:#EAE5DC; }
.sf-filter-chev{ position:absolute; right:10px; top:50%; transform:translateY(-50%); pointer-events:none; color:var(--muted-soft); font-size:9px; }

/* why the grid is empty, when it is (the picker's own three states, in the same words) */
.sf-notice{ margin-top:14px; padding:18px 20px; border:1px solid var(--border); border-radius:var(--radius-card); background:var(--surface);
  font-size:13px; line-height:1.5; color:var(--ink); }
.sf-notice[data-catalogue-status="failed"]{ color:#B3261E; }
.sf-notice-title{ font-weight:600; margin-bottom:2px; }
.sf-notice-text{ color:var(--muted); }

/* ── The grid: fills the width and adds columns as it widens (UI conventions, lines 27–30) ── */
.sf-catalogue{ margin-top:6px; }
.sf-section{ margin-top:18px; }
.sf-section-head{ display:flex; align-items:baseline; gap:8px; margin:0 0 10px; font-size:var(--fs-heading); font-weight:600; color:var(--ink); }
.sf-section-count{ font-size:var(--fs-small); font-weight:400; color:var(--muted-soft); }
.sf-section-count::before{ content:"\00b7  "; }
.sf-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(var(--sf-card-min), 1fr)); gap:var(--sf-gap); }
.sf-card{ display:flex; flex-direction:column; align-items:stretch; text-align:left; padding:0 0 10px; min-width:0;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-card); font-family:inherit; cursor:pointer; overflow:hidden; color:var(--ink); }
.sf-card:hover{ border-color:var(--brand); box-shadow:0 4px 14px rgba(43,42,40,.08); }
.sf-card:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; }
/* the picture area: a fixed height, a light wash, the picture fitted inside; empty when there is nothing to show */
.sf-card-pic{ height:var(--sf-card-pic-h); background:var(--sf-pic-bg); display:flex; align-items:center; justify-content:center; border-bottom:1px solid var(--hairline-faint); }
.sf-card-img{ max-width:100%; max-height:100%; object-fit:contain; display:block; }
.sf-card-sku{ padding:9px 12px 0; font-size:var(--fs-body); font-weight:700; color:var(--ink); }
.sf-card-name{ padding:2px 12px 0; font-size:13px; color:var(--muted); line-height:1.35; }
.sf-empty{ padding:34px 18px; text-align:center; font-size:var(--fs-body); color:#a8a299; }

/* the account name is one line, never wider than this: a long shop name beside it must not push the basket off screen */
.sf-account-name{ display:inline-block; max-width:240px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; vertical-align:middle; }

/* below 900 px (the tablet rule of TABLET-1): tighter gutters, the search on its own line, the header allowed to wrap
   (scoped to the storefront's header — a classic shop's bar is untouched; found by tablet-portrait: 802 px wide at 768) */
@media (max-width:900px){
  .app-frame-header:has(.sf-tabs){ flex-wrap:wrap; row-gap:8px; padding-left:16px; padding-right:16px; }
  .app-frame-header:has(.sf-tabs) > div:first-child{ flex-wrap:wrap; row-gap:8px; }
  .sf-account-name{ max-width:160px; }
  .sf-page{ padding:14px 16px 70px; }
  .sf-toolbar{ flex-wrap:wrap; }
  .sf-search{ flex-basis:100%; }
}

/* ── STOREFRONT-2: the basket page — the order page with the basket bar in place of its action bar ── */
/* STOREFRONT-3: the Submit page's checkout bar is the basket bar's shape — Back to cart · Submit order · the count · Submit order */
.sf-basket-bar, .sf-checkout-bar{ display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin-bottom:14px; }
.sf-continue, .sf-back-to-cart{ display:inline-flex; align-items:center; gap:8px; padding:10px 18px 10px 14px; }
/* the server's refusal, beside the button it answers (BANNER-1: it dies with the next attempt) */
.sf-checkout-error{ font-size:13px; line-height:1.45; color:var(--callout-warn-ink); max-width:420px; }
/* the review, shown IN the page: the review box's own block, as a card under the details card */
.submit-review-page{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-card); margin:0 36px 90px; overflow:hidden; }
.sf-continue-mark{ display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; border-radius:50%; background:var(--sf-pill-bg); font-size:14px; line-height:1; }
.sf-basket-name{ display:flex; align-items:baseline; gap:10px; flex:1 1 auto; min-width:0; }
.sf-basket-title{ font-size:18px; font-weight:600; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sf-basket-sub{ font-size:13px; color:var(--muted-faint); white-space:nowrap; }
.sf-basket-actions{ display:flex; align-items:center; gap:14px; }
.sf-basket-note{ font-size:12.5px; color:var(--muted); }

/* the Save as draft dialog: the name, and nothing else */
.sf-dialog-backdrop{ position:fixed; inset:0; z-index:50; background:rgba(43,42,40,.45); }
.sf-dialog{ position:fixed; top:50%; left:50%; transform:translate(-50%,-50%); z-index:51; width:440px; max-width:calc(100vw - 48px); box-sizing:border-box;
  background:var(--surface); border-radius:var(--radius-card); padding:24px 26px 20px; box-shadow:0 24px 64px rgba(43,42,40,.22); }
.sf-dialog-title{ font-size:18px; font-weight:600; color:var(--ink); margin-bottom:6px; }
.sf-dialog-text{ font-size:13.5px; line-height:1.5; color:var(--muted); margin-bottom:16px; }
.sf-dialog-input{ width:100%; box-sizing:border-box; }
.sf-dialog-error{ margin-top:6px; font-size:12.5px; }
.sf-dialog-actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:18px; }

/* ── STOREFRONT-4: a shop's public page (the owner, 11 Oct: "as drawn") ── */
/* the Sign in menu sits where the account menu sits; its items are links */
.sf-signin{ position:relative; }
a.sf-menu-item{ display:block; color:var(--ink); text-decoration:none; font-size:var(--fs-small); }
/* an address with no shop */
.sf-noshop{ max-width:520px; margin:60px auto 0; padding:26px 28px; text-align:center; background:var(--surface);
  border:1px solid var(--border); border-radius:var(--radius-card); }
.sf-noshop-title{ font-size:17px; font-weight:600; color:var(--ink); margin-bottom:6px; }
.sf-noshop-text{ font-size:var(--fs-body); color:var(--muted); }
/* the cabinet dialog, view only — the dialog's own look: the overlay, the cream card, white cards inside */
.sf-view-overlay{ position:fixed; inset:0; z-index:60; display:flex; align-items:flex-start; justify-content:center;
  padding:40px 20px; overflow-y:auto; background:rgba(43,42,40,.4); }
.sf-view-dialog{ width:100%; max-width:900px; background:#F7F4EF; border-radius:var(--radius-card); box-shadow:0 18px 50px rgba(43,42,40,.22); }
.sf-view-body{ display:flex; gap:22px; flex-wrap:wrap; padding:20px 24px; }
.sf-view-left{ flex:0 0 380px; max-width:100%; background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:14px 16px; box-sizing:border-box; }
.sf-view-head{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.sf-view-name{ font-size:17px; font-weight:700; color:var(--ink); }
.sf-view-sku{ font-size:11px; letter-spacing:.04em; color:var(--muted); background:#F0ECE3; border:1px solid var(--hairline); border-radius:999px; padding:3px 9px; }
.sf-view-img{ height:300px; display:flex; align-items:center; justify-content:center; background:var(--surface); border:1px solid var(--hairline-soft); border-radius:8px; }
.sf-view-img img{ max-width:100%; max-height:100%; display:block; }
.sf-view-right{ flex:1 1 300px; min-width:0; display:flex; flex-direction:column; gap:14px; }
.sf-view-card{ background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:14px 16px; }
.sf-view-h{ margin:0 0 10px; font-size:11.5px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted-soft); font-weight:700; }
/* one row per fact, label | value — the signed-in dialog's Size card (the owner, 12 Oct: "on separate rows") */
.sf-view-row{ display:flex; align-items:baseline; gap:10px; padding:6px 0; }
.sf-view-label{ min-width:140px; color:var(--muted-soft); font-size:12.5px; }
.sf-view-value{ font-size:var(--fs-body); color:var(--ink); }
.sf-view-counts{ margin-top:6px; padding-top:6px; border-top:1px solid var(--hairline-soft); }
.sf-view-signin{ background:var(--brand-tint); border:1px solid var(--sf-pill-border); border-radius:8px; padding:14px 16px; }
.sf-view-signin-text{ font-size:var(--fs-body); color:var(--brand-dark); font-weight:600; margin-bottom:12px; }
.sf-view-actions{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.sf-view-actions a{ text-decoration:none; }
@media (max-width:640px){ .sf-view-left{ flex-basis:100%; } .sf-view-img{ height:220px; } }
