.product-create-surface::before { display: none; }
.product-create-stack { display: grid; gap: 14px; }
.product-create-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; }
.product-create-header__icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 13px; color: #fff; background: #465a78; }
.product-create-header__icon svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.product-create-header__copy { min-width: 0; }
.product-create-header h1 { margin: 0; color: #17243a; font-size: clamp(1.35rem, 2.3vw, 1.85rem); letter-spacing: -.03em; }
.product-create-header p { margin: 3px 0 0; color: #66758b; font-size: .72rem; }
.product-create-header > a { min-height: 38px; padding: 8px 12px; font-size: .7rem; }
.product-create-form-shell { padding: 0; border: 0; background: transparent; }
.product-create-grid { gap: 10px 12px; }
.product-form-field { gap: 5px; }
.product-form-field label { color: #344a67; font-size: .64rem; font-weight: 800; }
.product-form-field .form-control { min-height: 40px; padding-block: 7px; font-size: .76rem; }
.product-form-field input[type="file"] { padding: 5px 7px; }
.product-form-field input[type="file"]::file-selector-button { margin-inline-end: 8px; padding: 6px 9px; border: 0; border-radius: 7px; color: #fff; background: #526783; font: inherit; font-weight: 750; cursor: pointer; }
.product-form-field .help-text { margin: 0; color: #68778c; font-size: .55rem; line-height: 1.3; }
.product-form-field .error-message { margin: 0; font-size: .58rem; }
.product-create-footer { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 14px; padding-top: 11px; border-top: 1px solid #e1e6ed; }
.product-create-active { display: inline-flex; align-items: center; gap: 8px; color: #334967; font-size: .68rem; font-weight: 800; cursor: pointer; }
.product-create-active input { width: 18px; height: 18px; accent-color: #526783; }
.product-create-footer > div { display: flex; gap: 8px; }
.product-create-flags { display: flex; flex-wrap: wrap; gap: 12px; }
.product-variants { display: grid; gap: 10px; margin-top: 16px; padding-top: 13px; border-top: 1px solid #e1e6ed; }
.product-variants__heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.product-variants h2 { margin: 0; color: #17243a; font-size: 1rem; }
.product-variants p { margin: 3px 0 0; color: #5d6c83; font-size: .7rem; }
.product-variants__heading button { min-height: 36px; padding: 7px 11px; font-size: .7rem; }
.product-variant-rows { display: grid; gap: 8px; }
.product-variant-row { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr) auto auto; align-items: end; gap: 10px; padding: 9px; border-radius: 9px; background: #f4f6fa; }
.product-variant-row > div { min-width: 0; }
.product-variant-row > div > label { display: block; margin-bottom: 5px; color: #344a67; font-size: .64rem; font-weight: 800; }
.product-variant-row .form-control { width: 100%; min-height: 38px; font-size: .75rem; }
.product-variant-check { display: inline-flex; align-items: center; gap: 5px; min-height: 38px; color: #344a67; font-size: .68rem; cursor: pointer; white-space: nowrap; }
.product-variant-check input { width: 16px; height: 16px; accent-color: #526783; }
.product-variant-check--remove { color: #a9434c; }
.product-edit-admin .product-create-page { width: 100%; max-width: none; padding: 20px 0; }
.product-edit-admin .product-create-surface { max-width: 1100px; margin-inline: auto; background: #fff; }
.product-edit-admin .product-create-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.product-edit-admin .product-form-field--name, .product-edit-admin .product-form-field--image { grid-column: span 2; }
.product-edit-admin .product-create-footer { margin-top: 12px; }
.product-create-footer :is(a, button) { min-height: 39px; padding: 8px 14px; font-size: .7rem; }

/* Administrator catalogue editor */
.product-edit-admin .product-create-stack { gap: 20px; }
.product-edit-admin .product-create-surface { padding: 24px; border: 1px solid #e1e7f5; border-radius: 20px; box-shadow: 0 12px 30px #243f7a12; }
.product-edit-admin .product-create-header { padding-bottom: 18px; border-bottom: 1px solid #e8edf7; }
.product-edit-admin .product-create-header__icon { color: #9b4f75; background: #fceaf3; }
.product-edit-admin .product-create-header p { font-size: .83rem; }
.product-edit-admin .product-create-form { gap: 20px; }
.product-editor-main { display: grid; grid-template-columns: minmax(220px, 30%) minmax(0, 1fr); align-items: stretch; gap: 16px; }
.product-photo-panel, .product-identity-panel { min-width: 0; padding: 18px; border: 1px solid #e6ebf5; border-radius: 16px; background: #fbfcff; }
.product-photo-panel { display: block; }
.product-photo-panel .product-editor-section-heading, .product-photo-preview { margin-bottom: 14px; }
.product-editor-section-heading { display: flex; align-items: flex-start; gap: 10px; }
.product-editor-step { display: grid; flex: 0 0 25px; width: 25px; height: 25px; place-items: center; border-radius: 8px; color: #fff; background: #9b4f75; font-size: .72rem; font-weight: 800; }
.product-editor-section-heading h2 { margin: 1px 0 3px; color: #101e5a; font-size: 1rem; line-height: 1.2; }
.product-editor-section-heading p { margin: 0; color: #657391; font-size: .72rem; line-height: 1.45; }
.product-photo-preview { display: grid; width: 100%; height: 190px; place-items: center; overflow: hidden; border: 1px dashed #c4cee3; border-radius: 12px; background: #f0f3fb; }
.product-photo-preview img { width: 100%; height: 100%; object-fit: contain; }
.product-photo-placeholder svg { width: 62px; height: 62px; fill: none; stroke: #9aa9c8; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.product-edit-admin .product-form-field { gap: 6px; }
.product-edit-admin .product-form-field > label { color: #263b6e; font-size: .75rem; }
.product-edit-admin .product-form-field .form-control { width: 100%; min-height: 44px; border: 1px solid #cdd7ea; border-radius: 10px; color: #14295b; background: #fff; font-size: .84rem; box-sizing: border-box; }
.product-edit-admin .product-form-field input[type="file"] { height: auto; min-height: 44px; max-width: 100%; padding: 6px; font-size: .72rem; }
.product-edit-admin .product-form-field input[type="file"]::file-selector-button { background: #315bd0; }
.product-identity-panel { display: grid; align-content: start; gap: 20px; }
.product-editor-fields, .product-extra-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 18px 14px; }
.product-price-input { position: relative; }
.product-price-input .form-control { padding-inline-end: 46px; }
.product-price-input > span { position: absolute; inset-inline-end: 14px; top: 50%; transform: translateY(-50%); color: #53698d; font-size: .78rem; font-weight: 800; pointer-events: none; }
.product-edit-admin .product-variants { gap: 14px; margin: 0; padding: 18px; border: 1px solid #e6ebf5; border-radius: 16px; background: #fff; }
.product-edit-admin .product-variants h2 { color: #101e5a; }
.product-edit-admin .product-variants p { font-size: .75rem; }
.product-edit-admin .product-variants__heading button { color: #315bd0; border: 1px solid #b5c7f1; background: #f5f8ff; font-size: .76rem; }
.product-edit-admin .product-variant-row { padding: 12px; border: 1px solid #e2e9f6; background: #f7f9fd; }
.product-edit-admin .product-variant-row .form-control { min-height: 42px; border: 1px solid #cdd7ea; border-radius: 9px; background: #fff; font-size: .8rem; }
.product-edit-admin .product-variant-row > div > label { font-size: .74rem; }
.product-edit-admin .product-variant-row.is-removed { opacity: .48; }
.product-extra-settings { border: 1px solid #e6ebf5; border-radius: 12px; background: #fbfcff; }
.product-extra-settings summary { padding: 14px 18px; color: #223665; font-size: .84rem; font-weight: 800; cursor: pointer; }
.product-extra-settings summary span { display: block; margin-top: 3px; color: #657391; font-size: .72rem; font-weight: 400; }
.product-extra-grid { padding: 4px 18px 18px; }
.product-edit-admin .product-create-footer { margin-top: 0; padding-top: 18px; }
.product-edit-admin .product-create-footer :is(a, button) { min-height: 43px; font-size: .78rem; }
.product-edit-admin .product-create-footer button[type="submit"] { background: #315bd0; }
.product-edit-admin .product-create-footer button[type="submit"]:hover { background: #244ab4; }

@media (max-width: 1100px) {
    .product-editor-main { grid-template-columns: minmax(0, 1fr); }
}

/* Keep the fields, variants and actions in normal flow, including short windows. */
body.role-warehouse_worker .product-form-field { min-width: 0; align-content: start; }
body.role-warehouse_worker .product-create-grid { align-items: start; }
body.role-warehouse_worker .product-variants__heading { flex-wrap: wrap; }

@media (min-width: 821px) {
    body.role-warehouse_worker .product-create-page { width: 100%; max-width: none; margin: 0; padding: 16px 24px; background: #eef2f7; }
    body.role-warehouse_worker .product-create-surface { width: min(1120px, 100%); margin: 0 auto; padding: 24px; overflow: visible; border: 0; border-radius: 16px; background: #fff; box-shadow: 0 14px 36px rgba(50, 69, 96, .09); box-sizing: border-box; }
    body.role-warehouse_worker .product-create-form { gap: 24px; }
    body.role-warehouse_worker .product-create-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    body.role-warehouse_worker .product-form-field--name { grid-column: span 2; }
    body.role-warehouse_worker .product-form-field--description { grid-column: span 2; }
    body.role-warehouse_worker .product-form-field--image { grid-column: span 2; }
}

@media (min-width: 1101px) {
    body.role-warehouse_worker .product-create-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .product-edit-admin .product-create-surface { padding: 18px; }
    .product-photo-preview { height: 180px; }
    .product-editor-fields, .product-extra-grid { grid-template-columns: minmax(0, 1fr); }
    .product-edit-admin .product-variants__heading { align-items: stretch; flex-direction: column; }
    .product-edit-admin .product-create-grid { grid-template-columns: minmax(0,1fr); }
    .product-edit-admin .product-form-field--name, .product-edit-admin .product-form-field--image { grid-column: auto; }
    .product-variant-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .product-create-header { grid-template-columns: auto minmax(0, 1fr); }
    .product-create-header > a { grid-column: 1 / -1; justify-content: center; }
    .product-create-grid { grid-template-columns: minmax(0, 1fr); }
    .product-create-footer { align-items: stretch; flex-direction: column; }
    .product-create-footer > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-create-footer :is(a, button) { justify-content: center; }
}
