/* product-modal.css
 * Styles for the shared ProductModal (product-modal.js).
 * Used by both the legacy spray form and the wizard.
 *
 * Loaded after app.css so the design tokens (--sf, --br, --tx, --tm, --gm, --rs)
 * resolve correctly.
 */

.pmodal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1500;     /* above the legacy .modal z-index of 1100 */
  align-items: stretch;
  justify-content: center;
}
.pmodal.open { display: flex; }

.psheet {
  background: var(--sf);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 760px) {
  .pmodal { align-items: center; padding: 32px; }
  .psheet {
    border-radius: 16px;
    max-width: 580px;
    height: auto;
    max-height: 86vh;
    box-shadow: 0 12px 48px rgba(0,0,0,.25);
  }
}

.phead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--br);
  flex-shrink: 0;
}
.phead h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--tx);
}
.pclose {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--tm);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}
.pclose:hover { background: rgba(0,0,0,.05); color: var(--tx); }

.pbody {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pp-field { display: flex; flex-direction: column; gap: 6px; }
.pp-field > label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--tm);
  font-weight: 600;
}
.pp-field input,
.pp-field select {
  padding: 11px 12px;
  border: 1px solid var(--br);
  border-radius: var(--rs);
  font-size: 15px;
  background: var(--sf);
  color: var(--tx);
  box-sizing: border-box;
  width: 100%;
}

.pp-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pp-info {
  font-size: 13px;
  color: var(--tm);
  padding: 10px 12px;
  background: #f5f5f0;
  border-radius: var(--rs);
  line-height: 1.5;
}
.pp-info-link { color: var(--gm); font-weight: 600; text-decoration: none; }
.pp-info-link:hover { text-decoration: underline; }

.pfoot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 12px 18px;
  border-top: 1px solid var(--br);
  flex-shrink: 0;
  background: var(--sf);
}
.pcancel, .pconfirm {
  padding: 11px 18px;
  border-radius: var(--rs);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.pcancel {
  background: var(--sf);
  border: 1px solid var(--br);
  color: var(--tx);
}
.pconfirm {
  background: var(--gm);
  color: #fff;
  border: none;
}
.pconfirm:hover { filter: brightness(1.08); }

/* Locked product field in edit mode */
.pp-search.pp-locked {
  background: #f5f5f0;
  color: var(--tm);
  cursor: not-allowed;
}
.pp-search.pp-locked:focus { outline: none; box-shadow: none; }

/* Autocomplete dropdowns (positioned via JS, position:fixed) */
.pp-ac-wrap { position: relative; }
.pp-ac-list {
  /* Position is set inline via JS so the dropdown can escape
     overflow:hidden ancestors. Other layout/styling is here. */
  max-height: 260px;
  overflow-y: auto;
  background: var(--sf);
  border: 1px solid var(--br);
  border-radius: var(--rs);
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.pp-ac-item {
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  color: var(--tx);
  border-bottom: 1px solid #f3f3ef;
}
.pp-ac-item:last-child { border-bottom: none; }
.pp-ac-item:hover { background: rgba(26,58,42,.06); }
.pp-ac-meta {
  font-size: 11px;
  color: var(--tm);
  margin-left: 8px;
}

/* v13.2: AC dropdowns are positioned absolutely relative to their wrap,
   constrained inside the modal sheet so taps don't fall on the backdrop. */
.pp-ac-wrap { position: relative; }
.pp-ac-list {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 10;
}
