/* ============================================================
   Contact Modal (.eps-cm)
   "Nachricht senden" modal for contacting seller
   ============================================================ */

/* Overlay */
.eps-cm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.33);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.eps-cm-overlay.visible { opacity: 1; }

/* Modal box */
.eps-cm {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 520px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  background: #FFFFFF;
  border: 1px solid #E8E8E8;
  z-index: 999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  overflow: hidden;
}
.eps-cm.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Header */
.eps-cm-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
  border-bottom: 1px solid #E8E8E8;
  flex-shrink: 0;
}
.eps-cm-header-icon {
  width: 18px;
  height: 18px;
  color: #2E6AAD;
  flex-shrink: 0;
  display: flex;
}
.eps-cm-header-icon svg {
  width: 18px;
  height: 18px;
}
.eps-cm-title {
  flex: 1;
  font-family: 'Rubik', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #0D0D0D;
  margin: 0;
  line-height: 1.2;
}
.eps-cm-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #E8E8E8;
  background: none;
  cursor: pointer;
  padding: 0;
  color: #666666;
  transition: border-color 0.15s;
}
.eps-cm-close:hover { border-color: #999; }
.eps-cm-close svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Body */
.eps-cm-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
}

/* Product row */
.eps-cm-product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #FAFAFA;
  padding: 16px;
  border: 1px solid #E8E8E8;
}
.eps-cm-product-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.eps-cm-product-img {
  width: 72px;
  height: 56px;
  object-fit: cover;
  flex-shrink: 0;
}
.eps-cm-product-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.eps-cm-product-name {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #0D0D0D;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eps-cm-product-loc {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: #999999;
}
.eps-cm-price-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.eps-cm-price-brutto {
  font-family: 'Rubik', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #0D0D0D;
  letter-spacing: -0.5px;
  white-space: nowrap;
}
.eps-cm-price-vat {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 10px;
  color: #B0B0B0;
}
.eps-cm-price-netto {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px;
  color: #7A7A7A;
}

/* Seller row */
.eps-cm-seller {
  display: flex;
  align-items: center;
  gap: 12px;
}
.eps-cm-seller-avatar {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2E6AAD;
  flex-shrink: 0;
  overflow: hidden;
}
.eps-cm-seller-avatar span {
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #FFFFFF;
}
.eps-cm-seller-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.eps-cm-seller-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.eps-cm-seller-name {
  font-family: 'Rubik', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #0D0D0D;
}
.eps-cm-seller-status {
  display: flex;
  align-items: center;
  gap: 6px;
}
.eps-cm-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4CAF50;
  flex-shrink: 0;
}
.eps-cm-status-text {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  color: #999999;
}

/* Message section */
.eps-cm-msg-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.eps-cm-msg-label {
  font-family: 'Rubik', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #0D0D0D;
}
.eps-cm-textarea {
  width: 100%;
  height: 120px;
  border: 1px solid #E8E8E8;
  border-radius: 0;
  padding: 14px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #0D0D0D;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.eps-cm-textarea::placeholder {
  color: #B0B0B0;
}
.eps-cm-textarea:focus {
  border-color: #2E6AAD;
}
.eps-cm-textarea.eps-cm-error {
  outline: 2px solid #e74c3c;
  outline-offset: -2px;
  background: #fdf0ef;
}

/* Button row */
.eps-cm-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.eps-cm-btn-cancel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border: 1px solid #E8E8E8;
  background: none;
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #666666;
  transition: border-color 0.15s;
}
.eps-cm-btn-cancel:hover { border-color: #999; }

.eps-cm-btn-send {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  background: #2E6AAD;
  border: none;
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #FFFFFF;
  transition: background 0.15s;
}
.eps-cm-btn-send:hover { background: #256199; }
.eps-cm-btn-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.eps-cm-btn-send svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Success state */
.eps-cm-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px 24px;
  text-align: center;
}
.eps-cm-success-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #E8F5E9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.eps-cm-success-icon svg {
  width: 24px;
  height: 24px;
  stroke: #4CAF50;
  stroke-width: 2;
  fill: none;
}
.eps-cm-success-title {
  font-family: 'Rubik', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #0D0D0D;
}
.eps-cm-success-text {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  color: #7A7A7A;
}
.eps-cm-btn-go-chat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: #2E6AAD;
  border: none;
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #FFFFFF;
  text-decoration: none;
  margin-top: 8px;
}
.eps-cm-btn-go-chat:hover { background: #256199; }

/* Responsive — fullscreen on mobile */
@media (max-width: 600px) {
  .eps-cm {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    top: 0;
    left: 0;
    transform: none;
    border: none;
  }
  .eps-cm.visible { transform: none; }
  .eps-cm-body { flex: 1; }
}
