.product-editor-page {
    display: grid;
    gap: 18px;
    max-width: 1500px;
    margin: 0 auto;
}

.product-review-layout.is-summary-only {
  grid-template-columns: minmax(0, 1fr) minmax(280px, .72fr);
  align-items: stretch;
}

.product-final-review.product-final-review-wide {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  column-gap: 22px;
  align-items: center;
}

.product-final-review.product-final-review-wide .product-final-visual {
  grid-row: span 4;
  width: 100%;
  min-height: 180px;
}

.product-commercial-policy {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 22px;
  border: 1px solid #d7c49f;
  border-radius: 18px;
  background: linear-gradient(145deg, #fff9ec, #f4f8f5);
}

.product-commercial-policy-icon {
  display: grid;
  flex: 0 0 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: #bf6a1d;
  font-size: 1.15rem;
  font-weight: 900;
}

.product-commercial-policy strong { color: #12343c; }
.product-commercial-policy p { margin: 5px 0 0; color: #617177; font-size: .84rem; line-height: 1.5; }

@media (max-width: 880px) {
  .product-review-layout.is-summary-only,
  .product-final-review.product-final-review-wide { grid-template-columns: 1fr; }
  .product-final-review.product-final-review-wide .product-final-visual { grid-row: auto; }
}

.product-editor-hero,
.product-visual-rule,
.product-editor-form {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 40px rgba(16, 54, 60, 0.06);
}

.product-editor-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 28px;
    border-radius: 24px;
}

.product-editor-hero h2 {
    margin: 4px 0 6px;
    font-size: clamp(1.7rem, 2.5vw, 2.5rem);
}

.product-editor-hero p:last-child,
.product-visual-rule p,
.product-step-heading p {
    margin: 0;
    color: var(--muted);
}

.product-visual-rule {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 20px;
    background: linear-gradient(100deg, #eef8f5 0%, #f7fbfa 65%, #fff9ec 100%);
}

.product-visual-rule-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 14px;
    background: #116c68;
    color: #fff;
    font-weight: 800;
}

.product-visual-rule-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.product-visual-rule-actions a {
    padding: 9px 12px;
    border: 1px solid #b7d7d2;
    border-radius: 12px;
    background: #fff;
    color: #0d5b59;
    font-size: .85rem;
    font-weight: 750;
    text-decoration: none;
}

.product-editor-form {
    overflow: hidden;
    border-radius: 26px;
}

.product-editor-feedback {
    margin: 18px 22px 0;
    padding: 13px 15px;
    border: 1px solid #9ed2c6;
    border-radius: 14px;
    background: #eaf8f3;
    color: #155d50;
    font-weight: 700;
}

.product-editor-feedback.is-error {
    border-color: #efb2aa;
    background: #fff2f0;
    color: #9b342c;
}

.product-stepper {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    padding: 0;
    background: var(--line);
    border-bottom: 1px solid var(--line);
}

.product-stepper button {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 11px;
    padding: 17px 20px;
    border: 0;
    background: #f7f9f8;
    color: #5d6c6f;
    text-align: left;
    cursor: pointer;
}

.product-stepper button > span {
    display: grid;
    grid-row: 1 / span 2;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: #e5ecea;
    color: #45605f;
    font-weight: 800;
}

.product-stepper button strong { color: #243c3f; }
.product-stepper button small { margin-top: 2px; }
.product-stepper button:disabled { cursor: not-allowed; opacity: .6; }
.product-stepper button.is-complete > span { background: #cae9df; color: #126454; }
.product-stepper button.is-active { background: #eaf7f3; }
.product-stepper button.is-active > span { background: #116c68; color: #fff; }

.product-step-panel {
    min-height: 560px;
    padding: 28px;
}

.product-step-panel[hidden] { display: none !important; }

.product-step-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
}

.product-step-heading > span {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 14px;
    background: #123f46;
    color: #fff;
    font-weight: 800;
}

.product-step-heading h3 { margin: 0 0 5px; font-size: 1.35rem; }

.product-kind-native {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.product-kind-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.product-kind-grid button {
    display: grid;
    min-height: 142px;
    align-content: start;
    gap: 7px;
    padding: 16px;
    border: 1px solid #d8e1df;
    border-radius: 18px;
    background: #fff;
    color: #294649;
    text-align: left;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.product-kind-grid button:hover {
    transform: translateY(-2px);
    border-color: #7bb8ad;
    box-shadow: 0 10px 26px rgba(18, 89, 84, .1);
}

.product-kind-grid button.is-selected {
    border-color: #16786f;
    background: linear-gradient(145deg, #eef9f5, #fff);
    box-shadow: inset 0 0 0 1px #16786f;
}

.product-kind-icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 12px;
    background: #eef3f2;
    color: #125d59;
    font-weight: 850;
}

.product-kind-grid button.is-selected .product-kind-icon { background: #16786f; color: #fff; }
.product-kind-grid small { color: var(--muted); line-height: 1.4; }

.product-field-grid {
    display: grid;
    gap: 16px;
}

.product-field-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-field-full { grid-column: 1 / -1; }
.product-field-wide { grid-column: 1 / -1; }
.product-field-grid .form-field > span b,
.product-price-field > span b { color: #c45042; }

.product-field-grid input,
.product-field-grid select,
.product-field-grid textarea,
.product-price-field input,
.product-conditional-panel select,
.product-conditional-panel textarea {
    width: 100%;
}

.product-active-card,
.product-promotion-toggle,
.product-remove-visual {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    border: 1px solid #d9e3e1;
    border-radius: 15px;
    background: #f8faf9;
}

.product-active-card span,
.product-promotion-toggle span {
    display: grid;
    gap: 3px;
}

.product-active-card input,
.product-promotion-toggle input,
.product-remove-visual input {
    width: 20px;
    height: 20px;
    accent-color: #116c68;
}

.product-content-layout {
    display: grid;
    grid-template-columns: minmax(300px, .78fr) minmax(0, 1.45fr);
    gap: 24px;
}

.product-image-workspace,
.product-content-fields,
.product-pricing-fields,
.product-margin-summary,
.product-promotion-fields,
.product-final-review {
    border: 1px solid #dbe4e2;
    border-radius: 20px;
    background: #f9fbfa;
}

.product-image-workspace { display: grid; align-content: start; gap: 12px; padding: 16px; }

.product-image-preview {
    position: relative;
    display: grid;
    min-height: 360px;
    place-items: center;
    overflow: hidden;
    border: 2px dashed #aac7c1;
    border-radius: 17px;
    background: linear-gradient(145deg, #edf5f2, #fff9ee);
}

.product-image-preview img {
    width: 100%;
    height: 100%;
    min-height: 360px;
    object-fit: contain;
    background: #eef1ef;
}

.product-image-preview > div {
    display: grid;
    max-width: 260px;
    justify-items: center;
    gap: 7px;
    padding: 28px;
    color: #486363;
    text-align: center;
}

.product-image-preview > div > span {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border-radius: 18px;
    background: #dbeee8;
    color: #12635d;
    font-size: 1.7rem;
}

.product-file-picker {
    display: grid;
    cursor: pointer;
}

.product-file-picker > span {
    padding: 12px 16px;
    border-radius: 13px;
    background: #123f46;
    color: #fff;
    font-weight: 800;
    text-align: center;
}

.product-file-picker input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.product-content-fields { display: grid; align-content: start; gap: 18px; padding: 20px; }
.product-conditional-panel { display: grid; gap: 14px; padding: 17px; border-radius: 16px; background: #edf6f3; }
.product-conditional-panel[hidden], .product-service-explanation[hidden] { display: none !important; }
.product-panel-title { display: grid; gap: 3px; }
.product-component-list ul,
.product-format-list ul,
.product-reward-list ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.product-component-list ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-component-list label,
.product-format-list label,
.product-reward-list label { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid #d5e2df; border-radius: 12px; background: #fff; }
.product-component-list input,
.product-format-list input,
.product-reward-list input { width: 18px; height: 18px; accent-color: #116c68; }

.product-service-explanation { padding: 16px; border: 1px solid #edd9aa; border-radius: 16px; background: #fff8e9; }
.product-service-explanation p { margin: 5px 0 0; color: #765f31; }

.product-pricing-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(310px, .7fr);
    gap: 22px;
}

.product-pricing-fields { display: grid; gap: 14px; padding: 20px; }
.product-price-field { display: grid; gap: 7px; padding: 17px; border: 1px solid #dce5e3; border-radius: 16px; background: #fff; }
.product-price-field > span { font-weight: 800; }
.product-price-field input { font-size: 1.25rem; font-weight: 800; }
.product-price-field.is-parent { border-left: 5px solid #d79432; }
.product-price-field.is-school { border-left: 5px solid #218a80; }
.product-price-field.is-cost { border-left: 5px solid #64757a; }

.product-margin-summary { display: grid; align-content: start; gap: 12px; padding: 20px; background: #123f46; color: #fff; }
.product-margin-summary .eyebrow { color: #9fd0c6; }
.product-margin-summary > div { display: flex; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,.14); }
.product-margin-summary > div span { color: #c9ddda; }
.product-margin-summary > p:last-child { padding: 12px; border-radius: 12px; background: rgba(255,255,255,.08); color: #d8e7e4; }
.product-margin-summary > p.is-warning { background: #5d3f20; color: #ffe5b6; }
.product-margin-summary > p.is-ok { background: #175b51; color: #d8fff5; }

.product-review-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr); gap: 22px; }
.product-promotion-toggle { cursor: pointer; background: #fff; }
.product-promotion-fields { display: grid; gap: 16px; margin-top: 14px; padding: 18px; }
.product-promotion-fields[hidden] { display: none !important; }
.product-final-review { display: grid; align-content: start; gap: 13px; padding: 18px; background: #f5f8f7; }
.product-final-visual { display: grid; min-height: 220px; place-items: center; overflow: hidden; border-radius: 15px; background: #e8efed; color: #607170; }
.product-final-visual img { width: 100%; height: 220px; object-fit: contain; }
.product-final-review h3 { margin: 0; }
.product-final-review dl { display: grid; gap: 0; margin: 0; }
.product-final-review dl div { display: flex; justify-content: space-between; gap: 18px; padding: 11px 0; border-bottom: 1px solid #dbe4e2; }
.product-final-review dt { color: var(--muted); }
.product-final-review dd { margin: 0; font-weight: 800; text-align: right; }

.product-editor-footer {
    position: sticky;
    bottom: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 22px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(14px);
}

.product-editor-footer-spacer { flex: 1; }
.product-editor-footer > span { color: var(--muted); font-size: .86rem; font-weight: 700; }
.product-editor-footer button[hidden] { display: none !important; }
.product-editor-footer button:disabled { opacity: .55; cursor: wait; }
.field-errors { display: block; margin-top: 6px; color: #ad3e34; font-weight: 700; }
.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea { border-color: #d45e52; box-shadow: 0 0 0 3px rgba(212,94,82,.12); }

@media (max-width: 1180px) {
    .product-kind-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .product-content-layout,
    .product-pricing-layout,
    .product-review-layout { grid-template-columns: 1fr; }
    .product-image-preview,
    .product-image-preview img { min-height: 300px; }
}

@media (max-width: 820px) {
    .product-editor-hero,
    .product-visual-rule { grid-template-columns: 1fr; align-items: start; }
    .product-editor-hero { flex-direction: column; }
    .product-visual-rule-actions { justify-content: flex-start; }
    .product-stepper { grid-template-columns: repeat(4, minmax(64px, 1fr)); }
    .product-stepper button { justify-items: center; padding: 12px 6px; text-align: center; }
    .product-stepper button > span { grid-row: auto; }
    .product-stepper button strong { font-size: .76rem; }
    .product-stepper button small { display: none; }
    .product-step-panel { min-height: auto; padding: 20px 16px; }
    .product-kind-grid,
    .product-field-grid.two-columns,
    .product-component-list ul { grid-template-columns: 1fr; }
    .product-kind-grid button { min-height: 112px; }
    .product-editor-footer { flex-wrap: wrap; }
    .product-editor-footer > span { order: -1; width: 100%; text-align: center; }
}
