/* ========================================
  マイページ（mp-）
  - 切り替え：min-width: 900px
  - 構成：ブロックごとに SP → PC の順で記述
======================================== */

/* EC-CUBEの外枠ではなく、モックの.l-container幅を使用する */
.mypage_orders_page .ec-layoutRole__contents,
.mypage_estimates_page .ec-layoutRole__contents,
.mypage_coupons_page .ec-layoutRole__contents,
.mypage_design_page .ec-layoutRole__contents {
  max-width: none;
}

.mypage_orders_page .header__search-wrap,
.mypage_estimates_page .header__search-wrap,
.mypage_coupons_page .header__search-wrap,
.mypage_design_page .header__search-wrap {
  display: none;
}

@media (min-width: 900px) {
  .mypage_orders_page .header__search-wrap,
  .mypage_estimates_page .header__search-wrap,
  .mypage_coupons_page .header__search-wrap,
  .mypage_design_page .header__search-wrap {
    display: block;
  }
}

/* ----------------------------------------
  メニューブロック SP
---------------------------------------- */
.mypage {
  padding-top: 30px;
  padding-bottom: 40px;
}

.mp-nav {
  overflow: hidden;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
}

.mp-nav__list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.mp-nav__item {
  grid-column: span 2;
  min-width: 0;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.mp-nav__item:nth-child(3n) {
  border-right: none;
}

/* 下段：お届け先 / 退会（横並び・2列） */
.mp-nav__item--row {
  grid-column: span 3;
  border-bottom: none;
}

.mp-nav__item--row:last-child {
  border-right: none;
}

.mp-nav__item.is-active {
  background-color: var(--color-bg-gray);
}

.mp-nav__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  color: var(--color-text, #333333);
  text-decoration: none;
}

.mp-nav__item--row .mp-nav__link {
  flex-direction: row;
  justify-content: flex-start;
  gap: 10px;
  padding: 14px 16px;
}

.mp-nav__icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.mp-nav__icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mp-nav__label {
  font-size: 11px;
  text-align: center;
}

.mp-nav__item--row .mp-nav__label {
  text-align: left;
}

/* ----------------------------------------
  メニューブロック PC
---------------------------------------- */
@media (min-width: 900px) {
  .mypage {
    padding-top: 28px;
    padding-bottom: 60px;
  }

  .mp-nav {
    overflow: visible;
    background-color: transparent;
    border: none;
  }

  .mp-nav__list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .mp-nav__item {
    grid-column: span 1;
    margin-right: -1px;
    margin-bottom: -1px;
    background-color: #ffffff;
    border: 1px solid var(--color-border);
  }

  .mp-nav__item.is-active .mp-nav__label {
    font-weight: 700;
  }

  .mp-nav__link {
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    padding: 16px 12px;
  }

  .mp-nav__item--row .mp-nav__link {
    padding: 16px 12px;
  }

  .mp-nav__item--row:last-child .mp-nav__link {
    border-right: 1px solid var(--color-border);
  }

  .mp-nav__icon {
    width: 24px;
    height: 24px;
  }

  .mp-nav__label {
    font-size: 15px;
    text-align: left;
  }
}

/* ----------------------------------------
  ページ見出し（共通） SP
---------------------------------------- */
.mp-title {
  margin: 30px 0 0;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.mp-welcome {
  margin: 8px 0 0;
  padding-bottom: 20px;
  font-size: 15px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.mp-welcome--no-border {
  border-bottom: none;
}

/* ----------------------------------------
  ご注文履歴ブロック SP
---------------------------------------- */
.mp-orders__body {
  display: grid;
  gap: 24px;
  margin-top: 20px;
}

.mp-orders__meta {
  display: grid;
  gap: 6px;
  padding-top: 16px;
  padding-bottom: 16px;
  border-top: 1px dotted var(--color-border);
  border-bottom: 1px dotted var(--color-border);
}

.mp-orders__meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0.5em;
  font-size: 15px;
}

.mp-orders__meta-row dt::after {
  content: "：";
}

.mp-orders__meta-row dd {
  margin: 0;
}

.mp-orders__items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mp-orders__item {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px dotted var(--color-border);
}

.mp-orders__thumb {
  overflow: hidden;
}

.mp-orders__thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.mp-orders__detail {
  display: grid;
  align-content: start;
}

.mp-orders__name {
  font-size: 15px;
}

.mp-orders__unit {
  font-size: 15px;
}

.mp-orders__sub {
  margin-left: 0.75em;
}

.mp-orders__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  margin-top: 16px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  background-color: var(--color-primary);
  border: none;
  border-radius: 4px;
  text-decoration: none;
}

.mp-orders__btn--lg {
  width: 100%;
  padding: 12px 16px;
  font-size: 18px;
}

.mp-orders__summary {
  padding: 16px;
  background-color: var(--color-bg-gray);
  border-radius: 8px;
}

.mp-orders__breakdown {
  display: grid;
  gap: 10px;
  border-bottom: 1px dotted var(--color-border);
  padding-bottom: 20px;
}

.mp-orders__breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
}

