/* =============================================
   Scrap Items Page — Pharmex Theme
   Primary theme: professional red (#A52A2A, icons lighter #C04040)
   Gradient uses slightly lighter shades of the primary
   Header & footer keep brand colors (styles.css)
   ============================================= */

:root {
  --radius: 0.875rem;
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-2xl: calc(var(--radius) + 8px);

  /* Core theme — professional deep red for visibility */
  --primary: #A52A2A;
  --primary-foreground: #ffffff;
  --primary-glow: #C04040;

  /* Supporting — professional red family (light → mid of primary) */
  --blue: #C04040;
  --gold: #D06060;
  --gold-accent: #C04040;
  --accent: #5C1010;

  /* Surfaces */
  --background: #ffffff;
  --foreground: #111111;
  --card: #fafafb;
  --secondary: #f5f4fa;
  --muted: #f5f4fa;
  --muted-foreground: #344054;

  /* Status */
  --destructive: #c9372d;
  --success: #0e9f6e;
  --success-light: #def7ec;

  /* Borders & focus */
  --border: rgba(229, 231, 235, 0.9);
  --ring: #A52A2A;

  /* Gradients — slightly light shade → darker primary */
  --gradient-primary: linear-gradient(90deg, #D87878 0%, #C04040 48%, #A52A2A 100%);
  --gradient-button: linear-gradient(90deg, #D87878 0%, #C04040 52%, #A52A2A 100%);
  --gradient-surface: linear-gradient(160deg, #ffffff 0%, #fafafb 55%, #f5f4fa 100%);

  --shadow-sm: 0 2px 8px rgba(17, 17, 17, 0.04);
  --shadow-glow: 0 20px 60px -20px rgba(165, 42, 42, 0.28);
  --shadow-panel: 0 24px 60px -30px rgba(30, 30, 35, 0.14);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --text-sm: 0.875rem;
  --text-base: 1rem;

  --sidebar-width: 260px;
  --ad-width: 240px;
}

/* Active nav uses page deep red */
.nav-link-active {
  color: #C04040 !important;
  font-weight: 700;
}

.dropdown-item-active {
  color: #C04040 !important;
  font-weight: 600;
  background: rgba(165, 42, 42, 0.10);
}

/* =====================================================
   Keep HEADER & FOOTER colors identical to index / styles.css
   (page theme primary must NOT tint chrome)
   ===================================================== */
.header {
  --primary: #3f2576;
  --primary-foreground: #ffffff;
  --primary-glow: #542b7d;
  --blue: #3b4a96;
  --gold: #a78b69;
  --gold-accent: #dab360;
  --accent: #542b7d;
  --ring: #3f2576;
  --gradient-primary: linear-gradient(90deg, #a78b69 0%, #3b4a96 48%, #3f2576 100%);
  --muted-foreground: #344054;
  --foreground: #111111;
  --border: rgba(229, 231, 235, 0.9);
}

.footer {
  --primary: #3f2576;
  --primary-foreground: #ffffff;
  --primary-glow: #542b7d;
  --blue: #3b4a96;
  --gold: #a78b69;
  --gold-accent: #dab360;
  --accent: #542b7d;
  --gradient-primary: linear-gradient(90deg, #a78b69 0%, #3b4a96 48%, #3f2576 100%);
  background: linear-gradient(90deg, #a78b69 0%, #3b4a96 48%, #3f2576 100%) !important;
  color: #ffffff;
}

/* Active nav item on this page still uses scrap deep red */
body.scrap-page .header .nav-link-active,
body.scrap-page .header .dropdown-item-active {
  color: #C04040 !important;
}

/* ---------- Header layout: logo left · nav centered · actions right ---------- */
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}

.header .logo-container {
  flex-shrink: 0;
}

/* Nav links truly centered between logo and right actions */
.header nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.header .nav-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px 10px;
  flex-wrap: nowrap;
}

/* ---------- Navbar right actions (Language → Profile → Cart) ---------- */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 0;
  flex-shrink: 0;
}

/* Language button — "EN" only + chevron (no globe) */
.lang-selector {
  position: relative;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px 0 12px;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--foreground);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  white-space: nowrap;
  line-height: 1;
  letter-spacing: 0.02em;
}

.lang-btn:hover,
.lang-btn.open {
  border-color: var(--primary);
  background: rgba(165, 42, 42, 0.04);
  box-shadow: 0 0 0 3px rgba(165, 42, 42, 0.08);
}

.lang-btn .lang-label {
  color: var(--foreground);
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 13px;
}

.lang-btn .lang-chevron {
  font-size: 10px;
  color: var(--muted-foreground);
  transition: transform 0.25s ease;
  margin-left: 0;
}

.lang-btn.open .lang-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(17, 17, 17, 0.12);
  padding: 8px;
  z-index: 1200;
  animation: langDropIn 0.18s ease;
}

.lang-dropdown.open {
  display: block;
}

@keyframes langDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--foreground);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-option .lang-flag {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.lang-option:hover {
  background: rgba(165, 42, 42, 0.06);
  color: var(--primary);
}

.lang-option.active {
  background: rgba(165, 42, 42, 0.1);
  color: var(--primary);
  font-weight: 600;
}

/* Shared icon buttons */
.nav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  text-decoration: none;
  color: var(--primary);
  transition: color 0.2s ease, transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  position: relative;
}

.nav-icon-btn i {
  font-size: 20px;
  line-height: 1;
  color: var(--primary);
}

/* Notification bell (filled) */
.notif-selector {
  position: relative;
}

