/* Component defaults for buttons, inputs, checkboxes, radios and the confirm dialog.
   Kept in a cascade layer so the unlayered page rules in enhancements.css (e.g. `.form-card .button`,
   `.record button`) override them — the same precedence the reference site's component library had. */
@layer components {
  .ui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    border-radius: calc(0.35rem - 2px);
    font-size: 14px;
    font-weight: 500;
    height: 36px;
    padding: 8px 16px;
    background: #343b23;
    color: #fffdf8;
    transition: background-color 0.15s, color 0.15s;
  }
  .ui-btn:hover {
    background: #343b23e6;
  }
  .ui-btn-outline {
    border: 1px solid #dcdccd;
    background: #f8f5ed;
    color: #292d20;
    box-shadow: 0 1px 2px #0000000d;
  }
  .ui-btn-outline:hover {
    background: #e8eadb;
    color: #343b23;
  }
  .ui-input {
    display: flex;
    width: 100%;
    min-width: 0;
    height: 36px;
    border: 1px solid #bec3ac;
    border-radius: calc(0.35rem - 2px);
    background: transparent;
    padding: 4px 12px;
    font-size: 14px;
    box-shadow: 0 1px 2px #0000000d;
    outline: none;
  }
  .ui-input:focus-visible {
    border-color: #987539;
    box-shadow: 0 0 0 3px #98753980;
  }
  .ui-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  .ui-check,
  .ui-radio {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: #343b23;
    cursor: pointer;
  }
  .ui-radio {
    width: 18px;
    height: 18px;
  }
}

/* Centre the product and checkout dialogs. The reference's CSS reset zeroes dialog margins, which
   pins them to the top-left corner; the bag drawer keeps its explicit right-aligned margin. */
.product-dialog,
.info-dialog,
.confirm-dialog {
  margin: auto;
}

.payment-option > input,
.check-label > input {
  margin-top: 4px;
}

/* Confirm dialog (replaces the reference's alert dialog component). */
.confirm-dialog {
  width: min(512px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid #dcdccd;
  border-radius: 0.35rem;
  background: #fffdf8;
  box-shadow: 0 10px 30px #0000001f;
}
.confirm-dialog h2 {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  margin-bottom: 8px;
}
.confirm-dialog p {
  font-size: 14px;
  color: #676c58;
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

@media (max-width: 600px) {
  .confirm-actions {
    flex-direction: column-reverse;
  }
}
