/* =============================================================================
   Pep Research -- order request (checkout.html). Not a store checkout: the
   customer submits an ORDER REQUEST; Pepvela reviews it and sends payment
   instructions. Navy foundation, glass panels, compact technical type, the
   locked palette. Desktop: the form left, a sticky order summary right.
   Phones: one column -- a collapsible summary first, the form, then submit.
   ============================================================================= */

/* ---- header: the neural scene, quietly ---- */
.co-hero { padding-bottom: 48px; }

/* ---- layout ---- */
.co-sec { padding: 40px 0 96px; }
.co-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
.co-form { display: flex; flex-direction: column; gap: 20px; min-width: 0; margin: 0; }
.co-side { position: sticky; top: calc(var(--v3-header-h) + 24px); display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---- form panels ---- */
.co-panel {
  min-width: 0;
  margin: 0;
  padding: 26px 28px 28px;
  border: 1px solid var(--v3-card-line);
  border-radius: var(--v3-radius-card);
  background: var(--v3-glass-card);
  box-shadow: var(--v3-card-shadow);
}
.co-legend {
  float: left;
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 20px;
  padding: 0;
}
.co-legend + * { clear: both; }
.co-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(91, 110, 224, 0.35);
  border-radius: var(--pv3-radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--pv-cyan);
}
.co-legend-text { font-size: 16px; line-height: 24px; font-weight: 600; letter-spacing: -0.01em; color: var(--v3-on-dark); }
.co-req { margin-left: 2px; color: var(--pv-periwinkle); }
.co-opt { font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--v3-on-dark-soft); }
.co-panel-note { margin: 0 0 16px; font-size: 13px; line-height: 20px; color: var(--v3-on-dark-muted); }
.co-hint { font-size: 12px; line-height: 18px; color: var(--v3-on-dark-soft); }

.co-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.co-full { grid-column: 1 / -1; }
.co-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.co-field > label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; line-height: 18px; font-weight: 600; color: var(--v3-on-dark-muted); }

.co-field input:not([type="checkbox"]),
.co-field select,
.co-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(11, 22, 64, 0.108);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--v3-on-dark);
  font-size: 14.5px;
  line-height: 22px;
  transition: border-color 220ms var(--v3-ease-out), box-shadow 220ms var(--v3-ease-out), background-color 220ms var(--v3-ease-out);
}
.co-field textarea { min-height: 104px; padding: 12px 14px; resize: vertical; }
.co-field input:not([type="checkbox"])::placeholder,
.co-field textarea::placeholder { color: rgba(11, 22, 64, 0.5); }
.co-field input:not([type="checkbox"]):hover,
.co-field select:hover,
.co-field textarea:hover { border-color: rgba(58, 75, 200, 0.4); }
.co-field input:not([type="checkbox"]):focus-visible,
.co-field select:focus-visible,
.co-field textarea:focus-visible { outline: none; border-color: var(--pv-periwinkle); background: rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 3px rgba(11, 22, 64, 0.04); }
.co-field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 40px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--pv-periwinkle) 50%), linear-gradient(135deg, var(--pv-periwinkle) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.co-field select option { background: var(--pv-night); color: var(--v3-on-dark); }
.co-notes-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.co-count { flex: none; font-size: 11px; line-height: 18px; color: var(--v3-on-dark-soft); }

/* ---- checkboxes: the acknowledgments (and the Wholesale product picks) ---- */
.co-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--v3-line-dark);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 22px;
  color: var(--v3-on-dark-muted);
  cursor: pointer;
  transition: border-color 220ms var(--v3-ease-out), background-color 220ms var(--v3-ease-out);
}
.co-check + .co-check { margin-top: 12px; }
.co-check:hover { border-color: rgba(58, 75, 200, 0.35); }
.co-check:has(input:checked) { border-color: rgba(58, 75, 200, 0.45); background: rgba(58, 75, 200, 0.1); color: var(--v3-on-dark); }
.co-check a { color: var(--pv-lavender); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(11, 22, 64, 0.2); }
.co-check a:hover { color: var(--v3-on-dark); }
.co-check--inline { margin-top: 10px; padding: 0; border: 0; background: none; font-size: 13.5px; }
.co-check--inline:has(input:checked) { background: none; }
.co-check input,
.co-pay-method input {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  display: grid;
  place-content: center;
  margin: 1px 0 0;
  border: 1.5px solid rgba(11, 22, 64, 0.2);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: background-color 180ms var(--v3-ease-out), border-color 180ms var(--v3-ease-out);
}
.co-check input { width: 20px; height: 20px; border-radius: 6px; }
.co-check input::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--pv-text-light);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  transform: scale(0);
  transition: transform 160ms var(--v3-ease-out);
}
.co-check input:checked { border-color: transparent; background: var(--v3-action-gradient); }
.co-check input:checked::before { transform: scale(1); }