.mp-orders__total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 40px;
  font-size: 16px;
  font-weight: 700;
}

.mp-orders__total strong {
  font-family: var(--font-inter);
  font-size: 30px;
  line-height: 1;
}

.mp-orders__summary .mp-orders__btn {
  margin-top: 16px;
}

/* ----------------------------------------
  ページ見出し（共通） PC
---------------------------------------- */
@media (min-width: 900px) {
  .mp-title {
    margin-top: 40px;
    font-size: 24px;
    text-align: left;
  }

  .mp-welcome {
    margin-top: 20px;
    font-size: 14px;
    border-bottom: none;
  }
}

/* ----------------------------------------
  ご注文履歴ブロック PC
---------------------------------------- */
@media (min-width: 900px) {
  .mp-orders__body {
    grid-template-columns: minmax(0, 1fr) 400px;
    align-items: start;
    gap: 40px;
    margin-top: 20px;
  }

  .mp-orders__item {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 20px;
    padding: 20px 0;
  }

  .mp-orders__thumb {
    border-radius: 50%;
  }

  .mp-orders__name {
    font-size: 15px;
  }

  .mp-orders__unit {
    font-size: 14px;
  }

  .mp-orders__summary {
    position: sticky;
    top: 24px;
    padding: 20px;
  }

  .mp-orders__total strong {
    font-size: 30px;
  }

  .mp-orders__btn {
    justify-self: start;
  }

  .mp-orders__btn--lg {
    padding: 14px 16px;
    font-size: 18px;
  }
}

/* ----------------------------------------
  見積履歴ブロック SP
---------------------------------------- */
.mp-est {
  margin-top: 20px;
}

.mp-est__count {
  font-size: 16px;
  font-weight: 700;
}

.mp-est__num {
  color: var(--color-primary);
}

.mp-est__list {
  margin-top: 20px;
}

.mp-est__sp {
  display: grid;
  gap: 16px;
}

.mp-est__pc {
  display: none;
}

.mp-est__table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--color-border);
}

.mp-est__sp .mp-est__table th,
.mp-est__sp .mp-est__table td {
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 400;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-border);
}

.mp-est__sp .mp-est__table tr:last-child th,
.mp-est__sp .mp-est__table tr:last-child td {
  border-bottom: none;
}

.mp-est__sp .mp-est__table th {
  width: 7.5em;
  background-color: var(--color-bg-gray);
  border-right: 1px solid var(--color-border);
}

.mp-est__id {
  color: var(--color-primary);
  text-decoration: underline;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.mp-est__product {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.mp-est__product span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mp-est__thumb {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  object-fit: cover;
}

.mp-est__detail {
  display: inline-block;
  padding: 4px 8px;
  width: fit-content;
  font-size: 15px;
  color: #41aade;
  text-decoration: none;
  background-color: #f3fcff;
  border: 1px solid #41aade;
  border-radius: 3px;
}

/* ----------------------------------------
  見積履歴ブロック PC
---------------------------------------- */
@media (min-width: 900px) {
  .mp-est {
    margin-top: 24px;
  }

  .mp-est__count {
    font-size: 15px;
  }

  .mp-est__sp {
    display: none;
  }

  .mp-est__pc {
    display: grid;
    gap: 20px;
  }

  .mp-est__table {
    table-layout: fixed;
  }

  .mp-est__pc .mp-est__table th,
  .mp-est__pc .mp-est__table td {
    padding: 12px 8px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    vertical-align: middle;
    border: 1px solid var(--color-border);
  }

  .mp-est__pc .mp-est__table thead th {
    font-weight: 700;
    background-color: var(--color-bg-gray);
  }

  .mp-est__pc .mp-est__table th:nth-child(1),
  .mp-est__pc .mp-est__table td:nth-child(1) {
    width: 12.5em;
    white-space: nowrap;
  }

  .mp-est__pc .mp-est__table th:nth-child(4),
  .mp-est__pc .mp-est__table td:nth-child(4) {
    width: 26%;
    text-align: left;
  }

  .mp-est__pc .mp-est__table th:nth-child(n + 5),
  .mp-est__pc .mp-est__table td:nth-child(n + 5) {
    width: 100px;
  }

  .mp-est__thumb {
    width: 60px;
    height: 60px;
  }
}

/* ----------------------------------------
  保有クーポンブロック SP
---------------------------------------- */
.mp-coupon {
  margin-top: 30px;
}

.mp-coupon__lead {
  margin: 16px 0 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.mp-coupon__list {
  display: grid;
  gap: 32px;
  margin-top: 20px;
}

.mp-coupon__card {
  padding-bottom: 32px;
  border-bottom: 1px dotted var(--color-border);
}

.mp-coupon__card:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.mp-coupon__head {
  position: relative;
  padding: 15px 20px;
  text-align: center;
  background-color: #fff3f3;
}

.mp-coupon__ribbon {
  position: absolute;
  top: -5px;
  left: -5px;
  z-index: 1;
  width: 68px;
  height: auto;
}

.mp-coupon__title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-primary);
}

.mp-coupon__title--off {
  font-size: 32px;
}

.mp-coupon__title--off span {
  font-size: 28px;
}

.mp-coupon__expiry {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.5;
}

.mp-coupon__meta {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
}

.mp-coupon__row {
  display: grid;
  grid-template-columns: 30% auto;
  align-items: start;
}

.mp-coupon__row dt,
.mp-coupon__row dd {
  margin: 0;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.5;
  background-color: #fafafa;
}

.mp-coupon__row dt {
  text-align: center;
  white-space: nowrap;
}

.mp-coupon__row dd {
  background-color: transparent;
}

/* ----------------------------------------
  保有クーポンブロック PC
---------------------------------------- */
@media (min-width: 900px) {
  .mp-coupon {
    margin-top: 40px;
  }

  .mp-coupon__lead {
    margin-top: 20px;
    font-size: 16px;
  }

  .mp-coupon__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 48px;
    margin-top: 20px;
  }

  .mp-coupon__card {
    position: relative;
    padding-bottom: 0;
    border-bottom: none;
  }

  .mp-coupon__card + .mp-coupon__card::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -24px;
    border-left: 1px dotted var(--color-border);
    content: "";
  }

  .mp-coupon__head {
    padding: 12px 16px 10px;
  }

  .mp-coupon__ribbon {
    top: -4px;
    left: -4px;
    width: 58px;
  }

  .mp-coupon__expiry {
    margin-top: 8px;
    font-size: 13px;
  }

  .mp-coupon__meta {
    gap: 6px;
    margin-top: 12px;
  }

  .mp-coupon__row {
    grid-template-columns: 90px auto;
    gap: 5px;
  }

  .mp-coupon__row dt,
  .mp-coupon__row dd {
    padding: 4px 8px;
    font-size: 13px;
  }

  .mp-coupon__row dd {
    padding: 4px 0;
  }
}

