/* =========================================================
   USER MENU — action icons + avatar dropdown + drawers
   ========================================================= */

.header_right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* =========================================================
   ACTION ICON ROW
   ========================================================= */

.header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.header-actions .icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .18s ease, color .18s ease;
}
.header-actions .icon-btn i {
    font-size: 17px;
    transition: transform .18s ease;
}
.header-actions .icon-btn:hover {
    background: #f1f5f9;
    color: #ff7a00;
}
.header-actions .icon-btn:hover i { transform: scale(1.08); }
.header-actions .icon-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 122, 0, .25);
}

/* ---------- Badges ---------- */
.icon-btn .badge,
.dropdown-action .badge {
    position: absolute;
    top: 5px;
    right: 5px;
    min-width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #ff7a00;
    box-shadow: 0 0 0 2px #fff;
}
.icon-btn .badge.with-count,
.dropdown-action .badge.with-count {
    top: 3px;
    right: 3px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================================
   AVATAR BUTTON
   ========================================================= */

.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-btn-logged {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 3px 10px 3px 3px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: background .18s, border-color .18s;
}
.user-btn-logged:hover {
    background: #f8fafc;
    border-color: #eef2f6;
}
.user-btn-logged:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 122, 0, .25);
}

.user-avatar-wrapper { position: relative; display: inline-flex; }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8a1f, #e56e00);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    overflow: hidden;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #eef2f6;
    transition: box-shadow .18s;
}
.user-btn-logged:hover .user-avatar {
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #ff7a00;
}
.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-btn-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-btn-chevron {
    font-size: 11px;
    color: #94a3b8;
    transition: transform .2s ease;
}
.user-btn-logged[aria-expanded="true"] .user-btn-chevron {
    transform: rotate(180deg);
}

/* =========================================================
   DROPDOWN PANEL — default popover (desktop override = side rail)
   ========================================================= */

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 300px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #eef2f6;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .04),
        0 24px 48px -12px rgba(15, 23, 42, .18);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(.98);
    transform-origin: top right;
    transition:
        opacity .18s ease,
        transform .18s ease,
        visibility 0s linear .18s;
    z-index: 9999;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition:
        opacity .18s ease,
        transform .18s ease,
        visibility 0s linear 0s;
}

/* ---------- Sheet header (shown on desktop panel + mobile sheet) ---------- */
.dropdown-sheet-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eef2f6;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2;
    flex-shrink: 0;
}
.dropdown-sheet-header > span {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}
.dropdown-sheet-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
}
.dropdown-sheet-close:hover,
.dropdown-sheet-close:focus-visible {
    background: #e2e8f0;
    outline: none;
}

/* ---------- User card ---------- */
.dropdown-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fff7ed, #fff);
    border: 1px solid #ffedd5;
    margin-bottom: 6px;
}
.dropdown-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8a1f, #e56e00);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 17px;
    text-transform: uppercase;
    overflow: hidden;
    flex-shrink: 0;
}
.dropdown-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.dropdown-user-info { min-width: 0; flex: 1; }
.dropdown-user-info strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dropdown-user-info small {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Mobile-only blocks (hidden by default) ---------- */
.dropdown-mobile-tools,
.dropdown-actions-mobile,
.dropdown-seller-mobile { display: none; }

/* ---------- Dividers ---------- */
.dropdown-divider {
    height: 1px;
    background: #eef2f6;
    margin: 6px 4px;
}

/* ---------- Menu items ---------- */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.dropdown-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    color: #64748b;
    transition: color .15s;
}
.dropdown-item:hover {
    background: #f8fafc;
    color: #ff7a00;
}
.dropdown-item:hover i { color: #ff7a00; }

.dropdown-item.admin-link,
.dropdown-item.logout-link { color: #e11d48; }
.dropdown-item.admin-link i,
.dropdown-item.logout-link i { color: #e11d48; }
.dropdown-item.admin-link:hover,
.dropdown-item.logout-link:hover {
    background: #fef2f2;
    color: #e11d48;
}
.dropdown-item.admin-link:hover i,
.dropdown-item.logout-link:hover i { color: #e11d48; }

/* =========================================================
   SELLER "+" DROPDOWN
   ========================================================= */

.seller-add-dropdown {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.seller-add-dropdown .icon-btn-round {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #0f172a;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .18s ease, transform .15s ease;
}
.seller-add-dropdown .icon-btn-round i {
    font-size: 14px;
    transition: transform .2s ease;
}
.seller-add-dropdown .icon-btn-round:hover { background: #ff7a00; }
.seller-add-dropdown .icon-btn-round:active { transform: scale(.96); }
.seller-add-dropdown .icon-btn-round:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 122, 0, .25);
}
.seller-add-dropdown .icon-btn-round[aria-expanded="true"] i {
    transform: rotate(45deg);
}

.seller-add-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 210px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eef2f6;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .04),
        0 16px 36px -12px rgba(15, 23, 42, .18);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(.98);
    transform-origin: top right;
    transition:
        opacity .18s ease,
        transform .18s ease,
        visibility 0s linear .18s;
    z-index: 9999;
}
.seller-add-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition:
        opacity .18s ease,
        transform .18s ease,
        visibility 0s linear 0s;
}

.seller-add-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.seller-add-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    color: #64748b;
    transition: color .15s ease;
}
.seller-add-item:hover {
    background: #f8fafc;
    color: #ff7a00;
}
.seller-add-item:hover i { color: #ff7a00; }

/* =========================================================
   GUEST BUTTONS
   ========================================================= */

.become-seller-btn,
.login-btn,
.signup-btn {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background .18s, border-color .18s, color .18s, transform .15s;
}
.become-seller-btn,
.login-btn {
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #0f172a;
}
.become-seller-btn:hover,
.login-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}
.signup-btn {
    background: #0f172a;
    border: 1px solid #0f172a;
    color: #fff;
}
.signup-btn:hover {
    background: #ff7a00;
    border-color: #ff7a00;
}
.signup-btn:active { transform: scale(.98); }