/* ---- preferred payment method: three preference cards ---- */
.co-pay-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.co-pay-method {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--v3-card-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: border-color 220ms var(--v3-ease-out), background-color 220ms var(--v3-ease-out), box-shadow 220ms var(--v3-ease-out);
}
.co-pay-method:hover { border-color: var(--v3-card-line-hover); }
.co-pay-method input { width: 18px; height: 18px; border-radius: 50%; }
.co-pay-method input::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pv-text-light);
  transform: scale(0);
  transition: transform 160ms var(--v3-ease-out);
}
.co-pay-method input:checked { border-color: var(--pv-violet-400); background: var(--pv-violet-600); }
.co-pay-method input:checked::before { transform: scale(1); }
.co-pay-method:has(input:checked) { border-color: rgba(58, 75, 200, 0.6); background: rgba(58, 75, 200, 0.1); box-shadow: inset 0 0 0 1px rgba(11, 22, 64, 0.055); }
.co-pay-method:has(input:focus-visible) { outline: 2px solid var(--v3-focus); outline-offset: 2px; }
.co-pm-name { display: block; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--v3-on-dark); }
.co-pm-desc { display: block; margin-top: 4px; font-size: 12.5px; line-height: 19px; color: var(--v3-on-dark-soft); }

/* ---- order summary ---- */
.co-summary {
  position: relative;
  padding: 24px;
  border: 1px solid var(--v3-card-line);
  border-radius: var(--v3-radius-panel);
  background: linear-gradient(180deg, rgba(58, 75, 200, 0.1) 0%, rgba(58, 75, 200, 0) 46%), var(--v3-glass-card);
  box-shadow: var(--v3-card-shadow);
}
.co-summary::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 24px;
  right: 24px;
  height: 1px;
  background: var(--v3-gradient-signal);
  opacity: 0.7;
}
.co-sum-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.co-sum-title { font-size: 16px; line-height: 24px; font-weight: 600; color: var(--v3-on-dark); }
.co-sum-count { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--v3-on-dark-soft); }
.co-sum-toggle { display: none; }
.co-lines { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; max-height: min(360px, 42vh); overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(11, 22, 64, 0.15) transparent; }
.co-line { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.co-thumb {
  display: grid;
  place-items: center;
  width: 48px;
  height: 60px;
  overflow: hidden;
  border: 1px solid var(--v3-line-dark);
  border-radius: 10px;
  background: radial-gradient(circle at 50% 32%, rgba(58, 75, 200, 0.1) 0%, rgba(255, 255, 255, 0.92) 72%), var(--pv-abyss);
}
.co-thumb img { width: auto; height: 54px; object-fit: contain; }
.co-line-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.co-line-name { font-size: 13.5px; line-height: 19px; font-weight: 600; color: var(--v3-on-dark); overflow-wrap: anywhere; }
a.co-line-name:hover { color: var(--pv-lavender); }
.co-line-meta { font-size: 12px; line-height: 17px; color: var(--v3-on-dark-soft); }
.co-line-strength { color: var(--pv-cyan); }
.co-line-total { font-size: 13.5px; font-weight: 600; color: var(--v3-on-dark); }
.co-totals { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--v3-line-dark); display: flex; flex-direction: column; gap: 10px; }
.co-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0; font-size: 13.5px; line-height: 20px; color: var(--v3-on-dark-muted); }
.co-row dt, .co-row dd { margin: 0; }
.co-row dd { font-variant-numeric: tabular-nums; white-space: nowrap; }
.co-row--discount dt { color: var(--pv-lavender); }
.co-row--discount dd { color: var(--pv-cyan); }
.co-row--save dt, .co-row--save dd { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pv-cyan); }
.co-row--total { padding-top: 12px; border-top: 1px solid var(--v3-line-dark); color: var(--v3-on-dark); font-weight: 600; }
.co-row--total dd { font-size: 20px; line-height: 26px; letter-spacing: -0.01em; }
.co-ship-note { margin-top: 14px; font-size: 12px; line-height: 18px; color: var(--v3-on-dark-soft); }

