/* ================================================================
   INBOX BELL + DROPDOWN
   ================================================================ */
.inbox-bell {
  position: relative; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 14px;
  background: transparent; border: 1px solid rgba(255,255,255,.06);
  transition: background .2s;
}
.inbox-bell:hover { background: rgba(255,255,255,.04); }
.inbox-bell i { font-size: 17px; color: #e5e7eb; }
.inbox-bell-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; border-radius: 100px;
  background: #ef4444; color: #fff; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px; border: 2px solid #0a0a0a;
  animation: ibPulse 2s ease-in-out infinite;
}
.inbox-bell-badge.hidden { display: none; }
@keyframes ibPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }

/* Mobile badge (on username) */
.inbox-mobile-badge {
  min-width: 18px; height: 18px; border-radius: 100px;
  background: #ef4444; color: #fff; font-size: 10px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px; margin-left: 6px; vertical-align: super;
  animation: ibPulse 2s ease-in-out infinite;
}
.inbox-mobile-badge.hidden { display: none; }

/* Dropdown Panel — desktop: anchored to bell wrapper */
.inbox-dropdown {
  position: absolute; top: calc(100% + 10px); right: -20px;
  width: 380px; max-height: 520px;
  background: #111; border: 1px solid rgba(255,255,255,.06);
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  z-index: 9999; display: none;
  animation: ibSlideIn .2s ease-out;
}
.inbox-dropdown.open { display: block; }
@keyframes ibSlideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* Mobile dropdown — fixed overlay */
@media (max-width: 768px) {
  .inbox-dropdown {
    position: fixed; top: 70px; left: 8px; right: 8px;
    width: auto; max-height: 70vh;
    border-radius: 18px;
  }
}

/* ================================================================
   MOBILE FLOATING SEARCH
   ================================================================ */
.mobile-float-search {
  display: none;
}
@media (max-width: 768px) {
  .mobile-float-search {
    display: flex; position: fixed; top: 80px; left: 12px;
    width: 42px; height: 42px; border-radius: 50%;
    background: rgba(10,10,10,.7); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.06);
    align-items: center; justify-content: center;
    z-index: 900; cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
    transition: transform .2s, opacity .2s;
  }
  .mobile-float-search i { font-size: 16px; color: #e5e7eb; }
  .mobile-float-search:active { transform: scale(.9); }
  /* Hide search toggle on very small screens */
  .mobile-float-search.hidden { display: none !important; }
}

/* ================================================================
   COMPACT CART BADGE (superscript style)
   ================================================================ */
.cart-badge-compact {
  position: absolute; top: -3px; right: -3px;
  min-width: 16px; height: 16px; border-radius: 100px;
  background: #10D98C; color: #000; font-size: 9px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid #0a0a0a;
}
.cart-badge-compact[data-cart-count="0"] { display: none; }