.notif-btn {
  background: transparent;
}

.notif-btn:hover {
  background: rgba(165, 42, 42, 0.06);
  transform: scale(1.06);
}

.notif-btn:hover i {
  color: var(--primary-glow);
}

.notif-btn.open {
  background: rgba(165, 42, 42, 0.08);
}

.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
  pointer-events: none;
}

.notif-badge[hidden] {
  display: none !important;
}

.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  max-width: min(300px, calc(100vw - 24px));
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(17, 17, 17, 0.12);
  z-index: 1200;
  overflow: hidden;
  animation: langDropIn 0.18s ease;
}

.notif-dropdown.open {
  display: block;
}

.notif-dropdown-header {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--foreground);
  border-bottom: 1px solid var(--border);
  background: #fafafb;
}

.notif-list {
  max-height: 420px;
  overflow-y: auto;
}

.notif-empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--muted-foreground);
}

.notif-item {
  display: block;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(229, 231, 235, 0.7);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
  cursor: pointer;
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:hover {
  background: rgba(165, 42, 42, 0.04);
}

.notif-item.unread {
  background: rgba(165, 42, 42, 0.04);
}

.notif-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 2px;
}

.notif-item-body {
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.4;
}

.notif-item-time {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

/* Profile: small filled icon inside circle */
.profile-selector {
  position: relative;
}

.profile-btn {
  width: 36px;
  height: 36px;
  background: linear-gradient(145deg, #faf2f2 0%, #f5e8e8 100%);
  border: 1.5px solid rgba(165, 42, 42, 0.18);
  box-shadow: 0 2px 6px rgba(165, 42, 42, 0.1);
}

.profile-btn i {
  font-size: 14px;
  color: var(--primary);
}

.profile-btn:hover,
.profile-btn.open {
  background: linear-gradient(145deg, #f5e8e8 0%, #edd6d6 100%);
  border-color: rgba(165, 42, 42, 0.3);
  box-shadow: 0 4px 12px rgba(165, 42, 42, 0.16);
  transform: translateY(-1px);
}

.profile-btn:hover i,
.profile-btn.open i {
  color: var(--primary-glow);
}

/* Profile dropdown menu (compact, transparent-white) */
.profile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(17, 17, 17, 0.12);
  padding: 6px;
  z-index: 1200;
  animation: langDropIn 0.18s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.profile-dropdown.open {
  display: block;
}

.profile-menu-item {
  display: block;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.profile-menu-item:hover {
  background: rgba(165, 42, 42, 0.06);
  color: var(--primary);
  text-decoration: none;
}

.profile-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 8px;
}

.profile-menu-logout {
  color: #dc2626 !important;
  font-weight: 600;
}

.profile-menu-logout:hover {
  background: rgba(220, 38, 38, 0.08) !important;
  color: #b91c1c !important;
}

/* Responsive: keep icons tidy on smaller screens */
@media (max-width: 768px) {
  .header .container {
    gap: 12px;
  }
  .nav-actions {
    gap: 2px;
  }
  .lang-btn {
    padding: 0 10px;
    min-width: 48px;
    justify-content: center;
  }
  .nav-icon-btn {
    width: 38px;
    height: 38px;
  }
  .nav-icon-btn i {
    font-size: 18px;
  }
  .profile-btn {
    width: 34px;
    height: 34px;
  }
  .notif-dropdown {
    right: -40px;
  }
}

/* ---------- Trade Toolbar ---------- */
.trade-toolbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.trade-toolbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--ad-width);
  gap: 20px;
  align-items: center;
}

.trade-page-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
  white-space: nowrap;
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.details-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--primary);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}
.details-back-link:hover {
  background: rgba(165, 42, 42, 0.08);
  color: var(--primary-glow);
}
.details-back-link i {
  font-size: 14px;
}

.toolbar-right {
  grid-column: 2 / 4;
  display: grid;
  grid-template-columns: 1fr var(--ad-width);
  align-items: center;
  gap: 20px;
  width: 100%;
}

/* Search bar width matched to main card column (1fr area) */
.search-wrap {
  display: flex;
  align-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 10px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(165, 42, 42, 0.1);
  background: transparent;
}
.search-wrap .search-icon-btn {
  color: var(--muted-foreground);
  font-size: 13px;
  cursor: pointer;
  padding: 8px 4px;
  transition: color 0.15s ease;
  flex-shrink: 0;
}
.search-wrap .search-icon-btn:hover {
  color: var(--primary);
}
.search-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 6px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  color: var(--foreground);
  font-weight: 500;
  min-width: 0;
}
.search-wrap input::placeholder {
  color: var(--muted-foreground);
  font-weight: 400;
}

/* Post button width matched to ad card (240px) */
.btn-post {
  background: var(--gradient-primary);
  color: var(--primary-foreground);
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.25s ease;
  font-family: inherit;
  box-shadow: var(--shadow-glow);
  width: var(--ad-width);
  min-width: var(--ad-width);
  max-width: var(--ad-width);
  flex-shrink: 0;
}
.btn-post:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -10px rgba(165, 42, 42, 0.40);
  filter: brightness(1.05);
}

/* ---------- Layout ---------- */
.page-layout {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--ad-width);
  gap: 20px;
  padding: 20px 24px 40px;
  align-items: start;
  background: var(--muted);
  min-height: 60vh;
}

/* ---------- Filter sidebar ---------- */
.filter-sidebar {
  background: transparent;
  border-right: 1px solid var(--border);
  padding: 8px 16px 16px 0;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.filter-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: -0.02em;
}

