/* =========================================================
   Contact Popup Modal (contact-popup.css)
   ========================================================= */

/* Loading spinner */
.ecm-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  font-size: 2rem;
  color: #888;
}

/* Wrapper */
.ecm-wrap {
  padding: 20px 24px 16px;
  font-size: 14px;
  color: #333;
  line-height: 1.4;
}

/* ---- Header ---- */
.ecm-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.ecm-avatar {
  position: relative;
  flex-shrink: 0;
}

.ecm-avatar img {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e8e8e8;
}

.ecm-company .ecm-avatar img {
  border-radius: 8px;
}

.ecm-online {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #bbb;
}

.ecm-online.is-online {
  background: #22c55e;
}

.ecm-seller-info {
  flex: 1;
  min-width: 0;
}

.ecm-seller-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ecm-verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3b49df;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.ecm-seller-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 12px;
  color: #777;
  margin-bottom: 6px;
}

.ecm-status-online {
  color: #22c55e;
  font-weight: 500;
}

.ecm-company-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: #555;
  margin-bottom: 4px;
}

.ecm-company-details span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ecm-hours {
  font-size: 12px;
  color: #555;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 6px;
}

.ecm-hours i {
  color: #888;
}

.ecm-hours span {
  white-space: nowrap;
}

.ecm-company-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 4px;
}

.ecm-website,
.ecm-profile-link {
  font-size: 12px;
  color: #3b49df;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ecm-website:hover,
.ecm-profile-link:hover {
  text-decoration: underline;
}

/* ---- Item info ---- */
.ecm-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 16px;
  font-size: 13px;
}

.ecm-item-title {
  font-weight: 500;
  flex: 1;
  min-width: 120px;
}

.ecm-item-ref {
  color: #888;
  white-space: nowrap;
}

.ecm-item-location {
  color: #666;
  white-space: nowrap;
}

.ecm-item-location i {
  color: #e05;
}

/* ---- Phone row ---- */
.ecm-contact-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.ecm-phone-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #3b49df;
  color: #fff;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  flex: 1;
  justify-content: center;
  transition: background 0.15s;
}

.ecm-phone-btn:hover {
  background: #2d39c0;
  color: #fff;
  text-decoration: none;
}

.ecm-phone-btn.revealed {
  background: #1a7c3e;
}

.ecm-phone-btn.revealed:hover {
  background: #155f30;
}

.ecm-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: #fff;
  color: #555;
  font-size: 16px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}

.ecm-copy-btn:hover {
  border-color: #3b49df;
  color: #3b49df;
}

.ecm-copy-btn.copied {
  border-color: #22c55e;
  color: #22c55e;
}

/* ---- Contact persons section ---- */
.ecm-contacts-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #888;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

.ecm-contacts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

/* ---- Footer ---- */
.ecm-footer {
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.ecm-all-items {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #3b49df;
  text-decoration: none;
  margin-bottom: 8px;
}

.ecm-all-items:hover {
  text-decoration: underline;
}

.ecm-hint {
  font-size: 12px;
  color: #999;
  margin: 0;
  font-style: italic;
}

/* ---- Error state ---- */
.ecm-error {
  padding: 24px;
  text-align: center;
  color: #c00;
}

/* ---- Manager cards in popup — slightly larger ---- */
.ecm-contacts .bpr-ic-avatar,
.ecm-contacts .bpr-ic-avatar-placeholder { width:48px; height:48px; flex:0 0 48px; font-size:20px; }
.ecm-contacts .bpr-ic-name { font-size:14px; }
.ecm-contacts .bpr-ic-title { font-size:12px; }

/* ---- Dark mode ---- */
body.dark .ecm-wrap {
  color: #ddd;
}

body.dark .ecm-avatar img {
  border-color: #444;
}

body.dark .ecm-item {
  background: #2a2a2a;
}

body.dark .ecm-copy-btn {
  background: #1e1e1e;
  border-color: #555;
  color: #aaa;
}

body.dark .ecm-contacts-label,
body.dark .ecm-footer {
  border-color: #333;
}

body.dark .ecm-hint {
  color: #666;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .ecm-wrap {
    padding: 16px;
  }

  .ecm-avatar img {
    width: 50px;
    height: 50px;
  }

  .ecm-seller-name {
    font-size: 15px;
  }
}
