/* Shared header notification styles, loaded on every customer-facing page. */

/* Notification Badge */
.notification-badge { position: relative; cursor: pointer; }

.notification-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--primary, #990302);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface, #ffffff);
  line-height: 1;
}
html[data-theme="dark"] .notification-count { border-color: var(--surface, #1a1214); }

.notification-dropdown {
  position: absolute;
  top: 50px;
  right: 0;
  width: 300px;
  max-width: calc(100vw - 32px);
  background: var(--surface, #ffffff);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: none;
  z-index: 1002;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border, rgba(153, 3, 2, 0.08));
}
html[data-theme="dark"] .notification-dropdown { background: var(--surface, #1a1214); }

.notification-dropdown.show { display: block; }

.notification-item {
  padding: 0.8rem;
  border-bottom: 1px solid var(--border, rgba(153, 3, 2, 0.08));
  cursor: pointer;
  font-size: 0.85rem;
}
.notification-item:hover { background: var(--primary-soft, #f5dada); }
.notification-item.unread { background: rgba(153, 3, 2, 0.05); }

.notification-title { font-weight: 600; font-size: 0.8rem; color: var(--text, #0f172a); }
.notification-message { font-size: 0.7rem; color: var(--text-muted, #64748b); margin-top: 0.2rem; }

/* Shared cart/orders badge for header icons */
.cart-badge, .orders-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--danger, #dc2626);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface, #ffffff);
  line-height: 1;
}
html[data-theme="dark"] .cart-badge,
html[data-theme="dark"] .orders-badge { border-color: var(--surface, #1a1214); }

/* ========== PROFILE BUTTON & MENU ========== */
.profile-btn {
  position: relative;
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: var(--primary-soft, #f5dada);
  border: 1px solid var(--border-strong, rgba(153, 3, 2, 0.16));
  color: var(--primary, #990302);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  flex-shrink: 0;
  z-index: 1001;
}
.profile-btn:hover {
  background: var(--primary, #990302);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(153, 3, 2, 0.2);
}
.profile-btn:active { transform: scale(0.95); }
.profile-btn.show { display: inline-flex; }

.profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 260px;
  max-width: calc(100vw - 32px);
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, rgba(153, 3, 2, 0.08));
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  display: none;
  z-index: 1002;
  overflow: hidden;
}
html[data-theme="dark"] .profile-menu { background: var(--surface, #1a1214); }
.profile-menu.show { display: block; }

.profile-menu-header {
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border, rgba(153, 3, 2, 0.08));
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-menu-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: var(--primary-soft, #f5dada);
  color: var(--primary, #990302);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.profile-menu-user {
  flex: 1;
  min-width: 0;
}
.profile-menu-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-menu-email {
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.profile-menu-links {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.profile-menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text, #0f172a);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.profile-menu-link:hover {
  background: var(--primary-soft, #f5dada);
  color: var(--primary, #990302);
}
.profile-menu-link i {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.profile-menu-link.logout {
  color: var(--danger, #ef4444);
  border-top: 1px solid var(--border, rgba(153, 3, 2, 0.08));
  border-radius: 0;
  margin-top: 4px;
  padding-top: 12px;
}
.profile-menu-link.logout:hover {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger, #ef4444);
}

/* Mobile: ensure menu stays in viewport and profile button is properly ordered */
@media(max-width:768px){
  .profile-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 0.95rem;
    order: 4;
  }
  .profile-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    bottom: auto;
    width: 260px;
    max-width: calc(100vw - 24px);
    z-index: 1002;
  }
}
@media(max-width:480px){
  .profile-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 0.95rem;
  }
}
@media(max-width:375px){
  .profile-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 0.9rem;
  }
}
@media(max-width:320px){
  .profile-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 0.9rem;
  }
}

/* ========== GLOBAL BUTTON CONSISTENCY ========== */
.rent-btn,
.btn-buy-now,
.btn-checkout,
.btn-place-order,
.btn-continue,
.btn-back,
.btn-deposit,
.wallet-deposit-pill,
.buy-numbers-btn,
.btn-view {
  min-height: 44px;
  border-radius: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.rent-btn:disabled,
.btn-buy-now:disabled,
.btn-checkout:disabled,
.btn-place-order:disabled,
.btn-continue:disabled,
.btn-back:disabled,
.btn-deposit:disabled,
.wallet-deposit-pill:disabled,
.buy-numbers-btn:disabled,
.btn-view:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.btn-small {
  min-height: 32px;
  border-radius: 10px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.btn-small:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}