/* ----------------------------------------
  保存済デザインブロック SP
---------------------------------------- */
.mp-design {
  margin-top: 30px;
}

.mp-design__lead {
  margin: 16px 0 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}

.mp-design__list {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.mp-design__card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.mp-design__name {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.mp-design__preview {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background-color: #e8e8e8;
  aspect-ratio: 1 / 1;
}

.mp-design__preview > img {
  display: block;
  width: 100%;
  object-fit: contain;
}

.mp-design__delete {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  cursor: pointer;
  background-color: rgba(120, 120, 120, 0.7);
  border: none;
  border-radius: 50%;
}

.mp-design__delete img {
  display: block;
  width: 100%;
}

.mp-design__code {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-text-light);
}

.mp-design__product {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  min-height: 3em;
}

.mp-design__meta {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
}

.mp-design__row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: baseline;
  margin: 0;
  padding: 8px 55px;
  font-size: 13px;
  line-height: 1.5;
}

.mp-design__row dt,
.mp-design__row dd {
  margin: 0;
}

.mp-design__row:first-child {
  background-color: var(--color-bg-gray);
}

.mp-design__row:first-child dd {
  font-size: 17px;
  font-weight: 700;
  color: #333333;
}

.mp-design__row:last-child {
  justify-content: center;
}

.mp-design__row--bold {
  font-weight: 700;
}

.mp-design__actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}

.mp-design__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  border-radius: 4px;
}

.mp-design__btn img {
  flex-shrink: 0;
  width: 27px;
  height: 29px;
}

.mp-design__btn--primary {
  color: #ffffff;
  background-color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.mp-design__btn--outline {
  color: var(--color-primary);
  background-color: #ffffff;
  border: 1px solid var(--color-primary);
}

/* ----------------------------------------
  保存済デザインブロック PC
---------------------------------------- */
@media (min-width: 900px) {
  .mp-design {
    margin-top: 40px;
  }

  .mp-design__lead {
    margin-top: 20px;
    font-size: 16px;
  }

  .mp-design__list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-top: 24px;
  }

  .mp-design__card {
    padding: 12px;
  }

  .mp-design__name {
    margin-bottom: 10px;
    font-size: 14px;
  }

  .mp-design__delete {
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
  }

  .mp-design__delete img {
    /* width: 14px;
    height: 14px; */
  }

  .mp-design__code {
    margin-top: 10px;
    font-size: 12px;
  }

  .mp-design__product {
    font-size: 13px;
  }

  .mp-design__meta {
    margin-top: 24px;
  }

  .mp-design__row {
    font-size: 12px;
    padding: 8px 40px;
  }

  .mp-design__row:first-child dd {
    font-size: 15px;
  }

  .mp-design__actions {
    gap: 8px;
    padding-top: 12px;
  }

  .mp-design__btn {
    padding: 10px 8px;
    font-size: 14px;
  }
}
