/* Loaded only when ecommerce is on, or on cart pages. Not on the default product page. */

.oz-add__long { display: none; }
@media (min-width: 40rem) {
  .oz-add__short { display: none; }
  .oz-add__long { display: inline; }
}

.oz-add__error {
  flex-basis: 100%;
  margin: 0;
  color: #000;
  font-size: 0.95rem;
}

[data-cart-link] { position: relative; }
.oz-cart-count:empty { display: none; }
.oz-cart-count {
  display: inline-block;
  margin-inline-start: 0.35rem;
}

.oz-cart-drawer {
  position: fixed;
  z-index: 95;
  inset-inline: 0;
  top: var(--oz-cart-top, 76px);
  bottom: var(--oz-cart-bottom, 0px);
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
  background: transparent;
}

.oz-cart-drawer[hidden] { display: none; }

.oz-cart-drawer__panel {
  pointer-events: auto;
  background: #fff;
  color: #000;
  border-inline-start: 2px solid #000;
  inline-size: min(28rem, 100%);
  max-block-size: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  align-self: stretch;
  min-block-size: 100%;
  padding: 1rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

@media (max-width: 767px) {
  .oz-cart-drawer__panel {
    inline-size: 100%;
    border-inline-start: 0;
    border-block-start: 2px solid #000;
  }
}

.oz-cart-drawer__head,
.oz-line__top,
.oz-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.oz-cart-drawer__head h2,
.oz-cart-page h1,
.oz-checkout h1,
.oz-order h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.oz-lines { display: flex; flex-direction: column; gap: 0.85rem; margin: 0; padding: 0; list-style: none; }

.oz-line {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 0.75rem;
  padding-block-end: 0.85rem;
  border-block-end: 1px solid #e5e5e5;
}

.oz-line--text { grid-template-columns: 1fr; }

.oz-line img {
  inline-size: 4rem;
  block-size: 4rem;
  object-fit: cover;
  background: #f4f4f5;
  border: 1px solid #e5e5e5;
}

.oz-line__name { margin: 0; font-weight: 700; }
.oz-line__meta { margin: 0.15rem 0 0; color: #525252; font-size: 0.92rem; }
.oz-line__warn { margin: 0.35rem 0 0; font-size: 0.92rem; }

.oz-qty { justify-content: flex-start; margin-block-start: 0.55rem; }
.oz-qty button,
.oz-cart-drawer__head button,
.oz-line__remove {
  min-block-size: 44px;
  min-inline-size: 44px;
  background: #fff;
  color: #000;
  border: 1.5px solid #000;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-weight: 700;
  cursor: pointer;
}

.oz-qty input {
  inline-size: 3.25rem;
  min-block-size: 44px;
  text-align: center;
  border: 1.5px solid #000;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-weight: 700;
}

.oz-line__remove { padding-inline: 0.75rem; }

.oz-cart-ship,
.oz-cart-tax,
.oz-subtotal {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
}
.oz-subtotal { font-family: 'Space Mono', ui-monospace, monospace; font-weight: 700; }
.oz-cart-tax { color: #525252; }

.oz-cart-actions,
.oz-checkout__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* .btn sets display and would otherwise keep a hidden catalog or checkout link on screen. */
.oz-cart-actions [hidden] {
  display: none;
}

.oz-checkout .quick-form {
  display: flex;
  flex-direction: column;
  margin-block-start: 1rem;
}
.oz-checkout fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.oz-checkout legend {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
[data-address-fields] { display: flex; flex-direction: column; gap: 1rem; }
[data-address-fields][hidden] { display: none; }
.oz-check { display: flex; gap: 0.6rem; align-items: flex-start; margin-block: 0.75rem 1rem; }
.oz-check input { margin-block-start: 0.2rem; inline-size: 1.15rem; block-size: 1.15rem; }
.field.is-invalid .error-msg,
.oz-check.is-invalid .error-msg,
.oz-form-error:not(:empty) { display: block; }
.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea { border-color: #b91c1c; background: #fef2f2; }
.oz-form-error { display: none; margin: 0 0 0.75rem; color: #b91c1c; }
.oz-status { margin: 0.75rem 0 0; }

.oz-summary { margin: 0 0 1rem; padding: 0; list-style: none; }
.oz-summary li { padding-block: 0.35rem; border-block-end: 1px solid #e5e5e5; }

.oz-order dl { display: grid; grid-template-columns: 8rem 1fr; gap: 0.35rem 1rem; margin: 1rem 0 0; }
.oz-order dt { font-family: 'Space Mono', ui-monospace, monospace; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.oz-order dd { margin: 0; }
