/* ==========================================================================
   SIRAJ ARCHITECTURAL ACCOUNT DRAWER (.account-drawer-overlay & .account-drawer-panel)
   Matching the Floating Header Anchor aesthetic of .cart-drawer-overlay
   ========================================================================== */

:root {
    --acc-bg: #FAF9F5;
    --acc-surface: #FFFFFF;
    --acc-text: #1C1917;
    --acc-muted: #8A8580;
    --acc-border: rgba(0, 0, 0, 0.08);
    --acc-warm: #D74E09;
    --acc-warm-glow: rgba(215, 78, 9, 0.15);
    --acc-emerald: #16A34A;
}

/* ==========================================================================
   1. HEADER TRIGGER BUTTON & ACTIVE / AUTHENTICATED STATES
   ========================================================================== */

.header-user-btn {
    position: relative;
    transition: all 0.25s ease;
}

/* Green Authenticated Status Dot */
.user-status-dot {
    position: absolute;
    top: 4px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    border: 2px solid #FFFFFF;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
    display: none;
    pointer-events: none;
}

.header-user-btn.is-authenticated .user-status-dot {
    display: block;
}

/* Header User Icon Active Orange State (Exact Match to Cart & Wishlist Trigger) */
.header-user-btn.is-active,
#accountDrawerTrigger.is-active {
    color: #D74E09 !important;
    border-radius: 50%;
    transform: scale(1.08);
}

.header-user-btn.is-active svg,
#accountDrawerTrigger.is-active svg {
    stroke: #D74E09 !important;
    color: #D74E09 !important;
}

.header-user-btn.is-active svg path,
#accountDrawerTrigger.is-active svg path {
    stroke: #D74E09 !important;
}

/* ==========================================================================
   2. OVERLAY & BACKDROP (Identical floating model to cart-drawer-overlay)
   ========================================================================== */

.account-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    direction: rtl;
    font-family: inherit;
}

.account-drawer-overlay.is-open {
    pointer-events: auto;
    opacity: 1;
}

/* Clean Backdrop (No Blur or Background Dim Tint, matching Cart Drawer) */
.account-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10001;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: transparent;
    cursor: pointer;
}

/* ==========================================================================
   3. FLOATING TOP-HANGING PANEL (Hanging from Header under User Icon)
   ========================================================================== */

.account-drawer-panel {
    position: fixed;
    top: 85px;
    left: 50px;
    z-index: 10002;
    width: calc(100% - 32px);
    max-width: 450px;
    max-height: calc(88vh - 76px);
    background: #FAF9F5;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-top: 3px solid #d74e09 !important;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform: translateY(-20px) scale(0.96);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.42s cubic-bezier(0.16, 1, 0.3, 1),
                max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity, height;
    box-shadow: 0 0 0 1px rgba(215, 78, 9, 0.2), 0 20px 50px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    overflow: visible;
    direction: rtl;
    color: var(--acc-text);
}

.account-drawer-body,
.account-items-body {
    transition: min-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: min-height;
}

/* Fluid Item Removal Collapse Animation */
.user-order-card.is-removing,
.user-address-card.is-removing {
    opacity: 0 !important;
    transform: scale(0.92) translateX(-24px) !important;
    max-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-width: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Caret Arrow / Visual Connection Bridge linking Panel to Header User Icon */
.account-drawer-panel::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 36px;
    width: 12px;
    height: 12px;
    background: #FAF9F5;
    border-top: 2px solid #D74E09;
    border-left: 2px solid #D74E09;
    transform: rotate(45deg);
    z-index: 10003;
}

.account-drawer-overlay.is-open .account-drawer-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

@media (max-width: 768px) {
    .account-drawer-panel {
        top: 68px;
        left: 16px;
        right: 16px;
        width: auto;
        max-width: none;
        max-height: calc(85vh - 68px);
    }
    .account-drawer-panel::before {
        left: 32px;
    }
}

/* ==========================================================================
   4. PANEL HEADER (Styled exactly like .cart-header)
   ========================================================================== */

.account-header,
.account-drawer-header {
    padding: 24px 24px 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: #FAF9F5;
    flex-shrink: 0;
    border-radius: 24px 24px 0 0;
}

