/* ---------- Product info block ---------- */
.order-detail {
  padding-top: 131px;
}

.product-info {
  border-top: 1px solid #999;
  padding: 13px 26px 0;
  display: flex;
  gap: 17px;
}

.product-info__media {
  flex: 0 0 45%;
  width: 45%;
  max-width: 220px;
  aspect-ratio: 138 / 185;
  overflow: hidden;
  background: #f2f2f0;
}

.product-info__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info__body {
  flex: 1;
  min-width: 0;
  padding-top: 7px;
}

.product-info__heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.product-info__name,
.product-info__price,
.order-total__row {
  font-family: 'Forum', 'Songti TC', 'Noto Serif TC', serif;
  font-size: 16px;
  letter-spacing: 0.025em;
}

.product-info__features {
  margin-top: 68px;
}

.product-info__features p,
.spec-row {
  font-family: 'Noto Serif TC', serif;
  font-weight: 200;
  font-size: 12px;
  letter-spacing: 0.025em;
  line-height: 14px;
}

.product-info__specs {
  margin-top: 27px;
  padding-bottom: 13px;
}

.spec-row {
  display: flex;
  padding: 3px 0;
}

.spec-label {
  flex: 0 0 76px;
}

.product-info__specs .spec-label {
  flex-basis: 68px;
}

/* ---------- Order form ---------- */
.order-form {
  border-top: 1px solid #999;
  margin-top: 40px;
}

.field {
  border-bottom: 1px solid #999;
}

.field__row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 26px;
  min-height: 21px;
  background: none;
  border: none;
  font-family: 'Noto Serif TC', serif;
  font-weight: 200;
  font-size: 12px;
  letter-spacing: 0.025em;
  line-height: 14px;
  color: #1a1a1a;
  text-align: left;
  cursor: pointer;
}

label.field__row {
  cursor: default;
}

.field__label {
  flex: 0 0 auto;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}


.field__value {
  flex: 1;
  text-align: right;
  color: #1a1a1a;
}

.field__value:empty::after {
  content: attr(data-empty);
}

.field__input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  text-align: right;
  font: inherit;
  color: #1a1a1a;
}

.field__input::placeholder {
  color: #b3b3b3;
}

.field__hint {
  padding: 0 26px 6px;
  margin-top: -2px;
  font-family: 'Noto Serif TC', serif;
  font-weight: 200;
  font-size: 10px;
  letter-spacing: 0.025em;
  color: #b23b3b;
  min-height: 0;
}

.field__hint:empty {
  display: none;
}

.field__hint--note {
  color: #999;
}

.field__hint--inline {
  padding: 0 26px 8px 64px;
  margin-top: -8px;
  text-align: right;
}

.field__hint--persist {
  padding: 0 26px 10px;
  margin-top: -2px;
  text-align: right;
}

/* accordion options */
.field__options {
  display: none;
  flex-direction: column;
  padding-bottom: 10px;
}

.field.is-open .field__options {
  display: flex;
}

.field.is-open .field__row {
  color: #1a1a1a;
}

.option {
  border: none;
  background: none;
  text-align: right;
  padding: 11px 26px 11px 46px;
  font-family: 'Noto Serif TC', serif;
  font-weight: 200;
  font-size: 12px;
  letter-spacing: 0.025em;
  line-height: 16px;
  color: #666;
  cursor: pointer;
}

.option:hover,
.option.is-selected {
  color: #1a1a1a;
}

.option.is-selected {
  font-weight: 400;
}

.qty-custom {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 11px 26px 11px 46px;
}

.qty-custom input {
  width: 84px;
  border: 1px solid #999;
  padding: 6px 8px;
  text-align: right;
  outline: none;
  font-family: 'Noto Serif TC', serif;
  font-weight: 200;
  font-size: 12px;
  letter-spacing: 0.025em;
  color: #1a1a1a;
}

.qty-custom input::placeholder {
  font-family: 'Noto Serif TC', serif;
  font-weight: 200;
  font-size: 12px;
  letter-spacing: 0.025em;
  color: #b3b3b3;
}

.qty-custom span {
  font-family: 'Noto Serif TC', serif;
  font-weight: 200;
  font-size: 12px;
  letter-spacing: 0.025em;
  color: #1a1a1a;
}

/* terms checkbox row — the whole .field__row button opens the modal */
.terms-check {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  pointer-events: none;
}

.terms-check__box {
  width: 12px;
  height: 12px;
  border: 1px solid #1a1a1a;
  display: inline-block;
  flex: none;
}

.terms-check.is-checked .terms-check__box,
#modalAgreeRow.is-checked .terms-check__box {
  background: #1a1a1a;
}

/* ---------- Total + submit ---------- */
.order-total {
  padding: 72px 26px 0;
}

.order-total__row {
  display: flex;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid #999;
}

.order-total__row--amount-only {
  justify-content: flex-end;
}

.submit-btn {
  display: block;
  width: calc(100% - 52px);
  margin: 32px 26px 60px;
  padding: 10px 0;
  background: var(--dark-gray);
  color: #fff;
  border: none;
  font-family: 'Noto Serif TC', serif;
  font-weight: 200;
  font-size: 13px;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.submit-btn[hidden] {
  display: none;
}

.submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cart-feedback {
  display: none;
  text-align: center;
  margin: -40px 26px 60px;
  font-family: 'Noto Serif TC', serif;
  font-weight: 200;
  font-size: 12px;
  letter-spacing: 0.025em;
  color: #3b7a3b;
}

.cart-feedback.is-visible {
  display: block;
}

.cart-feedback a {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: inherit;
}

/* ---------- Terms modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.modal__panel {
  position: relative;
  background: #fff;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transform: translateY(16px);
  transition: transform 0.3s ease;
}

.modal.is-open .modal__panel {
  transform: translateY(0);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 26px;
  border-bottom: 1px solid #999;
  font-family: 'Forum', 'Songti TC', 'Noto Serif TC', serif;
  font-size: 15px;
  letter-spacing: 0.025em;
}

.modal__close {
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #1a1a1a;
}

.modal__body {
  overflow-y: auto;
  padding: 20px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal__body p {
  font-family: 'Noto Serif TC', serif;
  font-weight: 200;
  font-size: 12px;
  letter-spacing: 0.025em;
  line-height: 20px;
  color: #333;
}

.modal__body--emphasis {
  font-weight: 500;
  color: #1a1a1a;
}

.modal__agree {
  display: none;
  align-items: flex-start;
  gap: 8px;
  padding: 16px 26px;
  border-top: 1px solid #999;
  font-family: 'Noto Serif TC', serif;
  font-weight: 200;
  font-size: 12px;
  letter-spacing: 0.025em;
  line-height: 20px;
  cursor: pointer;
}

.modal__agree .terms-check__box {
  margin-top: 4px;
}

.modal__agree em {
  display: block;
  font-style: normal;
  font-size: 10px;
  color: #999;
}

.modal__agree.is-visible {
  display: flex;
}

.modal__agree input {
  display: none;
}

/* ---------- Responsive ---------- */
@media (min-width: 700px) {
  .product-info,
  .field__row,
  .order-total,
  .submit-btn {
    padding-left: 48px;
    padding-right: 48px;
  }

  .submit-btn {
    width: calc(100% - 96px);
    margin-left: 48px;
    margin-right: 48px;
  }

  .product-info__media {
    flex-basis: 40%;
    width: 40%;
    max-width: 260px;
  }
}