/* =========================================================
   SHARED BACKDROP  (profile panel + drawers)
   ========================================================= */

.panel-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility 0s linear .2s;
    z-index: 9998;
    cursor: default;
}
.panel-backdrop.active {
    opacity: 1;
    visibility: visible;
    transition: opacity .2s ease, visibility 0s linear 0s;
}

/* =========================================================
   DRAWER PANELS — desktop: 380px right rail
   ========================================================= */

.panel-drawer {
    position: fixed;
    top: var(--header-h);
    right: 0;
    width: 380px;
    max-width: 100%;
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    background: #fff;
    border-left: 1px solid #eef2f6;
    box-shadow: -24px 0 48px -12px rgba(15, 23, 42, .18);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
    z-index: 9999;
}
.panel-drawer.active { transform: translateX(0); }

.panel-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eef2f6;
    flex-shrink: 0;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.panel-drawer-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}
.panel-drawer-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
}
.panel-drawer-close:hover,
.panel-drawer-close:focus-visible {
    background: #e2e8f0;
    outline: none;
}

.panel-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}
.panel-empty {
    color: #94a3b8;
    text-align: center;
    padding: 60px 12px;
    font-size: 14px;
}

/* =========================================================
   DESKTOP SIDE RAIL (>= 769px)
   The profile dropdown becomes a right-edge panel.
   ========================================================= */

@media (min-width: 769px) {

    .dropdown-menu {
        position: fixed;
        top: var(--header-h);
        right: 0;
        left: auto;
        width: 380px;
        min-width: 0;
        height: calc(100vh - var(--header-h));
        height: calc(100dvh - var(--header-h));
        max-height: none;
        border-radius: 0;
        border: none;
        border-left: 1px solid #eef2f6;
        box-shadow: -24px 0 48px -12px rgba(15, 23, 42, .18);
        padding: 0;
        transform: translateX(100%);
        transform-origin: unset;
        opacity: 1;
        visibility: hidden;
        transition:
            transform .28s cubic-bezier(.2, .8, .2, 1),
            visibility 0s linear .28s;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

    .dropdown-menu.active {
        transform: translateX(0);
        visibility: visible;
        transition:
            transform .28s cubic-bezier(.2, .8, .2, 1),
            visibility 0s linear 0s;
    }

    .dropdown-sheet-header { display: flex; }

    .dropdown-user {
        margin: 20px 20px 8px;
        padding: 16px;
        border-radius: 16px;
    }

    .dropdown-menu > .dropdown-item {
        margin: 0 12px;
        padding: 14px 16px;
        font-size: 15px;
        border-radius: 12px;
    }
    .dropdown-menu > .dropdown-item i { font-size: 16px; }
    .dropdown-menu > .dropdown-divider { margin: 8px 20px; }

    .dropdown-item.logout-link {
        margin: auto 12px 24px;
        background: #fef2f2;
    }
}

/* =========================================================
   DRAWER CONTENT — order / activity list
   ========================================================= */

.order-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ---------- Order card ---------- */
.order-card {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 12px;
    background: #fff;
    border: 1px solid #eef2f6;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        transform .12s ease;
}
.order-card:hover {
    border-color: #e2e8f0;
    box-shadow: 0 8px 24px -12px rgba(15, 23, 42, .15);
    transform: translateY(-1px);
}
.order-card:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 122, 0, .25);
}

.order-thumb {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    object-fit: cover;
    background: #f8fafc;
    flex-shrink: 0;
}

.order-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ---------- Status pill ---------- */
.order-status {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2px;
    background: #f1f5f9;
    color: #475569;
    white-space: nowrap;
    text-transform: capitalize;
}

.order-status.status-pending    { background: #fef3c7; color: #b45309; }
.order-status.status-processing { background: #dbeafe; color: #1d4ed8; }
.order-status.status-shipped    { background: #ede9fe; color: #6d28d9; }
.order-status.status-delivered  { background: #dcfce7; color: #15803d; }
.order-status.status-cancelled  { background: #fee2e2; color: #b91c1c; }
.order-status.status-default    { background: #f1f5f9; color: #475569; }

/* ---------- Product name ---------- */
.order-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
    margin: 0;
    letter-spacing: -0.005em;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.order-date {
    font-size: 11.5px;
    color: #94a3b8;
    font-weight: 500;
}

/* ---------- Price ---------- */
.order-price {
    font-size: 14px;
    font-weight: 700;
    color: #ff7a00;
    white-space: nowrap;
    align-self: end;
    padding-bottom: 2px;
}