/* Shared compact 1688 selector for cabinet/admin and client-side API lock */
body.zp1688-modal-open { overflow: hidden; }
.zp1688-modal { position: fixed; inset: 0; z-index: 12000; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(27,22,45,.58); backdrop-filter: blur(3px); }
.zp1688-dialog { position: relative; display:flex; flex-direction:column; width: min(840px,96vw); max-height:min(92vh,calc(100dvh - 28px)); overflow: hidden; padding:0; border-radius: 12px; background: #fff; box-shadow: 0 28px 85px rgba(24,17,53,.3); }
.zp1688-dialog-body{min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:18px 18px 10px}
.zp1688-loading-dialog { width: min(420px,92vw); padding:18px; }
.zp1688-loading-content { min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #2d2742; text-align: center; }
.zp1688-loading-content > i { color: #6c5ce7; font-size: 34px; }
.zp1688-loading-content > strong { font-size: 18px; }
.zp1688-loading-content > span { color: #777085; font-size: 13px; }
.zp1688-price-warning { display: grid; grid-template-columns: auto 1fr; gap: 7px 9px; margin: 8px 0; padding: 9px 11px; border: 1px solid #f0c36d; border-radius: 9px; background: #fff9ea; color: #6d5420; font-size: 12px; }
.zp1688-price-warning > i { margin-top: 2px; color: #d99a20; }
.zp1688-price-warning > label { grid-column: 2; display: flex; align-items: center; gap: 7px; font-weight: 700; }
.zp1688-price-warning input[type="checkbox"] { width: 16px; height: 16px; accent-color: #6c5ce7; }
.zp1688-price-cell { display: flex; align-items: center; }
.zp1688-price-edit,.zp1688-manual-shipping { display: inline-flex; align-items: center; gap: 4px; }
.zp1688-price-input { width: 66px; min-height: 30px; padding: 4px 6px; border: 1px solid #f0b84f; border-radius: 7px; color: #29243a; font-weight: 800; text-align: right; }
.zp1688-manual-shipping input { width: 84px; min-height: 30px; padding: 4px 7px; border: 1px solid #f0b84f; border-radius: 7px; font-weight: 800; text-align: right; }
.zp1688-close { position: absolute; z-index: 2; top: 8px; right: 8px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: #f4f2f8; color: #575166; font-size: 22px; cursor: pointer; }
.zp1688-grid { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 20px; }
.zp1688-media,.zp1688-content { min-width: 0; }
.zp1688-main-image { height: 250px; overflow: hidden; border: 1px solid #ece9f2; border-radius: 7px; background: #faf9fc; }
.zp1688-main-image img { width: 100%; height: 100%; object-fit: contain; }
.zp1688-thumbs { display: grid; grid-template-columns: repeat(5,42px); gap: 7px; margin-top: 8px; }
.zp1688-thumbs button,.zp1688-colors button { overflow: hidden; padding: 2px; border: 1px solid #e2dfea; border-radius: 6px; background: #fff; cursor: pointer; }
.zp1688-thumbs button { width: 42px; height: 42px; }
.zp1688-thumbs button.active,.zp1688-colors button.active { border: 2px solid var(--color-primary,#6C5CE7); box-shadow: 0 0 0 2px rgba(108,92,231,.1); }
.zp1688-thumbs img,.zp1688-colors img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }
.zp1688-no-image { height: 250px; display: grid; place-items: center; border-radius: 7px; background: #f8f7fb; color: #8b8597; }
.zp1688-content h3 { margin: 0 38px 8px 0; max-height: 78px; overflow: hidden; color: var(--color-dark,#1A1A2E); font-size: 14px; line-height: 1.4; font-weight: 750; }
.zp1688-source { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; color: #888294; font-size: 11px; }
.zp1688-source b { padding: 4px 6px; border-radius: 5px; background: #ff6a22; color: #fff; }
.zp1688-source a { margin-left: auto; color: var(--color-primary,#6C5CE7); font-weight: 750; text-decoration: none; }
.zp1688-price { display: inline-flex; margin: 3px 0 8px; padding: 7px 14px; border: 2px solid var(--color-primary,#6C5CE7); border-radius: 8px; color: var(--color-primary,#6C5CE7); font-size: 19px; font-weight: 900; }
.zp1688-content section { margin-top: 9px; }
.zp1688-content section h4 { margin: 0 0 6px; font-size: 13px; }
.zp1688-colors { display: flex; flex-wrap: wrap; gap: 7px; }
.zp1688-colors button { width: 46px; height: 46px; }
.zp1688-colors button span { display: block; overflow: hidden; font-size: 8px; }
.zp1688-size-list { max-height: 222px; overflow-y: auto; border: 1px solid #ece9f2; border-radius: 6px; }
.zp1688-size-head,.zp1688-size-row { display: grid; grid-template-columns: minmax(65px,1fr) 72px 105px 126px; align-items: center; gap: 6px; padding: 0 9px; }
.zp1688-size-head { min-height: 29px; background: #faf9fc; color: #90899c; font-size: 10px; }
.zp1688-size-row { min-height: 43px; border-top: 1px solid #f0edf4; }
.zp1688-size-row strong,.zp1688-size-row span,.zp1688-size-row small { font-size: 11px; }
.zp1688-size-row small { color: #96909f; }
.zp1688-stepper { height: 31px; display: grid; grid-template-columns: 30px 1fr 30px; overflow: hidden; border: 1px solid #e7e3ed; border-radius: 6px; }
.zp1688-stepper button { border: 0; background: #f6f4fa; color: var(--color-primary,#6C5CE7); font-size: 16px; font-weight: 800; cursor: pointer; }
.zp1688-stepper input { min-width: 0; width: 100%; border: 0; outline: 0; text-align: center; font-size: 12px; font-weight: 800; appearance: textfield; }
.zp1688-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; margin-top: 9px; padding: 9px 11px; border-radius: 7px; background: #f7f4ff; }
.zp1688-summary div { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.zp1688-summary strong { color: var(--color-primary,#6C5CE7); }
.zp1688-summary .zp1688-shipping-note { grid-column: 1 / -1; padding-top: 7px; border-top: 1px solid #e5dff8; }
.zp1688-summary .zp1688-shipping-note.is-loading strong{opacity:.72}
.zp1688-summary .zp1688-summary-total{grid-column:1/-1;margin-top:2px;padding:8px 0 1px;border-top:1px solid #d9d1f3;font-size:14px;font-weight:850}
.zp1688-summary .zp1688-summary-total strong{font-size:15px;color:var(--color-primary-dark,#5A4BD1)}
.zp1688-actions { position:relative; z-index:3; display: grid; flex:0 0 auto; grid-template-columns: 1fr 1.25fr; gap: 8px; margin:0; padding:10px 18px 16px; border-top:1px solid #ece8f3; background:#fff; box-shadow:0 -8px 22px rgba(38,29,79,.06); }
.zp1688-actions button { height: 40px; border-radius: 7px; font-size: 15px; font-weight: 900; cursor: pointer; }
.zp1688-cancel { border: 1px solid #ddd8e8; background: #fff; color: #3d3748; }
.zp1688-save { border: 0; background: var(--color-primary,#6C5CE7); color: #fff; box-shadow: 0 7px 17px rgba(108,92,231,.22); }
.api-product-locked input[readonly] { background: #f4f3f7 !important; color: #625d6d !important; border-color: #e6e3eb !important; cursor: not-allowed !important; box-shadow: none !important; }
.api-product-locked { position: relative; }
.api-product-locked td:first-child { color: var(--color-primary,#6C5CE7); font-weight: 900; }
.product-color-option__check { display: none !important; }
.cabinet-form-grid input,.cabinet-form-grid select,
.admin-form-grid input,.admin-form-grid select {
  min-height: 44px;
  border-width: 1px;
  border-style: solid;
  border-radius: 10px;
  box-sizing: border-box;
}
.field-group input,.field-group select {
  min-height: 48px;
  border-width: 1px;
  border-style: solid;
  border-radius: 12px;
  box-sizing: border-box;
}

@media (max-width: 700px) {
  .zp1688-modal { align-items: flex-end; padding: 0; }
  .zp1688-dialog { width: 100%; max-height:96dvh; overflow:hidden; padding:0; border-radius: 14px 14px 0 0; }
  .zp1688-dialog-body{padding:14px 14px 9px;scrollbar-gutter:auto}
  .zp1688-loading-dialog{padding:14px}
  .zp1688-grid { grid-template-columns: 1fr; gap: 14px; }
  .zp1688-main-image,.zp1688-no-image { height: min(56vw,250px); }
  .zp1688-thumbs { grid-template-columns: repeat(6,38px); }
  .zp1688-thumbs button { width: 38px; height: 38px; }
  .zp1688-size-head { display: none; }
  .zp1688-size-row { grid-template-columns: 1fr 72px 126px; grid-template-areas: 'size price qty' 'stock stock qty'; padding: 8px 9px; }
  .zp1688-size-row strong { grid-area: size; }.zp1688-size-row span { grid-area: price; }.zp1688-size-row small { grid-area: stock; }.zp1688-stepper { grid-area: qty; }
  .zp1688-actions { grid-template-columns: 1fr; padding:10px 14px calc(10px + env(safe-area-inset-bottom)); }
}

@media (max-height: 720px) and (min-width: 701px) {
  .zp1688-dialog-body{padding-top:14px}
  .zp1688-main-image,.zp1688-no-image{height:190px}
  .zp1688-size-list{max-height:170px}
}
