:root {
  color-scheme: light dark;
  font-family: system-ui, 'Malgun Gothic', sans-serif;
  color: #302b35;
  background: #faf8fc;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
main {
  width: min(100%, 720px);
  margin: auto;
  padding: 24px 16px 48px;
}
h1 {
  font-size: 26px;
}
h2 {
  font-size: 20px;
}
section {
  background: #fff;
  border: 1px solid #e5ddeb;
  border-radius: 18px;
  padding: 20px;
  margin: 20px 0;
}
a {
  color: #76578e;
}
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}
input,
select,
button {
  font: inherit;
  min-height: 46px;
  border-radius: 10px;
  border: 1px solid #cfc4d6;
  padding: 10px;
  width: 100%;
}
button {
  background: #77538c;
  color: white;
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
.consent {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}
.consent input {
  flex: 0 0 20px;
  width: 20px;
  min-height: 20px;
  margin: 2px 0;
}
.consent span {
  min-width: 0;
  line-height: 1.5;
}
article {
  border-top: 1px solid #ddd;
  padding: 16px 0;
  overflow-wrap: anywhere;
}
article button {
  margin-top: 8px;
}
#error {
  color: #b2294b;
  white-space: pre-wrap;
}
#notice {
  line-height: 1.6;
}
@media (prefers-color-scheme: dark) {
  :root {
    background: #211e28;
    color: #eee;
  }
  section {
    background: #2b2633;
    border-color: #50455b;
  }
  a {
    color: #d2b2e7;
  }
  input,
  select {
    background: #211e28;
    color: #eee;
  }
}

:root[data-theme='dark'] {
  background: #211e28;
  color: #eee;
}
:root[data-theme='dark'] section {
  background: #2b2633;
  border-color: #50455b;
}
:root[data-theme='dark'] a {
  color: #d2b2e7;
}
:root[data-theme='dark'] input,
:root[data-theme='dark'] select {
  background: #211e28;
  color: #eee;
}
:root[data-theme='light'] {
  background: #faf8fc;
  color: #302b35;
}
:root[data-theme='light'] section {
  background: #fff;
  border-color: #e5ddeb;
}
:root[data-theme='light'] a {
  color: #76578e;
}
:root[data-theme='light'] input,
:root[data-theme='light'] select {
  background: #fff;
  color: #302b35;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
legend {
  font-weight: 700;
  padding: 8px 0;
}
#product-seller,
#delivery-policy,
#purchase-availability {
  line-height: 1.6;
  overflow-wrap: anywhere;
}

[hidden] {
  display: none !important;
}
.checkout-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.checkout-pair label {
  min-width: 0;
}
#purchase-fields {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
#shipping-address-fields {
  border: 1px solid #cfc4d6;
  border-radius: 12px;
  padding: 0 14px;
  margin-top: 18px;
  min-width: 0;
}
#total {
  display: grid;
  gap: 5px;
  margin: 22px 0;
}
#total small {
  font-size: 14px;
  opacity: 0.75;
}
#total strong {
  font-size: 26px;
  line-height: 1.4;
}
details {
  margin: 12px 0;
  font-size: 14px;
}
summary {
  cursor: pointer;
  min-height: 28px;
}
details p {
  line-height: 1.65;
}
.checkout-product {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.checkout-product img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 12px;
}
.checkout-product h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
}
.checkout-product details {
  margin-top: 8px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.focused-checkout main {
  max-width: 600px;
}
.focused-checkout h1 {
  font-size: 24px;
}
.focused-checkout #purchase {
  margin-top: 16px;
}
.focused-checkout #notice:empty,
.focused-checkout #purchase-availability:empty {
  display: none;
}
#purchase-submit {
  font-size: 18px;
  font-weight: 700;
  min-height: 50px;
}
@media (max-width: 420px) {
  .checkout-pair {
    gap: 10px;
  }
  section {
    padding: 16px;
  }
  .checkout-product h2 {
    font-size: 18px;
  }
}

#service-total {
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.checkout-points {
  margin: 16px 0;
}
.checkout-points a {
  font-weight: 700;
}

