/* ── afrAIca Pulse - Deal Room Styles (Mobile-First) ─────────────────────── */

/* ── Deal Room Layout ─────────────────────────────────────────────────────── */
.dealroom-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 768px) {
  .dealroom-layout {
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    padding: 1.5rem;
  }
}

/* ── Mobile filter toggle ─────────────────────────────────────────────────── */
.filters-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.25rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  transition: border-color var(--transition);
}
.filters-toggle:hover { border-color: var(--primary); }
.filters-toggle-icon {
  font-size: 1.2rem;
  transition: transform var(--transition);
}
.filters-toggle[aria-expanded="true"] .filters-toggle-icon { transform: rotate(180deg); }

@media (min-width: 768px) {
  .filters-toggle { display: none; }
}

/* ── Filters Sidebar ──────────────────────────────────────────────────────── */
.filters-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: none; /* hidden on mobile until toggled */
}

.filters-sidebar.open { display: block; }

@media (min-width: 768px) {
  .filters-sidebar {
    display: block;
    position: sticky;
    top: calc(var(--header-height) + 1rem);
  }
}

.filters-sidebar h3 {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1.25rem;
}

.filter-section { margin-bottom: 1.75rem; }
.filter-section:last-child { margin-bottom: 0; }

.filter-section h4 {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.filter-list { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; }

.filter-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.5rem;
  min-height: 44px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: all var(--transition);
  user-select: none;
}

@media (min-width: 768px) {
  .filter-item { padding: 0.35rem 0.5rem; min-height: unset; font-size: 0.85rem; }
}

.filter-item:hover { background: var(--surface-2); color: var(--text); }
.filter-item.active { color: var(--primary); background: rgba(204, 0, 0, 0.08); }

.filter-checkbox {
  width: 18px;
  height: 18px;
  border: 1px solid var(--text-dim);
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

@media (min-width: 768px) {
  .filter-checkbox { width: 16px; height: 16px; }
}

.filter-item.active .filter-checkbox {
  background: var(--primary);
  border-color: var(--primary);
}
.filter-item.active .filter-checkbox::after {
  content: '✓';
  color: #F2F0EB;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.filter-count {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-dim);
  background: var(--surface-2);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

.filter-search {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem; /* 16px minimum prevents iOS zoom */
  margin-bottom: 1.5rem;
  min-height: 48px;
  transition: border-color var(--transition);
  -webkit-appearance: none;
}

@media (min-width: 768px) {
  .filter-search {
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
    min-height: unset;
  }
}

.filter-search:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  border-color: var(--primary);
}
.filter-search::placeholder { color: var(--text-dim); }

.filter-actions { display: flex; flex-direction: column; gap: 0.5rem; }

/* ── Vendor Grid ──────────────────────────────────────────────────────────── */
.vendors-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .vendors-toolbar { gap: 1rem; margin-bottom: 1.5rem; }
}

.vendors-count { font-size: 0.85rem; color: var(--text-muted); }
.vendors-count strong { color: var(--text); }

.sort-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  margin-left: auto;
  cursor: pointer;
  min-height: 44px;
  -webkit-appearance: none;
}
.sort-select:focus { outline: 2px solid var(--primary); outline-offset: -1px; }


.vendor-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 520px) {
  .vendor-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

.vendor-grid.list-view { grid-template-columns: 1fr; }

.vendor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color var(--transition);
  cursor: pointer;
}

@media (min-width: 768px) {
  .vendor-card { padding: 1.5rem; }
}

.vendor-card:hover { border-color: var(--primary); }
.vendor-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.vendor-card.list-view {
  flex-direction: row;
  align-items: flex-start;
  gap: 1.5rem;
}

.vendor-logo {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
  overflow: hidden;
}
.vendor-logo img { width: 100%; height: 100%; object-fit: cover; }

.vendor-body { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }

.vendor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
.vendor-name    { font-size: 1rem; font-weight: 700; color: var(--text); }
.vendor-country { font-size: 0.75rem; color: var(--text-dim); }

.vendor-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.vendor-tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 500;
  border: 1px solid var(--border);
}

.vendor-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vendor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.vendor-match { font-size: 0.75rem; font-weight: 700; color: var(--primary); }
.vendor-footer .btn { font-size: 0.8rem; padding: 0.5rem 0.8rem; min-height: 40px; }

/* Verified badge */
.vendor-verified {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: rgba(242, 240, 235, 0.1);
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* ── Vendor Detail Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fadeIn 0.15s ease;
}

@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
    padding: 1.5rem;
  }
}

.modal-overlay.hidden { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
}

@media (min-width: 768px) {
  .modal {
    max-width: 640px;
    max-height: 90vh;
    border-radius: var(--radius-lg);
  }
}

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.modal-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

@media (min-width: 768px) {
  .modal-header { padding: 1.5rem; }
}

