/* Блокируем прокрутку фона, когда модалка открыта */
html.crr-no-scroll, body.crr-no-scroll { overflow: hidden !important; }

/* Оверлей */
.crr-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2147483647;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* Диалог — фикс для любых тем (никаких .modal) */
.crr-dialog{
  width: min(760px, 92vw);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  padding: 20px 20px 16px;
  position: relative;

  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

/* Закрыть */
.crr-close{
  position: absolute;
  right: 10px;
  top: 8px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color:#000;
}

/* Заголовок и текст */
.crr-title{
  font-size: 20px;
  font-weight: 700;
  margin: 0 28px 8px 0;
}
.crr-msg{
  margin: 0 0 12px 0;
  color: #444;
  line-height: 1.4;
  white-space: pre-line; /* переносы строк из настроек */
}

/* Сетка товаров */
.crr-items{
  display: grid;
  grid-template-columns: 72px 1fr auto auto;
  gap: 10px 12px;
  align-items: center;
}
.crr-item{ display: contents; }
.crr-thumb{
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: #f5f6f8;
  overflow: hidden;
}
.crr-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.crr-name{ font-weight: 500; }
.crr-qtyprice, .crr-sum{ text-align: right; white-space: nowrap; }

/* Итого */
.crr-summary{
  margin-top: 12px;
  border-top: 1px solid #eee;
  padding-top: 10px;
}
.crr-row{
  display:flex;
  justify-content: space-between;
  padding: 4px 0;
}

/* Действия */
.crr-actions{ display:flex; gap:10px; justify-content: flex-end; margin-top: 10px; }
.crr-go{
  display: inline-block;
  padding: 10px 16px;
  border-radius: 10px;
  background: #06c;
  color:#fff;
  text-decoration: none;
  font-weight: 700;
}
.crr-hide{
  padding: 10px 16px;
  border-radius: 10px;
  background: #eee;
  color:#333;
  border: 1px solid #ddd;
  cursor: pointer;
}

/* Адаптив */
@media (max-width:640px){
  .crr-items{ grid-template-columns: 56px 1fr auto; }
  .crr-sum{ display:none; }
}
