.cw-quote-main {
  width: min(1240px, calc(100% - 48px));
  margin: 32px auto 64px;
}
.cw-quote-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #486176;
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
}
.cw-quote-main h1 {
  margin: 14px 0 28px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  letter-spacing: -0.025em;
}
.cw-quote-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}
.cw-quote-card {
  position: relative;
  min-width: 0;
  padding: 28px;
  border: 1px solid #d6e3ec;
  border-radius: 14px;
  background: linear-gradient(135deg, #f9fcfe 0%, #fff 64%, #edf5f9 100%);
  box-shadow: 0 14px 30px rgba(12, 45, 79, 0.07);
}
.cw-quote-card:before {
  content: '';
  position: absolute;
  top: 0;
  left: 28px;
  right: 28px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, #0c2d4f, #257bad);
}
.cw-quote-card h2 {
  margin: 0 0 24px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.38rem;
  font-weight: 700;
  letter-spacing: -0.018em;
}
.cw-quote-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 18px;
}
.cw-quote-field--message,
.cw-quote-field--name,
.cw-quote-field--address {
  grid-column: 1/-1;
}
.cw-quote-field label {
  display: block;
  margin-bottom: 7px;
  color: #486176;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.01em;
}
.cw-quote-field textarea,
.cw-quote-field input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid #c8d8e4;
  border-radius: 8px;
  color: #183c59;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(12, 45, 79, 0.03);
  font: inherit;
  font-size: 1rem;
}
.cw-quote-field textarea:focus,
.cw-quote-field input:focus {
  outline: none;
  border-color: #2875a5;
  box-shadow: 0 0 0 3px rgba(40, 117, 165, 0.13);
}
.cw-quote-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 52px;
  padding: 14px 24px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #0c2d4f, #116fae);
  color: #fff;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(12, 45, 79, 0.16);
}
.cw-quote-form .cw-quote-button {
  width: 100%;
  margin-top: 28px;
}
.cw-quote-button:hover {
  filter: brightness(1.1);
}
.cw-quote-button:focus-visible,
.cw-quote-back:focus-visible {
  outline: 3px solid #6fa5d3;
  outline-offset: 3px;
}
.cw-quote-summary {
  padding: 24px;
}
.cw-quote-summary ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cw-quote-summary li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid #dbe6ed;
  align-items: start;
}
.cw-quote-image {
  position: relative;
}
.cw-quote-image img {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
}
.cw-quote-image > span {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 20px;
  background: #0c2d4f;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 750;
}
.cw-quote-item > span {
  display: block;
  color: #0c2d4f;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.cw-quote-item small {
  display: block;
  margin-top: 8px;
  color: #607589;
  font-size: 0.8rem;
}
.cw-quote-summary-total {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 20px;
  border-top: 1px solid #dbe6ed;
  color: #0c2d4f;
  font-size: 0.95rem;
}
.cw-quote-error {
  padding: 14px 16px;
  border: 1px solid #d39b9b;
  border-radius: 8px;
  background: #fff4f4;
  color: #7b2626;
  font-size: 0.9rem;
}
.cw-quote-success {
  max-width: 700px;
}
.cw-quote-success p {
  margin-bottom: 24px;
}
@media (max-width: 1000px) {
  .cw-quote-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
@media (max-width: 600px) {
  .cw-quote-main {
    width: calc(100% - 28px);
    margin-top: 18px;
    margin-bottom: 36px;
  }
  .cw-quote-main h1 {
    margin: 10px 0 22px;
  }
  .cw-quote-card {
    padding: 22px 18px;
  }
  .cw-quote-card:before {
    left: 18px;
    right: 18px;
  }
  .cw-quote-card h2 {
    font-size: 1.25rem;
    margin-bottom: 22px;
  }
  .cw-quote-fields {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .cw-quote-field {
    grid-column: 1;
  }
  .cw-quote-summary li {
    gap: 14px;
  }
}

/* Fail closed until an eligible shipping service has been selected. */
body.woocommerce-checkout:not(.cw-payment-ready)
  :is(
    .wp-block-woocommerce-checkout-express-payment-block,
    .wc-block-components-express-payment,
    .wc-block-components-express-payment-continue-rule,
    .wp-block-woocommerce-checkout-payment-block,
    .wc-block-checkout__payment-method
  ) {
  display: none !important;
}
body.woocommerce-checkout:not(.cw-payment-ready):not(.cw-delivery-quote-selected)
  .wc-block-components-checkout-place-order-button {
  display: none !important;
}

body.cw-delivery-quote-selected .wc-block-components-checkout-place-order-button {
  display: none !important;
}
#cw-quote-link[hidden] {
  display: none !important;
}
#cw-quote-link {
  width: 100%;
  text-align: center;
  justify-content: center;
}

.wc-block-components-radio-control__option:has(input[value="cw-delivery:choose"]) { display: none !important; }

/* Placeholder services are not payable rates; keep actual delivery totals native. */
body.cw-delivery-choice-pending .wc-block-components-totals-shipping .wc-block-components-totals-item__value,
body.cw-delivery-quote-selected .wc-block-components-totals-shipping .wc-block-components-totals-item__value { font-size: 0; }
body.cw-delivery-choice-pending .wc-block-components-totals-shipping .wc-block-components-totals-item__value::after { content: 'Choose an option'; font-size: 1rem; }
body.cw-delivery-quote-selected .wc-block-components-totals-shipping .wc-block-components-totals-item__value::after { content: 'Price on request'; font-size: 1rem; }

body.cw-delivery-choice-pending .wc-block-components-totals-shipping .wc-block-components-totals-item__value *,
body.cw-delivery-quote-selected .wc-block-components-totals-shipping .wc-block-components-totals-item__value * { font-size: 0 !important; }
.cw-delivery-price-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.cw-quote-field textarea { min-height: 120px; resize: vertical; }

/* Distinguish checkout-owned address values from editable contact fields. */
.cw-quote-field input[readonly] {
  background: #edf0f2;
  border-color: #d3d9de;
  color: #53616d;
  box-shadow: none;
}
.cw-quote-edit-address {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  box-sizing: border-box;
  border: 1px solid #b9cdda;
  border-radius: 8px;
  background: #edf5f9;
  color: #0c2d4f;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}
.cw-quote-edit-address:hover {
  background: #dfeef6;
  color: #0c2d4f;
  text-decoration: none;
}
.cw-quote-edit-address:focus-visible {
  outline: 3px solid #6fa5d3;
  outline-offset: 3px;
}
