/* assets/csp-frontend.css
   Scoped, theme-friendly styles for CSP fields + summary
   (No PPOM selectors; keeps native radio markup)
------------------------------------------------------------------ */

/* Scope to product pages */
body.single-product .csp-fields-wrap {
  margin: 12px 0 16px;
}

/* Field block */
body.single-product .csp-field {
  margin: 10px 0 12px;
}
body.single-product .csp-field > label {
  display: block;
  margin: 0 0 6px;
  font-weight: 600;
}

/* Inputs */
body.single-product .csp-field input[type="text"],
body.single-product .csp-field input[type="number"],
body.single-product .csp-field input[type="file"],
body.single-product .csp-field select,
body.single-product .csp-field textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px;
  border: 2px solid #d6d6d6;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}
body.single-product .csp-field textarea { min-height: 140px; }

/* Radios / Checkboxes laid out as a tidy grid (native inputs kept) */
body.single-product .csp-field.csp-type-radio,
body.single-product .csp-field.csp-type-checkbox {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
body.single-product .csp-field.csp-type-radio > label:first-child,
body.single-product .csp-field.csp-type-checkbox > label:first-child {
  grid-column: 1 / -1;
  margin-bottom: 2px;
}
body.single-product label.csp-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 2px solid #d6d6d6;
  border-radius: 8px;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
body.single-product label.csp-opt:hover {
  border-color: #2b6cb0;
  box-shadow: 0 0 0 3px rgba(43,108,176,.12);
}
body.single-product label.csp-opt input[type="radio"],
body.single-product label.csp-opt input[type="checkbox"] {
  margin-left: 2px;
}

/* Dimension fields visibility (shown only when variation is “Custom”) */
body.single-product .variations_form:not(.csp-custom-on) .csp-field.csp-dim,
body.single-product .variations_form:not(.csp-custom-on) .csp-field[data-dn$="_ft"],
body.single-product .variations_form:not(.csp-custom-on) .csp-field[data-dn$="_in"],
body.single-product .variations_form:not(.csp-custom-on) .csp-field[data-dn$="_inches"] {
  display: none;
}

/* Optional small feet readout */
body.single-product .csp-ft-readout {
  display: none;
  margin: 6px 0 10px;
  font-weight: 600;
  font-size: 14px;
  opacity: .9;
}
body.single-product .variations_form.csp-custom-on .csp-ft-readout { display: block; }

/* Summary table */
body.single-product .csp-summary {
  margin: 10px 0 14px;
  border: 1px solid #e2e8f0;
  background: #f9fafb;
  border-radius: 8px;
  overflow: hidden;
}
body.single-product .csp-summary .csp-sum-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #edf2f7;
}
body.single-product .csp-summary .csp-sum-row:last-child { border-bottom: 0; }
body.single-product .csp-summary .csp-sum-label { font-weight: 500; }
body.single-product .csp-summary .csp-sum-amount {
  font-variant-numeric: tabular-nums;
}
body.single-product .csp-summary .csp-sum-total {
  background: #fff;
}
body.single-product .csp-summary .csp-sum-total .csp-sum-label,
body.single-product .csp-summary .csp-sum-total .csp-sum-amount {
  font-weight: 700;
}

/* Minor spacing next to theme elements */
body.single-product .single_variation_wrap { margin-top: 8px; }

/* Responsive tweaks */
@media (max-width: 640px){
  body.single-product .csp-field.csp-type-radio,
  body.single-product .csp-field.csp-type-checkbox {
    grid-template-columns: 1fr;
  }
}
