/* ======================================================
   YN Purchase Subscription - Frontend
   디자인 시안 기준: 좌측 마이페이지 메뉴 + 우측 구독 목록
====================================================== */

.woocommerce-account .woocommerce {
  display: grid !important;
  grid-template-columns: 212px minmax(0, 1fr);
  column-gap: 22px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/*
 * WooCommerce의 clearfix 가상 요소가 grid item으로 잡히면
 * 메뉴는 오른쪽 위, 콘텐츠는 왼쪽 아래로 밀려납니다.
 * 마이페이지 grid 안에서는 반드시 제거합니다.
 */
.woocommerce-account .woocommerce::before,
.woocommerce-account .woocommerce::after {
  content: none !important;
  display: none !important;
}

.woocommerce-account .woocommerce-MyAccount-navigation,
.woocommerce-account .woocommerce-MyAccount-content {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  max-width: 100%;
  box-sizing: border-box;
}

.woocommerce-account .woocommerce-MyAccount-content {
  min-width: 0;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.woocommerce-account .woocommerce-MyAccount-navigation li {
  margin: 0 0 3px !important;
  padding: 0 !important;
  list-style: none !important;
  background: #f7f7f7;
}

.woocommerce-account .woocommerce-MyAccount-navigation li::before,
.woocommerce-account .woocommerce-MyAccount-navigation li::after {
  display: none !important;
}

.woocommerce-account .woocommerce-MyAccount-navigation li a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 11px 14px;
  color: #969696;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  text-decoration: none !important;
  box-sizing: border-box;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.woocommerce-account .woocommerce-MyAccount-navigation li:hover a,
.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a {
  color: #fff;
  background: #222;
}

.ynps-account-list {
  width: 100%;
  overflow-x: auto;
}

.ynps-subscription-table {
  width: 100%;
  min-width: 680px;
  margin: 0 !important;
  border: 0 !important;
  border-collapse: collapse !important;
  table-layout: fixed;
  background: #fff;
  color: #666;
  font-family: inherit;
}

.ynps-subscription-table th,
.ynps-subscription-table td {
  border: 0 !important;
  border-bottom: 1px solid #ededed !important;
  padding: 14px 14px !important;
  text-align: left;
  vertical-align: middle;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
  box-sizing: border-box;
}

.ynps-subscription-table th {
  height: 58px;
  background: #fafafa;
  color: #666;
  font-size: 15px;
}

.ynps-subscription-table th:nth-child(1),
.ynps-subscription-table td:nth-child(1) {
  width: 52%;
}

.ynps-subscription-table th:nth-child(2),
.ynps-subscription-table td:nth-child(2),
.ynps-subscription-table th:nth-child(3),
.ynps-subscription-table td:nth-child(3) {
  width: 16.5%;
}

.ynps-subscription-table th:nth-child(4),
.ynps-subscription-table td:nth-child(4) {
  width: 15%;
}

.ynps-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.ynps-status__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: #9b9b9b;
}

.ynps-status--active .ynps-status__dot {
  background: #f2c21b;
}

.ynps-status--expired .ynps-status__dot {
  background: #999;
}

.ynps-status--waiting .ynps-status__dot {
  background: #d59028;
}

.ynps-status--cancelled .ynps-status__dot {
  background: #b44747;
}

.ynps-status--unknown .ynps-status__dot {
  background: #6f7782;
}

.ynps-empty {
  height: 130px;
  text-align: center !important;
  color: #999;
}

.ynps-notice {
  padding: 18px;
  background: #f7f7f7;
}

@media (max-width: 1024px) {
  .woocommerce-account .woocommerce {
    grid-template-columns: 190px minmax(0, 1fr);
    column-gap: 18px;
  }

  .ynps-subscription-table th,
  .ynps-subscription-table td {
    padding: 13px 11px !important;
  }
}

@media (max-width: 767px) {
  .woocommerce-account .woocommerce {
    display: block;
  }

  .woocommerce-account .woocommerce-MyAccount-navigation {
    margin-bottom: 28px !important;
  }

  .woocommerce-account .woocommerce-MyAccount-navigation ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .woocommerce-account .woocommerce-MyAccount-navigation li {
    margin: 0 !important;
  }

  .woocommerce-account .woocommerce-MyAccount-navigation li a {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 12px;
  }

  .ynps-account-list {
    overflow: visible;
  }

  .ynps-subscription-table,
  .ynps-subscription-table tbody,
  .ynps-subscription-table tr,
  .ynps-subscription-table td {
    display: block;
    width: 100% !important;
    min-width: 0;
  }

  .ynps-subscription-table thead {
    display: none;
  }

  .ynps-subscription-table tr {
    margin-bottom: 14px;
    padding: 10px 14px;
    border: 1px solid #ededed;
    background: #fff;
    box-sizing: border-box;
  }

  .ynps-subscription-table td {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    padding: 9px 0 !important;
    border-bottom: 1px solid #f1f1f1 !important;
    font-size: 12px;
  }

  .ynps-subscription-table td:last-child {
    border-bottom: 0 !important;
  }

  .ynps-subscription-table td::before {
    content: attr(data-label);
    color: #999;
    font-size: 11px;
  }

  .ynps-subscription-table .ynps-empty {
    display: block;
    padding: 34px 0 !important;
  }

  .ynps-subscription-table .ynps-empty::before {
    display: none;
  }
}
