/* LOWIZ Account Drawer & Top-Left Brand Harmony — Luxury Marketplace Edition */

/* ==========================================================================
   1. TOP-LEFT HEADER: 3-DOT MENU + LOWIZ STORE BRAND HARMONY
   ========================================================================== */

.site-header .nav-shell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-header .nav-shell > #authTrigger.account-menu-trigger,
.site-header .nav-shell #authTrigger.login-trigger {
  order: -2 !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  max-width: 42px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 13px !important;
  border: 1px solid rgba(168, 85, 247, 0.28) !important;
  background:
    radial-gradient(circle at 24% 20%, rgba(168, 85, 247, 0.22), transparent 62%),
    linear-gradient(145deg, rgba(16, 20, 34, 0.94), rgba(9, 12, 22, 0.96)) !important;
  color: #f8fafc !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  box-shadow:
    0 10px 26px rgba(2, 6, 23, 0.48),
    0 0 0 1px rgba(56, 189, 248, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  flex: 0 0 42px !important;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.24s ease,
    box-shadow 0.24s ease,
    background 0.24s ease !important;
}

.site-header .nav-shell #authTrigger::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.22), transparent 70%);
  opacity: 0;
  transition: opacity 0.24s ease;
  pointer-events: none;
}

/* Clean up any legacy cluttered labels or avatars inside #authTrigger */
.site-header .nav-shell #authTrigger .login-label,
.site-header .nav-shell #authTrigger .profile-avatar {
  display: none !important;
}

.site-header .nav-shell #authTrigger .account-menu-glyph {
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3.5px !important;
  width: 18px !important;
  height: 18px !important;
  position: relative;
  z-index: 1;
}

.site-header .nav-shell #authTrigger .account-menu-glyph i {
  display: block !important;
  width: 4px !important;
  height: 4px !important;
  border-radius: 999px !important;
  background: #f8fafc !important;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.55);
  transition:
    transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.22s ease,
    width 0.26s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s ease;
}

.site-header .nav-shell #authTrigger .account-menu-glyph i:nth-child(2) {
  background: #c084fc !important;
}

.site-header .nav-shell #authTrigger:hover,
.site-header .nav-shell #authTrigger[aria-expanded="true"] {
  transform: translateY(-1px);
  border-color: rgba(168, 85, 247, 0.58) !important;
  box-shadow:
    0 14px 30px rgba(88, 28, 135, 0.34),
    0 0 18px rgba(56, 189, 248, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
}

.site-header .nav-shell #authTrigger:hover::before,
.site-header .nav-shell #authTrigger[aria-expanded="true"]::before {
  opacity: 1;
}

.site-header .nav-shell #authTrigger:hover .account-menu-glyph i:nth-child(2),
.site-header .nav-shell #authTrigger[aria-expanded="true"] .account-menu-glyph i:nth-child(2) {
  width: 10px !important;
  background: #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.75);
}

.site-header .nav-shell #authTrigger.is-authenticated::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.85);
}

