/* ═══════════════════════════════════════════
   Comments Widget
   ═══════════════════════════════════════════ */

.cm-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  animation: cmBgIn 0.25s ease both;
       justify-content: flex-end;
}

@keyframes cmBgIn { from { opacity: 0; } to { opacity: 1; } }

.cm {
  width: 100%;
  
  background: #111;
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  animation: cmSheetIn 0.32s cubic-bezier(0.16,1,0.3,1) both;
  overflow: hidden;
}

@keyframes cmSheetIn {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

@media (min-width: 768px) {
  .cm-overlay {
    align-items: center;
    justify-content: center;
  }
  .cm {
    max-width: 520px;
    max-height: 70vh;
    border-radius: 20px;
    animation: cmModalIn 0.25s ease both;
  }
  @keyframes cmModalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }
}


.cm__handle {
  width: 36px; height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
  margin: 12px auto 0;
  flex-shrink: 0;
}


.cm__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.cm__title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.cm__close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: none; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer;
  transition: background 0.2s;
}
.cm__close:hover { background: rgba(255,255,255,0.14); }


.cm__list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cm__list::-webkit-scrollbar { display: none; }


.cm__item {
  display: flex;
  gap: 12px;
}
.cm__item-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  overflow: hidden;
}
.cm__item-avatar img { width: 100%; height: 100%; object-fit: cover; }

.cm__item-body { flex: 1; }

.cm__item-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.cm__item-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.cm__item-buyer {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(184,245,61,0.1);
  color: var(--c-accent, #b8f53d);
  letter-spacing: 0.3px;
}
.cm__item-time {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  margin-left: auto;
}
.cm__item-text {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  line-height: 1.5;
  font-weight: 300;
}


.cm__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 20px;
  color: rgba(255,255,255,0.2);
  text-align: center;
}
.cm__empty i { font-size: 32px; }
.cm__empty p { font-size: 14px; }


.cm__input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  background: #111;
}
.cm__input-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
}
.cm__input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 9px 16px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.cm__input::placeholder { color: rgba(255,255,255,0.25); }
.cm__input:focus { border-color: rgba(255,255,255,0.2); }

.cm__send {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--c-accent, #b8f53d);
  border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: #080808;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}
.cm__send:hover { transform: scale(1.08); }
.cm__send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.cm__item-delete {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 12px;
  flex-shrink: 0;
  transition: color 0.2s;
}

.cm__item-delete:hover {
  color: #ef4444;
}

.cm__item-owner {
  font-size: 10px;
  background: rgba(168,85,247,0.15);
  color: var(--c-accent);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}
