/* Checkout / order complete: form sections on the left, payment panel on the right (stacked on phones) */
.checkout,
.checkout * {
  font-family: 'Roboto', 'Noto Sans KR', sans-serif;
}

.checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(320px, 30vw, 420px);
  column-gap: clamp(28px, 5vw, 80px);
  align-items: start;
  padding: 28px var(--gutter) 6rem;
  font-weight: 300;
}

.checkout--done {
  grid-template-columns: minmax(0, 1fr);
}

.checkout__title {
  margin: 0 0 2.4rem;
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: 0.04em;
}

.checkout__status {
  margin: 0 0 1.5rem;
  color: #b23b3b;
  font-size: 0.8rem;
}

/* sections */
.co-section {
  margin-bottom: 3.2rem;
}

.co-section__head {
  padding-bottom: 0.9rem;
  border-bottom: 1px solid #222;
}

.co-section__head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.co-section__head h2 span {
  font-weight: 300;
}

.co-row {
  display: grid;
  grid-template-columns: minmax(110px, 220px) minmax(0, 1fr);
  align-items: center;
  column-gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid #efefef;
  font-size: 0.82rem;
}

.co-row--top {
  align-items: start;
}

.co-row label b {
  font-weight: 400;
}

.co-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkout input[type='text'],
.checkout input[type='tel'],
.checkout input[type='password'],
.checkout select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #d5d5d5;
  border-radius: 2px;
  background: #fff;
  color: var(--fg);
  font-size: 0.82rem;
  font-weight: 300;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.checkout select {
  padding-right: 36px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23333' stroke-width='1.2'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 14px center;
}

.checkout input:focus,
.checkout select:focus {
  border-color: #222;
}

.checkout input::placeholder {
  color: #aaa;
}

.checkout input.is-invalid {
  border-color: #b23b3b;
}

.co-zip-row {
  display: flex;
  gap: 10px;
}

.co-zip-btn {
  flex: none;
  width: 120px;
  border: 1px solid #222;
  border-radius: 2px;
  background: #fff;
  color: var(--fg);
  font-size: 0.82rem;
  font-weight: 300;
  cursor: pointer;
}

.co-zip-btn:hover {
  background: #222;
  color: #fff;
}

.checkout input[readonly] {
  background: #f5f5f5;
  cursor: pointer;
}

/* checkboxes */
.co-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  cursor: pointer;
}

.co-check--right {
  display: flex;
  justify-content: flex-end;
  margin: 14px 0 4px;
}

.co-check--sub {
  font-size: 0.74rem;
  color: #555;
}

.co-check input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1px solid #c8c8c8;
  background: #fff;
  cursor: pointer;
}

.co-check input:checked {
  border-color: #222;
  background: #222 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='9' fill='none' stroke='%23fff' stroke-width='1.6'%3E%3Cpath d='M1 4.5l3.2 3L11 1'/%3E%3C/svg%3E") no-repeat center;
}

.co-check a {
  text-decoration: underline;
}

/* order items */
.co-items {
  display: block;
}

.co-item {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) auto;
  column-gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid #efefef;
}

.co-item__img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  background: #f3f3f3;
}

.co-item__name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 400;
}

.co-item__meta {
  margin: 0.55rem 0 0;
  color: #777;
  font-size: 0.72rem;
}

.co-item__price {
  align-self: end;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 400;
}

/* payment methods */
.co-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.co-method {
  height: 48px;
  border: 1px solid #d5d5d5;
  border-radius: 2px;
  background: #fff;
  color: var(--fg);
  font-size: 0.82rem;
  font-weight: 300;
  cursor: pointer;
}

.co-method.is-selected {
  border-color: #222;
  font-weight: 400;
}

.co-note {
  margin: 14px 0 0;
  color: #b23b3b;
  font-size: 0.74rem;
}

/* right panel */
.checkout__panel {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  margin-top: 4.6rem;
  padding: 36px 32px 32px;
  border: 1px solid #dedede;
  background: #fff;
}

.co-panel__title {
  margin: 0 0 1.4rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid #222;
  font-size: 1rem;
  font-weight: 400;
}

.co-panel__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.6rem 0 1.2rem;
  border-bottom: 1px solid #efefef;
  font-size: 0.9rem;
}

.co-panel__total strong {
  font-size: 1.15rem;
  font-weight: 400;
}

.co-panel__lines {
  margin: 0;
  padding: 1rem 0 1.6rem;
}

.co-panel__lines div {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  color: #888;
  font-size: 0.76rem;
}

.co-panel__lines dd {
  margin: 0;
  color: #333;
}

.co-terms {
  border: 1px solid #ececec;
}

.co-terms__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px;
}

.co-terms__toggle {
  border: none;
  background: none;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.co-terms__toggle[aria-expanded='true'] {
  transform: rotate(180deg);
}

.co-terms__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px 16px 46px;
}

.co-panel__privacy {
  margin: 1.1rem 0 1.6rem;
  color: #888;
  font-size: 0.68rem;
  line-height: 1.6;
}

