/* Build-a-box */
.bx-hero { background: var(--orange); color: #fff; padding: 40px 0 30px; }
.bx-hero .split { gap: 40px; }
.bx-hero img { max-height: 340px; width: auto; margin: 0 auto; border-radius: 0; }
.bx-hero .lead { max-width: 560px; font-size: 1.2rem; margin: 0; }
.bx { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; padding-top: 40px; }
.bx-step { margin-bottom: 40px; }
.bx-step h2 { font-size: 1.6rem; display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.bx-step h2 span { width: 34px; height: 34px; border-radius: 50%; background: var(--ember); color: #fff; font-family: var(--body); font-size: 1rem; font-weight: 700; display: grid; place-items: center; flex: none; }

.bx-sizes, .bx-freq { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bx-opt { position: relative; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 8px; padding: 18px 20px; color: var(--ink); display: grid; gap: 4px; }
.bx-opt:hover { border-color: var(--kraft); }
.bx-opt:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
.bx-opt.on { border-color: var(--ember); background: #fff1f0; }
.bx-opt b { font-family: var(--display); font-size: 1.3rem; font-weight: 600; }
.bx-opt .save { color: var(--forest); font-weight: 700; font-size: .92rem; }
.bx-opt small { color: var(--ink-2); }
.bx-opt .flag { position: absolute; top: -10px; right: 16px; background: var(--ember); color: #fff; font-size: .7rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; letter-spacing: .04em; text-transform: uppercase; }
.bx-opt .bags { display: flex; gap: 4px; margin-bottom: 4px; }
.bx-opt .bags i { width: 16px; height: 22px; border-radius: 4px 4px 3px 3px; background: var(--kraft); }
.bx-opt.on .bags i { background: var(--ember); }
.bx-freq .bx-opt .sel { margin-top: 8px; }
.bx-freq .bx-opt[data-mode="once"] { align-content: start; }

.bx-tools { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.bx-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.bx-quick .chip { background: #fff1f0; border-color: var(--ember); color: var(--ember-2); }
.bx-quick .chip:hover { background: var(--ember); color: #fff; }
.bx-grind { display: grid; gap: 6px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; min-width: 220px; }
.bx-grind .sel { text-transform: none; letter-spacing: 0; font-weight: 500; }
.bx-filters { margin: 16px 0 18px; }
.bx-filters .chip:focus-visible, .bx-quick .chip:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }

.bx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.bx-tile { background: #fff; border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; border: 1.5px solid var(--ink); transition: border-color .15s; }
.bx-tile.on { box-shadow: 0 0 0 3px var(--ink); }
.bx-tile .m { position: relative; aspect-ratio: 1; background: var(--sand); }
.bx-tile .m img { width: 100%; height: 100%; object-fit: cover; }
.bx-tile .m .n { position: absolute; top: 10px; right: 10px; background: var(--ember); color: #fff; font-weight: 700; min-width: 30px; height: 30px; border-radius: 15px; display: grid; place-items: center; padding: 0 8px; }
.bx-tile .m .badge { top: 10px; left: 10px; }
.bx-tile .b { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.bx-tile .t { font-family: var(--ui); font-weight: 600; font-size: 1rem; line-height: 1.2; letter-spacing: .05em; text-transform: uppercase; }
.bx-tile .notes { font-size: .84rem; color: var(--ink-2); }
.bx-tile .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.bx-tile .pr { font-weight: 700; }
.bx-tile .pr s { font-weight: 400; color: var(--ink-2); font-size: .82rem; margin-left: 4px; }
.bx-tile .qty button { width: 36px; height: 36px; }
.bx-tile .qty button:disabled { opacity: .3; cursor: not-allowed; }
.bx-tile .qty button:focus-visible { outline: 2px solid var(--forest); border-radius: 50%; }
.bx-tile .add { padding: 8px 18px; font-size: .9rem; }
.bx-tile .add:disabled { opacity: .4; }
.bx-tile .note-g { font-size: .74rem; color: var(--ember-2); font-weight: 600; }
.bx-empty { grid-column: 1 / -1; text-align: center; padding: 40px; background: #fff; border-radius: var(--radius); }

/* summary */
.bx-sum { position: sticky; top: 96px; background: #fff; border-radius: 8px; box-shadow: var(--shadow); padding: 22px; display: grid; gap: 14px; }
.bx-sum h3 { margin: 0; }
.bx-sum .hd { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.bx-sum .hd small { color: var(--ink-2); font-weight: 600; }
.bx-sum .bar { margin-top: 0; height: 9px; }
.bx-sum .bar i { background: var(--ember); }
.bx-sum .toggle { display: none; }
.bx-slots { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; }
.bx-slots li { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.bx-slots img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--sand); flex: none; }
.bx-slots .nm { flex: 1; line-height: 1.25; }
.bx-slots .nm small { display: block; color: var(--ink-2); font-size: .78rem; }
.bx-slots .x { background: none; border: 0; color: var(--ink-2); width: 30px; height: 30px; border-radius: 50%; font-size: 1.1rem; flex: none; }
.bx-slots .x:hover { background: var(--sand); color: var(--ink); }
.bx-slots .empty { width: 46px; height: 46px; border-radius: 8px; border: 2px dashed var(--kraft); flex: none; }
.bx-slots li.open .nm { color: var(--ink-2); }
.bx-lines { display: grid; gap: 4px; font-size: .92rem; border-top: 1px solid var(--line); padding-top: 12px; }
.bx-lines div { display: flex; justify-content: space-between; gap: 10px; }
.bx-lines .g { color: var(--forest); font-weight: 700; }
.bx-lines .big { font-weight: 700; font-size: 1.08rem; margin-top: 6px; }
.bx-lines .fine { font-size: .76rem; color: var(--ink-2); display: block; }
.bx-gift { background: #fff0e6; color: var(--ember-2); border-radius: 10px; padding: 9px 12px; font-size: .86rem; font-weight: 700; }
.bx-sum .btn .spin { margin: 0 auto; }
.bx-sum .fine-print { font-size: .76rem; color: var(--ink-2); text-align: center; margin: 0; }

@media (max-width: 960px) {
  .bx { grid-template-columns: 1fr; padding-top: 28px; }
  .bx-main { padding-bottom: 150px; }
  .bx-sum { position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 60; border-radius: 18px 18px 0 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); gap: 10px; box-shadow: 0 -8px 30px rgba(28, 14, 18, .18); max-height: 82vh; overflow: auto; }
  .bx-sum .toggle { display: inline-block; background: none; border: 0; font-weight: 700; color: var(--forest); padding: 4px 0; text-decoration: underline; font-size: .88rem; }
  .bx-sum .more { display: none; }
  .bx-sum.open .more { display: grid; gap: 12px; }
  .bx-sum h3 { font-size: 1.1rem; }
}
@media (max-width: 560px) {
  .bx-sizes, .bx-freq { grid-template-columns: 1fr; }
  .bx-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .bx-tile .b { padding: 10px; }
  .bx-tile .t { font-size: 1rem; }
  .bx-tile .notes { font-size: .78rem; }
  .bx-tile .row { flex-wrap: wrap; }
  .bx-tile .qty button { width: 32px; height: 32px; }
  .bx-grind { width: 100%; }
  .bx-step h2 { font-size: 1.35rem; }
}

/* guard: shared footer grid overflows ~11px at 390px (joy.css) — keep this page within the viewport */
.ftr-grid > * { min-width: 0; }
.news input { min-width: 0; width: 100%; }
@media (max-width: 960px) {
  .bx-sum .hd { align-items: center; }
  .bx-sum .hd h3 { font-size: 1.05rem; }
  .bx-sum .toggle { justify-self: start; padding: 0; }
  .bx-sum .btn { padding: 13px 20px; }
  .bx-sum .fine-print { display: none; }
  .bx-sum.open .fine-print { display: block; }
}
