/* Pilehead Modern My Account Design */

/* General Container Fixes */
.woocommerce-account .woocommerce {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1632px; /* Updated to match Home/Cart width */
    margin: 40px auto;
    padding: 0 20px;
    font-family: 'Inter', sans-serif;
}

/* Force Parent Container Expansion */
@media (min-width: 1200px) {
    .woocommerce-account .phst-container {
        max-width: 1632px !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

/* Sidebar Navigation */
.woocommerce-MyAccount-navigation {
    flex: 0 0 260px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    padding: 20px 0;
    height: fit-content;
}

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

.woocommerce-MyAccount-navigation ul li {
    margin: 0;
    padding: 0;
}

.woocommerce-MyAccount-navigation ul li a {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    color: #4b5563;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.woocommerce-MyAccount-navigation ul li a:hover {
    background: #f9fafb;
    color: #111827;
}

.woocommerce-MyAccount-navigation ul li.is-active a {
    background: #f3f4f6;
    color: #2563eb; /* Brand Blue */
    border-left-color: #2563eb;
    font-weight: 600;
}

/* Icons for Navigation Items (Pseudo-elements or expected classes) */
/* We will inject icons via JS or modify the template, but CSS content fallback */
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--dashboard a::before { content: "\f0e4"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-right: 12px; width: 20px; text-align: center; }
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--orders a::before { content: "\f468"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-right: 12px; width: 20px; text-align: center; }
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--downloads a::before { content: "\f019"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-right: 12px; width: 20px; text-align: center; }
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--edit-address a::before { content: "\f3c5"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-right: 12px; width: 20px; text-align: center; }
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--edit-account a::before { content: "\f007"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-right: 12px; width: 20px; text-align: center; }
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--customer-logout a::before { content: "\f2f5"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-right: 12px; width: 20px; text-align: center; }
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--payment-methods a::before { content: "\f09d"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-right: 12px; width: 20px; text-align: center; }


/* Main Content Area */
.woocommerce-MyAccount-content {
    flex: 1;
    min-width: 0; /* Fix flex overflow */
}

/* Dashboard Greeting */
.woocommerce-MyAccount-content p {
    color: #6b7280;
    line-height: 1.6;
    font-size: 15px;
}

.woocommerce-MyAccount-content p a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.woocommerce-MyAccount-content p a:hover {
    text-decoration: underline;
}

/* Dashboard Cards (Custom Grid for Dashboard Overview) */
.ph-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.ph-dashboard-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.ph-dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-color: #2563eb;
}

.ph-card-icon {
    font-size: 32px;
    color: #2563eb;
    margin-bottom: 16px;
    background: #eff6ff;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.ph-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}

.ph-card-desc {
    font-size: 14px;
    color: #6b7280;
}

/* Orders Table Modernization */
.woocommerce-orders-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.woocommerce-orders-table thead th {
    background: #f9fafb;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.woocommerce-orders-table tbody td {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    color: #4b5563;
    font-size: 14px;
}

.woocommerce-orders-table tbody tr:last-child td {
    border-bottom: none;
}

.woocommerce-button {
    display: inline-block;
    padding: 8px 16px;
    background: #2563eb;
    color: #fff !important;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
}

.woocommerce-button:hover {
    background: #1d4ed8;
}

/* Addresses Grid */
.u-columns.woocommerce-Addresses {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.u-column--billing-address, .u-column--shipping-address {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
}

.woocommerce-Address-title h3 {
    font-size: 20px;
    margin-top: 0;
    color: #111827;
}

.edit-link {
    float: right;
    font-size: 14px;
    color: #2563eb;
    text-decoration: none;
}

address {
    font-style: normal;
    color: #4b5563;
    line-height: 1.6;
    margin-top: 16px;
}

/* Account Details Form */
.woocommerce-EditAccountForm fieldset {
    border: 1px solid #e5e7eb;
    padding: 24px;
    border-radius: 12px;
    margin-top: 30px;
}

.woocommerce-EditAccountForm legend {
    font-weight: 600;
    padding: 0 10px;
    color: #111827;
}

.woocommerce-Input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    margin-top: 6px;
    transition: border 0.2s;
}

.woocommerce-Input:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.woocommerce-form-row {
    margin-bottom: 20px;
}

.woocommerce-form-row label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .woocommerce-account .woocommerce {
        flex-direction: column;
    }

    .woocommerce-MyAccount-navigation {
        flex: none;
        width: 100%;
        overflow-x: auto;
    }
    
    .woocommerce-MyAccount-navigation ul {
        display: flex;
        padding-bottom: 10px;
    }
    
    .woocommerce-MyAccount-navigation ul li {
        flex: 0 0 auto;
    }
    
    .woocommerce-MyAccount-navigation ul li a {
        padding: 10px 16px;
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
        border-radius: 0;
    }
    
    .woocommerce-MyAccount-navigation ul li.is-active a {
        background: transparent;
        border-left: none;
        border-bottom-color: #2563eb;
    }

    .ph-dashboard-grid {
        grid-template-columns: 1fr;
    }
}
