/* ===== Account Page Styles ===== */
.account-page {
    min-height: 100vh;
    background: var(--bg-primary);
}

.account-header {
    background: var(--text-primary);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.account-header .navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.account-header .logo img {
    height: 40px;
    width: auto;
}

.account-back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffffff;
    text-decoration: none;
    font-family: var(--font-arabic);
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.account-back-link:hover {
    opacity: 0.7;
}

.account-main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.account-greeting {
    margin-bottom: 2rem;
}

.account-greeting h1 {
    font-family: var(--font-arabic);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.account-greeting p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Tabs */
.account-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
    overflow-x: auto;
}

.account-tab {
    padding: 0.85rem 1.5rem;
    border: none;
    background: none;
    font-family: var(--font-arabic);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.2s;
}

.account-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    left: 0;
    height: 2px;
    background: transparent;
    transition: background 0.2s;
}

.account-tab.active {
    color: var(--text-primary);
    font-weight: 600;
}

.account-tab.active::after {
    background: var(--text-primary);
}

.account-tab:hover {
    color: var(--text-primary);
}

.account-tab i {
    margin-left: 0.4rem;
}

/* Tab panels */
.account-panel {
    display: none;
    animation: fadeInPanel 0.3s;
}

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

@keyframes fadeInPanel {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Orders */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: box-shadow 0.2s;
}

.order-card:hover {
    box-shadow: var(--shadow-sm);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.order-number {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.order-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.order-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

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

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

.order-status.shipped {
    background: #e0e7ff;
    color: #3730a3;
}

.order-status.delivered {
    background: #dcfce7;
    color: #166534;
}

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

.order-items-preview {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.order-item-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.order-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.order-total {
    font-weight: 600;
    color: var(--text-primary);
}

/* Wishlist */
.wishlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

.wishlist-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.wishlist-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.wishlist-card-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.wishlist-card-body {
    padding: 0.75rem;
}

.wishlist-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wishlist-card-price {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.wishlist-card-actions {
    display: flex;
    gap: 0.5rem;
}

.wishlist-card-actions button {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-arabic);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.wishlist-card-actions .wishlist-add-cart {
    background: var(--text-primary);
    color: #ffffff;
    border-color: var(--text-primary);
}

.wishlist-card-actions .wishlist-remove {
    color: #b91c1c;
    border-color: #fca5a5;
}

.wishlist-card-actions .wishlist-remove:hover {
    background: #fee2e2;
}

/* Addresses */
.addresses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.address-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    position: relative;
}

.address-card.is-default {
    border-color: var(--accent-primary);
}

.address-default-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--accent-glow);
    color: var(--accent-dark);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}

.address-card-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.address-card-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.address-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.address-card-actions button {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-arabic);
    font-size: 0.8rem;
    cursor: pointer;
    background: var(--bg-primary);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.address-card-actions button:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.address-card-actions .address-delete:hover {
    border-color: #b91c1c;
    color: #b91c1c;
}

.add-address-card {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    min-height: 160px;
    color: var(--text-muted);
}

.add-address-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.add-address-card i {
    font-size: 1.5rem;
}

/* Address Form Modal */
.address-form-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    display: none;
}

.address-form-overlay.active {
    display: block;
}

.address-form-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 480px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 2rem;
    z-index: 9999;
    display: none;
    max-height: 90vh;
    overflow-y: auto;
}

.address-form-modal.active {
    display: block;
}

.address-form-modal h3 {
    font-family: var(--font-arabic);
    font-size: 1.2rem;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.address-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.address-form .auth-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.address-form label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    display: block;
}

.address-form input,
.address-form select,
.address-form textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-arabic);
    font-size: 0.9rem;
    background: var(--bg-secondary);
    transition: border-color 0.2s;
}

.address-form input:focus,
.address-form select:focus,
.address-form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.address-form textarea {
    resize: vertical;
    min-height: 70px;
}