.btn-apply {
  background: #ffffff;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.btn-apply:hover {
  background: rgba(165, 42, 42, 0.06);
}

.filter-group {
  padding: 2px 0;
}

.filter-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  cursor: pointer;
  user-select: none;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}
.filter-main:hover {
  background: rgba(165, 42, 42, 0.04);
}

.filter-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  color: var(--primary);
  font-size: 14px;
  flex-shrink: 0;
}
.filter-icon i {
  color: #C04040;
}
.card-global-icon {
  color: #C04040 !important;
}

.filter-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}
.filter-main .chevron {
  font-size: 11px;
  color: var(--muted-foreground);
  transition: transform 0.25s ease;
}
.filter-group.open .chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.filter-options {
  display: none;
  padding: 2px 0 8px 32px;
  flex-direction: column;
  gap: 5px;
}
.filter-group.open .filter-options {
  display: flex;
  max-height: 480px;
  overflow-y: auto;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 2px 0;
}
.checkbox-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
  cursor: pointer;
}
.checkbox-item:hover {
  color: var(--foreground);
}

.country-select-wrap {
  padding-left: 32px !important;
}
.country-select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-family: inherit;
  background: #fff;
  color: var(--foreground);
  outline: none;
  cursor: pointer;
}
.country-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(165, 42, 42, 0.1);
}

.filter-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.btn-clear {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.btn-clear:hover {
  border-color: var(--destructive);
  color: var(--destructive);
  background: rgba(201, 55, 45, 0.04);
}

/* ---------- Inquiry cards ---------- */
.inquiry-main {
  min-width: 0;
}
.inquiry-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inquiry-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.inquiry-card:hover {
  box-shadow: var(--shadow-panel);
  border-color: rgba(165, 42, 42, 0.2);
}
.inquiry-card.is-hidden {
  display: none;
}

.card-collapsed {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
}

.card-summary {
  flex: 1;
  min-width: 0;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-global-icon {
  font-size: 14px;
  color: var(--primary);
  flex-shrink: 0;
  opacity: 0.9;
}
.card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 16px;
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.45;
}
.card-meta span {
  min-width: 0;
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.card-meta .label {
  font-weight: 500;
  color: var(--foreground);
}
.card-meta .meta-industry {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--foreground);
  grid-column: 1 / -1;
}
.card-meta .meta-sep {
  color: var(--muted-foreground);
  font-weight: 400;
  margin: 0 4px;
}
.card-meta .meta-yes {
  color: var(--success);
  font-weight: 600;
}
.card-meta .meta-no {
  color: var(--destructive);
  font-weight: 600;
}
/* MoQ · Reg. Required · Supply To — single 3-column row */
.card-meta .meta-row-3 {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3px 12px;
  min-width: 0;
}
.card-meta .meta-row-3 > span {
  min-width: 0;
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* View icon button (slightly smaller) */
.card-view-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 2px;
  background: rgba(165, 42, 42, 0.06);
  border: 1px solid rgba(165, 42, 42, 0.15);
  text-decoration: none;
  transition: all 0.2s ease;
}
.card-view-btn:hover {
  background: rgba(165, 42, 42, 0.12);
  border-color: var(--primary);
  color: var(--primary-glow);
  transform: scale(1.05);
}

/* ---------- Pagination ---------- */
.pagination-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}
.page-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: flex-end;
  width: 100%;
}
.page-info {
  font-size: 13px;
  color: var(--muted-foreground);
  font-weight: 500;
}
.page-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}
.page-btn {
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  color: var(--foreground);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}
.page-btn i { font-size: 12px; }
.page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}
.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.page-btn-nav {
  color: var(--muted-foreground);
}
.page-ellipsis {
  padding: 0 4px;
  color: var(--muted-foreground);
  font-size: 13px;
}

/* ---------- Ad sidebar ---------- */
.ad-sidebar {
  position: sticky;
  top: 100px;
}
.ad-card {
  background: linear-gradient(165deg, #ffffff 0%, #faf2f2 55%, #f5e8e8 100%);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  color: var(--foreground);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(208, 96, 96, 0.35);
}
.ad-card-tall {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.ad-visual {
  position: relative;
  height: 100px;
  margin-bottom: 20px;
}
.ad-pills {
  display: flex;
  gap: 6px;
  position: absolute;
  bottom: 10px;
  left: 10px;
}
.ad-pills .pill {
  width: 18px;
  height: 10px;
  border-radius: 10px;
  background: rgba(208, 96, 96, 0.35);
}
.ad-pills .pill:nth-child(2) {
  background: rgba(208, 96, 96, 0.55);
  width: 22px;
}
.ad-pills .pill:nth-child(3) {
  background: rgba(208, 96, 96, 0.75);
}
.ad-vial {
  position: absolute;
  right: 20px;
  top: 0;
  width: 28px;
  height: 60px;
  border: 2px solid rgba(208, 96, 96, 0.55);
  border-radius: 4px 4px 8px 8px;
  background: rgba(208, 96, 96, 0.12);
}
.ad-vial::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 8px;
  border: 2px solid rgba(208, 96, 96, 0.55);
  border-radius: 3px 3px 0 0;
}
.ad-content h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.35;
  color: var(--primary);
}
.ad-content p {
  font-size: 13px;
  margin-bottom: 20px;
  color: var(--muted-foreground);
  line-height: 1.55;
}
.ad-cta {
  display: inline-block;
  background: var(--gradient-primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
}
.ad-cta:hover {
  background: var(--primary-glow);
  transform: translateY(-1px);
}

/* ---------- Details page panel ---------- */
.details-page-panel {
  min-height: 200px;
}
.details-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted-foreground);
  font-size: 14px;
}
.details-page-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 20px 22px 24px;
  overflow: hidden;
}
.details-page-header {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.details-breadcrumb {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 400;
  margin: 0 0 6px 0;
  letter-spacing: 0.01em;
  line-height: 1.2;
}
.details-breadcrumb a {
  color: #94a3b8;
  text-decoration: none;
}
.details-breadcrumb a:hover {
  color: var(--primary);
}
.details-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.details-page-heading {
  font-size: 18px;
  font-weight: 700;
  color: var(--foreground);
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.details-id {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 6px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.details-industry-line {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  font-weight: 500;
  line-height: 1.3;
}
.details-industry-line .meta-sep {
  color: #cbd5e1;
  margin: 0 4px;
}

/* Detail sections (shared with modal styles) */
.detail-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 18px;
}
.detail-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.detail-label {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 500;
  line-height: 1.25;
}
.detail-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
  line-height: 1.35;
  word-break: break-word;
}
.detail-value.yes { color: var(--success); }
.detail-value.no { color: var(--destructive); }
.detail-value.contacted {
  color: var(--success);
  font-weight: 600;
}

.details-contacted-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--success);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.details-contacted-note i {
  font-size: 14px;
}