/* Tabs */
.inbox-tabs {
  display: flex; background: rgba(255,255,255,.03);
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.inbox-tab {
  flex: 1; padding: 14px 0; text-align: center;
  font-size: 13px; font-weight: 700; color: #6b7280;
  cursor: pointer; border: none; background: none;
  position: relative; transition: color .2s;
}
.inbox-tab.active { color: #10D98C; }
.inbox-tab.active::after {
  content: ''; position: absolute; bottom: 0; left: 20%; right: 20%;
  height: 2px; background: #10D98C; border-radius: 2px;
}
.inbox-tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; border-radius: 100px;
  background: #ef4444; color: #fff; font-size: 9px; font-weight: 800;
  padding: 0 4px; margin-left: 4px; vertical-align: middle;
}

/* Header */
.inbox-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 0;
}
.inbox-header h3 { font-size: 16px; font-weight: 800; color: #f9fafb; margin: 0; }
.inbox-mark-all {
  font-size: 11px; font-weight: 700; color: #10D98C;
  cursor: pointer; background: none; border: none; padding: 4px 8px;
}
.inbox-mark-all:hover { text-decoration: underline; }

/* Notification List */
.inbox-list {
  overflow-y: auto; max-height: 400px;
  padding: 8px 10px 10px;
}
.inbox-item {
  display: flex; gap: 12px; padding: 12px;
  border-radius: 14px; cursor: pointer;
  transition: background .15s;
}
.inbox-item:hover { background: rgba(255,255,255,.03); }
.inbox-item.unread { background: rgba(16,217,140,.03); }
.inbox-item-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #10D98C; flex-shrink: 0; margin-top: 6px;
}
.inbox-item.unread .inbox-item-dot { background: #10D98C; }
.inbox-item:not(.unread) .inbox-item-dot { background: rgba(255,255,255,.08); }
.inbox-item-content { flex: 1; min-width: 0; }
.inbox-item-title {
  font-size: 13px; font-weight: 700; color: #f9fafb;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.inbox-item-body {
  font-size: 12px; color: #9ca3af; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-top: 2px;
}
.inbox-item-time {
  font-size: 10px; color: #4b5563; margin-top: 4px;
}
.inbox-empty {
  text-align: center; padding: 40px 20px; color: #6b7280;
  font-size: 13px; font-weight: 600;
}
.inbox-empty i { font-size: 28px; display: block; margin-bottom: 10px; color: #4b5563; }

/* Messages Thread */
.inbox-thread {
  overflow-y: auto; max-height: 340px;
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
}
.inbox-msg {
  max-width: 85%; padding: 10px 14px;
  border-radius: 16px; font-size: 13px; line-height: 1.5;
  word-wrap: break-word;
}
.inbox-msg.admin {
  align-self: flex-start;
  background: rgba(16,217,140,.08); color: #d1fae5;
  border-bottom-left-radius: 4px;
}
.inbox-msg.customer {
  align-self: flex-end;
  background: rgba(255,255,255,.06); color: #e5e7eb;
  border-bottom-right-radius: 4px;
}
.inbox-msg-time {
  font-size: 9px; color: #6b7280; margin-top: 4px;
}

/* Compose */
.inbox-compose {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,.04);
  background: rgba(255,255,255,.02);
}
.inbox-compose input {
  flex: 1; background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px; padding: 10px 14px;
  color: #f9fafb; font-size: 13px; font-weight: 500;
  outline: none;
}
.inbox-compose input:focus { border-color: #10D98C; }
.inbox-compose input::placeholder { color: #4b5563; }
.inbox-compose button {
  background: #10D98C; color: #000; border: none;
  border-radius: 12px; padding: 10px 16px;
  font-size: 13px; font-weight: 800; cursor: pointer;
  transition: transform .15s;
}
.inbox-compose button:hover { transform: scale(1.03); }
.inbox-compose button:disabled { opacity: .5; }

/* ================================================================
   TOO-SMALL SCREEN OVERLAY (< 370px)
   ================================================================ */
.screen-too-small {
  display: none;
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(6,10,8,.85);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  flex-direction: column; align-items: center; justify-content: center;
  padding: 32px; text-align: center; gap: 20px;
  transition: opacity .4s ease;
}
.screen-too-small .sts-icon {
  width: 64px; height: 64px; border-radius: 20px;
  background: rgba(16,217,140,.08); border: 1px solid rgba(16,217,140,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #10D98C;
}
.screen-too-small h2 {
  font-size: 18px; font-weight: 800; color: #f9fafb;
  margin: 0; line-height: 1.3;
}
.screen-too-small p {
  font-size: 13px; color: #9ca3af; line-height: 1.6; margin: 0;
  max-width: 260px;
}
.screen-too-small .sts-logo {
  width: 36px; opacity: .4; margin-top: 12px;
}
@media (max-width: 369px) {
  .screen-too-small { display: flex; }
}

/* ================================================================
   SEARCH SUGGESTIONS
   ================================================================ */
.search-suggestions {
  padding: 18px 20px 20px;
}
.search-section-label {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: #6b7280; margin-bottom: 10px;
}
.search-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.search-chip {
  padding: 8px 16px; border-radius: 100px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  color: #e5e7eb; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.search-chip:hover { background: rgba(16,217,140,.08); border-color: rgba(16,217,140,.15); color: #10D98C; }
.search-chip:active { transform: scale(.95); }

.search-cats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
@media (max-width: 480px) { .search-cats { grid-template-columns: repeat(2, 1fr); } }

.search-cat-link {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 14px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.05);
  color: #d1d5db; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: all .15s;
}
.search-cat-link:hover { background: rgba(16,217,140,.06); border-color: rgba(16,217,140,.12); color: #10D98C; }
.search-cat-link i { font-size: 14px; color: #10D98C; opacity: .7; }

/* Search close as text button */
.search-close {
  background: none !important; border: none !important;
  color: #10D98C !important; font-size: 14px !important;
  font-weight: 700 !important; cursor: pointer;
  padding: 8px 12px !important; white-space: nowrap;
}
.search-close i { display: none; }

/* ================================================================
   MOBILE HEADER SPACE SAVING
   ================================================================ */
@media (max-width: 768px) {
  .mega-menu-actions { gap: 10px !important; }
  .mega-menu-header { padding: 0 14px !important; }

  /* Truncate username */
  #authActionsContainer .mega-menu-btn span,
  #authActionsContainer [data-user-label] {
    max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    display: inline-block; vertical-align: middle;
  }
  #authActionsContainer .mega-menu-btn {
    padding: 10px 14px !important; font-size: 14px !important;
  }
  .inbox-bell { width: 44px; height: 44px; border-radius: 14px; }
  .inbox-bell i { font-size: 18px; }
  .cart-toggle { padding: 10px 14px !important; }
  .mega-menu-mobile-toggle { width: 44px; height: 44px; }
  .mega-menu-btn.search-toggle { width: 44px; height: 44px; }

  /* Fix search results on mobile */
  .search-results {
    max-height: none !important; overflow: visible !important;
    gap: 8px;
  }
  .search-result-item {
    padding: 12px !important;
  }
  .search-result-thumb {
    width: 52px !important; height: 52px !important; border-radius: 10px !important;
  }
  .search-container { padding: 60px 16px 30px !important; }
}
@media (max-width: 460px) {
  .mega-menu-actions { gap: 8px !important; }
  .mega-menu-header { padding: 0 10px !important; }

  #authActionsContainer .mega-menu-btn span,
  #authActionsContainer [data-user-label] {
    max-width: 44px;
  }
  #authActionsContainer .mega-menu-btn {
    padding: 9px 11px !important; font-size: 13px !important; border-radius: 12px !important;
  }
  .inbox-bell { width: 40px; height: 40px; }
  .inbox-bell i { font-size: 16px; }
  .cart-toggle { padding: 9px 11px !important; border-radius: 12px !important; }
  .mega-menu-mobile-toggle { width: 40px; height: 40px; }
}
@media (max-width: 369px) { .screen-too-small { display: flex !important; } }