.co-panel__privacy a {
  text-decoration: underline;
}

.co-pay-btn {
  display: block;
  width: 100%;
  padding: 1.15rem 1rem;
  border: none;
  background: #36383a;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s ease;
}

.co-pay-btn:hover:not(:disabled) {
  background: #1d1e1f;
}

.co-pay-btn:disabled {
  background: #c9c9c9;
  cursor: default;
}

/* order complete */
.done {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.done__msg,
.done__lead {
  margin: 0 0 2rem;
  font-size: 0.9rem;
}

.done__meta {
  margin: 0 0 3rem;
  padding: 1.2rem 0;
  border-top: 1px solid #222;
  border-bottom: 1px solid #efefef;
}

.done__meta div,
.done__ship div {
  display: grid;
  grid-template-columns: minmax(90px, 160px) minmax(0, 1fr);
  padding: 0.45rem 0;
  font-size: 0.82rem;
}

.done__meta dd,
.done__ship dd {
  margin: 0;
  word-break: break-all;
}

.done__ship {
  margin: 0;
  padding: 1rem 0;
}

.done__link {
  display: inline-block;
  margin-top: 1rem;
  text-decoration: underline;
  font-size: 0.82rem;
}

@media (max-width: 768px) {
  .checkout {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 20px;
  }

  .checkout__title {
    font-size: 1.6rem;
    margin-bottom: 1.8rem;
  }

  .co-row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 8px;
    align-items: stretch;
  }

  .co-item {
    grid-template-columns: 80px minmax(0, 1fr);
    row-gap: 8px;
  }

  .co-item__img {
    width: 80px;
    height: 80px;
  }

  .co-item__price {
    grid-column: 2;
  }

  .co-methods {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .checkout__panel {
    position: static;
    margin-top: 0;
    padding: 28px var(--gutter) 24px;
  }
}

/* my page */
.mp-empty {
  margin: 1.6rem 0 0;
  color: #777;
}

.mp-order {
  padding: 22px 0 6px;
  border-bottom: 1px solid #efefef;
}

.mp-order__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  font-size: 0.78rem;
}

.mp-order__id {
  color: #777;
  word-break: break-all;
}

.mp-order__total {
  margin: 14px 0 0;
  text-align: right;
  font-size: 0.9rem;
  font-weight: 400;
}

.mp-logout {
  padding: 0.9rem 2.4rem;
  border: 1px solid #222;
  background: #fff;
  color: var(--fg);
  font-size: 0.8rem;
  font-weight: 300;
  cursor: pointer;
}

.mp-logout:hover {
  background: #222;
  color: #fff;
}

/* my page: edit forms */
.mp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.mp-link-btn {
  padding: 0;
  border: none;
  background: none;
  color: #555;
  font-size: 0.78rem;
  font-weight: 300;
  text-decoration: underline;
  cursor: pointer;
}

.mp-link-btn:hover {
  color: var(--fg);
}

.mp-form {
  margin-top: 4px;
}

.mp-msg {
  margin: 14px 0 0;
  color: #b23b3b;
  font-size: 0.76rem;
}

.mp-msg.is-ok {
  color: #2f6f4f;
}

.mp-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.mp-logout--small {
  padding: 0.55rem 1.3rem;
  font-size: 0.72rem;
}

.mp-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mp-withdraw-link {
  padding: 0;
  border: none;
  background: none;
  color: #888;
  font-size: 0.72rem;
  font-weight: 300;
  text-decoration: underline;
  cursor: pointer;
}

.mp-withdraw-link:hover {
  color: var(--fg);
}

.mp-withdraw {
  margin-top: 28px;
  padding: 22px 0 0;
  border-top: 1px solid #efefef;
}

.mp-withdraw__text {
  margin: 0 0 14px;
  color: #555;
  font-size: 0.76rem;
  line-height: 1.6;
}

.mp-withdraw input {
  max-width: 360px;
}

.mp-save {
  padding: 0.9rem 2.4rem;
  border: 1px solid #36383a;
  background: #36383a;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 300;
  cursor: pointer;
}

.mp-save:hover:not(:disabled) {
  background: #1d1e1f;
}

.mp-save:disabled {
  opacity: 0.6;
  cursor: default;
}

.mp-flash {
  margin: 14px 0 0;
  color: #2f6f4f;
  font-size: 0.78rem;
}

/* order complete / lookup */
.done__id {
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.done__notice {
  margin: -1.8rem 0 3rem;
  color: #b23b3b;
  font-size: 0.76rem;
  line-height: 1.7;
}

.done__notice a {
  text-decoration: underline;
}

.co-login-note {
  margin: 0 0 1.6rem;
  padding: 14px 16px;
  background: #f7f7f7;
  color: #555;
  font-size: 0.76rem;
}

.co-login-note a {
  margin-left: 6px;
  color: var(--fg);
  text-decoration: underline;
}
