/* PostalAnnex Stanford theme for the Stickonfig sticker editor (/print/stickers/).
   Loaded after the editor's own builder.css. We do NOT load its base.css (it styles body, a,
   footer, .container globally); the few base rules the editor needs are copied here, scoped
   to .sb-scope so they can't leak into the rest of the site. */

:root {
  --builder-blue: #8C1515;
  --builder-blue-soft: #FBF4F3;
  --builder-ink: #1C2434;
  --builder-muted: #5A6473;
  --builder-line: #E5DFD4;
  --builder-orange: #8C1515;
  --font-display: 'Source Serif 4', Georgia, serif;
}

/* ---- base rules the editor relies on (from its base.css), scoped ---- */
.sb-scope button, .sb-scope input, .sb-scope select { font: inherit; }
.sb-scope .button { display:inline-flex; justify-content:center; align-items:center; min-height:44px; padding:10px 17px; border:1px solid var(--builder-line); border-radius:12px; background:#fff; color:var(--builder-ink); text-decoration:none; font-weight:600; cursor:pointer; transition:border-color .18s ease, background-color .18s ease; }
.sb-scope .button:hover { border-color:rgba(140,21,21,.35); }
.sb-scope .button-primary { background:#8C1515; color:#fff; border-color:transparent; }
.sb-scope .button-primary:hover:not(:disabled) { background:#6E1010; }
.sb-scope .button:disabled { opacity:.45; cursor:default; }
.sb-scope .config-section h2, .sb-scope .subtotal-box h2 { font-size:18px; margin:0 0 10px; }
.sb-scope .option-help { font-size:13px; color:var(--builder-muted); }
.sb-scope .tile-grid { display:grid; gap:10px; grid-template-columns:repeat(2,minmax(0,1fr)); }
.sb-scope .config-tile { border:1px solid var(--builder-line); border-radius:12px; background:#fff; text-align:left; padding:12px 14px; cursor:pointer; box-shadow:0 1px 2px rgba(28,36,52,.05); transition:border-color .18s ease, box-shadow .18s ease, background-color .18s ease, transform .18s ease; }
.sb-scope .config-tile:hover { border-color:rgba(140,21,21,.35); transform:translateY(-1px); box-shadow:0 8px 20px -12px rgba(28,36,52,.35); }
.sb-scope .config-tile small { display:block; font-size:12px; color:var(--builder-muted); margin-top:4px; font-weight:700; }
.sb-scope .config-tile.is-selected { border-color:#8C1515; background:#FBF4F3; box-shadow:inset 0 0 0 1px #8C1515, 0 10px 24px -16px rgba(140,21,21,.55); transform:none; }
.sb-scope .config-tile.is-selected b, .sb-scope .config-tile.is-selected small { color:#8C1515; }
.sb-scope .custom-tile { width:100%; margin-top:10px; }
.sb-scope .subtotal-box { border-top:1px solid var(--builder-line); padding-top:22px; }
.sb-scope .proof-toggle { display:flex; gap:10px; align-items:flex-start; cursor:pointer; }
.sb-scope .proof-toggle input { margin-top:5px; width:18px; height:18px; accent-color:#8C1515; }
.sb-scope .builder-controls input[type=number] { width:100%; min-width:0; }
.sb-scope .builder-option-grid input:focus-visible + span { outline:2px solid #8C1515; outline-offset:2px; }
.sb-scope #download-links { display:flex; gap:10px; flex-wrap:wrap; }

/* ---- our look ---- */
.sb-scope { color:var(--builder-ink); }
.sb-scope .sticker-builder-shell { width:100%; }
.sb-scope .builder-card { border-radius:20px; border-color:var(--builder-line); box-shadow:0 18px 40px -28px rgba(28,36,52,.45); }
.sb-scope .builder-card-heading h2 { font-family:var(--font-display); font-weight:600; letter-spacing:-.01em; }
.sb-scope .builder-controls legend, .sb-scope .config-section h2, .sb-scope .subtotal-box h2 { font-weight:600; }
.sb-scope .builder-step { background:#8C1515; }
.sb-scope .builder-status-pill { background:#F7F4EF; color:var(--builder-muted); }
.sb-scope .builder-status-pill.is-ready { background:#ECFDF5; color:#065F46; }
.sb-scope .builder-drop-zone { border-color:rgba(28,36,52,.18); background:#fff; border-radius:16px; }
.sb-scope .builder-drop-zone:hover, .sb-scope .builder-drop-zone.is-dragging { border-color:#8C1515; background:#FBF4F3; }
.sb-scope .builder-proof-stage { border-color:var(--builder-line); border-radius:16px; background-color:#F7F4EF; }
.sb-scope .builder-proof-placeholder { background:rgba(247,244,239,.92); }
.sb-scope .builder-option-grid span { border-radius:12px; box-shadow:0 1px 2px rgba(28,36,52,.05); }
.sb-scope .builder-option-grid label:hover span { border-color:rgba(140,21,21,.35); }
.sb-scope .builder-option-grid input:checked + span { background:#FBF4F3; }
.sb-scope .builder-option-grid input:checked + span b { color:#8C1515; }
.sb-scope .builder-custom-offset, .sb-scope .builder-dimensions label, .sb-scope .builder-grouping-control { color:var(--builder-ink); font-weight:600; }
.sb-scope .builder-grouping-control select, .sb-scope .builder-custom-offset input, .sb-scope .builder-dimensions input,
.sb-scope .builder-size-stepper button { border-color:var(--builder-line); border-radius:12px; }
.sb-scope .builder-size-stepper button { border-radius:12px 0 0 12px; }
.sb-scope .builder-size-stepper button:last-child { border-radius:0 12px 12px 0; }
.sb-scope .builder-size-stepper button:focus-visible, .sb-scope .builder-resolution-actions button:focus-visible,
.sb-scope .builder-editor-dialog button:focus-visible, .sb-scope .builder-editor-dialog input:focus-visible { outline:2px solid #8C1515; }
.sb-scope .builder-shape-icon { filter:drop-shadow(0 3px 3px rgba(28,36,52,.2)); }
.sb-scope .builder-controls .subtotal-box > strong { font-family:var(--font-display); color:var(--builder-ink); }
.sb-scope .builder-add-button { width:100%; min-height:52px; border-radius:12px; font-size:16px; }
.sb-scope .builder-validation a { color:#8C1515; font-weight:700; text-decoration:underline; text-underline-offset:4px; }
.sb-scope .builder-resolution-dialog, .sb-scope .builder-editor-dialog { border-color:var(--builder-line); border-radius:20px; color:var(--builder-ink); }
.sb-scope .builder-editor-tools button { border-color:var(--builder-line); border-radius:12px; color:var(--builder-ink); }
.sb-scope .builder-editor-tools button[aria-pressed="true"] { background:#FBF4F3; color:#8C1515; border-color:#8C1515; box-shadow:inset 0 0 0 1px #8C1515; }
.sb-scope .builder-editor-stage { border-color:var(--builder-line); background:#F7F4EF; }
.sb-scope dialog::backdrop { background:rgba(28,36,52,.45); }

/* Price chip in the title band */
.sb-price strong { font-family:var(--font-display); }

/* ================= Layout (see /assets/stickonfig-layout.js) =================
   Proof on the left stays in view; upload + options scroll on the right; the price and
   Add to order button stay pinned at the bottom of the options column. */
.sb-scope[data-layout] .sticker-builder-shell { grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr); gap:28px; }
.sb-scope[data-layout] .builder-controls { position:static; }
.sb-scope[data-layout] .sb-right { display:grid; gap:22px; min-width:0; align-content:start; }
.sb-scope[data-layout] .sticker-builder-workspace { position:sticky; top:150px; align-self:start; }
.sb-scope[data-layout] .builder-proof-card { padding:20px 22px; }
.sb-scope[data-layout] .builder-proof-card .builder-card-heading { margin-bottom:12px; }
.sb-scope[data-layout] .builder-resolution-pill { margin:0 0 10px; }
.sb-scope[data-layout] .builder-proof-stage { min-height:max(300px, calc(100vh - 500px)); padding:10px; }
.sb-scope[data-layout] .builder-proof-stage canvas { width:auto; height:auto; max-width:100%; max-height:max(280px, calc(100vh - 520px)); margin:auto; }
.sb-scope[data-layout] .builder-proof-key { margin-top:10px; font-size:.78rem; }
.sb-scope[data-layout] .builder-edit-tools { display:flex; align-items:center; gap:12px; margin-top:10px; }
.sb-scope[data-layout] .builder-edit-tools .builder-inline-note { margin:0; font-size:.8rem; }

/* Compact upload card once artwork is loaded */
.sb-scope[data-loaded] .builder-upload-card .builder-inline-note { display:none; }
.sb-scope[data-loaded] .builder-drop-zone { min-height:0; padding:12px 16px; grid-auto-flow:column; justify-content:start; gap:10px; }
.sb-scope[data-loaded] .builder-drop-zone strong { font-size:0; }
.sb-scope[data-loaded] .builder-drop-zone strong::before { content:'Replace artwork'; font-size:14px; color:#8C1515; }
.sb-scope[data-loaded] .builder-drop-zone span { display:none; }
.sb-scope[data-loaded] .builder-upload-card { display:grid; grid-template-columns:auto 1fr; gap:0 16px; align-items:center; }
.sb-scope[data-loaded] .builder-upload-card .builder-card-heading { grid-column:1 / -1; order:-2; margin-bottom:12px; }
.sb-scope[data-loaded] .builder-art-preview { order:-1; display:flex; align-items:center; gap:12px; margin:0; }
.sb-scope[data-loaded] .builder-art-preview img { width:56px; height:56px; }
.sb-scope[data-loaded] .builder-art-preview dl { display:block; margin:0; font-size:13px; }
.sb-scope[data-loaded] .builder-art-preview dt, .sb-scope[data-loaded] .builder-art-preview dd:not(:nth-of-type(1)) { display:none; }
.sb-scope[data-loaded] .builder-art-preview dd:nth-of-type(1) { margin:0; font-weight:600; max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Pinned price + button */
.sb-scope[data-layout] .sb-buy { position:sticky; bottom:12px; z-index:5; display:grid; gap:12px; margin:4px -12px -12px; padding:16px 16px 14px;
  background:rgba(255,255,255,.96); backdrop-filter:blur(6px); border:1px solid var(--builder-line); border-radius:16px; box-shadow:0 -12px 30px -22px rgba(28,36,52,.5); }
.sb-scope[data-layout] .sb-buy .subtotal-box { border:0; padding:0; display:grid; grid-template-columns:1fr auto; align-items:end; gap:2px 16px; }
.sb-scope[data-layout] .sb-buy .subtotal-box h2 { display:none; }
.sb-scope[data-layout] .sb-buy .subtotal-box dl { grid-column:1 / -1; order:3; margin:0; font-size:12.5px; color:var(--builder-muted); display:flex; flex-wrap:wrap; gap:2px 12px; }
.sb-scope[data-layout] .sb-buy .subtotal-box dl > div { margin:0 !important; gap:4px !important; }
.sb-scope[data-layout] .sb-buy .subtotal-box dt::after { content:':'; }
.sb-scope[data-layout] .sb-buy .subtotal-box > strong { order:2; font-size:2rem; line-height:1; }
.sb-scope[data-layout] .sb-buy #builder-unit-price { order:1; margin:0; align-self:end; }
.sb-scope[data-layout] .sb-buy .builder-validation:empty { display:none; }

@media (max-width:1050px) {
  .sb-scope[data-layout] .sticker-builder-shell { grid-template-columns:1fr; }
  .sb-scope[data-layout] .sticker-builder-workspace { position:static; order:2; }
  .sb-scope[data-layout] .sb-right { display:contents; }
  .sb-scope[data-layout] .builder-upload-card { order:1; }
  .sb-scope[data-layout] .builder-controls { order:3; }
  .sb-scope[data-layout] .builder-proof-stage { max-height:none; }
  .sb-scope[data-layout] .sb-buy { bottom:8px; margin:4px -8px -8px; }
}