/* Top-Left LOWIZ STORE Brand Presentation */
.site-header .nav-shell > .brand {
  order: -1 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin-right: auto !important;
  padding: 5px 11px 5px 6px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(148, 163, 184, 0.12) !important;
  background: linear-gradient(145deg, rgba(15, 20, 34, 0.72), rgba(8, 11, 20, 0.58)) !important;
  box-shadow:
    0 8px 22px rgba(2, 6, 23, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  text-decoration: none !important;
  min-width: 0;
  flex-shrink: 0 !important;
  transition:
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.24s ease,
    box-shadow 0.24s ease,
    background 0.24s ease !important;
}

.site-header .nav-shell > .brand:hover {
  transform: translateY(-1px);
  border-color: rgba(168, 85, 247, 0.36) !important;
  box-shadow:
    0 12px 28px rgba(2, 6, 23, 0.42),
    0 0 20px rgba(168, 85, 247, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
}

.site-header .nav-shell > .brand .brand-logo {
  display: none !important;
}

.lw-brand-emblem {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 25% 20%, rgba(56, 189, 248, 0.45), transparent 65%),
    linear-gradient(135deg, rgba(139, 92, 246, 0.95), rgba(59, 130, 246, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow:
    0 6px 16px rgba(124, 58, 237, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.lw-brand-emblem-core {
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #ffffff;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(2, 6, 23, 0.45);
}

.site-header .nav-shell > .brand .brand-name,
.footer-brand .brand-name,
.auth-brand .brand-name {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.lw-brand-word-main {
  font-size: 0.98rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  color: #f8fafc;
  text-transform: uppercase;
}

.lw-brand-word-sub {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 7px;
  border-radius: 6px;
  color: #e9d5ff;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.24), rgba(56, 189, 248, 0.16));
  border: 1px solid rgba(168, 85, 247, 0.32);
}

.footer-brand .lw-brand-emblem,
.auth-brand .lw-brand-emblem {
  display: none;
}

/* Hide redundant old profile link in mobile menu since 3-dot drawer is unified */
.mobile-menu [data-mobile-auth] {
  display: none !important;
}

/* ==========================================================================
   2. THREE-DOT PREMIUM DRAWER (#lowizAccountDrawer)
   ========================================================================== */

.lowiz-account-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1250;
  background:
    radial-gradient(circle at 12% 16%, rgba(139, 92, 246, 0.18), transparent 44%),
    rgba(3, 6, 15, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.lowiz-account-drawer {
  position: fixed;
  top: 12px;
  left: 12px;
  bottom: 12px;
  width: min(372px, calc(100vw - 24px));
  z-index: 1251;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(168, 85, 247, 0.26);
  background:
    radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.22), transparent 48%),
    radial-gradient(circle at 100% 18%, rgba(56, 189, 248, 0.14), transparent 46%),
    linear-gradient(170deg, rgba(11, 15, 28, 0.97) 0%, rgba(6, 9, 19, 0.99) 100%);
  box-shadow:
    0 28px 72px rgba(2, 6, 23, 0.78),
    0 0 0 1px rgba(56, 189, 248, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  transform: translate3d(calc(-100% - 28px), 0, 0) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.26s ease;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.lowiz-account-drawer.is-open {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Top bar of drawer */
.lowiz-account-drawer__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lowiz-account-drawer__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #c4b5fd;
}

.lowiz-account-drawer__brand::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #a855f7, #38bdf8);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.8);
}

.lowiz-account-drawer__close {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lowiz-account-drawer__close:hover {
  border-color: rgba(168, 85, 247, 0.45);
  background: rgba(168, 85, 247, 0.16);
  color: #ffffff;
  transform: rotate(90deg);
}

/* Identity Card at Top of Drawer */
.lowiz-account-drawer__identity {
  position: relative;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(168, 85, 247, 0.28);
  background:
    radial-gradient(circle at 90% 10%, rgba(168, 85, 247, 0.22), transparent 55%),
    linear-gradient(145deg, rgba(19, 25, 44, 0.9), rgba(10, 14, 26, 0.92));
  box-shadow:
    0 14px 32px rgba(2, 6, 23, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lowiz-account-drawer__user-row {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.lowiz-account-drawer__avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 55%, #06b6d4 100%);
  color: #ffffff;
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  box-shadow:
    0 10px 24px rgba(139, 92, 246, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  overflow: hidden;
}

.lowiz-account-drawer__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lowiz-account-drawer__status-dot {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #34d399;
  border: 2px solid #0b1020;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.85);
}

.lowiz-account-drawer__user-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lowiz-account-drawer__name {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.lowiz-account-drawer__uid-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.lowiz-account-drawer__uid-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(15, 23, 42, 0.78);
  color: #bae6fd;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lowiz-account-drawer__uid-pill:hover {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.14);
  color: #ffffff;
}

.lowiz-account-drawer__uid-pill svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.lowiz-account-drawer__email {
  margin: 0;
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mini wallet & bonus strip inside drawer header */
.lowiz-account-drawer__metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.lowiz-account-drawer__metric {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(9, 13, 24, 0.66);
  border: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lowiz-account-drawer__metric span {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.lowiz-account-drawer__metric strong {
  font-size: 0.88rem;
  font-weight: 800;
  color: #f8fafc;
}

.lowiz-account-drawer__metric.is-bonus strong {
  color: #c084fc;
}

/* Navigation Section Label */
.lowiz-account-drawer__section-label {
  margin: 2px 4px -4px;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
}

/* 6 Menu Items List */
.lowiz-account-drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.lowiz-account-drawer__item {
  width: 100%;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 15px;
  border: 1px solid rgba(148, 163, 184, 0.11);
  background: linear-gradient(145deg, rgba(16, 22, 38, 0.74), rgba(10, 14, 26, 0.64));
  color: #f8fafc;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.22s ease,
    background 0.22s ease,
    box-shadow 0.22s ease;
}

.lowiz-account-drawer.is-open .lowiz-account-drawer__item {
  animation: lwDrawerItemIn 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.lowiz-account-drawer.is-open .lowiz-account-drawer__item:nth-child(1) { animation-delay: 0.03s; }
.lowiz-account-drawer.is-open .lowiz-account-drawer__item:nth-child(2) { animation-delay: 0.06s; }
.lowiz-account-drawer.is-open .lowiz-account-drawer__item:nth-child(3) { animation-delay: 0.09s; }
.lowiz-account-drawer.is-open .lowiz-account-drawer__item:nth-child(4) { animation-delay: 0.12s; }
.lowiz-account-drawer.is-open .lowiz-account-drawer__item:nth-child(5) { animation-delay: 0.15s; }
.lowiz-account-drawer.is-open .lowiz-account-drawer__item:nth-child(6) { animation-delay: 0.18s; }

@keyframes lwDrawerItemIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.lowiz-account-drawer__item:hover,
.lowiz-account-drawer__item.is-active {
  transform: translateX(4px);
  border-color: rgba(168, 85, 247, 0.44);
  background:
    radial-gradient(circle at 0% 50%, rgba(168, 85, 247, 0.2), transparent 65%),
    linear-gradient(145deg, rgba(24, 31, 54, 0.92), rgba(13, 18, 34, 0.92));
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.4);
}

.lowiz-account-drawer__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(168, 85, 247, 0.24);
  background:
    radial-gradient(circle at 30% 25%, rgba(168, 85, 247, 0.24), transparent 70%),
    rgba(15, 23, 42, 0.85);
  color: #c4b5fd;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.22s ease;
}

.lowiz-account-drawer__item:hover .lowiz-account-drawer__icon,
.lowiz-account-drawer__item.is-active .lowiz-account-drawer__icon {
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.48);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.85), rgba(56, 189, 248, 0.72));
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.32);
}

.lowiz-account-drawer__icon svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lowiz-account-drawer__copy strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.01em;
}

.lowiz-account-drawer__copy small {
  display: block;
  margin-top: 2px;
  font-size: 0.73rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lowiz-account-drawer__chev {
  color: #64748b;
  font-size: 0.95rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.lowiz-account-drawer__item:hover .lowiz-account-drawer__chev {
  color: #e2e8f0;
  transform: translateX(2px);
}

/* Footer actions inside drawer */
.lowiz-account-drawer__footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.lowiz-account-drawer__action-btn {
  padding: 11px 12px;
  border-radius: 13px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.75);
  color: #f8fafc;
  font-size: 0.8rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lowiz-account-drawer__action-btn.is-primary {
  border-color: rgba(168, 85, 247, 0.45);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.9), rgba(59, 130, 246, 0.85));
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.28);
}

.lowiz-account-drawer__action-btn.is-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.lowiz-account-drawer__action-btn.is-danger {
  border-color: rgba(244, 63, 94, 0.26);
  background: rgba(244, 63, 94, 0.1);
  color: #fda4af;
}

.lowiz-account-drawer__action-btn.is-danger:hover {
  border-color: rgba(244, 63, 94, 0.48);
  background: rgba(244, 63, 94, 0.18);
  color: #ffffff;
}

/* ==========================================================================
   3. MOBILE & TABLET RESPONSIVENESS (320px — 780px)
   ========================================================================== */

@media (max-width: 780px) {
  .site-header .nav-shell {
    gap: 7px !important;
  }

  .site-header .nav-shell > #authTrigger.account-menu-trigger,
  .site-header .nav-shell #authTrigger.login-trigger {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    max-width: 38px !important;
    flex: 0 0 38px !important;
    border-radius: 11px !important;
  }

  .site-header .nav-shell > .brand {
    padding: 4px 8px 4px 5px !important;
    gap: 7px !important;
    border-radius: 11px !important;
  }

  .lw-brand-emblem {
    width: 26px;
    height: 26px;
    border-radius: 8px;
  }

  .lw-brand-emblem-core {
    font-size: 0.64rem;
  }

  .lw-brand-word-main {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
  }

  .lw-brand-word-sub {
    font-size: 0.56rem;
    letter-spacing: 0.13em;
    padding: 3px 5px;
  }

  .lowiz-account-drawer {
    top: 8px;
    left: 8px;
    bottom: 8px;
    width: min(348px, calc(100vw - 16px));
    padding: 15px;
    border-radius: 20px;
  }
}

@media (max-width: 380px) {
  .site-header .nav-shell > .brand {
    padding: 3px 6px 3px 4px !important;
    gap: 5px !important;
  }

  .lw-brand-emblem {
    width: 23px;
    height: 23px;
  }

  .lw-brand-word-main {
    font-size: 0.74rem;
    letter-spacing: 0.06em;
  }

  .lw-brand-word-sub {
    font-size: 0.5rem;
    padding: 2px 4px;
    letter-spacing: 0.1em;
  }
}
