/* Header — stock alerts (Alpine.js) */
[x-cloak].pp-stock-notify,
.pp-stock-notify [x-cloak] {
  display: none !important;
}

.pp-stock-notify {
  position: static;
}

@media (min-width: 768px) {
  .pp-stock-notify {
    position: relative;
  }
}

.pp-stock-notify .nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem !important;
  min-width: 44px;
  min-height: 44px;
}

.pp-stock-notify-badge {
  position: absolute;
  top: 2px;
  right: 0;
  z-index: 2;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid #007bff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

/* Mobile backdrop (shown via Alpine x-show) */
.pp-stock-notify-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1045;
  background: rgba(15, 23, 42, 0.45);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.pp-stock-notify-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1055;
  width: min(92vw, 380px);
  max-height: min(70vh, 480px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-top: 0.35rem;
  padding: 0;
  border-radius: 12px;
  border: none;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2);
  background: #fff;
}

.pp-stock-notify-head {
  flex-shrink: 0;
  padding: 12px 14px;
  background: linear-gradient(135deg, #007bff, #0ea5e9);
  color: #fff;
}

.pp-stock-notify-head h6 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  min-width: 0;
}

.pp-stock-notify-tabs {
  flex-shrink: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.pp-stock-notify-tabs::-webkit-scrollbar {
  display: none;
}

.pp-stock-notify-tab {
  flex: 1 0 auto;
  min-width: max(72px, 22%);
  border: none;
  background: transparent;
  padding: 10px 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

.pp-stock-notify-tab--sell.is-active {
  color: #0ea5e9;
  box-shadow: inset 0 -2px 0 #0ea5e9;
}

.pp-stock-notify-tab.is-active {
  color: #007bff;
  box-shadow: inset 0 -2px 0 #007bff;
  background: #fff;
}

.pp-stock-notify-tab .badge {
  margin-left: 4px;
  font-size: 0.65rem;
  vertical-align: middle;
}

.pp-stock-notify-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  max-height: 320px;
  padding: 6px 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.pp-stock-notify-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  min-height: 56px;
}

.pp-stock-notify-item:hover,
.pp-stock-notify-item:focus {
  background: #f1f5f9;
  outline: none;
}

.pp-stock-notify-item img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #e2e8f0;
  flex-shrink: 0;
}

.pp-stock-notify-item-main {
  flex: 1;
  min-width: 0;
}

.pp-stock-notify-item-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.pp-stock-notify-item-meta {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.3;
  word-break: break-word;
}

.pp-stock-notify-item-meta strong {
  color: #dc2626;
  font-weight: 700;
}

.pp-stock-notify-empty,
.pp-stock-notify-loading,
.pp-stock-notify-more {
  padding: 16px 14px;
  text-align: center;
  color: #64748b;
  font-size: 0.875rem;
}

.pp-stock-notify-more {
  padding: 10px;
  font-size: 0.8125rem;
  color: #007bff;
}

.pp-stock-notify-foot {
  flex-shrink: 0;
  padding: 10px 14px;
  padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.pp-stock-notify-foot .btn {
  font-size: 0.8125rem;
  font-weight: 600;
  min-height: 44px;
}

.pp-stock-notify-error {
  flex-shrink: 0;
  padding: 12px 14px;
  font-size: 0.8125rem;
  color: #b91c1c;
  background: #fef2f2;
}

/* —— Tablet —— */
@media (max-width: 991.98px) {
  .pp-stock-notify-menu {
    width: min(94vw, 380px);
    max-height: min(75vh, 520px);
  }

  .pp-stock-notify-body {
    max-height: min(55vh, 400px);
  }
}

/* —— Mobile —— */
@media (max-width: 767.98px) {
  .pp-stock-notify {
    position: static;
    overflow: visible;
  }

  .pp-stock-notify .nav-link {
    overflow: visible;
  }

  /* Shared backdrop: pp-header-mobile-sheet.js (#ppHeaderMobileBackdrop) */
  .pp-stock-notify-backdrop {
    display: none !important;
    pointer-events: none !important;
  }

  .pp-stock-notify-menu[x-cloak],
  .pp-stock-notify-menu[style*="display: none"] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .pp-stock-notify-menu {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    max-height: min(85dvh, 640px);
    margin: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.22);
    z-index: 1055;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    overscroll-behavior: contain;
  }

  .pp-stock-notify-head {
    padding: 14px 16px;
    padding-top: max(14px, env(safe-area-inset-top, 0px));
  }

  .pp-stock-notify-head h6 {
    font-size: 1rem;
  }

  .pp-stock-notify-tab {
    padding: 12px 6px;
    font-size: 0.75rem;
    min-height: 48px;
    white-space: normal;
  }

  .pp-stock-notify-body {
    max-height: none;
    flex: 1 1 auto;
  }

  .pp-stock-notify-item {
    padding: 12px 16px;
    min-height: 60px;
  }

  .pp-stock-notify-foot {
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .pp-stock-notify-tab {
    font-size: 0.6875rem;
    padding: 10px 4px;
  }

  .pp-stock-notify-tab .badge {
    display: block;
    margin: 4px auto 0;
    margin-left: auto;
  }
}

/* Prevent navbar clipping the fixed panel */
body.pp-stock-notify-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

@media (min-width: 768px) {
  body.pp-stock-notify-open {
    overflow: auto;
    position: static;
    width: auto;
  }
}