.buyer-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  margin-bottom: 14px;
}
.buyer-details-hint {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  margin: 0;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.detail-section {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.detail-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.detail-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.details-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 0;
  border-top: none;
}
.details-page-actions .btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--foreground);
  transition: all 0.2s ease;
}
.details-page-actions .btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(165, 42, 42, 0.05);
}
.details-page-actions .btn-important.starred {
  color: var(--gold-accent);
  border-color: var(--gold-accent);
  background: rgba(208, 96, 96, 0.1);
}
/* Contact Buyer → Contacted Buyer (green) */
.details-page-actions .btn-contacted,
.details-page-actions .btn-outline.btn-contacted {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
  font-weight: 600;
  cursor: default;
  pointer-events: none;
}
.details-page-actions .btn-contacted:hover,
.details-page-actions .btn-outline.btn-contacted:hover {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}

/* ---------- Modals ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 5, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 1;
  visibility: visible;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-overlay.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.modal-box {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  max-height: min(90vh, 900px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-panel);
  animation: modalIn 0.25s ease;
}
.modal-box.details-modal {
  border-radius: 16px;
  max-width: 780px;
  max-height: min(90vh, 900px);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 22px 12px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  z-index: 2;
  flex-shrink: 0;
}
.modal-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: -0.02em;
  margin: 0;
}
.modal-close {
  background: var(--muted);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  color: var(--muted-foreground);
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: 12px;
}
.modal-close:hover {
  color: var(--foreground);
  background: var(--secondary);
}

.modal-body {
  padding: 14px 22px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.modal-footer {
  flex-shrink: 0;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--foreground);
  transition: all 0.2s ease;
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(165, 42, 42, 0.05);
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: var(--gradient-button);
  color: #fff;
  transition: all 0.2s ease;
}
.btn-primary:hover {
  filter: brightness(1.06);
  color: #fff;
}

/* ===== Contact Buyer modals (match design screenshots) ===== */
.phx-credit-modal,
.phx-compose-modal {
  max-width: 520px;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 900px);
}
.phx-success-modal {
  max-width: 420px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 900px);
}
.phx-credit-header {
  padding: 18px 22px 12px;
  border-bottom: none;
  flex-shrink: 0;
}
.phx-credit-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #6B2020;
}
.phx-credit-body {
  padding: 8px 22px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.phx-compose-body {
  padding: 8px 22px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.phx-success-body {
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.phx-credit-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  background: #faf2f2;
  border-radius: 14px;
  padding: 18px 12px;
  margin-bottom: 22px;
}
.phx-credit-cell {
  text-align: center;
  padding: 0 8px;
  position: relative;
}
.phx-credit-cell:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 12%;
  height: 76%;
  width: 1px;
  background: rgba(165, 42, 42, 0.12);
}
.phx-credit-icon-wrap {
  width: 36px;
  height: 36px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: rgba(165, 42, 42, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #C04040;
  font-size: 14px;
}
.phx-credit-letter {
  font-weight: 700;
  font-size: 15px;
  color: #C04040;
}
.phx-credit-cell-label {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
  font-weight: 500;
}
.phx-credit-cell-value {
  font-size: 14px;
  font-weight: 700;
  color: #6B2020;
}
.phx-credit-zero {
  color: #c4a35a !important;
}
.phx-credit-theme {
  color: #C04040 !important;
}
.phx-buy-credits-text {
  font-size: 13px;
  font-weight: 700;
  color: #C04040;
  display: inline-block;
  cursor: default;
  pointer-events: none;
  user-select: none;
}
.phx-buy-credits-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  color: #C04040;
  cursor: pointer;
  font-family: inherit;
}
.phx-buy-credits-link:hover .disabled-hover {
  text-decoration: underline;
}
.phx-credit-cta-wrap {
  display: flex;
  justify-content: center;
}
.phx-buy-now-btn {
  min-width: 200px;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 14px;
  background: #A52A2A;
}
.phx-buy-now-btn:hover {
  background: #A52A2A;
}

.phx-form-group {
  margin-bottom: 14px;
}
.phx-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #6B2020;
  margin-bottom: 6px;
}
.phx-req {
  color: #dc2626;
}
.phx-input,
.phx-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  font-family: inherit;
  color: #6B2020;
  outline: none;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.phx-input:focus,
