/* 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;
  text-align: left;
}

/* 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(190px, 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: 8px 5px; /* tighter pill */
  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;
  width: 100%;
}
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 for radio/checkbox grids */
@media (max-width: 640px){
  body.single-product .csp-field.csp-type-radio,
  body.single-product .csp-field.csp-type-checkbox {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------
   Compatibility: Elementor Add-to-Cart flex fix on variable products
   (Prevents quantity + button from being forced into one row)
------------------------------------------------------------------ */
body.single-product
  .elementor-widget-woocommerce-product-add-to-cart form.cart.variations_form .woocommerce-variation-add-to-cart,
body.single-product
  .elementor-widget-wc-add-to-cart form.cart.variations_form .woocommerce-variation-add-to-cart {
  display: block !important; /* stack qty + button */
}

/* Optional: make the Add to Cart button full width beneath qty */
body.single-product .variations_form .woocommerce-variation-add-to-cart .single_add_to_cart_button {
  width: 100%;
}

/* -------------------------------------------------------------
   Column width utilities (flex with internal gutters = no overflow)
   This avoids the 50%+50%+gap overflow issue.
-------------------------------------------------------------- */
body.single-product .csp-fields-wrap {
  --csp-gutter: 10px;            /* adjust if you want wider/narrower gutters */
  display: flex;
  flex-wrap: wrap;
  margin-left: calc(var(--csp-gutter) * -1);
  margin-right: calc(var(--csp-gutter) * -1);
}
body.single-product .csp-fields-wrap .csp-field {
  box-sizing: border-box;
  padding-left: var(--csp-gutter);
  padding-right: var(--csp-gutter);
  flex: 0 0 100%;
  max-width: 100%;
  min-width: 0;
}

/* Column sizes (12-grid) — exact percents, gutters are internal */
body.single-product .csp-fields-wrap .csp-field.col-12 { flex-basis: 100%;      max-width: 100%; }
body.single-product .csp-fields-wrap .csp-field.col-9  { flex-basis: 75%;       max-width: 75%;  }
body.single-product .csp-fields-wrap .csp-field.col-8  { flex-basis: 66.6667%;  max-width: 66.6667%; }
body.single-product .csp-fields-wrap .csp-field.col-6  { flex-basis: 50%;       max-width: 50%;  }
body.single-product .csp-fields-wrap .csp-field.col-4  { flex-basis: 33.3333%;  max-width: 33.3333%; }
body.single-product .csp-fields-wrap .csp-field.col-3  { flex-basis: 25%;       max-width: 25%;  }
body.single-product .csp-fields-wrap .csp-field.col-2  { flex-basis: 16.6667%;  max-width: 16.6667%; }

/* Make non-field blocks (like the summary) span full row in this layout */
body.single-product .csp-fields-wrap > .csp-summary,
body.single-product .csp-fields-wrap > .single_variation_wrap {
  flex: 0 0 100%;
  max-width: 100%;
}

/* Stack on small screens */
@media (max-width: 640px){
  body.single-product .csp-fields-wrap .csp-field[class*="col-"] {
    flex-basis: 100%;
    max-width: 100%;
  }
}


 

/* ---------- CSP Uploader ---------- */
.csp-uploader{border:1px dashed #c3c4c7;background:#fbfbfc;border-radius:10px;padding:12px;position:relative}
.csp-uploader__drop{
  display:flex;align-items:center;justify-content:center;gap:10px;
  background:#fff;border:1px solid #e6e7ea;border-radius:8px;padding:14px;cursor:pointer;user-select:none;outline:none
}
.csp-uploader__drop:hover{background:#f8f9fb}
.csp-uploader.is-dragover .csp-uploader__drop{border-color:#2271b1;background:#eef6ff}
.csp-uploader__icon{width:22px;height:22px;flex:0 0 22px;opacity:.75}
.csp-uploader__text{font-weight:600}
.csp-uploader__hint{margin-top:6px;font-size:12px;color:#6b7280;text-align:center}
.csp-uploader__list{list-style:none;margin:10px 0 0;padding:0;display:grid;gap:8px}
.csp-uploader__item{
  display:grid;grid-template-columns:44px 1fr auto;align-items:center;gap:10px;
  background:#fff;border:1px solid #e6e7ea;border-radius:8px;padding:8px
}
.csp-uploader__thumb{width:44px;height:44px;border-radius:6px;object-fit:cover;background:#f1f1f1;display:block}
.csp-uploader__name{font-weight:600;word-break:break-all}
.csp-uploader__size{font-size:12px;color:#6b7280;margin-top:2px}
.csp-uploader__remove{display:inline-block;color:#a00;text-decoration:none;font-weight:700;padding:2px 8px;border-radius:6px}
.csp-uploader__remove:hover{background:#fbeaea}
.csp-uploader__clear{    margin-top: 5px !important;
    margin-right: 16px !important;}
.csp-native-file{position:absolute !important;left:-9999px !important;width:1px;height:1px;overflow:hidden}




.single-product .quantity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.single-product .quantity .csp-qty-label{
  display: inline-block;
  font-weight: 600;
}
.single-product .quantity .screen-reader-text{
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}


/* Show only the CSP price on single product pages */
.single-product .summary .price,
.single-product .single_variation .price,
.single-product .woocommerce-variation .price,
.single-product .woocommerce-variation-price .price { display:none !important; }

.single-product .summary .csp-managed-price { display:block !important; } /* keep ours */
