#catalogStudio[hidden] {
  display: none !important;
}
#catalogStudio {
  position: fixed;
  inset: 0;
  z-index: 1900;
  background: rgba(17, 32, 57, 0.4);
  backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  padding: 24px;
  color: #23324a;
}
#catalogStudio * {
  box-sizing: border-box;
}
.cs-window {
  width: min(1360px, 100%);
  height: min(900px, 94dvh);
  display: flex;
  flex-direction: column;
  border: 1px solid #fff;
  border-radius: 30px;
  background: linear-gradient(
    145deg,
    rgba(248, 252, 255, 0.97),
    rgba(241, 245, 252, 0.94)
  );
  box-shadow: 0 36px 110px #09234940;
  overflow: hidden;
}
.cs-window > header {
  display: flex;
  justify-content: space-between;
  padding: 24px 30px 16px;
  border-bottom: 1px solid #dae3ed;
}
.cs-window h2 {
  margin: 5px 0;
  font-size: 23px;
}
.cs-window p {
  font-size: 13px;
  line-height: 1.7;
  color: #6e798b;
  margin: 6px 0;
}
.cs-window small {
  font-size: 11px;
  color: #8390a3;
}
.cs-window button {
  cursor: pointer;
  border: 1px solid #d6e0eb;
  border-radius: 12px;
  background: #ffffffad;
  color: #33425b;
  padding: 10px 15px;
  font: inherit;
  font-size: 13px;
}
.cs-window button:hover {
  background: #fff;
  box-shadow: 0 4px 15px #294f7b15;
}
.cs-window button:focus-visible,
.cs-product:focus-visible {
  outline: 3px solid #0f46c8;
  outline-offset: 2px;
}
.cs-window > header > button {
  font-size: 24px;
  align-self: flex-start;
}
.cs-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 15px 30px;
}
.cs-toolbar span {
  margin-left: auto;
  color: #748199;
  font-size: 12px;
}
.cs-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 22px;
  padding: 0 30px 20px;
  min-height: 0;
  flex: 1;
}
.cs-preview {
  border: 1px solid white;
  border-radius: 24px;
  background: linear-gradient(150deg, #f4f8fd, #fbf8f3);
  box-shadow: 0 14px 35px #456b9a15;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.cs-brand {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.cs-brand > b {
  color: #0f46c8;
}
.cs-brand > span {
  border-radius: 22px;
  padding: 8px 13px;
  color: #a92a3f;
  font-size: 12px;
  background: linear-gradient(135deg, #fff7f5dd, #facdd1a6);
  border: 1px solid white;
  box-shadow: 0 5px 14px #a63e4818;
}
.cs-shop {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}
#csCategories {
  overflow-y: auto;
  background: #e8edf580;
  border-right: 1px solid #fff;
  padding: 12px 8px;
}
#csProducts {
  overflow-y: auto;
  padding: 8px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cs-category {
  position: relative;
  border: 1px solid transparent;
  border-radius: 15px;
  transition: background 0.2s, transform 0.2s;
  margin-bottom: 9px;
}
.cs-category.active {
  background: #fff9f5;
  border-color: white;
  box-shadow: 0 5px 12px #637f9820;
}
.cs-category.drop-target {
  background: #ffe1d9;
  transform: scale(1.04);
  border: 2px dashed #bb3447;
}
.cs-category > button:first-child {
  width: 100%;
  background: none;
  border: 0;
  padding: 20px 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
}
.cs-category b {
  font-size: 13px;
}
.cs-category em {
  position: absolute;
  top: 0;
  left: 0;
  background: linear-gradient(135deg, #d94b55, #a71931);
  color: white;
  padding: 3px 6px;
  font: normal 9px sans-serif;
  border-radius: 10px 2px 8px 2px;
}
.cs-category .cs-category-edit {
  display: block;
  margin: 0 auto 8px;
  padding: 3px 5px;
  font-size: 10px;
  border: 0;
  background: transparent;
  color: #8490a0;
}
.cs-product {
  position: relative;
  background: linear-gradient(125deg, #ffffffeb, #fff9f3b8);
  border: 1px solid white;
  border-radius: 21px;
  padding: 14px;
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 14px;
  box-shadow: 0 6px 20px #42669012;
  cursor: grab;
  flex-shrink: 0;
}
.cs-product:active {
  cursor: grabbing;
}
.cs-product > img {
  width: 100px;
  height: 110px;
  object-fit: contain;
  border-radius: 13px;
  background: white;
}
.cs-product h3 {
  font-size: 16px;
  line-height: 1.4;
  margin: 7px 0;
  word-break: break-word;
}
.cs-product strong {
  color: #bb243c;
  font-size: 23px;
}
.cs-product p {
  font-size: 11px;
}
.cs-buy {
  float: right;
  border: 1px solid #fff3ed;
  border-radius: 18px;
  background: linear-gradient(140deg, #e55c66, #b31d36);
  color: white;
  padding: 6px 15px;
  font-size: 12px;
  box-shadow: 0 4px 12px #b6233830;
}
.cs-product > button {
  grid-column: 1/-1;
  padding: 5px;
  font-size: 11px;
  background: transparent;
}
.cs-empty {
  text-align: center;
  padding: 70px 15px;
  color: #8190a5;
  font-size: 14px;
  line-height: 2;
}
.cs-body > aside {
  overflow-y: auto;
  background: #ffffff8a;
  border: 1px solid white;
  border-radius: 22px;
  padding: 22px;
}
.cs-body h3 {
  margin: 0 0 12px;
}
.cs-body label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  margin: 15px 0;
  color: #536178;
}
.cs-body input:not([type="checkbox"]):not([type="file"]),
.cs-body textarea,
.cs-body select {
  width: 100%;
  border: 1px solid #d7e0e8;
  border-radius: 11px;
  background: #ffffffc7;
  color: #263d55;
  padding: 10px;
  font: inherit;
  font-weight: 400;
  font-size: 13px;
}
.cs-body input[readonly],
.cs-body textarea[readonly] {
  background: #edf1f5;
  color: #8490a3;
}
.cs-body textarea {
  min-height: 80px;
  resize: vertical;
}
.cs-upload {
  border: 1px dashed #adbdce;
  border-radius: 16px;
  padding: 14px;
  align-items: center;
  text-align: center;
  background: #f6f9ff;
}
.cs-upload img {
  width: 100%;
  height: 120px;
  object-fit: contain;
}
.cs-upload input {
  max-width: 100%;
  font-size: 11px;
}
.cs-upload.drag-over {
  background: #ffe4df;
}
.cs-upload span {
  font-size: 11px;
  color: #95624e;
}
.cs-check {
  flex-direction: row !important;
  align-items: center;
}
.cs-check input {
  width: auto;
}
.cs-form-error {
  color: #b02038;
  font-size: 13px;
  line-height: 1.6;
  margin-top: 12px;
}
.cs-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cs-welcome span {
  font-size: 12px;
  color: #a44449;
  display: block;
  margin: 20px 0 12px;
}
.cs-window > footer {
  border-top: 1px solid white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 18px 30px;
  background: #fff9;
}
.cs-window > footer > span {
  font-size: 12px;
  color: #526881;
  line-height: 1.7;
}
.cs-window > footer > div {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.cs-window .cs-publish {
  background: #0f46c8;
  color: white;
  border-color: #0f46c8;
  box-shadow: 0 5px 15px #0f46c82a;
}
.cs-busy .cs-body,
.cs-busy .cs-toolbar {
  pointer-events: none;
  opacity: 0.65;
}
.cs-window button:disabled {
  opacity: 0.5;
  cursor: wait;
}
@media (max-width: 1000px) {
  .cs-body {
    grid-template-columns: minmax(0, 1fr) 290px;
    padding: 0 16px 15px;
    gap: 12px;
  }
  .cs-product {
    grid-template-columns: 75px minmax(0, 1fr);
    gap: 10px;
  }
  .cs-product > img {
    width: 75px;
    height: 90px;
  }
  .cs-shop {
    grid-template-columns: 95px minmax(0, 1fr);
  }
}
@media (max-width: 720px) {
  #catalogStudio {
    padding: 6px;
  }
  .cs-window {
    height: 97dvh;
    border-radius: 20px;
  }
  .cs-window > header {
    padding: 16px;
  }
  .cs-window h2 {
    font-size: 18px;
  }
  .cs-window > header p {
    font-size: 11px;
  }
  .cs-toolbar {
    padding: 10px 14px;
    flex-wrap: wrap;
  }
  .cs-toolbar span {
    font-size: 10px;
  }
  .cs-body {
    display: flex;
    flex-direction: column;
    overflow: auto;
  }
  .cs-preview {
    min-height: 420px;
    flex-shrink: 0;
  }
  .cs-body > aside {
    overflow: visible;
    flex-shrink: 0;
  }
  .cs-brand {
    padding: 13px;
    font-size: 12px;
  }
  .cs-brand > span {
    font-size: 10px;
  }
  .cs-window > footer {
    padding: 12px;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }
  .cs-window > footer > div {
    justify-content: flex-end;
  }
  .cs-product h3 {
    font-size: 14px;
  }
}
