.storefront-order-detail-page {
  padding-top: 24px;
  padding-bottom: 72px;
  background: #fff;
}

.storefront-order-detail {
  max-width: 1180px;
  margin: 0 auto;
}

.storefront-order-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding: 30px 32px;
  border: 1px solid #e7e7ea;
  border-radius: 18px;
  background: #fff;
}

.storefront-order-detail-header > div:first-child > p {
  margin: 0 0 6px;
  color: #77727f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
}

.storefront-order-detail-header h1 {
  margin: 0;
  color: #161418;
  font-size: 28px;
  line-height: 1.25;
}

.storefront-order-detail-header dl {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin: 18px 0 0;
}

.storefront-order-detail-header dl > div {
  display: flex;
  gap: 9px;
}

.storefront-order-detail-header dt,
.storefront-order-detail-header dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.storefront-order-detail-header dt {
  color: #89858f;
}

.storefront-order-detail-header dd {
  color: #27232c;
  font-weight: 700;
}

.storefront-order-mall {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  color: #8b8790;
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
}

.storefront-order-mall b {
  color: #5f5965;
  font-weight: 600;
}

.storefront-order-mall span::before {
  content: "·";
  margin-right: 4px;
}

.storefront-order-detail-statuses {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.storefront-order-detail-statuses strong,
.storefront-order-detail-statuses span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.storefront-order-detail-statuses strong {
  color: #5b3dc4;
  background: #f1edff;
}

.storefront-order-detail-statuses strong[data-status="SHIPPING"] {
  color: #1769aa;
  background: #eaf5ff;
}

.storefront-order-detail-statuses strong[data-status="DELIVERED"] {
  color: #177245;
  background: #eaf8f0;
}

.storefront-order-detail-statuses strong[data-status="CANCELED"],
.storefront-order-detail-statuses strong[data-status="RETURN_REQUESTED"] {
  color: #b53a44;
  background: #fff0f1;
}

.storefront-order-detail-statuses span {
  color: #4c4851;
  background: #f4f4f6;
}

.storefront-order-detail-card {
  margin-top: 18px;
  border: 1px solid #e7e7ea;
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}

.storefront-order-detail-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid #ededf0;
}

.storefront-order-detail-card > header h2 {
  margin: 0;
  color: #211e24;
  font-size: 18px;
}

.storefront-order-detail-card > header span {
  color: #8b8790;
  font-size: 13px;
}

.storefront-order-detail-items {
  padding: 0 24px;
}

.storefront-order-detail-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 250px;
  gap: 20px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid #efeff1;
}

.storefront-order-detail-item:last-child {
  border-bottom: 0;
}

.storefront-order-detail-image {
  width: 92px;
  height: 92px;
  border: 1px solid #ececef;
  border-radius: 12px;
  overflow: hidden;
  background: #fafafa;
}

.storefront-order-detail-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.storefront-order-detail-image-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa6ae;
  font-size: 10px;
  letter-spacing: .03em;
}

.storefront-order-detail-item-info {
  min-width: 0;
}

.storefront-order-detail-item-info > span,
.storefront-order-detail-item-info > strong,
.storefront-order-detail-item-info > small {
  display: block;
}

.storefront-order-detail-item-info > span {
  margin-bottom: 5px;
  color: #8a8590;
  font-size: 12px;
}

.storefront-order-detail-item-info > strong {
  color: #211e24;
  font-size: 15px;
  line-height: 1.45;
}

.storefront-order-detail-item-info > small {
  margin-top: 7px;
  color: #6f6a75;
  font-size: 13px;
  line-height: 1.5;
}

.storefront-order-detail-item-info > p {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8f7fa;
  color: #5c5761;
  font-size: 12px;
  line-height: 1.5;
}

.storefront-order-detail-item-info > p b {
  margin-right: 8px;
  color: #6a56a7;
}

.storefront-order-detail-item-price {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.storefront-order-detail-item-price > div {
  text-align: right;
}

.storefront-order-detail-item-price dt,
.storefront-order-detail-item-price dd {
  margin: 0;
}

.storefront-order-detail-item-price dt {
  margin-bottom: 5px;
  color: #99949e;
  font-size: 11px;
}

.storefront-order-detail-item-price dd {
  color: #4c4751;
  font-size: 13px;
}

.storefront-order-detail-item-price dd strong {
  color: #211e24;
  font-size: 14px;
}

.storefront-order-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.storefront-order-detail-payment dl,
.storefront-order-detail-delivery dl {
  margin: 0;
  padding: 8px 24px 18px;
}

.storefront-order-detail-payment dl > div,
.storefront-order-detail-delivery dl > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid #f0f0f2;
}