.phx-textarea:focus {
  border-color: #C04040;
  box-shadow: 0 0 0 3px rgba(165, 42, 42, 0.1);
}
.phx-textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.5;
}
.phx-char-count {
  text-align: right;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}
.phx-compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.phx-deduct-note {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 180px;
  line-height: 1.4;
}
.phx-deduct-note i {
  color: #C04040;
  opacity: 0.7;
}
.phx-send-msg-btn {
  border-radius: 10px;
  padding: 11px 20px;
  background: #A52A2A;
  white-space: nowrap;
}
.phx-send-msg-btn:hover {
  background: #A52A2A;
}

/* Success modal */
.phx-success-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}
.phx-success-body {
  text-align: center;
  padding: 32px 28px 28px;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.phx-success-check {
  font-size: 48px;
  color: #16a34a;
  line-height: 1;
  margin-bottom: 12px;
}
.phx-success-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: #16a34a;
}
.phx-success-sub {
  margin: 0 0 20px;
  font-size: 13px;
  color: #64748b;
}
.phx-success-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}
.phx-success-stat {
  padding: 16px 12px;
  text-align: center;
}
.phx-success-stat:first-child {
  border-right: 1px solid #e2e8f0;
}
.phx-success-stat-label {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
  font-weight: 500;
}
.phx-success-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: #C04040;
}

@media (max-width: 520px) {
  .phx-credit-strip {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .phx-credit-cell:not(:last-child)::after {
    display: none;
  }
  .phx-compose-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .phx-send-msg-btn {
    width: 100%;
    justify-content: center;
  }
}

.contact-modal,
.contact-flow-modal {
  max-width: 440px;
  border-radius: 16px;
  overflow: hidden;
}
.contact-flow-body {
  padding: 18px 22px 20px;
}
.contact-support-text {
  font-size: 14px;
  line-height: 1.55;
  color: #475569;
  margin: 0 0 18px 0;
}
.contact-flow-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

/* Credit balance */
.credit-balance-box {
  text-align: center;
}
.credit-balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.credit-label {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}
.credit-points {
  font-size: 22px;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: -0.02em;
}
.credit-hint {
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
  margin: 0 0 16px 0;
  text-align: left;
}
.btn-buy-credits {
  width: 100%;
  justify-content: center;
  padding: 11px 16px;
}

/* Credit utilized */
.credit-utilized-box {
  text-align: left;
}
.credit-utilized-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  margin-bottom: 4px;
}
.credit-utilized-amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  line-height: 1.1;
}
.credit-utilized-note {
  font-size: 12px;
  color: #94a3b8;
  margin: 0 0 14px 0;
  line-height: 1.4;
}

/* Success */
.contact-success-modal .contact-flow-body {
  text-align: center;
}
.contact-success-icon {
  font-size: 42px;
  color: var(--success, #16a34a);
  margin-bottom: 12px;
  line-height: 1;
}
.contact-success-text {
  font-size: 14px;
  line-height: 1.55;
  color: #475569;
  margin: 0 0 18px 0;
}
.contact-success-modal .contact-flow-actions {
  justify-content: center;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--foreground);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-panel);
  z-index: 3000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: var(--success); }
.toast.info { background: var(--primary); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted-foreground);
}
.empty-state i {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.35;
  color: var(--primary);
}
.empty-state p {
  font-size: 14px;
}
.empty-state a {
  color: var(--primary);
  font-weight: 600;
}

@media (max-width: 1100px) {
  .page-layout {
    grid-template-columns: var(--sidebar-width) 1fr;
  }
  .ad-sidebar { 
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
  }
  .trade-toolbar-inner {
    grid-template-columns: var(--sidebar-width) 1fr;
  }
  .toolbar-right {
    grid-column: 2;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
  }
  .btn-post {
    width: auto;
    min-width: 0;
    max-width: none;
  }
}
@media (max-width: 768px) {
  .page-layout {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .filter-sidebar {
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0 0 16px 0;
  }
  .trade-toolbar-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .trade-page-title {
    grid-column: auto;
  }
  .toolbar-right {
    grid-column: auto;
    margin-left: 0;
    flex-wrap: wrap;
    justify-content: stretch;
  }
  .search-wrap {
    width: 100%;
    flex: 1 1 100%;
  }
  .btn-post {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    max-width: none;
    justify-content: center;
  }
  .card-meta {
    grid-template-columns: 1fr;
  }
  .card-meta .meta-row-3 {
    grid-template-columns: 1fr;
    gap: 3px 0;
  }
  .pagination-bar {
    justify-content: center;
  }
  .detail-grid-3 {
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
  }
  .details-page-heading {
    font-size: 16px;
  }
}
@media (max-width: 420px) {
  .detail-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ===== Buyer Details unlock flow ===== */
.details-page-actions .btn-buyer-unlocked,
.details-page-actions .btn-outline.btn-buyer-unlocked {
  background: #fef9c3;
  border-color: #eab308;
  color: #a16207;
  font-weight: 600;
}
.details-page-actions .btn-buyer-unlocked:hover,
.details-page-actions .btn-outline.btn-buyer-unlocked:hover {
  background: #fef08a;
  border-color: #ca8a04;
  color: #854d0e;
}

.phx-buyer-modal {
  max-width: 480px;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 900px);
}
.phx-buyer-profile-modal {
  max-width: 560px;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 900px);
}
.phx-buyer-body {
  padding: 8px 22px 22px;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.phx-buyer-center-body {
  text-align: center;
}

.phx-buyer-lock-block {
  text-align: center;
  padding: 12px 8px 4px;
}
.phx-buyer-lock-icon {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(145deg, #faf2f2 0%, #f0dede 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #C04040;
  font-size: 28px;
}
.phx-lock-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 14px;
  background: #fff;
  color: #C04040;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.phx-buyer-lock-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: #6B2020;
}
.phx-buyer-lock-sub {
  margin: 0 0 18px;
  font-size: 13px;
  color: #64748b;
}
.phx-buyer-continue {
  min-width: 160px;
  justify-content: center;
  border-radius: 10px;
  padding: 11px 22px;
  background: #A52A2A;
  gap: 8px;
}
.phx-buyer-continue:hover {
  background: #A52A2A;
}
.phx-buyer-close-btn {
  min-width: 120px;
  justify-content: center;
  border-radius: 10px;
  padding: 10px 20px;
}

.phx-buyer-granted-block {
  text-align: center;
  padding: 8px 8px 4px;
}
.phx-buyer-granted-icon {
  font-size: 48px;
  color: #16a34a;
  line-height: 1;
  margin-bottom: 10px;
}
.phx-buyer-granted-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: #16a34a;
}
.phx-buyer-granted-sub {
  margin: 0 0 18px;
  font-size: 13px;
  color: #64748b;
}

