/* =============================================================
   마이페이지 - 몽연 커스텀
============================================================= */

/* ─── 전체 레이아웃 ─── */
.myaccount-wrap {
    background: var(--color-bg, #FAFAFA);
    min-height: 70vh;
    padding: 40px 0 80px;
}
.myaccount-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 28px;
    align-items: start;
}

/* ─── 사이드바 ─── */
.myaccount-sidebar {
    position: sticky;
    top: calc(var(--header-height, 68px) + 24px);
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--color-border, #E8E8E8);
    overflow: hidden;
}

/* 사용자 카드 */
.myaccount-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: linear-gradient(135deg, var(--color-primary, #8B35C8) 0%, var(--color-primary-dark, #6B1FA8) 100%);
    color: #fff;
}
.myaccount-avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255,255,255,.25);
}
.myaccount-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.myaccount-avatar-default {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.myaccount-user-info { min-width: 0; }
.myaccount-username {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.myaccount-useremail {
    font-size: 11px;
    opacity: .75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 네비게이션 */
.myaccount-nav { padding: 8px 0; }
.myaccount-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    border-left: 3px solid transparent;
    transition: all .15s;
    text-decoration: none;
}
.myaccount-nav-item:hover {
    background: #f8f0ff;
    color: var(--color-primary, #8B35C8);
    border-left-color: var(--color-primary, #8B35C8);
}
.myaccount-nav-item.is-active {
    background: #f5edfe;
    color: var(--color-primary, #8B35C8);
    border-left-color: var(--color-primary, #8B35C8);
    font-weight: 700;
}
.nav-icon { color: inherit; display: flex; flex-shrink: 0; }
.nav-label { flex: 1; }
.nav-arrow {
    color: #ccc;
    font-size: 16px;
    font-weight: 300;
    margin-left: auto;
}
.myaccount-nav-item:hover .nav-arrow,
.myaccount-nav-item.is-active .nav-arrow { color: var(--color-primary, #8B35C8); }

/* ─── 컨텐츠 영역 ─── */
.myaccount-content {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--color-border, #E8E8E8);
    min-height: 400px;
    padding: 28px;
}

/* WC 기본 스타일 오버라이드 */
.myaccount-content table.woocommerce-orders-table,
.myaccount-content table.shop_table { border: none; }
.myaccount-content .woocommerce-MyAccount-content > p:first-child { display: none; }

/* ─── 대시보드 ─── */
.dash-section { margin-bottom: 36px; }
.dash-section:last-child { margin-bottom: 0; }
.dash-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.dash-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-navy, #1A1A2E);
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-primary, #8B35C8);
    display: inline-block;
}
.dash-section-header .dash-section-title { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }
.dash-more-link {
    font-size: 13px;
    color: var(--color-text-muted, #666);
    transition: color .15s;
}
.dash-more-link:hover { color: var(--color-primary, #8B35C8); }

/* 주문 현황 카드 */
.dash-order-status {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.dash-status-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px;
    background: #f9f3ff;
    border-radius: 10px;
    border: 1px solid #eddcff;
    text-decoration: none;
    transition: all .2s;
    gap: 4px;
}
.dash-status-card:hover {
    background: #f0e0ff;
    border-color: var(--color-primary, #8B35C8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139,53,200,.12);
}
.dash-status-icon { font-size: 24px; line-height: 1; }
.dash-status-count {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-primary, #8B35C8);
    line-height: 1.2;
}
.dash-status-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* 흐름 화살표 */
.dash-status-arrow { margin-top: 10px; }
.dash-arrow-bar {
    display: flex;
    align-items: center;
    gap: 4px;
}
.dash-arrow-step {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    color: #aaa;
}
.dash-arrow-chevron {
    font-size: 16px;
    color: #ddd;
}

/* 주문 테이블 */
.dash-orders-table-wrap { overflow-x: auto; }
.dash-orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.dash-orders-table thead tr {
    border-bottom: 1px solid var(--color-border, #E8E8E8);
}
.dash-orders-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted, #666);
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
}
.dash-orders-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.dash-orders-table tr:last-child td { border-bottom: none; }
.dash-orders-table tr:hover td { background: #fafafa; }

.dash-order-num { font-weight: 600; color: var(--color-navy, #1A1A2E); }
.dash-order-product {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-order-date { color: var(--color-text-muted, #666); white-space: nowrap; }
.dash-order-total { font-weight: 600; white-space: nowrap; }

/* 상태 배지 */
.dash-order-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.dash-order-badge.status-pending    { background: #fff8e6; color: #b78105; }
.dash-order-badge.status-processing { background: #e8f4ff; color: #1a6dc8; }
.dash-order-badge.status-on-hold    { background: #fff0e6; color: #c86a1a; }
.dash-order-badge.status-completed  { background: #e8f9ee; color: #1a8843; }
.dash-order-badge.status-cancelled  { background: #f5f5f5; color: #888; }
.dash-order-badge.status-refunded   { background: #f5f5f5; color: #888; }
.dash-order-badge.status-failed     { background: #ffe8e8; color: #c81a1a; }

.dash-order-view-btn {
    display: inline-block;
    padding: 5px 12px;
    background: #fff;
    border: 1px solid var(--color-border, #E8E8E8);
    border-radius: 4px;
    font-size: 12px;
    color: #555;
    transition: all .15s;
    white-space: nowrap;
}
.dash-order-view-btn:hover {
    border-color: var(--color-primary, #8B35C8);
    color: var(--color-primary, #8B35C8);
}

/* 빈 상태 */
.dash-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-muted, #666);
}
.dash-empty p { margin-bottom: 16px; }
.dash-shop-btn {
    display: inline-flex;
    padding: 12px 28px;
    background: var(--color-primary, #8B35C8);
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    transition: background .2s;
}
.dash-shop-btn:hover { background: var(--color-primary-dark, #6B1FA8); color: #fff; }

/* ─── 주문 목록 페이지 ─── */
.myorders-section { padding: 0; }
.myorders-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-navy, #1A1A2E);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-primary, #8B35C8);
    display: inline-block;
}

.myorders-list { display: flex; flex-direction: column; gap: 16px; }
.myorder-card {
    border: 1px solid var(--color-border, #E8E8E8);
    border-radius: 10px;
    overflow: hidden;
}
.myorder-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #FAFAFA;
    border-bottom: 1px solid var(--color-border, #E8E8E8);
    gap: 12px;
    flex-wrap: wrap;
}
.myorder-meta { display: flex; align-items: center; gap: 12px; }
.myorder-num {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-navy, #1A1A2E);
}
.myorder-date { font-size: 13px; color: var(--color-text-muted, #666); }
.myorder-header-right { display: flex; align-items: center; gap: 10px; }
.myorder-detail-btn {
    padding: 5px 12px;
    background: #fff;
    border: 1px solid var(--color-border, #E8E8E8);
    border-radius: 4px;
    font-size: 12px;
    color: #555;
    transition: all .15s;
}
.myorder-detail-btn:hover {
    border-color: var(--color-primary, #8B35C8);
    color: var(--color-primary, #8B35C8);
}

.myorder-items { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.myorder-item {
    display: flex;
    align-items: center;
    gap: 12px;
}
.myorder-item-thumb {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f5f5;
}
.myorder-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.myorder-item-info { flex: 1; min-width: 0; }
.myorder-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-navy, #1A1A2E);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.myorder-item-qty { font-size: 13px; color: var(--color-text-muted, #666); }
.myorder-item-price { font-size: 14px; font-weight: 700; white-space: nowrap; }

.myorder-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #FAFAFA;
    border-top: 1px solid var(--color-border, #E8E8E8);
}
.myorder-total-label { font-size: 14px; font-weight: 600; color: #444; }
.myorder-total-price {
    font-size: 17px;
    font-weight: 800;
    color: var(--color-primary, #8B35C8);
}

/* 페이지네이션 */
.myorders-paging {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}
.myorders-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid var(--color-border, #E8E8E8);
    font-size: 14px;
    color: #555;
    background: #fff;
    transition: all .15s;
}
.myorders-page-btn:hover { border-color: var(--color-primary, #8B35C8); color: var(--color-primary, #8B35C8); }
.myorders-page-btn.is-active {
    background: var(--color-primary, #8B35C8);
    border-color: var(--color-primary, #8B35C8);
    color: #fff;
}

/* ─── WC 폼 스타일 (회원정보 수정, 주소 등) ─── */
.myaccount-content .woocommerce-MyAccount-content h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-navy, #1A1A2E);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border, #E8E8E8);
}
.myaccount-content .woocommerce-address-fields label,
.myaccount-content .woocommerce-EditAccountForm label,
.myaccount-content .woocommerce-password-strength { font-size: 14px; }
.myaccount-content input[type="text"],
.myaccount-content input[type="email"],
.myaccount-content input[type="tel"],
.myaccount-content input[type="password"],
.myaccount-content select,
.myaccount-content textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: var(--color-navy, #1A1A2E);
    background: #fff;
    transition: border-color .15s;
}
.myaccount-content input:focus,
.myaccount-content select:focus,
.myaccount-content textarea:focus {
    outline: none;
    border-color: var(--color-primary, #8B35C8);
    box-shadow: 0 0 0 3px rgba(139,53,200,.08);
}
.myaccount-content .button,
.myaccount-content button[type="submit"],
.myaccount-content input[type="submit"] {
    padding: 12px 28px;
    background: var(--color-primary, #8B35C8);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
}
.myaccount-content .button:hover,
.myaccount-content button[type="submit"]:hover,
.myaccount-content input[type="submit"]:hover {
    background: var(--color-primary-dark, #6B1FA8);
}

/* ─── 반응형 ─── */
@media (max-width: 900px) {
    .myaccount-inner {
        grid-template-columns: 1fr;
    }
    .myaccount-sidebar {
        position: static;
    }
    .dash-order-status { grid-template-columns: repeat(4, 1fr); }
    .myaccount-content { padding: 20px; }
}

@media (max-width: 600px) {
    .myaccount-wrap { padding: 20px 0 60px; }
    .dash-order-status { grid-template-columns: repeat(2, 1fr); }
    .dash-orders-table { font-size: 13px; }
    .dash-orders-table th,
    .dash-orders-table td { padding: 10px 8px; }
    .dash-arrow-bar { display: none; }
    .myorder-card-header { flex-direction: column; align-items: flex-start; gap: 8px; }

    /* 대시보드 테이블: 일부 컬럼 숨김 */
    .dash-orders-table .dash-order-date { display: none; }
}
