/* Products tab (admin) - edit styles */

#productViewPanel {
  display: grid;
  gap: 0;
}

#productViewPanel[hidden] {
  display: none !important;
}

.product-two-col {
  display: grid;
  grid-template-columns: 3fr 2fr; /* 60% / 40% */
  gap: 14px;
  margin-top: 0;
  align-items: start;
}

.product-right {
  min-width: 0;
  display: grid;
  gap: 0;
  min-height: 0;
  overflow: hidden;
  align-self: start;
  height: var(--product-right-height, auto);
  max-height: var(--product-right-height, none);
}

.product-left {
  min-width: 0;
  min-height: 0;
  align-content: start;
  grid-auto-rows: max-content;
}

/* Keep typography consistent across editor content */
.desc-editor .admin-editor-html-rich {
  font-size: 14px;
  line-height: 1.35;
  font-family: inherit;
}

.desc-editor {
  display: grid;
  border: none;
  border-radius: 0;
  background: transparent;
  min-width: 0;
  min-height: 0;
}

.desc-editor.admin-editor-html {
  --admin-editor-html-min-height: 0;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

.desc-editor.admin-editor-html .admin-editor-html-surface {
  min-height: 0;
  height: auto;
}

.product-description-surface {
  position: relative;
}

.product-description-media-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.media-remove.media-remove--editor {
  position: absolute;
  pointer-events: auto;
}

.desc-editor.admin-editor-html .admin-editor-html-rich,
.desc-editor.admin-editor-html .admin-editor-html-code {
  min-height: 0;
}

.field-media {
  margin-top: 0;
  padding-top: 0;
}

/* Variants list uses global ListView rows (lv-variants just preserves the column layout). */
.lv-variants {
  --lv-cols: 1.6fr 180px 180px;
}

.t-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.gen-option-input {
  width: 100%;
}

.gen-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.product-creatives-panel {
  min-width: 0;
}

.product-creatives-board-wrap {
  min-width: 0;
  padding: 0 0 12px;
}

.product-creatives-board {
  min-width: 1320px;
}

.product-creatives-card.is-editing {
  cursor: text;
}

.product-creatives-card-title-input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 1.35em;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
  box-sizing: border-box;
  overflow: hidden;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.35;
  letter-spacing: inherit;
  text-align: inherit;
  box-shadow: none;
}

.product-creatives-card-title-input::placeholder {
  color: var(--admin-muted);
  opacity: 1;
}

.product-creative-modal-body {
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  overflow-x: hidden;
}

.product-creative-select-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.product-creative-select-trigger:hover {
  background: #fff;
}

.product-creative-select-trigger-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-creative-select-trigger-icon {
  width: 16px;
  height: 16px;
  color: var(--admin-muted);
  flex: 0 0 auto;
}

.product-creative-select-trigger-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.product-creative-modal-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.product-creative-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 12px;
  min-width: 0;
}

.product-creative-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-creative-script-field {
  display: block;
  min-height: 0;
}

#variantsModal .modal-card {
  margin: 0 auto;
  box-sizing: border-box;
}

#variantsModal .modal-body {
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  overflow-x: hidden;
}

#variantsModal #genOptionsList {
  min-width: 0;
}

#variantsModal .gen-options-head,
#variantsModal .gen-options-row {
  --lv-cols: minmax(160px, 0.45fr) minmax(0, 1.55fr) 150px;
  width: 100%;
  min-width: 0;
}

#variantsModal .gen-options-row {
  min-height: 45px;
  height: 45px;
}

#variantsModal .gen-options-row .lv-cell,
#variantsModal .gen-options-row .lv-cell-button,
#variantsModal .gen-options-row .lv-inline-cell,
#variantsModal .gen-options-row .lv-inline-cell-text {
  min-width: 0;
}

#variantsModal .gen-options-row > div {
  align-items: center;
}

#variantsModal .lv-empty {
  padding: 12px;
}

.gen-options-lv {
  margin-top: 2px;
  min-width: 0;
}

.gen-options-footer {
  display: grid;
  justify-items: start;
  gap: 0;
  margin-top: 2px;
}

#variantsModal #addVariantOptionBtn {
  justify-self: start;
}

#variantsModal .pricing-editor {
  width: min(320px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
}

@media (max-width: 520px) {
  .gen-row {
    grid-template-columns: 1fr;
  }

  #variantsModal .gen-options-head,
  #variantsModal .gen-options-row {
    --lv-cols: minmax(132px, 0.5fr) minmax(0, 1.5fr);
  }
}

@media (max-width: 980px) {
  .product-creative-modal-layout {
    grid-template-columns: 1fr;
  }

  .product-creative-script-editor,
  .product-creative-script-editor.admin-property-editor-markdown {
    height: auto;
    max-height: none;
  }

  .product-creative-top-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .product-creative-modal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .product-two-col {
    grid-template-columns: 1fr;
  }

  .product-right {
    height: auto;
    max-height: none;
  }

  .desc-editor {
    min-height: 280px;
    height: auto;
  }

}