/* Buyer profile 2-column layout (matches screenshot) */
.phx-bd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 40px;
  margin-bottom: 16px;
}
.phx-bd-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.phx-bd-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.phx-bd-label {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
  line-height: 1.3;
}
.phx-bd-value {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
  word-break: break-word;
}
.phx-buyer-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
  margin-bottom: 14px;
}
.phx-buyer-profile-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.phx-buyer-profile-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  text-transform: none;
}
.phx-buyer-profile-value {
  font-size: 13px;
  font-weight: 600;
  color: #6B2020;
  word-break: break-word;
}
.phx-verified-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #159644;
  background: #dcfce7;
  padding: 2px 10px;
  border-radius: 999px;
}
.phx-verified-pill.pending {
  color: #a87c1c;
  background: #fef9c3;
}
.phx-buyer-confidential-note {
  margin: 0;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e2e8f0;
}
.phx-buyer-confidential-note i {
  color: #94a3b8;
}
.phx-buyer-profile-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 22px 18px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: #fff;
}

.phx-buyer-saved-block {
  text-align: center;
  padding: 28px 16px 12px;
}
.phx-buyer-saved-icon {
  font-size: 52px;
  color: #16a34a;
  line-height: 1;
  margin-bottom: 12px;
}
.phx-buyer-saved-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: #16a34a;
}
.phx-buyer-saved-sub {
  margin: 0 0 20px;
  font-size: 13px;
  color: #64748b;
}

@media (max-width: 520px) {
  .phx-buyer-profile-grid {
    grid-template-columns: 1fr;
  }
  .phx-buyer-profile-footer {
    flex-direction: column-reverse;
  }
  .phx-buyer-profile-footer .btn-outline,
  .phx-buyer-profile-footer .btn-primary {
    width: 100%;
    justify-content: center;
  }
}




/* Post Requirements modal note + continue (matches design) */
.phx-post-info-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 18px;
  padding: 12px 14px;
  background: #faf2f2;
  border: 1px solid #f0dede;
  border-radius: 12px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
  text-align: left;
  box-sizing: border-box;
}
.phx-post-info-banner i {
  color: #94a3b8;
  font-size: 14px;
  flex-shrink: 0;
}
.phx-post-info-banner span {
  flex: 1;
  min-width: 0;
  color: #64748b;
}
.phx-post-cta-wrap {
  display: flex !important;
  justify-content: center !important;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 4px 0 8px;
}
.phx-post-continue-btn {
  min-width: 240px;
  width: min(100%, 280px);
  justify-content: center;
  border-radius: 12px;
  padding: 13px 32px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: var(--gradient-button) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(45, 27, 105, 0.25);
  display: inline-flex;
  align-items: center;
}
.phx-post-continue-btn:hover {
  filter: brightness(1.06);
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(165, 42, 42, 0.32);
}

/* Post Requirements: single + bulk split */
.phx-post-split-modal {
  max-width: 720px;
  width: min(720px, calc(100vw - 32px));
}
.phx-post-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 4px;
  border: 1px solid #f0dede;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.phx-post-split-col {
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 240px;
}

/* LEFT card — scrap theme soft red (not purple) */
.phx-post-split-single {
  border-right: 1px solid #f0dede;
  background: #faf2f2;
  position: relative;
}
.phx-post-split-single::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #A52A2A;
}

/* RIGHT card */
.phx-post-split-bulk {
  background: #ffffff;
}

/* Headings with icons – no background */
.phx-post-split-title {
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: #6B2020;
  text-transform: none;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  min-height: 24px;
}
.phx-post-split-title i {
  font-size: 15px;
  flex-shrink: 0;
  width: 1.2em;
  text-align: center;
  line-height: 1;
}
.phx-post-split-single .phx-post-split-title {
  color: #C04040;
}
.phx-post-split-single .phx-post-split-title i {
  color: #C04040;
}
.phx-post-split-bulk .phx-post-split-title {
  color: #A52A2A;
}
.phx-post-split-bulk .phx-post-split-title i {
  color: #C04040;
}