.address-form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.address-form-actions button {
    flex: 1;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-arabic);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.address-form-actions .btn-save-address {
    background: var(--text-primary);
    color: #ffffff;
    border: none;
}

.address-form-actions .btn-save-address:hover {
    background: var(--accent-dark);
}

.address-form-actions .btn-cancel-address {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Profile settings */
.profile-form {
    max-width: 500px;
}

.profile-form .auth-field {
    margin-bottom: 1rem;
}

.profile-form .auth-submit-btn {
    max-width: 200px;
}

/* Empty states */
.account-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.account-empty i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.account-empty p {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.account-empty a {
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: underline;
}

/* Logout button */
.account-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: 1px solid #fca5a5;
    border-radius: var(--radius-sm);
    background: #fff;
    color: #b91c1c;
    font-family: var(--font-arabic);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 2rem;
}

.account-logout-btn:hover {
    background: #fee2e2;
}

/* Mobile */
@media (max-width: 768px) {
    .account-main {
        padding: 1.5rem 1rem 3rem;
    }

    .account-tabs {
        gap: 0;
    }

    .account-tab {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .wishlist-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

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

    .order-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== Points Tab ===== */
.points-wrap { display: flex; flex-direction: column; gap: 24px; }

.points-balance-card {
    background: linear-gradient(135deg, var(--text-primary, #14161a) 0%, #1f2329 100%);
    color: #fff;
    border-radius: 18px;
    padding: 28px 24px;
    text-align: center;
    border: 1px solid var(--accent-light, #BFC5CC);
    box-shadow: 0 6px 28px rgba(0,0,0,0.18);
}
.points-balance-label {
    color: var(--accent-light, #BFC5CC);
    letter-spacing: 2px;
    font-size: 0.78rem;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.points-balance-value {
    font-size: 2.6rem;
    font-weight: 700;
    margin-bottom: 18px;
}
.points-balance-value small {
    font-size: 1rem;
    color: rgba(255,255,255,0.6);
    margin-inline-start: 6px;
    font-weight: 400;
}
.points-progress { margin-bottom: 18px; }
.points-progress-bar {
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}
.points-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary, #6E737A), var(--accent-light, #BFC5CC));
    border-radius: 999px;
    transition: width 0.4s ease;
}
.points-progress-meta {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}
.points-redeem-btn {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    background: #fff;
    color: var(--text-primary, #14161a);
    border: none;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.points-redeem-btn:not(:disabled):hover { transform: translateY(-1px); }
.points-redeem-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.points-rule-hint {
    margin: 14px 0 0;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
}

.points-section {
    background: var(--bg-secondary, #fff);
    border: 1px solid var(--border-color, #eee);
    border-radius: 14px;
    padding: 18px;
}
.points-section h3 {
    margin: 0 0 14px;
    font-size: 1rem;
    color: var(--text-primary, #14161a);
    display: flex;
    align-items: center;
    gap: 8px;
}
.points-section h3 i { color: var(--accent-primary, #6E737A); }

.points-codes-list, .points-history-list { display: flex; flex-direction: column; gap: 10px; }
.points-code-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-tertiary, #eeeef1);
    border: 1px dashed var(--accent-primary, #6E737A);
    border-radius: 10px;
}
.points-code-code {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-primary, #14161a);
}
.points-code-meta {
    font-size: 0.78rem;
    color: var(--text-muted, #666);
    margin-top: 4px;
}
.points-code-copy {
    background: #14161a;
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.points-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-primary, #fafafa);
    border-radius: 10px;
    border: 1px solid var(--border-color, #eee);
}
.points-history-meta { display: flex; flex-direction: column; gap: 2px; font-size: 0.9rem; }
.points-history-date { font-size: 0.75rem; color: var(--text-muted, #888); }
.points-history-amount {
    font-weight: 700;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
}
.points-history-amount.pos { color: #16a34a; }
.points-history-amount.neg { color: #dc2626; }

.account-empty-mini {
    color: var(--text-muted, #888);
    font-size: 0.88rem;
    text-align: center;
    padding: 18px 8px;
}