.account-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.account-title,
.account-drawer-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: #1C1917;
    margin: 0;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-count-badge {
    color: #8A8580;
    font-weight: 500;
    font-size: 0.92rem;
}

.account-close-btn,
.account-drawer-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.03);
    color: #1C1917;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

.account-close-btn:hover,
.account-drawer-close:hover {
    background: #1C1917;
    color: #FFFFFF;
    border-color: #1C1917;
    transform: rotate(90deg);
}

.account-status-info {
    font-size: 0.78rem;
    color: #605953;
    line-height: 1.4;
}

.account-status-info strong {
    color: #D74E09;
}

/* ==========================================================================
   5. PANEL SCROLLABLE BODY (Styled like .cart-items-body)
   ========================================================================== */

.account-items-body,
.account-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: none;
    min-height: 0;
}

.account-items-body::-webkit-scrollbar,
.account-drawer-body::-webkit-scrollbar {
    display: none;
}

/* ==========================================================================
   6. VIEW 1: AUTHENTICATION / PHONE OTP LOGIN CARD
   ========================================================================== */

.auth-flow-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-box-card {
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 18px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}


.auth-input-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-phone-field {
    display: flex;
    align-items: center;
    background: var(--acc-surface);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.auth-phone-field:focus-within {
    border-color: var(--acc-warm);
    box-shadow: 0 0 0 3px var(--acc-warm-glow);
}

.country-flag-prefix {
    background: rgba(0, 0, 0, 0.03);
    padding: 0 12px;
    height: 46px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.86rem;
    font-weight: 700;
    color: #4B5563;
    border-left: 1px solid var(--acc-border);
    direction: ltr;
}

.auth-phone-input {
    flex: 1;
    height: 46px;
    border: none;
    padding: 0 12px;
    font-family: inherit;
    font-size: 0.96rem;
    color: var(--acc-text);
    outline: none;
    direction: ltr;
    text-align: left;
    background: transparent;
}

.auth-submit-btn {
    width: 100%;
    height: 46px;
    background: var(--acc-warm);
    color: #FFFFFF;
    border: none;
    border-radius: 30px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(215, 78, 9, 0.2);
}

.auth-submit-btn:hover {
    background: #B63E04;
    transform: translateY(-1px);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* OTP Step */
.otp-step-panel {
    display: none;
    flex-direction: column;
    gap: 14px;
    animation: fadeInAcc 0.25s ease;
}

.otp-step-panel.is-active {
    display: flex;
}

.otp-code-input {
    height: 48px;
    background: var(--acc-surface);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.35em;
    font-family: monospace;
    outline: none;
    color: var(--acc-warm);
    transition: all 0.2s ease;
}

.otp-code-input:focus {
    border-color: var(--acc-warm);
    box-shadow: 0 0 0 3px var(--acc-warm-glow);
}

.otp-helper-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--acc-muted);
    margin-bottom: 24px;
}