/* Middle row – same height on both sides so banners + buttons align */
.phx-post-mid {
  min-height: 40px;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
}
.phx-post-split-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #64748b;
}
.phx-post-split-desc strong {
  color: #C04040;
  font-weight: 600;
}

/* Left info banner = white */
.phx-post-split-single .phx-post-info-banner {
  margin: 0 0 14px;
  padding: 10px 12px;
  font-size: 12px;
  flex: 0 0 auto;
  background: #ffffff;
  border: 1px solid #f0dede;
  color: #64748b;
}
.phx-post-split-single .phx-post-info-banner i {
  color: #C04040;
}

/* Right info banner = soft red */
.phx-post-split-bulk .phx-post-info-banner {
  margin: 0 0 14px;
  padding: 10px 12px;
  font-size: 12px;
  flex: 0 0 auto;
  background: #faf2f2;
  border: 1px solid #f0dede;
}

.phx-post-split-col .phx-post-cta-wrap {
  margin-top: auto;
  padding: 4px 0 0;
}
.phx-post-split-col .phx-post-continue-btn {
  min-width: 0;
  width: 100%;
  max-width: none;
  padding: 12px 16px;
  font-size: 13.5px;
  background: var(--gradient-button) !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(165, 42, 42, 0.22);
}
.phx-post-split-col .phx-post-continue-btn:hover {
  filter: brightness(1.06);
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(165, 42, 42, 0.3);
}

/* Bulk: label + input same line */
.phx-bulk-qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  flex-wrap: nowrap;
  width: 100%;
}
.phx-bulk-qty-row .phx-bulk-qty-label {
  display: inline;
  margin: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
  flex-shrink: 0;
}
.phx-bulk-qty-row .phx-bulk-qty-input {
  width: 72px;
  flex: 0 0 72px;
  height: 36px;
  padding: 0 8px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: #6B2020;
  text-align: center;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.phx-bulk-qty-row .phx-bulk-qty-input:focus {
  border-color: #C04040;
  box-shadow: 0 0 0 3px rgba(165, 42, 42, 0.12);
}

/* legacy */
.phx-bulk-qty-wrap { margin-bottom: 12px; }
.phx-bulk-qty-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #344054;
  margin-bottom: 6px;
}
.phx-bulk-qty-input {
  width: 100%;
  box-sizing: border-box;
  height: 42px;
  padding: 0 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #6B2020;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.phx-bulk-qty-input:focus {
  border-color: #C04040;
  box-shadow: 0 0 0 3px rgba(165, 42, 42, 0.1);
}
.phx-bulk-credit-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: #faf2f2;
  border: 1px solid #f0dede;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}
.phx-bulk-credit-line i {
  color: #C04040;
  margin-top: 2px;
  flex-shrink: 0;
}
.phx-bulk-credit-line strong {
  color: #C04040;
  font-weight: 700;
}
.phx-post-bulk-btn {
  background: #8B1A1A !important;
}
@media (max-width: 640px) {
  .phx-post-split {
    grid-template-columns: 1fr;
  }
  .phx-post-split-single {
    border-right: none;
    border-bottom: 1px solid #f0dede;
  }
  .phx-post-split-single::before {
    width: 100%;
    height: 4px;
    bottom: auto;
  }
  .phx-post-split-col {
    min-height: 0;
  }
}

/* ===== Auto breadcrumb (subtle) — trade page ===== */
.phx-breadcrumb-wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 24px 14px;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  clear: both;
  display: block;
  background: #ffffff !important;
  background-color: #ffffff !important;
}
.post-page > .phx-breadcrumb-wrap {
  padding: 4px 0 14px;
  max-width: none;
  background: #ffffff !important;
  background-color: #ffffff !important;
}
.page-container > .phx-breadcrumb-wrap {
  padding: 10px 0 12px;
  grid-column: 1 / -1;
}
/* Keep little distance between path and banner image */
.phx-breadcrumb-wrap + .trade-banner {
  margin-top: 6px;
}
.phx-breadcrumb {
  font-size: 12px;
  line-height: 1.45;
}
.phx-bc-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 22px;
}
.phx-bc-item {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  flex-shrink: 0;
}
.phx-bc-link {
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
  white-space: nowrap;
}
.phx-bc-link:hover {
  color: #C04040;
  text-decoration: none;
}
.phx-bc-current {
  color: #64748b;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}
.phx-bc-sep {
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  color: #cbd5e1;
  font-size: 9px;
  list-style: none;
  flex-shrink: 0;
}
.phx-bc-sep i {
  font-size: 9px;
}
@media (max-width: 600px) {
  .phx-breadcrumb-wrap {
    padding: 10px 14px 12px;
  }
  .phx-bc-current {
    max-width: 160px;
  }
  .phx-breadcrumb-wrap + .trade-banner {
    margin-top: 4px;
  }
}

/* =========================================================
   TRADE INQUIRIES BANNER — image-based hero
   Background image: images/trade-banner-bg.jpg
   Theme: professional red (scrap page)
========================================================= */
.trade-banner {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 180px;
  overflow: hidden;
  border-top: 1px solid rgba(165, 42, 42, 0.08);
  border-bottom: 1px solid rgba(165, 42, 42, 0.12);
  /* Banner background image — full width */
  background-color: #C04040;
  background-image: url("../images/trade-banner.png");
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
  box-sizing: border-box;
}

/* Full-bleed background image layer */
.trade-banner-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("../images/trade-banner.png");
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
}