.commerce-embedded main > a:first-child {
  display: none;
}
#product-description {
  white-space: pre-wrap;
  line-height: 1.65;
}
#goods-basket {
  margin: 18px 0;
}
.basket-chooser {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  gap: 10px;
  align-items: end;
}
.basket-chooser label {
  min-width: 0;
  margin: 0;
}
.basket-chooser select {
  min-width: 0;
}
.basket-chooser button {
  font-weight: 700;
}
.basket-hint {
  font-size: 14px;
  line-height: 1.5;
  color: #897795;
}
.basket-items {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.basket-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 36px;
  gap: 8px;
  align-items: center;
  border: 1px solid #d9cfe2;
  border-radius: 12px;
  padding: 12px;
}
.basket-item > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.basket-item small {
  opacity: 0.8;
}
.basket-item input {
  min-width: 0;
  padding: 8px;
  text-align: center;
}
.basket-item .basket-remove {
  display: grid;
  place-items: center;
  width: 36px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  font-size: 25px;
  line-height: 1;
  background: transparent;
  color: inherit;
  border: 0;
}
.secondary {
  background: transparent;
  color: inherit;
  border: 1px solid #cfc4d6;
}
#checkout-review {
  line-height: 1.6;
  overflow-wrap: anywhere;
}
#checkout-review h3 {
  font-size: 20px;
}
.goods-order-card h3 {
  font-size: 20px;
  line-height: 1.4;
}
.goods-order-state {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 8px;
  background: #eee6f5;
  color: #76548f;
  font-size: 13px;
  font-weight: 700;
}
.goods-order-card .order-line {
  font-size: 15px;
  line-height: 1.6;
}
.goods-tracking-history {
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.goods-tracking-history summary {
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
  line-height: 1.5;
}
.goods-tracking-history summary span {
  display: inline-block;
  margin-inline-start: 0.6em;
  text-decoration: underline;
}
.goods-tracking-history ol {
  list-style: none;
  padding-inline-start: 0;
}
.goods-tracking-history ol:empty {
  display: none;
}
.goods-tracking-history li {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-inline-start: 2px solid #9a7cb1;
}
.goods-tracking-history time {
  font-size: 0.875em;
}
.goods-tracking-form {
  margin-top: 12px;
  padding: 0 14px 14px;
  border: 1px solid #cfc4d6;
  border-radius: 12px;
}
.goods-tracking-error {
  color: #b2294b;
  white-space: pre-line;
}
.goods-tracking-error:empty {
  margin: 0;
}
.goods-tracking-actions {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
}
.goods-pickup-ticket {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 22px 0;
  padding: 18px 14px;
  border: 1px solid #d9cfe2;
  border-radius: 16px;
}
.goods-pickup-ticket h3 {
  margin: 0;
}
.goods-pickup-ticket canvas {
  display: block;
  max-width: 100%;
  width: 280px;
  height: auto;
  background: #fff;
}
.goods-pickup-ticket strong {
  font-size: 30px;
  letter-spacing: 5px;
  font-variant-numeric: tabular-nums;
}
.goods-pickup-ticket p {
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  margin: 0;
}
.pickup-reader,
.pickup-manual,
.goods-order-summary {
  border: 1px solid #d9cfe2;
  border-radius: 12px;
  padding: 12px;
  margin: 14px 0;
}
.pickup-reader summary,
.pickup-manual summary,
.goods-order-summary summary {
  font-weight: 700;
  line-height: 28px;
}
.pickup-reader p,
.goods-order-summary p {
  line-height: 1.6;
}
.pickup-reader input {
  min-width: 0;
  font-size: 14px;
}
.pickup-manual form,
.order-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pickup-manual input {
  min-width: 0;
}
.pickup-manual button {
  margin: 0;
}
.order-pagination {
  margin-top: 20px;
}
.checkout-delivery-fixed {
  display: block;
  padding: 12px 0;
  font-weight: 700;
}
.goods-preorder-notice {
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.goods-preorder-notice h4 {
  margin: 14px 0 6px;
}
.goods-preorder-notice p {
  font-size: 14px;
}
.goods-preorder-notice .consent {
  font-size: 14px;
}
#purchase-submit {
  margin-top: 12px;
}
.focused-checkout main {
  padding-bottom: 28px;
}
@media (prefers-color-scheme: dark) {
  .goods-order-state {
    background: #41304f;
    color: #ddc2f1;
  }
  .basket-hint {
    color: #b4a1c4;
  }
}
:root[data-theme='dark'] .goods-order-state {
  background: #41304f;
  color: #ddc2f1;
}
:root[data-theme='dark'] .basket-hint {
  color: #b4a1c4;
}
:root[data-theme='light'] .goods-order-state {
  background: #eee6f5;
  color: #76548f;
}
@media (max-width: 360px) {
  .basket-item {
    grid-template-columns: minmax(0, 1fr) 54px 30px;
    padding: 10px;
    gap: 6px;
  }
  .basket-item .basket-remove {
    width: 30px;
  }
  .goods-pickup-ticket {
    padding: 14px 10px;
  }
  .pickup-manual form {
    grid-template-columns: 1fr;
  }
  .checkout-pair {
    grid-template-columns: 1fr;
  }
  .focused-checkout main {
    padding-left: 12px;
    padding-right: 12px;
  }
}

.commerce-embedded main {
  width: 100%;
  max-width: none;
  padding: 14px 16px 24px;
}
.commerce-embedded main > h1 {
  display: none;
}
.commerce-embedded #purchase {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.commerce-embedded #order-history {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.commerce-embedded #notice:empty {
  display: none;
}

.commerce-embedded .focused-checkout #order-history > h2 {
  display: none;
}
.goods-order-card:first-of-type {
  padding-top: 8px;
}

/* Light order windows are white; dark windows keep the selected dark theme. */
:root:not([data-theme='dark']):has(body.focused-checkout) {
  color-scheme: light !important;
  background: #fff;
  color: #302b35;
}
:root:not([data-theme='dark']):has(body.focused-checkout)
  :is(body, main, section, fieldset, .checkout-product, .basket-item, #checkout-review) {
  background: #fff;
  color: #302b35;
}
:root:not([data-theme='dark']):has(body.focused-checkout) :is(input, select, textarea) {
  background: #fff;
  color: #302b35;
  border-color: #d5d0d9;
}
:root:not([data-theme='dark']):has(body.focused-checkout) a {
  color: #76578e;
}
:root:not([data-theme='dark']):has(body.focused-checkout) .basket-hint {
  color: #746a7b;
}
:root:not([data-theme='dark']):has(body.focused-checkout) :is(.secondary, .basket-remove) {
  background: #fff;
  color: #302b35;
}
:root:not([data-theme='dark']):has(body.focused-checkout) .goods-order-state {
  background: #fff;
  color: #76548f;
  border: 1px solid #ded7e4;
}
