#addModal {box-sizing:border-box;padding:16px;overflow:hidden;}
#addModal > .modal-box.product-modal {width:850px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);margin:auto;box-sizing:border-box;overflow:auto;}
#addModal .form-field {min-width:0;}
#addModal .form-field:has(#aSku) {order:1;}
#addModal .form-field:has(#aSku) {display:grid;grid-template-columns:minmax(80px,1fr) repeat(3,80px) 64px 64px;grid-template-rows:auto 42px;gap:6px 8px;overflow-x:auto;}
#addModal .form-field:has(#aSku) > label {grid-column:1;grid-row:1;transform:none;}
#addModal #aSkuAutoWrap {grid-column:1;grid-row:2;min-width:0;width:100%;}
#addModal #aPricingRule,#addModal #aPricingRule .pricing-rule-primary,#addModal #aPricingRule .pricing-rule-secondary {display:contents;}
#addModal #aPricingRule .pricing-rule-toggle {grid-row:2;width:100%;min-width:0;height:42px;padding:0 6px;}
#addModal #aVariantModeToggle {grid-column:2;}
#addModal #aPresaleToggle {grid-column:3;}
#addModal #aUnderwearToggle {grid-column:4;}
#addModal #aPricingRule .mini-field {grid-row:1 / 3;display:flex;flex-direction:column;justify-content:space-between;min-width:0;}
#addModal #aPricingRule .mini-field:has(#aBundleQty) {grid-column:5;}
#addModal #aPricingRule .mini-field:has(#aBundleDiscount) {grid-column:6;}
#addModal #aPricingRule .mini-field input {width:100%;min-width:0;height:42px;}
#addModal .product-core-fields-row {order:2;grid-template-columns:repeat(4,minmax(0,1fr));}
#addModal .product-core-fields-row > .form-field:has(#aPrice) {order:-1;}
#addModal .form-field:has(#aName) {order:3;}
#addModal .form-field:has(#aVariantList) {order:4;}
#addModal #aSku,#addModal #aPrice,#addModal #aCost {font-weight:700;}
#addModal .add-variant-entry-row {grid-template-columns:minmax(0,1fr) 76px 90px 96px;}
#addModal #aVariantCost,#addModal #aVariantStock {font-size:12px;padding:0 8px;}
#addModal #aVariantAddButton {width:96px;background:#222;color:#fff;border-color:#222;white-space:nowrap;}
#addModal #aVariantAddButton:disabled {opacity:.6;}
#addModal .add-cost-summary {display:flex;align-items:center;gap:6px;border:1.5px solid #d8d8d8;border-radius:8px;padding:0 12px;height:42px;box-sizing:border-box;}
#addModal .add-cost-summary:has(input[readonly]) {background:#f3f3f3;}
#addModal .add-cost-summary #aCost {min-width:0;width:40px;flex:1;height:38px;border:0;padding:0;background:transparent;box-shadow:none;appearance:textfield;}
#addModal #aCostHint {font-size:11px;color:#777;font-weight:700;line-height:1.3;}
#addModal #aCostHint[hidden] {display:none;}
#addModal .variant-total-line {height:42px;background:#f3f3f3;justify-content:space-between;}
#addModal .variant-total-line span {font-size:11px;color:#777;font-weight:700;}
#addModal .variant-total-line strong {font-size:15px;font-weight:800;}
#addModal #aVariantList {min-width:0;width:100%;}
#addModal #aVariantList .variant-draft-row {display:grid;grid-template-columns:minmax(0,1fr) 76px 76px 64px;min-width:0;width:100%;height:auto;min-height:42px;gap:6px;}
#addModal #aVariantList .variant-draft-row input {width:100%;min-width:0;box-sizing:border-box;}
#addModal #aSaveStatus {min-height:20px;text-align:right;color:#666;font-size:11px;margin:8px 0;overflow-wrap:anywhere;}
#addModal #aSaveStatus:empty {display:none;}
#addModal .add-matrix-scroll {overflow-x:auto;scrollbar-width:none;border:1px solid #222;border-radius:8px;touch-action:pan-x pan-y;}
#addModal .add-matrix-scroll::-webkit-scrollbar {display:none;}
#addModal .add-variant-matrix {width:100%;table-layout:fixed;border-collapse:collapse;font-size:11px;}
#addModal .add-variant-matrix th {width:80px;background:#f7f7f7;font-weight:500;position:sticky;left:0;z-index:1;box-shadow:1px 0 #222;}
#addModal .add-variant-matrix th,#addModal .add-variant-matrix td {height:47px;padding:0 8px;border-right:1px solid #222;border-bottom:1px solid #222;box-sizing:border-box;}
#addModal .add-variant-matrix tr:last-child > * {border-bottom:0;}
#addModal .add-variant-matrix tr > :last-child {border-right:0;}
#addModal .add-matrix-name {display:flex;align-items:center;gap:4px;min-width:0;height:46px;}
#addModal .add-matrix-name .edit-variant-name {width:0;min-width:0;flex:1;height:30px;padding:0;border:0;border-bottom:1px solid transparent;border-radius:0;font-size:12px;font-weight:700;box-shadow:none;}
#addModal .add-matrix-name .edit-variant-name:focus {border-bottom-color:#222;}
#addModal .add-matrix-name button {display:grid;place-items:center;flex:0 0 22px;width:22px;height:30px;padding:0;border:0;background:transparent;}
#addModal .add-matrix-delete svg {width:14px;height:14px;}
#addModal .add-matrix-values {display:flex;justify-content:space-between;gap:8px;align-items:baseline;}
#addModal .add-matrix-values label {display:flex;align-items:baseline;gap:4px;margin:0;color:#222;font-size:11px;font-weight:400;white-space:nowrap;}
#addModal .add-matrix-values label > span {display:flex;align-items:baseline;gap:3px;}
#addModal .add-matrix-values input {width:36px;min-width:0;height:24px;padding:0;text-align:center;border:0;border-bottom:1px solid transparent;border-radius:0;box-shadow:none;background:transparent;font-size:12px;font-weight:700;appearance:textfield;}
#addModal .add-matrix-values input::-webkit-inner-spin-button,#addModal .add-matrix-values input::-webkit-outer-spin-button {appearance:none;}
#addModal .add-matrix-values input:focus,#addModal .add-matrix-values input:placeholder-shown {border-bottom-color:#222;}
#addModal .add-matrix-values small {font-size:9px;font-weight:700;}
#addModal .add-matrix-empty {text-align:center;color:#999;}
@media(max-width:620px) {
 #addModal .product-core-fields-row {grid-template-columns:repeat(2,minmax(0,1fr));}
 #addModal .add-variant-entry-row {grid-template-columns:minmax(0,1fr) minmax(0,1fr) 96px;}
 #addModal #aName {grid-column:1 / -1;}
 #addModal #aVariantList .variant-draft-row {grid-template-columns:minmax(0,1fr) minmax(0,1fr) 64px;}
 #addModal #aVariantList .edit-variant-name {grid-column:1 / -1;}
}