/* No left shadow — transparent overlay (kept for structure) */
.trade-banner-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: transparent;
  pointer-events: none;
}

/* Content — high-contrast text without dark panel */
.trade-banner-content {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  box-sizing: border-box;
}

.trade-banner-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.trade-banner-content h2 {
  max-width: 440px;
  margin: 0;
  color: #ffffff;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 12px rgba(30, 20, 60, 0.45);
}

.trade-banner-content p {
  max-width: 420px;
  margin: 8px 0 0;
  color: #e8e4f4;
  font-size: 13.5px;
  line-height: 1.45;
  font-weight: 450;
  text-shadow: 0 1px 8px rgba(30, 20, 60, 0.35);
}

/* Desktop */
@media (min-width: 1100px) {
  .trade-banner {
    height: 190px;
  }
  .trade-banner-content {
    padding-left: 24px;
  }
  .trade-banner-bg {
    background-position: center right 5%;
  }
}

/* Tablet */
@media (max-width: 900px) {
  .trade-banner {
    height: 170px;
  }
  .trade-banner-content h2 {
    font-size: 24px;
    max-width: 380px;
  }
  .trade-banner-content p {
    max-width: 360px;
    font-size: 13px;
  }
  .trade-banner-overlay {
    background: transparent;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .trade-banner {
    height: 160px;
  }
  .trade-banner-content {
    justify-content: center;
    padding: 16px 20px;
  }
  .trade-banner-content h2 {
    max-width: 100%;
    font-size: 22px;
    line-height: 1.2;
  }
  .trade-banner-content p {
    max-width: 100%;
    margin-top: 6px;
    font-size: 12.5px;
    line-height: 1.4;
  }
  .trade-banner-bg {
    background-position: center center;
  }
  .trade-banner-overlay {
    background: transparent;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .trade-banner {
    height: 150px;
  }
  .trade-banner-content {
    padding: 14px 16px;
  }
  .trade-banner-badge {
    font-size: 10px;
    padding: 4px 10px;
    margin-bottom: 6px;
  }
  .trade-banner-content h2 {
    font-size: 20px;
  }
  .trade-banner-content p {
    font-size: 12px;
  }
}

/* Unified light page background */
body { background: #f4f6f9 !important; }


/* Path bar white bg force — match header */
.phx-breadcrumb-wrap {
  background: #ffffff !important;
  background-color: #ffffff !important;
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
}

/* Details scrap: full-row fields + wrap + status */
.detail-cell-span-2 { grid-column: span 2; }
.detail-cell-span-3 { grid-column: 1 / -1; }
.detail-value-wrap {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
}
.detail-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}
.detail-status-verified {
  color: #0e9f6e;
}
.detail-status-pending {
  color: #94a3b8;
}
@media (max-width: 900px) {
  .detail-cell-span-2,
  .detail-cell-span-3 { grid-column: 1 / -1; }
}


.card-meta .meta-details-text {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: inline;
}

/* THEME-MATCH NOTIF + PROFILE ICONS */
/* Force notif + profile icons to page theme (header otherwise uses brand purple) */
.header .nav-icon-btn,
.header .nav-icon-btn i,
.header .notif-btn i {
  color: #A52A2A !important;
}
.header .notif-btn:hover {
  background: rgba(165, 42, 42, 0.06) !important;
}
.header .notif-btn:hover i,
.header .notif-btn.open i {
  color: #C04040 !important;
}
.header .notif-btn.open {
  background: rgba(165, 42, 42, 0.08) !important;
}
.header .profile-btn {
  background: linear-gradient(145deg, #fdf5f5 0%, #f8ebeb 100%) !important;
  border: 1.5px solid rgba(165, 42, 42, 0.18) !important;
  box-shadow: 0 2px 6px rgba(165, 42, 42, 0.1) !important;
}
.header .profile-btn i {
  color: #A52A2A !important;
}
.header .profile-btn:hover,
.header .profile-btn.open {
  background: linear-gradient(145deg, #f8ebeb 0%, #f0d6d6 100%) !important;
  border-color: rgba(165, 42, 42, 0.3) !important;
  box-shadow: 0 4px 12px rgba(165, 42, 42, 0.16) !important;
}
.header .profile-btn:hover i,
.header .profile-btn.open i {
  color: #C04040 !important;
}

/* ===== Details label same size as other field labels (not big text) ===== */
.card-meta .meta-details-row {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  margin-top: 0;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
  font-size: 12px; /* match .card-meta */
  color: var(--muted-foreground);
}
.card-meta .meta-details-row .label {
  font-weight: 500; /* same as .card-meta .label */
  color: var(--foreground);
  margin-right: 4px;
  font-size: inherit; /* not larger */
}
.card-meta .meta-full {
  grid-column: 1 / -1;
  display: block;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
  font-size: 12px;
}
.card-meta .meta-full .label {
  font-weight: 500;
  color: var(--foreground);
  margin-right: 4px;
  font-size: inherit;
}

/* ===== Auto-wrap long field values without breaking grid ===== */
.card-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal; /* wrap when needed instead of hard ellipsis-only */
}
.card-meta .meta-row-3 > span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.detail-value {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.detail-value-wrap {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
  display: block;
}
.detail-cell {
  min-width: 0; /* allow grid children to shrink/wrap */
}

/* Notification count only when there are unread messages */
.notif-badge[hidden],
.notif-badge:empty {
  display: none !important;
}
