/* QualityPack — repeat order modal. */

.qp-repeat-overlay {
  position: fixed;
  inset: 0;
  z-index: 1110;
  background: rgba(15, 23, 30, 0);
  visibility: hidden;
  transition: background .25s ease, visibility .25s ease;
}
.qp-repeat-overlay.is-open {
  background: rgba(15, 23, 30, 0.55);
  visibility: visible;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.qp-repeat-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -45%) scale(0.96);
  opacity: 0;
  z-index: 1120;
  width: min(820px, calc(100% - 24px));
  max-height: calc(100vh - 48px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  display: flex;
  flex-direction: column;
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: none;
}
.qp-repeat-overlay.is-open .qp-repeat-modal {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.qp-repeat-head {
  padding: 18px 24px;
  border-bottom: 1px solid #eef1ea;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.qp-repeat-head h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1f2a24;
  display: flex;
  align-items: center;
  gap: 10px;
}
.qp-repeat-head h3 i { color: #94c93d; }
.qp-repeat-head .order-no {
  font-family: ui-monospace, Menlo, monospace;
  color: #6c7770;
  font-weight: 500;
  font-size: 0.95rem;
}
.qp-repeat-close {
  background: transparent;
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  color: #888;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.qp-repeat-close:hover { background: #f3f5f7; color: #111; }

.qp-repeat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}
.qp-repeat-loading {
  text-align: center;
  padding: 3rem 0;
  color: #6c7770;
}
.qp-repeat-loading i { font-size: 1.8rem; color: #94c93d; }

.qp-repeat-bulk {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #fafcf6;
  border: 1px solid #eef1ea;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 0.88rem;
}
.qp-repeat-bulk-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1f2a24;
  cursor: pointer;
  font-weight: 600;
}
.qp-repeat-bulk-count {
  color: #6c7770;
}

.qp-repeat-item {
  display: grid;
  grid-template-columns: auto 56px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #eef1ea;
  border-radius: 10px;
  margin-bottom: 8px;
  background: #fff;
  transition: border-color .15s ease, background .15s ease, opacity .15s ease;
}
.qp-repeat-item:hover { border-color: #cfd6d0; }
.qp-repeat-item.is-selected { border-color: #94c93d; background: #fafcf6; }
.qp-repeat-item.is-unavailable { opacity: 0.65; background: #fafafa; }

.qp-repeat-check { width: 18px; height: 18px; accent-color: #94c93d; cursor: pointer; }
.qp-repeat-item.is-unavailable .qp-repeat-check { cursor: not-allowed; }

.qp-repeat-img {
  width: 56px; height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: #f3f5f7;
}

.qp-repeat-info { min-width: 0; }
.qp-repeat-name {
  font-weight: 600;
  color: #1f2a24;
  font-size: 0.92rem;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qp-repeat-code {
  font-size: 0.78rem;
  color: #8a949a;
  font-family: ui-monospace, Menlo, monospace;
}
.qp-repeat-warn {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.78rem;
  background: #fdeeee;
  color: #c62828;
  padding: 2px 8px;
  border-radius: 50px;
  font-weight: 600;
}

.qp-repeat-qty {
  width: 64px;
  height: 32px;
  border: 1px solid #cfd6d0;
  border-radius: 6px;
  padding: 4px 8px;
  text-align: center;
  font-size: 0.88rem;
}
.qp-repeat-qty:focus { outline: none; border-color: #94c93d; box-shadow: 0 0 0 3px rgba(148, 201, 61, 0.15); }
.qp-repeat-qty[disabled] { background: #f3f5f4; }

.qp-repeat-price { text-align: right; min-width: 120px; }
.qp-repeat-price-old {
  display: block;
  font-size: 0.76rem;
  color: #98a2a8;
  text-decoration: line-through;
  margin-bottom: 2px;
}
.qp-repeat-price-current {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: #06441a;
}
.qp-repeat-price-delta {
  display: inline-block;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 50px;
  margin-top: 2px;
  font-weight: 600;
}
.qp-repeat-price-delta.up   { background: #fdeeee; color: #c62828; }
.qp-repeat-price-delta.down { background: #e9f5d8; color: #06441a; }

.qp-repeat-foot {
  padding: 14px 24px;
  border-top: 1px solid #eef1ea;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.qp-repeat-summary { color: #6c7770; font-size: 0.92rem; }
.qp-repeat-summary strong { color: #1f2a24; }
.qp-repeat-actions { display: flex; gap: 8px; }
.qp-repeat-btn {
  border: 0;
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.qp-repeat-btn-primary { background: #94c93d; color: #fff; }
.qp-repeat-btn-primary:hover { background: #7eb030; color: #fff; }
.qp-repeat-btn-primary[disabled] { background: #9aa3a0; cursor: not-allowed; }
.qp-repeat-btn-ghost { background: #f3f5f7; color: #1f2a24; }
.qp-repeat-btn-ghost:hover { background: #e6eaed; }

@media (max-width: 640px) {
  .qp-repeat-modal { width: 100%; height: 100vh; max-height: 100vh; border-radius: 0; }
  .qp-repeat-item { grid-template-columns: auto 1fr auto; }
  .qp-repeat-img { display: none; }
  .qp-repeat-price { min-width: 0; }
  .qp-repeat-qty { width: 56px; }
}