.storefront-order-detail-payment dl > div:last-child,
.storefront-order-detail-delivery dl > div:last-child {
  border-bottom: 0;
}

.storefront-order-detail-payment dt,
.storefront-order-detail-payment dd,
.storefront-order-detail-delivery dt,
.storefront-order-detail-delivery dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.storefront-order-detail-payment dt,
.storefront-order-detail-delivery dt {
  color: #8a8590;
}

.storefront-order-detail-payment dd,
.storefront-order-detail-delivery dd {
  color: #302c34;
  text-align: right;
  overflow-wrap: anywhere;
}

.storefront-order-detail-payment .storefront-order-detail-total {
  margin-top: 5px;
  padding-top: 16px;
  border-top: 1px solid #dcd9e2;
}

.storefront-order-detail-payment .storefront-order-detail-total dt,
.storefront-order-detail-payment .storefront-order-detail-total dd {
  color: #4f3694;
  font-size: 15px;
  font-weight: 800;
}

.storefront-order-detail-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.storefront-order-detail-actions a,
.storefront-order-detail-message > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid #cbc7d2;
  border-radius: 9px;
  color: #3c3741;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.storefront-order-detail-actions a.primary {
  border-color: #5c3da7;
  color: #fff;
  background: #5c3da7;
}

.storefront-order-detail-message {
  padding: 70px 24px;
  text-align: center;
}

.storefront-order-detail-message > span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #f2eff8;
  color: #5c3da7;
  font-size: 24px;
  font-weight: 800;
}

.storefront-order-detail-message h1 {
  margin: 0;
  font-size: 20px;
}

.storefront-order-detail-message p {
  margin: 10px 0 22px;
  color: #77727d;
  font-size: 13px;
}

.storefront-order-detail-empty {
  margin: 0;
  padding: 40px 0;
  text-align: center;
  color: #85808a;
  font-size: 13px;
}

@media (max-width: 820px) {
  .storefront-order-detail-page {
    padding-top: 10px;
    padding-bottom: 36px;
  }

  .storefront-order-detail {
    width: 100%;
  }

  .storefront-order-detail-header {
    display: block;
    padding: 22px 18px;
    border-radius: 12px;
  }

  .storefront-order-detail-header h1 {
    font-size: 22px;
  }

  .storefront-order-detail-header dl {
    display: block;
    margin-top: 14px;
  }

  .storefront-order-detail-header dl > div + div {
    margin-top: 5px;
  }

  .storefront-order-detail-statuses {
    justify-content: flex-start;
    margin-top: 16px;
  }

  .storefront-order-detail-card {
    margin-top: 12px;
    border-radius: 12px;
  }

  .storefront-order-detail-card > header {
    padding: 16px;
  }

  .storefront-order-detail-card > header h2 {
    font-size: 16px;
  }

  .storefront-order-detail-items {
    padding: 0 16px;
  }

  .storefront-order-detail-item {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    padding: 17px 0;
  }

  .storefront-order-detail-image {
    width: 72px;
    height: 72px;
  }

  .storefront-order-detail-item-info > strong {
    font-size: 14px;
  }

  .storefront-order-detail-item-info > small {
    margin-top: 5px;
    font-size: 12px;
  }

  .storefront-order-detail-item-price {
    grid-column: 1 / -1;
    padding-left: 84px;
  }

  .storefront-order-detail-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .storefront-order-detail-payment dl,
  .storefront-order-detail-delivery dl {
    padding: 6px 16px 14px;
  }

  .storefront-order-detail-payment dl > div,
  .storefront-order-detail-delivery dl > div {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 0;
  }

  .storefront-order-detail-actions {
    gap: 8px;
    margin-top: 20px;
  }

  .storefront-order-detail-actions a {
    min-width: 0;
    flex: 1 1 0;
    min-height: 44px;
    padding: 0 12px;
  }
}

/* Product identity links retain the existing order item layout. */
.storefront-order-product-link{color:inherit;text-decoration:none}
.storefront-order-product-link:hover{text-decoration:underline}
.storefront-order-product-link:focus-visible{outline:2px solid #6834cc;outline-offset:3px}
.storefront-order-detail-image.storefront-order-product-link{display:block}
