/* ═══ Модальное окно товара ═══ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-card {
  background: var(--bg-card);
  border: var(--border-width) solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 750px;
  width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.modal-close:hover {
  color: var(--accent-pink);
}

/* ═══ Горизонтальный layout: картинка слева, инфо справа ═══ */

.modal-body {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.modal-image {
  flex-shrink: 0;
  width: 220px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-align: center;
}

.modal-image img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.modal-details {
  flex: 1;
  min-width: 0;
}

/* Ссылка на товар */
.modal-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82em;
  border-bottom: 1px dashed rgba(136, 136, 136, 0.4);
  transition: color 0.15s, border-color 0.15s;
  word-break: break-all;
}

.modal-link:visited {
  color: var(--text-muted);
}

.modal-link:hover {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.75rem 0;
  line-height: 1.3;
}

/* Адаптив: на узких экранах — вертикально */
@media (max-width: 550px) {
  .modal-body {
    flex-direction: column;
  }
  .modal-image {
    width: 100%;
  }
}

/* ═══ Модалка создания папки ═══ */
.folder-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.2rem;
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.folder-modal__header {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.folder-modal__input {
  width: 100%;
  font-size: 13px;
  padding: 0.35rem 0.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  box-sizing: border-box;
}

.folder-modal__icons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.folder-modal__icon-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 18px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, border-color 0.1s;
}

.folder-modal__icon-btn:hover {
  background: var(--bg-hover);
}

.folder-modal__icon-btn--active {
  border-color: var(--accent-blue);
  background: rgba(92, 158, 255, 0.15);
}

.folder-modal__preview {
  font-size: 13px;
  color: var(--text-muted);
  padding: 0.25rem 0.4rem;
  background: var(--bg-primary);
  border-radius: var(--radius);
  min-height: 1.6rem;
}

.folder-modal__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

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

.modal-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.modal-label {
  color: var(--text-muted);
  font-size: 0.85em;
  min-width: 80px;
  flex-shrink: 0;
}

.modal-price {
  color: var(--accent-yellow);
  font-weight: 700;
  font-size: 1.2em;
}

.modal-old-price {
  color: var(--text-muted);
  text-decoration: line-through;
  font-size: 0.9em;
}

.modal-add-btn {
  margin-left: auto;
}

.text--green { color: #4ecdc4; }
.text--red { color: var(--accent-pink); }

.modal-features {
  border-top: var(--border-width) solid var(--border-color);
  padding-top: 0.75rem;
}

.modal-features-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 0.5rem 0;
}

.modal-features-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85em;
}

.modal-feat-key {
  color: var(--text-muted);
  padding: 0.25rem 0.75rem 0.25rem 0;
  white-space: nowrap;
  vertical-align: top;
}

.modal-feat-val {
  color: var(--text-primary);
  padding: 0.25rem 0;
}

