/* Final interaction layer for the product editor. */
.attribute-multi-select.is-open .attribute-multi-select-trigger > i { transform: rotate(180deg); }
.attribute-multi-select-options { max-height: 196px !important; padding: 3px !important; }
.attribute-multi-select-options label { min-height: 36px !important; padding: 5px 8px !important; gap: 8px !important; font-size: 14px !important; line-height: 1.25 !important; }
.attribute-multi-select-options .ui-checkbox-input { position: absolute !important; inline-size: 1px !important; block-size: 1px !important; margin: -1px !important; padding: 0 !important; appearance: none !important; opacity: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; }
.attribute-multi-select-options .ui-checkbox-mark { flex: 0 0 18px; inline-size: 18px; block-size: 18px; }
.attribute-multi-select-more { align-self: center; color: #476158; font-size: 13px; font-weight: 700; }
.attribute-multi-select-search { padding: 7px 9px !important; }
.attribute-multi-select-panel { max-width: 360px; overflow: hidden !important; }
.attribute-form-group:has(.attribute-multi-select.is-open) { position: relative; z-index: 40; overflow: visible !important; }
.attribute-form-group:has(.attribute-multi-select.is-open) .attribute-fields-grid { overflow: visible !important; }

/* Unified multi-select behaviour: position the menu from its trigger, not the stretched grid row. */
.attribute-multi-select { align-self: start; min-height: 0; }
.attribute-multi-select-panel { top: calc(100% + 4px); display: none; grid-template-rows: auto minmax(0, 1fr) auto; width: min(360px, 100%); max-width: 100% !important; }
.attribute-multi-select.is-open .attribute-multi-select-panel { display: grid; }
.attribute-multi-select-option:focus-visible { outline: 2px solid #167055; outline-offset: -2px; }
.attribute-multi-select-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-top: 1px solid #e2e9e5; color: #65776f; font-size: 12px; }
.attribute-multi-select-actions button { min-height: 30px; padding: 4px 11px; border: 1px solid #167055; border-radius: 5px; background: #167055; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.attribute-multi-select-actions button:hover { background: #0f6249; }

/* Never show a browser-generated disclosure icon beside the intended one. */
.advanced-product-section > summary { display: grid !important; grid-template-columns: minmax(0, 1fr) auto !important; list-style: none !important; }
.advanced-product-section > summary::marker { display: none !important; content: "" !important; }
.advanced-product-section > summary::-webkit-details-marker { display: none !important; }
.advanced-product-section > summary > i { justify-self: end; }
.tiptap-image-resize-handle{box-sizing:border-box!important;display:block!important;min-width:15px!important;min-height:15px!important;width:15px!important;height:15px!important;padding:0!important;margin:0!important;line-height:0!important;aspect-ratio:1/1!important;border-radius:50%!important;flex:none!important}

.product-create-dialog .product-form-section{padding:14px 0}.product-create-dialog .product-form-section-heading{margin-bottom:10px}.product-create-dialog .field-row{margin:0}.product-create-dialog .product-form-section>:is(.settings-grid,.product-identity-form-grid,.measurement-fields,.packaging-level-grid,.attribute-form-groups){width:calc(100% - 36px);margin-left:36px}.product-create-dialog :is(.settings-grid,.product-identity-form-grid,.measurement-fields,.packaging-fields,.attribute-fields-grid,.reference-product-controls){grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.product-creation-methods{display:flex;gap:8px;margin-left:36px}.product-creation-choice{position:relative;display:block;flex:0 0 260px;width:260px;cursor:pointer}.product-creation-choice>input{position:absolute;opacity:0;pointer-events:none}.product-creation-choice>span{display:grid;width:100%;grid-template-columns:22px minmax(0,1fr);align-items:center;gap:8px;min-height:50px;padding:9px 12px;border:1px solid #d7e1dc;border-radius:7px;background:#fff;transition:border-color .15s,background .15s}.product-creation-choice i{color:#557168;font-size:17px}.product-creation-choice strong{color:#1f2d29;font-size:13px}.product-creation-choice>input:checked+span{border-color:#16805f;background:#f2faf6;box-shadow:inset 3px 0 #16805f}.product-creation-choice>input:focus-visible+span{outline:2px solid #16805f;outline-offset:2px}.reference-product-picker{display:grid;width:calc(100% - 36px);gap:7px;margin:10px 0 0 36px;padding:0;border:0;background:transparent}.reference-product-picker-heading{display:flex;align-items:center}.reference-product-picker-heading label{font-size:12px;font-weight:700}.reference-product-search{position:relative}.reference-product-search i{position:absolute;left:11px;top:50%;transform:translateY(-50%);color:#71817a}.reference-product-search input{width:100%;padding-left:34px}.reference-product-status{margin:0;color:#64756e;font-size:11px}.reference-product-status:empty{display:none}.reference-product-status:not(:empty){color:#176b50;font-weight:650}.product-create-dialog .product-identity-form-grid>.settings-grid{display:contents}.product-create-dialog .product-identity-form-grid>.image-source-picker{min-width:0}.product-create-dialog .measurement-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.product-specification-notes{margin:0}.product-specification-notes textarea{min-height:84px}.product-create-dialog .packaging-level-grid{grid-template-columns:1fr}.product-create-dialog .attribute-fields-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.product-create-dialog .field-span-2{grid-column:1/-1}.product-code-change{display:grid;width:calc(100% - 36px);grid-template-columns:18px minmax(0,1fr);align-items:start;gap:9px;margin:10px 0 0 36px;padding:10px 12px;border:1px solid #dfc98f;border-radius:7px;background:#fffaf0;color:#4b3b17}.product-code-change[hidden]{display:none}.product-code-change>i{margin-top:2px;color:#9b6d08}.product-code-change strong{font-size:12px}.product-code-change p{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:3px 0 1px;font-size:12px;font-weight:700}.product-code-change p>i{color:#8a7b58;font-size:11px}.product-code-change small{color:#74633c;font-size:11px}
.product-create-dialog .product-specification-notes{width:calc(100% - 36px);margin-left:36px}
@media(max-width:820px){.product-create-dialog .product-form-section>:is(.settings-grid,.product-identity-form-grid,.measurement-fields,.packaging-level-grid,.attribute-form-groups),.reference-product-picker,.product-code-change{width:100%;margin-left:0}.product-create-dialog :is(.settings-grid,.product-identity-form-grid,.measurement-fields,.packaging-fields,.attribute-fields-grid,.reference-product-controls){grid-template-columns:1fr}.product-creation-methods{flex-direction:column;margin-left:0}.product-creation-choice{flex-basis:auto;width:100%}.product-create-dialog .product-specification-notes{width:100%;margin-left:0}}

/* Keep core identity fields and the main-image workflow in stable, independent regions. */
.product-create-dialog .product-identity-form-grid{
  grid-template-columns:minmax(0,1fr) minmax(300px,320px);
  align-items:stretch;
}
.product-create-dialog .product-identity-form-grid>.settings-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  align-content:start;
  align-items:stretch;
}
.product-create-dialog .product-identity-form-grid>.settings-grid>.field-row>label{
  display:flex;
  height:18px;
  align-items:center;
  margin:0;
  line-height:18px;
}
.product-create-dialog .product-identity-form-grid>.settings-grid>.field-row{
  grid-template-rows:18px 42px;
  align-content:start;
}
.product-create-dialog .product-identity-form-grid>.settings-grid>.field-row>:is(input,select,textarea,.attribute-multi-select){
  align-self:start;
  margin:0;
}
.product-create-dialog .product-identity-form-grid>.image-source-picker{
  min-width:0;
  height:100%;
  align-self:stretch;
}
.product-create-dialog .product-identity-form-grid>.image-source-picker .image-source-summary{
  height:100%;
  grid-template-columns:156px minmax(0,1fr);
  grid-template-rows:auto auto auto auto minmax(0,1fr) auto;
  column-gap:12px;
  row-gap:2px;
  align-items:start;
}
.product-create-dialog .product-identity-form-grid>.image-source-picker .image-source-preview{
  width:156px;
  grid-column:1;
  grid-row:1/6;
  align-self:center;
}
.product-create-dialog .product-identity-form-grid>.image-source-picker .image-source-summary-copy{
  display:contents;
}
.product-create-dialog .product-identity-form-grid>.image-source-picker .image-source-eyebrow,
.product-create-dialog .product-identity-form-grid>.image-source-picker .image-source-summary-copy>strong,
.product-create-dialog .product-identity-form-grid>.image-source-picker .image-source-summary-copy>small{
  grid-column:2;
}
.product-create-dialog .product-identity-form-grid>.image-source-picker .image-source-eyebrow{grid-row:1}
.product-create-dialog .product-identity-form-grid>.image-source-picker .image-source-summary-copy>strong{grid-row:2}
.product-create-dialog .product-identity-form-grid>.image-source-picker .image-source-summary-copy>small:nth-of-type(1){grid-row:3}
.product-create-dialog .product-identity-form-grid>.image-source-picker .image-source-summary-copy>small:nth-of-type(2){grid-row:4}
.product-create-dialog .product-identity-form-grid>.image-source-picker .image-source-actions{
  grid-column:1/-1;
  grid-row:6;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  align-self:end;
  margin-top:10px;
}
.product-create-dialog .modal-close{
  width:34px;
  height:34px;
  min-width:34px;
  min-height:34px;
  flex-basis:34px;
  font-size:16px;
}
.product-create-dialog .attribute-form-groups{
  gap:8px;
}
.product-create-dialog .attribute-form-group{
  overflow:hidden;
  border:1px solid #d7e1dc;
  border-radius:7px;
  background:#fff;
}
.product-create-dialog .attribute-form-group>summary{
  display:grid;
  min-height:54px;
  grid-template-columns:minmax(0,1fr) 16px;
  gap:12px;
  align-items:center;
  padding:10px 12px;
  border:0;
  background:#f8faf9;
}
.product-create-dialog .attribute-form-group>summary>span{
  display:grid;
  min-width:0;
  gap:2px;
}
.product-create-dialog .attribute-form-group>summary strong,
.product-create-dialog .attribute-form-group>summary small{
  display:block;
  margin:0;
  line-height:1.3;
}
.product-create-dialog .attribute-form-group>summary strong{
  color:#26352f;
  font-size:12px;
}
.product-create-dialog .attribute-form-group>summary small{
  color:#71817a;
  font-size:10px;
}
.product-create-dialog .attribute-form-group>summary::after{
  width:auto;
  height:auto;
  justify-self:center;
  border:0;
  color:#566860;
  content:"›";
  font-size:18px;
  line-height:1;
  transform:rotate(90deg);
  transition:transform .15s ease;
}
.product-create-dialog .attribute-form-group[open]>summary{
  border-bottom:1px solid #d7e1dc;
}
.product-create-dialog .attribute-form-group[open]>summary::after{
  transform:rotate(270deg);
}
.product-create-dialog .attribute-form-group>.settings-grid{
  padding:12px;
}
@media(max-width:820px){
  .product-create-dialog .product-identity-form-grid{
    grid-template-columns:1fr;
    align-items:start;
  }
  .product-create-dialog .product-identity-form-grid>.settings-grid{
    grid-template-columns:1fr;
  }
  .product-create-dialog .product-identity-form-grid>.image-source-picker{
    height:auto;
    align-self:start;
  }
  .product-create-dialog .product-identity-form-grid>.image-source-picker .image-source-summary{
    height:auto;
  }
  .product-create-dialog .modal-close{
    width:40px;
    height:40px;
    min-width:40px;
    min-height:40px;
    flex-basis:40px;
  }
}
/* Reference-product flow: show the picker only after its creation method is chosen. */
.reference-product-picker[hidden]{display:none!important}
.reference-product-picker{gap:13px;margin-top:13px;padding:14px 15px;border:1px solid #cde0d7;border-radius:8px;background:#f7fbf9}
.reference-product-picker-heading{align-items:flex-start;gap:10px}
.reference-product-step,.reference-product-control-step{display:grid;place-items:center;border-radius:50%;color:#176b50;background:#dceee6;font-weight:800}
.reference-product-step{width:24px;height:24px;flex:0 0 24px;font-size:11px}
.reference-product-picker-heading h4{margin:0;color:#1f2d29;font-size:13px}
.reference-product-picker-heading p{margin:3px 0 0;color:#66776f;font-size:11px;line-height:1.45}
.reference-product-controls{display:grid;grid-template-columns:minmax(0,.9fr) minmax(280px,1.25fr);gap:10px;align-items:start}
.reference-product-control{display:grid;grid-template-rows:18px 42px;gap:6px;min-width:0}
.reference-product-control>label{display:flex;height:18px;align-items:center;gap:6px;color:#40524a;font-size:11px;font-weight:750;line-height:18px}
.reference-product-control>label>span:last-child{display:flex;align-items:baseline;gap:4px;min-width:0}
.reference-product-control>label small{margin:0;color:#829089;font-size:10px;font-weight:500;line-height:1}
.reference-product-control-step{width:17px;height:17px;flex:0 0 17px;color:#fff;background:#638278;font-size:9px}
.reference-product-input-shell{position:relative;width:100%;height:42px;min-width:0}
.reference-product-input-shell i{position:absolute;inset:0 auto 0 0;z-index:1;display:grid;width:42px;height:42px;place-items:center;color:#71817a;font-size:15px;line-height:1;transform:none;pointer-events:none}
.reference-product-control :is(input,select){display:block;width:100%;height:42px;min-height:42px;margin:0;box-sizing:border-box;border:1px solid #bfcfc7;border-radius:6px;color:#1d2d26;background:#fff;font:inherit;line-height:normal}
.reference-product-search input{padding:0 12px 0 42px}
.reference-product-select select{padding-block:0}
.reference-product-control :is(input,select):focus{border-color:#5d9a83;box-shadow:0 0 0 3px rgba(18,99,75,.09);outline:0}
@media(max-width:820px){.reference-product-picker{width:100%;margin-left:0}.reference-product-controls{grid-template-columns:1fr}}
.product-create-dialog .packaging-level-grid{gap:20px}.product-create-dialog .packaging-level{border:0;background:transparent;overflow:visible}.product-create-dialog .packaging-level-heading{padding:0 0 8px;border-bottom:1px solid #d7e1dc;background:transparent}.product-create-dialog .packaging-fields{padding:10px 0 0}

/* Mobile section-by-section product editing. Desktop keeps the complete form visible. */
.product-mobile-section-nav,.product-mobile-step-actions{display:none}
@media(max-width:760px){
  .product-settings-dialog .product-create-scroll{padding-inline:14px}
  .product-mobile-section-nav{display:flex;position:sticky;top:0;z-index:8;gap:6px;margin:0 -14px 12px;padding:8px 14px;overflow-x:auto;background:#f5f8f6;border-bottom:1px solid #d9e2de;scrollbar-width:none}
  .product-mobile-section-nav::-webkit-scrollbar{display:none}
  .product-mobile-section-nav button{display:grid;grid-template-columns:24px minmax(0,1fr);align-items:center;gap:7px;flex:0 0 148px;min-height:50px;padding:7px 9px;border:1px solid #cad8d1;border-radius:7px;background:#fff;color:#4c6158;text-align:left;font:inherit;cursor:pointer}
  .product-mobile-section-nav button::before{content:attr(data-section-index);display:grid;grid-row:1/3;width:24px;height:24px;place-items:center;border-radius:50%;background:#e8efeb;color:#486258;font-size:11px;font-weight:800}
  .product-mobile-section-nav button strong,.product-mobile-section-nav button small{grid-column:2;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .product-mobile-section-nav button strong{font-size:12px}
  .product-mobile-section-nav button small{color:#708078;font-size:10px}
  .product-mobile-section-nav button.is-active{border-color:#167055;background:#f0f8f4;color:#174f3d}
  .product-mobile-section-nav button.is-complete::before{content:'\2713';background:#167055;color:#fff}
  .product-mobile-section-nav button.has-error{border-color:#b42318;color:#8d1e17}
  .product-mobile-section-nav button.has-error::before{content:'!';background:#b42318;color:#fff}
  .product-settings-dialog .product-form-section{display:none;padding-top:8px}
  .product-settings-dialog .product-form-section.is-mobile-current{display:block}
  .product-settings-dialog .product-form-section>:is(.settings-grid,.product-identity-form-grid,.measurement-fields,.packaging-level-grid,.attribute-form-groups),.product-settings-dialog .reference-product-picker,.product-settings-dialog .product-code-change{width:100%;margin-left:0}
  .product-settings-dialog .product-form-section-heading .section-index{display:none}
  .product-mobile-step-actions{display:grid;grid-column:1/-1;grid-template-columns:1fr 1fr;gap:8px}
  .product-mobile-step-actions button{min-height:44px}
  .product-settings-dialog .modal-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding-bottom:calc(10px + var(--safe-bottom))}
  .product-settings-dialog .modal-actions>button{min-height:44px}
  .product-settings-dialog .form-progress{display:none}
}