.modal-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.modal-close:hover { color: var(--text); background: var(--surface-2); }
.modal-body   { padding: 1.25rem; }

@media (min-width: 768px) {
  .modal-body { padding: 1.5rem; }
}

.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .modal-footer { padding: 1.25rem 1.5rem; }
}

/* ── Submit Vendor Form ───────────────────────────────────────────────────── */
.submit-form-wrapper {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

@media (min-width: 768px) {
  .submit-form-wrapper { padding: 2rem 1.5rem 4rem; }
}

.submit-form-wrapper h2 { margin-bottom: 0.5rem; }
.submit-form-wrapper > p { margin-bottom: 2rem; }

.form-section { margin-bottom: 1.5rem; }
.form-section h3 {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ── Match Banner ─────────────────────────────────────────────────────────── */
.match-banner {
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

@media (min-width: 768px) {
  .match-banner {
    padding: 1.5rem;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
  }
  .match-banner .btn { margin-left: auto; }
}

.match-banner-text h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.match-banner .btn { width: 100%; justify-content: center; }

@media (min-width: 768px) {
  .match-banner .btn { width: auto; }
}

/* ── Empty State ──────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .empty-state { padding: 4rem 2rem; }
}

.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3   { margin-bottom: 0.5rem; }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 44px;
  height: 44px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-family: var(--font);
}
.page-btn:hover,
.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #F2F0EB;
}

/* ── Product Cards ────────────────────────────────────────────────────────── */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: border-color var(--transition);
  cursor: pointer;
}

.product-card:hover { border-color: var(--primary); }
.product-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.product-card.list-view {
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
}

.product-top-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.product-name    { font-size: 0.95rem; font-weight: 700; color: var(--text); margin: 0; }
.product-vendor  { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }
.product-country { font-size: 0.72rem; color: var(--text-dim); white-space: nowrap; }

.product-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.product-tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 500;
  border: 1px solid var(--border);
}

.product-description {
  font-size: 0.82rem;
  color: #bbb;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.product-top-row .btn { font-size: 0.78rem; padding: 0.35rem 0.7rem; min-height: 34px; }

/* ── Sovereignty Badge ───────────────────────────────────────────────────── */
.sovereignty-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}

/* ── Commercial model badge ──────────────────────────────────────────────── */
.cm-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ── Sovereignty criteria circles ────────────────────────────────────────── */
.sovereignty-criteria {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.sov-criterion {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.sov-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sov-dot.met  { background: #008800; }
.sov-dot.unmet { background: #CC0000; }

/* ── Product detail modal sections ──────────────────────────────────────── */
.modal-section {
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.modal-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.modal-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  margin-bottom: 0.875rem;
}

/* ── Seek a Deal ─────────────────────────────────────────────────────────── */
.seek-deal-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.request-types {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.request-type-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  background: var(--surface-2);
  transition: all 0.15s;
  user-select: none;
}

.request-type-card:hover { border-color: rgba(204,0,0,0.5); }

.request-type-card.selected {
  border-color: var(--primary);
  background: rgba(204,0,0,0.08);
}

.request-type-card input[type=radio] { display: none; }

.request-type-content strong {
  display: block;
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.request-type-content span {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.seek-message-wrap {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
}
.seek-message-wrap.visible { display: flex; }

.seek-message-wrap label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.seek-message-wrap textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  padding: 0.75rem;
  min-height: 90px;
  resize: vertical;
  transition: border-color var(--transition);
}
.seek-message-wrap textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.seek-error {
  font-size: 0.82rem;
  color: var(--primary);
  background: rgba(204,0,0,0.08);
  border: 1px solid rgba(204,0,0,0.25);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  display: none;
}
.seek-error.visible { display: block; }

.seek-success {
  text-align: center;
  padding: 1.25rem;
}
.seek-success strong {
  display: block;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.seek-success p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Auth gate (register to view) button variant ─────────────────────────── */
.btn-register-gate {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  padding: 0.5rem 0.8rem;
  min-height: 40px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-register-gate:hover { border-color: var(--primary); color: var(--text); }

/* ── Like button - product card ──────────────────────────────────────────── */
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.like-btn:hover { border-color: #CC0000; color: #CC0000; }
.like-btn.liked  { border-color: #CC0000; color: #CC0000; }
.like-btn .like-icon { font-size: 0.9rem; line-height: 1; }
.like-count-static {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ── Like button - modal footer ──────────────────────────────────────────── */
.like-btn-modal {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-family: var(--font);
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.like-btn-modal:hover { border-color: #CC0000; color: #CC0000; }
.like-btn-modal.liked { border-color: #CC0000; color: #CC0000; }
.like-btn-modal .like-icon { font-size: 1rem; }
.like-count-modal { color: var(--text-dim); font-weight: 400; font-size: 0.82rem; }