/* ---- submit ---- */
.co-submit {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 24px;
  border: 1px solid var(--v3-card-line);
  border-radius: var(--v3-radius-panel);
  background: rgba(255, 255, 255, 0.9);
}
.co-submit-btn { width: 100%; }
.co-submit-btn[disabled] { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }
.co-submit-btn[disabled]::after { display: none; }
.co-submit-btn[aria-busy="true"] { opacity: 0.8; cursor: progress; }
.co-submit-hint { font-size: 12px; line-height: 18px; color: var(--v3-on-dark-soft); }
.co-pay-notice { display: none; padding: 10px 12px; border: 1px solid rgba(58, 75, 200, 0.4); border-radius: 10px; background: rgba(58, 75, 200, 0.1); font-size: 13px; line-height: 20px; color: var(--v3-on-dark); }
.co-pay-notice.show { display: block; }
.co-guard-note, .co-wholesale { font-size: 12px; line-height: 18px; color: var(--v3-on-dark-soft); }
.co-wholesale a { color: var(--pv-lavender); }
.co-wholesale a:hover { color: var(--v3-on-dark); }

/* ---- notices: cart revalidated, empty cart ---- */
.co-revalidate { display: none; margin-bottom: 20px; padding: 12px 16px; border: 1px solid rgba(91, 110, 224, 0.35); border-radius: 12px; background: rgba(91, 110, 224, 0.08); font-size: 13px; line-height: 20px; color: var(--v3-on-dark); }
.co-revalidate.show { display: block; }
.co-empty {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px;
  text-align: center;
  border: 1px solid var(--v3-card-line);
  border-radius: var(--v3-radius-panel);
  background: var(--v3-glass-card);
  color: var(--v3-on-dark-muted);
}
.co-empty-title { margin-bottom: 6px; font-size: 18px; line-height: 26px; font-weight: 600; color: var(--v3-on-dark); }
.co-empty-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 22px; }

/* ---- order request received ---- */
.co-confirm {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px;
  border: 1px solid var(--v3-card-line);
  border-radius: var(--v3-radius-panel);
  background: linear-gradient(180deg, rgba(58, 75, 200, 0.1) 0%, rgba(58, 75, 200, 0) 50%), var(--v3-glass-card);
  box-shadow: var(--v3-card-shadow);
}
.co-confirm:focus { outline: none; }
.co-confirm h2 { margin-top: 14px; font-size: var(--t-h2); line-height: var(--t-h2-lh); letter-spacing: -0.02em; color: var(--v3-on-dark); }
.co-confirm h2:focus { outline: none; }
.co-confirm-num { margin-top: 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pv-cyan); }
.co-confirm .co-totals { margin-top: 24px; }
.co-confirm-copy { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; line-height: 23px; color: var(--v3-on-dark-muted); }
.co-confirm-warn {
  margin-top: 24px;
  padding: 16px 18px;
  border: 1px solid rgba(58, 75, 200, 0.55);
  border-left: 3px solid var(--pv-periwinkle);
  border-radius: 14px;
  background: rgba(58, 75, 200, 0.1);
  font-size: 14px;
  line-height: 22px;
  font-weight: 600;
  color: var(--v3-on-dark);
}
.co-confirm-acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* ---- responsive ---- */
@media (max-width: 1023px) {
  .co-wrap { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  /* one column: the summary first, then the form, then submit */
  .co-side { display: contents; }
  .co-summary { order: -1; padding: 18px 20px; }
  .co-submit { order: 1; }
  .co-sum-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin-top: 12px;
    padding: 10px 14px;
    border: 1px solid var(--v3-line-dark-strong);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 600;
    color: var(--v3-on-dark);
  }
  .co-sum-toggle-label { display: inline-flex; align-items: center; gap: 8px; color: var(--pv-lavender); }
  .co-sum-toggle-label::after {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 220ms var(--v3-ease-out);
  }
  .co-summary.is-open .co-sum-toggle-label::after { transform: translateY(1px) rotate(225deg); }
  .co-sum-toggle-total { font-size: 15px; font-variant-numeric: tabular-nums; }
  .co-sum-body { display: none; }
  .co-summary.is-open .co-sum-body { display: block; }
  .co-lines { max-height: none; }
}
@media (max-width: 639px) {
  .co-sec { padding: 24px 0 72px; }
  .co-panel { padding: 20px 18px 22px; border-radius: 16px; }
  .co-legend { margin-bottom: 16px; }
  .co-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .co-pay-methods { grid-template-columns: minmax(0, 1fr); }
  /* 16px keeps phones from zooming into a focused field */
  .co-field input:not([type="checkbox"]), .co-field select, .co-field textarea { font-size: 16px; }
  .co-check { padding: 12px 14px; font-size: 13.5px; }
  .co-notes-meta { flex-direction: column; gap: 4px; }
  .co-submit { padding: 18px; }
  .co-confirm { padding: 26px 20px; }
  .co-confirm h2 { font-size: 24px; line-height: 32px; }
  .co-empty { padding: 28px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .co-field input:not([type="checkbox"]), .co-field select, .co-field textarea, .co-check, .co-check input, .co-check input::before,
  .co-pay-method, .co-pay-method input, .co-pay-method input::before, .co-sum-toggle-label::after { transition: none; }
}