.otp-phone-display {
    font-size: 0.82rem;
    color: var(--acc-muted);
    line-height: 1.6;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.otp-phone-number {
    direction: ltr !important;
    unicode-bidi: isolate !important;
    display: inline-flex;
    align-items: center;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, monospace, sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--acc-warm, #D74E09);
    padding: 2px 8px;
    letter-spacing: 0.8px;
}

.btn-resend-otp {
    background: none;
    border: none;
    color: var(--acc-warm);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ==========================================================================
   7. VIEW 2: AUTHENTICATED CUSTOMER DASHBOARD
   ========================================================================== */

.account-profile-view {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.account-profile-view.is-active {
    display: flex;
}

/* User Identity Card */
.user-identity-card {
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.identity-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.identity-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--acc-warm-glow);
    color: var(--acc-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
}

.identity-phone {
    font-weight: 700;
    font-size: 0.92rem;
    direction: ltr;
    text-align: right;
}

.identity-badge {
    font-size: 0.74rem;
    color: var(--acc-emerald);
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.btn-signout-mini {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--acc-border);
    color: #605953;
    padding: 6px 12px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-signout-mini:hover {
    background: rgba(244, 63, 94, 0.1);
    color: #DC2626;
    border-color: rgba(244, 63, 94, 0.2);
}

/* Dashboard Navigation Tabs */
.account-nav-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    padding: 3px;
    gap: 4px;
}

.acc-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--acc-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.acc-tab-btn.is-active {
    background: #FFFFFF;
    color: var(--acc-text);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    font-weight: 700;
}

/* Tab Panels */
.tab-content-panel {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.tab-content-panel.is-active {
    display: flex;
}

/* ==========================================================================
   8. ORDER CARDS (Styled similarly to .cart-item-card)
   ========================================================================== */

.user-order-card {
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.user-order-card:hover {
    border-color: rgba(215, 78, 9, 0.25);
    box-shadow: 0 4px 14px rgba(215, 78, 9, 0.06);
}

.user-order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-order-num {
    font-family: monospace;
    font-weight: 700;
    font-size: 0.86rem;
    color: var(--acc-text);
}

.user-order-status {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 12px;
}

.status-badge-new { background: rgba(2, 132, 199, 0.1); color: #0284C7; }
.status-badge-proc { background: rgba(217, 119, 6, 0.1); color: #D97706; }
.status-badge-ship { background: rgba(147, 51, 234, 0.1); color: #9333EA; }
.status-badge-deliv { background: rgba(22, 163, 74, 0.1); color: #16A34A; }

.user-order-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
}

.user-order-price {
    font-weight: 800;
    color: var(--acc-warm);
    font-size: 0.95rem;
}

.btn-track-mini {
    padding: 5px 12px;
    background: rgba(215, 78, 9, 0.08);
    border: 1px solid rgba(215, 78, 9, 0.18);
    border-radius: 9px;
    color: var(--acc-warm);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-track-mini:hover {
    background: var(--acc-warm);
    color: #FFFFFF;
    border-color: var(--acc-warm);
}

/* ==========================================================================
   9. ADDRESS CARDS & ADD ADDRESS FORM
   ========================================================================== */

.user-address-card {
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.user-address-card:hover {
    border-color: rgba(215, 78, 9, 0.2);
}

.user-address-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.user-address-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.address-label-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--acc-warm);
    background: var(--acc-warm-glow);
    padding: 2px 7px;
    border-radius: 6px;
    white-space: nowrap;
}

.address-text-city {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--acc-text);
}

.address-text-district {
    font-size: 0.78rem;
    color: var(--acc-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.btn-delete-addr {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: #9CA3AF;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.btn-delete-addr:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #DC2626;
    border-color: rgba(239, 68, 68, 0.2);
}

.add-address-box {
    background: rgba(0, 0, 0, 0.02);
    border: 1px dashed rgba(0, 0, 0, 0.14);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.addr-input {
    height: 38px;
    background: #FFFFFF;
    border: 1px solid var(--acc-border);
    border-radius: 10px;
    padding: 0 12px;
    font-family: inherit;
    font-size: 0.84rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.addr-input:focus {
    border-color: var(--acc-warm);
    box-shadow: 0 0 0 2px var(--acc-warm-glow);
}

.btn-save-addr {
    height: 38px;
    background: var(--acc-text);
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-save-addr:hover {
    background: #000000;
}

/* ==========================================================================
   10. PANEL FOOTER (Matching cart-trust-note & footer style)
   ========================================================================== */

.account-footer {
    padding: 14px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: #FAF9F5;
    flex-shrink: 0;
    border-radius: 0 0 24px 24px;
}

.account-trust-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.76rem;
    color: #8A8580;
}

.account-trust-note svg {
    color: #D74E09;
    stroke: #D74E09;
}

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

/* ==========================================================================
   11. MODERN ARCHITECTURAL LOADING STATES & SKELETONS
   ========================================================================== */

/* Base Shimmer Wave Animation */
.skeleton-shimmer {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.04) 25%, rgba(0, 0, 0, 0.09) 50%, rgba(0, 0, 0, 0.04) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmerWave 1.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    border-radius: 8px;
    display: inline-block;
}

@keyframes skeletonShimmerWave {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Account Skeleton Cards */
.account-skeleton-card {
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.account-skeleton-card.compact {
    padding: 10px 14px;
    gap: 6px;
    border-radius: 12px;
}

.skeleton-line {
    height: 12px;
    border-radius: 6px;
}

.skeleton-pill {
    height: 18px;
    border-radius: 10px;
}

/* Smooth Fade In when content arrives */
.loaded-fade-in {
    animation: contentFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

