/* ============================================
   Custom Account Page
   ============================================ */

.custom-account-page {
    background: #f8f9fa;
    min-height: 100vh;
    padding: 60px 0;
}

.custom-account-container {
    max-width: 1340px;
    margin: 0 auto;
    padding: 0 30px;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
    align-items: start;
}

/* ============================================
   Sidebar
   ============================================ */

.custom-account-sidebar {
    position: sticky;
    top: 100px;
}

.account-user-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid #e5e7eb;
}

.account-user-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--tl-primary,#dc4d28);
    box-shadow: 0 4px 12px color-mix(in srgb,var(--tl-primary,#dc4d28) 20%,transparent);
}

.account-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-user-info {
    color: #1f2937;
}


/* Navigation */
.account-nav {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.account-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.account-nav-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    color: #374151;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.account-nav-item a svg {
    flex-shrink: 0;
    stroke: #6b7280;
    transition: stroke 0.3s ease;
}

.account-nav-item:hover a,
.account-nav-item.active a {
    background: linear-gradient(90deg, color-mix(in srgb,var(--tl-primary,#dc4d28) 10%,transparent) 0%, transparent 100%);
    color: var(--tl-primary,#dc4d28);
    border-left-color: var(--tl-primary,#dc4d28);
}

.account-nav-item:hover a svg,
.account-nav-item.active a svg {
    stroke: var(--tl-primary,#dc4d28);
}

.account-nav-logout {
    border-top: 1px solid #e5e7eb;
}

.account-nav-logout a {
    color: #ef4444;
}

.account-nav-logout a svg {
    stroke: #ef4444;
}

.account-nav-logout:hover a {
    background: #fee2e2;
    border-left-color: #ef4444;
}

/* ============================================
   Main Content
   ============================================ */

.custom-account-content {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 48px;
}

.account-tab {
    display: none;
}

.account-tab.active {
    display: block;
}

.account-tab-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
}

.account-tab-title {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 12px 0;
}

.account-tab-description {
    font-size: 16px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

/* ============================================
   Dashboard
   ============================================ */

.dashboard-section-title {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 24px 0;
}

.orders-list {
    display: grid;
    gap: 20px;
    margin-bottom: 32px;
}

.order-card {
    background: #f8f9fa;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
}

.order-card:hover {
    border-color: var(--tl-primary,#dc4d28);
    box-shadow: 0 4px 12px color-mix(in srgb,var(--tl-primary,#dc4d28) 10%,transparent);
    transform: translateY(-2px);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.order-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--tl-primary,#dc4d28);
}

.order-status.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.order-status.status-processing {
    background: #dbeafe;
    color: #1e40af;
}

.order-status.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.order-status.status-cancelled,
.order-status.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.order-status.status-on-hold {
    background: #e5e7eb;
    color: #374151;
}

.order-card-body {
    margin-bottom: 16px;
}

.order-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.order-total {
    font-size: 18px;
    color: #1f2937;
}

.order-card-footer {
    text-align: right;
}

.btn-view-order {
    display: inline-block;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--tl-primary,#dc4d28);
    background: transparent;
    border: 2px solid var(--tl-primary,#dc4d28);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-view-order:hover {
    background: var(--tl-primary,#dc4d28);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px color-mix(in srgb,var(--tl-primary,#dc4d28) 30%,transparent);
}

.dashboard-view-all {
    text-align: center;
}

/* ============================================
   Orders Table
   ============================================ */

.orders-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table thead {
    background: #f8f9fa;
}

.orders-table th {
    padding: 18px 20px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e5e7eb;
}

.orders-table td {
    padding: 18px 20px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 15px;
    color: #374151;
}

.orders-table tbody tr:hover {
    background: #f8f9fa;
}

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

.order-link {
    color: var(--tl-primary,#dc4d28);
    font-weight: 600;
    text-decoration: none;
}

.order-link:hover {
    text-decoration: underline;
}

/* ============================================
   Profile Form
   ============================================ */

.account-form {
    max-width: 800px;
}

.form-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 32px;
}

.form-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.form-section-description {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 24px 0;
}

/* Override WooCommerce form-row styles */
.custom-account-page .form-row {
    margin-bottom: 0;
    margin-right: 0 !important;
    margin-left: 0 !important;
}

.custom-account-page .form-row::before,
.custom-account-page .form-row::after {
    display: none !important;
    content: none !important;
}

.custom-account-page .form-row-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #fff;
}

.form-group input:focus {
    outline: none;
    border-color: var(--tl-primary,#dc4d28);
    box-shadow: 0 0 0 3px color-mix(in srgb,var(--tl-primary,#dc4d28) 10%,transparent);
}

.form-group small {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
}

.form-actions {
    padding-top: 24px;
    border-top: 2px solid #e5e7eb;
}

/* ============================================
   Addresses
   ============================================ */

.addresses-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.address-card {
    background: #f8f9fa;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 28px;
    transition: all 0.3s ease;
}

.address-card:hover {
    border-color: var(--tl-primary,#dc4d28);
    box-shadow: 0 4px 12px color-mix(in srgb,var(--tl-primary,#dc4d28) 10%,transparent);
}

.address-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 20px 0;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.address-card-content {
    margin-bottom: 24px;
    min-height: 120px;
}

.address-card-content p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
}

.address-empty {
    color: #9ca3af;
    font-style: italic;
}

.address-card-actions {
    text-align: right;
}

/* ============================================
   Buttons
   ============================================ */

.custom-account-page .btn-primary {
    display: inline-block;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--tl-primary,#dc4d28) 0%, var(--tl-primary-dark,#b83d1f) 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px color-mix(in srgb,var(--tl-primary,#dc4d28) 30%,transparent);
}

.custom-account-page .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px color-mix(in srgb,var(--tl-primary,#dc4d28) 40%,transparent);
}

.custom-account-page .btn-action {
    display: inline-block;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--tl-primary,#dc4d28);
    background: transparent;
    border: 2px solid var(--tl-primary,#dc4d28);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.custom-account-page .btn-action:hover {
    background: var(--tl-primary,#dc4d28);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px color-mix(in srgb,var(--tl-primary,#dc4d28) 30%,transparent);
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state svg {
    margin: 0 auto 32px;
    color: #9ca3af;
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 12px 0;
}

.empty-state p {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 32px 0;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1024px) {
    .custom-account-container {
        grid-template-columns: 280px 1fr;
        gap: 30px;
    }

    .custom-account-content {
        padding: 36px;
    }
}

@media (max-width: 992px) {
    .custom-account-container {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .custom-account-sidebar {
        position: static;
    }

    .addresses-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .custom-account-page {
        padding: 40px 0;
    }

    .custom-account-container {
        padding: 0 20px;
    }

    .custom-account-content {
        padding: 28px 20px;
    }

    .account-tab-title {
        font-size: 26px;
    }

    .custom-account-page .form-row-half {
        grid-template-columns: 1fr !important;
        gap: 0;
        margin-bottom: 24px;
    }

    /* Stack orders table */
    .orders-table {
        display: block;
    }

    .orders-table thead {
        display: none;
    }

    .orders-table tbody,
    .orders-table tr,
    .orders-table td {
        display: block;
        width: 100%;
    }

    .orders-table tr {
        margin-bottom: 20px;
        border: 2px solid #e5e7eb;
        border-radius: 12px;
        overflow: hidden;
    }

    .orders-table td {
        padding: 14px 16px;
        position: relative;
        padding-left: 45%;
        text-align: right;
        border-bottom: 1px solid #e5e7eb;
    }

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

    .orders-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 16px;
        font-weight: 700;
        text-transform: uppercase;
        font-size: 12px;
        color: #6b7280;
    }
}
