/* =================================================================
   BCP Product Widget — Single Product Page
   Scoped under .bcp-pw so it never conflicts with theme or wizard styles.
   Reuses the same design tokens as the configurator.
   ================================================================= */

.bcp-pw {
  font-family: inherit;
  color: #1a1a1a;
  margin-top: 24px;
}

/* ── Section wrappers ─────────────────────────────────────────── */
.bcp-pw-section {
  margin-bottom: 24px;
}

.bcp-pw-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #3d3528;
  margin-bottom: 12px;
}

.bcp-pw-section-sub {
  font-weight: 400;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  color: #888;
  font-size: 11px;
  margin-left: 4px;
}

/* ── Fit selector ─────────────────────────────────────────────── */
.bcp-pw-fit-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.bcp-pw-fit-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px 20px;
  border: 1px solid #d8cfc0;
  background: #fff;
  cursor: pointer;
  min-width: 140px;
  transition: border-color 0.15s, background 0.15s;
}

.bcp-pw-fit-btn:hover {
  border-color: #3d3528;
}

.bcp-pw-fit-btn.is-active {
  background: #3d3528;
  border-color: #3d3528;
  color: #fff;
}

.bcp-pw-fit-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bcp-pw-fit-sub {
  font-size: 11px;
  opacity: 0.7;
}

/* ── Size row ─────────────────────────────────────────────────── */
.bcp-pw-size-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bcp-pw-sizes-slim,
.bcp-pw-sizes-regular {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

/* Size buttons — reuse existing .bcp-size-btn styles from configurator.css */
.bcp-pw .bcp-size-btn {
  background: #fff;
  border: 1px solid #d8cfc0;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.bcp-pw .bcp-size-btn:hover {
  border-color: #3d3528;
}

.bcp-pw .bcp-size-btn.is-active {
  background: #3d3528;
  color: #fff;
  border-color: #3d3528;
}

/* ── Measurement grid — reuse .bcp-measure-* from configurator.css ─ */
/* The configurator.css already defines these globally, so we only
   need overrides specific to the product widget context. */

.bcp-pw .bcp-measure-grid {
  margin-bottom: 12px;
}

.bcp-pw .bcp-measure-input {
  background: #fafaf8;
}

.bcp-pw .bcp-measure-input:focus {
  outline: 1px solid #3d3528;
  background: #fff;
}

/* ── Tolerance section ────────────────────────────────────────── */
.bcp-pw-tolerance-section {
  margin-top: 24px;
  padding: 20px 24px;
  background: #f9f7f4;
  border: 1px solid #e8e0d5;
  border-radius: 4px;
}

.bcp-pw-tolerance-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.bcp-pw-tolerance-sub {
  font-weight: 400;
  color: #888;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.bcp-pw-tolerance-note {
  font-size: 12px;
  color: #777;
  margin-bottom: 16px;
  line-height: 1.5;
}

.bcp-pw-tolerance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.bcp-pw-tolerance-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bcp-pw-tolerance-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #555;
}

.bcp-pw-tolerance-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Tolerance +/- buttons — reuse .bcp-tol-btn from configurator.css */
.bcp-pw .bcp-tol-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 4px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.bcp-pw .bcp-tol-btn:hover {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #fff;
}

.bcp-pw .bcp-tol-input {
  width: 56px;
  height: 32px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  -moz-appearance: textfield;
}

.bcp-pw .bcp-tol-input::-webkit-outer-spin-button,
.bcp-pw .bcp-tol-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.bcp-pw .bcp-tol-unit {
  font-size: 12px;
  color: #888;
  flex-shrink: 0;
}

/* ── Error message ────────────────────────────────────────────── */
.bcp-pw-error {
  margin-top: 14px;
  padding: 10px 14px;
  background: #fff5f5;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  color: #c0392b;
  font-size: 13px;
  line-height: 1.5;
}

/* ── Add to Cart row ──────────────────────────────────────────── */
.bcp-pw-cart-row {
  margin-top: 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.bcp-pw-add-btn {
  background: #1a1a1a;
  color: #fff;
  border: none;
  padding: 14px 32px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

.bcp-pw-add-btn:hover {
  background: #3d3528;
}

.bcp-pw-add-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.bcp-pw-adding {
  font-size: 13px;
  color: #888;
}

.bcp-pw-added {
  font-size: 13px;
  color: #1a6b3a;
  font-weight: 600;
}

.bcp-pw-added a {
  color: #1a6b3a;
  text-decoration: underline;
  margin-left: 8px;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  .bcp-pw .bcp-measure-grid {
    grid-template-columns: 1fr;
  }

  .bcp-pw-tolerance-grid {
    grid-template-columns: 1fr 1fr;
  }

  .bcp-pw-fit-row {
    flex-direction: column;
  }

  .bcp-pw-fit-btn {
    min-width: unset;
    width: 100%;
  }
}
