/******************************************************
 * 페이지 타이틀 (myaccount/orders 전용)
 ******************************************************/
body.woocommerce-orders .wp-block-post-title {
  display: block !important;
  font-size: 28px;
}

/******************************************************
 * 상품 정보 레이아웃 (썸네일 + 이름)
 ******************************************************/
.order-product-info-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

/******************************************************
 * 썸네일
 ******************************************************/
.product-thumb-wrap {
  position: relative;
  width: 55px;
  height: 55px;
  border-radius: 10px;
  overflow: hidden;
  background: #f5f5f5;
  flex-shrink: 0;
}

/* 실제 이미지 */
.product-thumb-wrap .thumb-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 썸네일 개수 배지 */
.product-thumb-wrap .thumb-count {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 3px 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  border-top-left-radius: 6px;
}

/******************************************************
 * 상품명 / 외 n개
 ******************************************************/
.product-info-text {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.3;
}

.product-info-text .first-name {
  font-weight: 400;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-info-text .more-items {
  font-size: 12px;
  color: #777;
  white-space: nowrap;
}

/******************************************************
 * 주문번호 / 날짜
 ******************************************************/
.my-order-number {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.my-order-date {
  font-size: 12px;
  color: #777;
  margin-top: 3px;
}

/******************************************************
 * 상태 / 결제금액
 ******************************************************/
.woocommerce-orders-table__cell-order-status,
.woocommerce-orders-table__cell-order-total {
  white-space: nowrap;
}

/******************************************************
 * 액션 버튼
 ******************************************************/
.woocommerce-orders-table__cell-order-actions {
  text-align: right;
  vertical-align: middle;
  padding-right: 10px;
}

.woocommerce-orders-table__cell-order-actions a.woocommerce-button {
  font-size: var(--everythings-font-size) !important;
  font-weight: 600;
  min-width: 50px !important;
  padding: 8px 16px;
  border-radius: 4px;
  background: #111;
  color: #fff;
  display: inline-block;
  margin: 0 !important;
  transition: 0.2s;
}

.woocommerce-orders-table__cell-order-actions a.woocommerce-button + a.woocommerce-button {
  margin-top: 6px !important;
}

.woocommerce-orders-table__cell-order-actions a.woocommerce-button:hover {
  background: #333;
}

/******************************************************
 * 테이블 기본 스타일
 ******************************************************/
/* 공통 border 제거 – 중복 선언 통합 */
.woocommerce-orders-table,
.woocommerce-orders-table th,
.woocommerce-orders-table td {
  border: none !important;
}

/* 테이블 헤더 */
.woocommerce-orders-table thead th {
  background: #fafafa;
  font-weight: 600;
  padding: 14px 12px;
  border-top: 1px solid #999 !important;
  border-bottom: 1px solid #e5e5e5 !important;
}

/* 주문 row */
.woocommerce-orders-table__row {
  border-bottom: 1px solid #e7e7e7;
}

/******************************************************
 * 페이지네이션
 ******************************************************/
.my-orders-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 28px 0 15px;
}

.my-orders-pagination a,
.my-orders-pagination span {
  width: 34px;
  height: 34px;
  border: 1px solid #ddd;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: #fff;
  color: #222;
  text-decoration: none;
}

.my-orders-pagination .active {
  border: 2px solid #000;
  font-weight: 600;
}

.my-orders-pagination .disabled {
  opacity: 0.4;
  cursor: default;
  border: 1px solid #eee;
}

/******************************************************
 * 모바일 전용 (기존 동작 유지)
 ******************************************************/
@media (max-width: 768px) {
  /* 모바일 배경 강제 통일 */
  .woocommerce-orders-table__row,
  .woocommerce-orders-table tr:nth-child(even),
  .woocommerce-orders-table tr:nth-child(odd),
  .woocommerce-orders-table td,
  .woocommerce-orders-table th {
    background: #fff !important;
  }

  /* 상품 정보 라벨 제거 */
  .woocommerce-orders-table__header-order-product-info,
  .woocommerce-orders-table__cell-order-product-info::before {
    display: none;
  }

  /* 상태 / 금액 label 유지 */
  .woocommerce table.shop_table_responsive .woocommerce-orders-table__cell-order-status::before,
  .woocommerce table.shop_table_responsive .woocommerce-orders-table__cell-order-total::before {
    content: attr(data-title);
  }

  /* 상품 정보 세로 정렬 */
  .order-product-info-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }

  /* 썸네일 확대 (기존 로직 유지) */
  .product-thumb-wrap {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .product-thumb-wrap .thumb-count {
    display: none;
  }

  .product-info-text {
    align-items: center;
  }

  .product-info-text .first-name {
    max-width: 100%;
    font-size: 13px;
    white-space: normal !important;
    text-align: center;
    line-height: 1.4;
    margin-bottom: 6px;
  }

  .product-info-text .more-items {
    font-size: 13px;
    color: #666;
  }

  .woocommerce-orders-table__cell-order-status,
  .woocommerce-orders-table__cell-order-total {
    padding: 0.5em 1em !important;
  }

  .woocommerce-orders-table__cell-order-actions a.woocommerce-button {
    padding: 14px 24px;
  }
}

/******************************************************
 * 데스크톱 컬럼 폭
 ******************************************************/
@media (min-width: 769px) {
  .woocommerce-orders-table__header-order-number,
  .woocommerce-orders-table__cell-order-number {
    width: 20% !important;
  }

  .woocommerce-orders-table__header-order-product-info,
  .woocommerce-orders-table__cell-order-product-info {
    width: 35% !important;
  }

  .woocommerce-orders-table__header-order-status,
  .woocommerce-orders-table__cell-order-status,
  .woocommerce-orders-table__header-order-total,
  .woocommerce-orders-table__cell-order-total,
  .woocommerce-orders-table__header-order-actions,
  .woocommerce-orders-table__cell-order-actions {
    width: 10% !important;
  }
}
