/* Commerce only. Existing page links and layout remain owned by the frontend. */
.zf-commerce {
  --commerce-paper: var(--paper, #eee7da);
  --commerce-ink: var(--ink, #272921);
  --commerce-rule: var(--rule, #c5bdac);
  color: var(--commerce-ink);
  background: var(--commerce-paper);
  border-block: 2px solid var(--commerce-ink);
  margin-block: 2rem;
  padding: clamp(1rem, 3vw, 2rem);
  overflow-wrap: anywhere;
}
.zf-commerce [hidden] { display: none !important; }
.zf-commerce *, .zf-commerce *::before, .zf-commerce *::after { box-sizing: border-box; }
.zf-commerce h2, .zf-commerce h3, .zf-commerce h4 { margin: 0 0 .75rem; }
.zf-commerce p { margin-block: .75rem; }
.zf-commerce label { display: grid; gap: .4rem; font-weight: 600; margin-block: .8rem; }
.zf-commerce input, .zf-commerce select, .zf-commerce button {
  font: inherit;
  color: inherit;
  background: var(--commerce-paper);
  border: 1px solid currentColor;
  border-radius: 0;
  min-height: 44px;
  max-width: 100%;
  padding: .6rem .8rem;
}
.zf-commerce select { width: 100%; }
.zf-commerce input[type="number"] { width: 8rem; }
.zf-commerce button { cursor: pointer; }
.zf-commerce button:hover:not(:disabled) { background: var(--commerce-ink); color: var(--commerce-paper); }
.zf-commerce :disabled { cursor: not-allowed; opacity: .55; }
.zf-commerce :focus-visible { outline: 3px solid var(--focus, #bc4c17); outline-offset: 4px; }
.zf-commerce a { color: inherit; text-decoration: underline; text-underline-offset: .2em; }
.zf-commerce__bar { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.zf-commerce__status { min-height: 1.6em; }
.zf-commerce__detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1rem, 3vw, 2rem); margin-block: 2rem; }
.zf-commerce__preview { display: grid; place-items: center; min-height: 12rem; }
.zf-commerce__preview img { display: block; width: 100%; height: auto; max-height: 36rem; object-fit: contain; }
.zf-commerce__thumbs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.zf-commerce__thumbs button { width: 80px; height: 90px; padding: .25rem; }
.zf-commerce__thumbs img { width: 100%; height: 100%; object-fit: contain; display: block; }
.zf-commerce__thumbs [aria-pressed="true"] { outline: 2px solid currentColor; outline-offset: 2px; }
.zf-commerce__description { white-space: pre-line; }
.zf-commerce__price, .zf-commerce__totals { font-weight: 700; }
.zf-commerce__cart { border-top: 1px solid var(--commerce-rule); padding-top: 1.5rem; margin-top: 2rem; }
.zf-commerce__cart > button { margin: .25rem .5rem .25rem 0; }
.zf-commerce__lines { list-style: none; padding: 0; margin-block: 1rem; }
.zf-commerce__line { display: flex; gap: 1rem; border-bottom: 1px solid var(--commerce-rule); padding-block: 1rem; }
.zf-commerce__line > img { width: 80px; height: 100px; object-fit: contain; flex: none; }
.zf-commerce__line > div { min-width: 0; }
.zf-commerce__line-controls, .zf-commerce__discount { display: flex; flex-wrap: wrap; gap: .65rem; align-items: end; }
.zf-commerce__line-controls label, .zf-commerce__discount label { margin: 0; }
.zf-commerce__line-controls label { max-width: 22rem; }
.zf-commerce__discount { margin-block: 1.5rem; }
@media (max-width: 700px) {
  .zf-commerce__detail { grid-template-columns: minmax(0, 1fr); }
  .zf-commerce__line { gap: .65rem; }
  .zf-commerce__line > img { width: 60px; height: 80px; }
}
