/* Commerce components extend the existing theme; homepage and catalog presentation stay local. */
.commerce-page {
  min-height: 65vh;
}
.commerce-page h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  overflow-wrap: anywhere;
}
.commerce-page h2 {
  font-size: 1.5rem;
  margin-top: 30px;
}
.commerce-page a:not(.button) {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.commerce-narrow {
  max-width: 600px;
  margin: auto;
}
.commerce-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 50px;
  align-items: start;
}
.commerce-columns > * {
  min-width: 0;
}
.commerce-fields {
  display: grid;
  gap: 18px;
  margin-bottom: 24px;
}
.commerce-fields label,
.purchase-quantity {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
}
.commerce-fields input:not([type='checkbox']),
.commerce-fields select,
.product-purchase textarea,
.purchase-quantity input {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  border: 1px solid #637481;
  border-radius: 5px;
  padding: 10px 12px;
  color: var(--text);
  background: #14212b;
  font: inherit;
}
.commerce-fields small {
  color: var(--muted);
}
.commerce-page .commerce-check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 20px 0;
}
.commerce-check input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 4px;
}
.commerce-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin: 24px 0;
}
.commerce-actions form {
  margin: 0;
}
.commerce-link-button {
  border: 0;
  background: transparent;
  color: var(--yellow);
  padding: 12px 0;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.commerce-notice,
.commerce-error,
.commerce-sandbox,
.commerce-status {
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-bottom: 24px;
  overflow-wrap: anywhere;
}
.commerce-error {
  color: #ffc1c1;
  border-color: #af6671;
}
.commerce-error p {
  color: inherit;
  margin-bottom: 6px;
}
.commerce-sandbox {
  color: #f6d77f;
  background: #f4c5420b;
}
.commerce-cart-line {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto;
  gap: 24px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.commerce-cart-line h2 {
  margin-top: 0;
}
.commerce-cart-line img,
.commerce-order-line img {
  width: 100%;
  object-fit: contain;
  border-radius: 6px;
  background: #20282c;
}
.commerce-options {
  font-size: 0.88rem;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.commerce-quantity {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.commerce-quantity input {
  width: 72px;
  min-height: 44px;
  font: inherit;
}
.commerce-summary {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin: 24px 0;
}
.commerce-summary > p:not(:has(a)) {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.commerce-summary > p > span {
  flex: 1;
  min-width: 0;
}
.commerce-total {
  font-size: 1.2rem;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.commerce-summary .button {
  width: 100%;
  margin-top: 12px;
}
.commerce-order-list {
  display: grid;
  gap: 18px;
}
.commerce-order-card {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 25px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.commerce-order-card > * {
  overflow-wrap: anywhere;
}
.commerce-order-card strong {
  color: var(--yellow);
}
.commerce-order-line {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  gap: 18px;
  margin: 22px 0;
}
.commerce-page address {
  font-style: normal;
  line-height: 1.8;
}
.commerce-admin {
  margin-top: 35px;
  padding: 24px;
  border: 1px solid var(--line);
}
.product-purchase {
  margin-block: 25px;
}
.product-purchase .purchase-quantity {
  width: 120px;
  margin-bottom: 18px;
}
.product-purchase textarea {
  resize: vertical;
}
.commerce-page button:disabled,
.product-purchase button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
@media (max-width: 800px) {
  .commerce-columns {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .commerce-cart-line {
    grid-template-columns: 85px minmax(0, 1fr);
    gap: 15px;
  }
  .commerce-cart-line > strong {
    grid-column: 2;
  }
  .commerce-order-line {
    grid-template-columns: 65px minmax(0, 1fr);
  }
  .commerce-order-line > strong {
    grid-column: 2;
  }
  .commerce-page h1,
  .commerce-page > .wrap > .eyebrow {
    text-align: center;
  }
  .commerce-actions {
    justify-content: center;
  }
  .commerce-summary {
    padding: 20px;
  }
}

/* Promotion forms reuse the storefront's accessible field and button styles. */
.coupon-admin-form {
  max-width: 640px;
}
.coupon-form {
  max-width: 560px;
}
.coupon-form .commerce-actions {
  margin: 0;
}
.coupon-form input {
  flex: 1 1 200px;
  min-width: 0;
}

.coupon-product-picker {
  border: 1px solid #637481;
  border-radius: 5px;
  padding: 12px;
}
.coupon-product-picker .commerce-check {
  margin: 12px 0;
}

/* Wix history uses the existing dark commerce theme; source fields stay readable on phones. */
.wix-history .commerce-panel {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 20px;
  margin: 24px 0;
}
.wix-history form .button {
  margin-top: 14px;
}
.wix-history input[type='file'] {
  display: block;
  max-width: 100%;
  margin-top: 12px;
  font: inherit;
}
.wix-history .wix-table-scroll {
  overflow-x: auto;
  max-height: 32rem;
}
.wix-history table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
}
.wix-history th,
.wix-history td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  min-width: 7rem;
}
.wix-history dt {
  color: var(--muted);
  margin-top: 16px;
}
.wix-history dd {
  margin: 4px 0 0;
}
.wix-history .wix-source-value {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.wix-history summary {
  cursor: pointer;
  font-weight: 700;
}

/* Staff verification notes inherit the form theme without affecting other textareas. */
.wix-history .commerce-fields textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  background: #14212b;
  color: var(--text);
  border: 1px solid #637481;
  border-radius: 5px;
  font: inherit;
  resize: vertical;
}
