/* ================================================================
   Designawall — Product Calculator
   All styles scoped to .dw-calc, .dw-trust-icons, .dw-size-matrix,
   .dw-sticky-cart, and WooCommerce product tab content
   ================================================================ */

/* ── Variables (fallback if tokens not loaded) ────────────────── */
.dw-calc {
  --_red:    var(--dw-red,    #FF3B4D);
  --_char:   var(--dw-charcoal, #171717);
  --_ivory:  var(--dw-ivory,  #F7F2EA);
  --_ivory2: var(--dw-ivory-2, #EFE9DF);
  --_stone:  var(--dw-stone,  #D8CDC1);
  --_mid:    var(--dw-text-mid, #5a5248);
  --_light:  var(--dw-text-light, #8a837a);
  --_border: var(--dw-border, #D8CDC1);
  --_r:      var(--dw-r-md, 8px);
  --_ui:     var(--dw-font-ui, 'Inter', sans-serif);
}

/* ── Wrapper ──────────────────────────────────────────────────── */
.dw-calc {
  font-family: var(--_ui);
  margin-bottom: 1.5rem;
}

/* ── Section ──────────────────────────────────────────────────── */
.dw-calc__section {
  margin-bottom: 1.5rem;
}
.dw-calc__section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--_mid);
  margin: 0 0 0.75rem;
}
.dw-calc__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.dw-calc__section-head .dw-calc__section-label { margin-bottom: 0; }

/* ── Material cards ───────────────────────────────────────────── */
.dw-calc__materials {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.625rem;
}
@media (max-width: 480px) {
  .dw-calc__materials { grid-template-columns: 1fr; }
}

.dw-calc__mat-card {
  border: 1.5px solid var(--_border);
  border-radius: var(--_r);
  padding: 0.875rem 1rem;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  position: relative;
  outline: none;
}
.dw-calc__mat-card:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 59, 77, 0.25);
}
.dw-calc__mat-card:hover {
  border-color: var(--_stone);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.dw-calc__mat-card.is-selected {
  border-color: var(--_red);
  background: #fff8f8;
  box-shadow: 0 2px 12px rgba(255,59,77,0.1);
}
.dw-calc__mat-card.is-selected::before {
  content: '';
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--_red);
}

.dw-calc__mat-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--_char);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}
.dw-calc__mat-rate {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--_red);
  margin-bottom: 0.5rem;
}
.dw-calc__mat-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
}
.dw-calc__mat-bullets li {
  font-size: 0.7rem;
  color: var(--_mid);
  padding-left: 1em;
  position: relative;
  line-height: 1.6;
}
.dw-calc__mat-bullets li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--_red);
  font-size: 0.65rem;
  top: 0.05em;
}

/* ── Unit toggle ──────────────────────────────────────────────── */
.dw-calc__unit-toggle {
  display: flex;
  gap: 0;
  border: 1.5px solid var(--_border);
  border-radius: 6px;
  overflow: hidden;
}
.dw-calc__unit-opt {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--_light);
  background: #fff;
  transition: background 0.12s, color 0.12s;
  user-select: none;
}
.dw-calc__unit-opt input { display: none; }
.dw-calc__unit-opt.is-active {
  background: var(--_char);
  color: #fff;
}
.dw-calc__unit-opt:first-child {
  border-right: 1.5px solid var(--_border);
}

/* ── Dimension inputs ─────────────────────────────────────────── */
.dw-calc__dims {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  align-items: end;
}
.dw-calc__x {
  font-size: 1.25rem;
  color: var(--_light);
  padding-bottom: 0.5rem;
  text-align: center;
}
.dw-calc__field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--_mid);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.dw-unit-sfx {
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: 0;
  color: var(--_light);
}
.dw-calc__input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1.5px solid var(--_border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: var(--_ui);
  background: #fff;
  color: var(--_char);
  transition: border-color 0.15s, box-shadow 0.15s;
  -moz-appearance: textfield;
  appearance: textfield;
}
.dw-calc__input::-webkit-inner-spin-button,
.dw-calc__input::-webkit-outer-spin-button { -webkit-appearance: none; }
.dw-calc__input:focus {
  outline: none;
  border-color: var(--_red);
  box-shadow: 0 0 0 3px rgba(255,59,77,0.15);
}

/* ── Estimate box ─────────────────────────────────────────────── */
.dw-calc__estimate {
  background: var(--_ivory);
  border: 1.5px solid var(--_border);
  border-radius: var(--_r);
  padding: 1rem 1.25rem 0.875rem;
  margin-bottom: 1.25rem;
}
.dw-calc__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}
@media (max-width: 600px) {
  .dw-calc__stats { grid-template-columns: repeat(2, 1fr); }
}
.dw-calc__stat-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--_light);
  margin-bottom: 0.2rem;
}
.dw-calc__stat-val {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--_char);
}
.dw-calc__price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--_border);
}
.dw-calc__price-formula {
  font-size: 0.75rem;
  color: var(--_mid);
  flex: 1;
}
.dw-calc__price-total {
  font-size: 2rem;
  font-weight: 800;
  color: var(--_red);
  white-space: nowrap;
  font-family: var(--dw-font-heading, 'Sora', sans-serif);
}
.dw-calc__min-note {
  font-size: 0.7rem;
  color: var(--_mid);
  background: rgba(255,59,77,0.07);
  border-left: 3px solid var(--_red);
  padding: 0.3rem 0.6rem;
  border-radius: 0 4px 4px 0;
  margin: 0.5rem 0 0;
}
.dw-calc__min-note[hidden] { display: none; }
.dw-calc__panel-note {
  font-size: 0.7rem;
  color: var(--_light);
  margin: 0.4rem 0 0;
  min-height: 1em;
}

/* ── Add-ons ──────────────────────────────────────────────────── */
.dw-calc__addons {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 1.25rem;
}
.dw-calc__addon {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #fff;
  border: 1.5px solid var(--_border);
  border-radius: var(--_r);
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.dw-calc__addon:hover { border-color: var(--_stone); }
.dw-calc__addon input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.125rem;
  accent-color: var(--_red);
  flex-shrink: 0;
  cursor: pointer;
}
.dw-calc__addon-body { display: flex; flex-direction: column; gap: 0.15rem; }
.dw-calc__addon-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--_char);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dw-calc__addon-price {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--_red);
  background: rgba(255,59,77,0.08);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.dw-calc__addon-desc {
  font-size: 0.75rem;
  color: var(--_light);
}

/* ── Sample CTA row ───────────────────────────────────────────── */
.dw-calc__sample-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.dw-calc__sample-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.25rem;
  border: 1.5px solid var(--_char);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--_char);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.dw-calc__sample-btn:hover {
  background: var(--_char);
  color: #fff;
}
.dw-calc__sample-note {
  font-size: 0.75rem;
  color: var(--_light);
}

/* ── WooCommerce add-to-cart button override (on calc products) ── */
.dw-calc ~ .single_add_to_cart_button,
.dw-calc + .single_add_to_cart_button {
  width: 100%;
  margin-top: 0;
}

/* ── Trade CTA ────────────────────────────────────────────────── */
.dw-calc__trade-row {
  margin-top: 0.875rem;
}
.dw-calc__trade-link {
  font-size: 0.78rem;
  color: var(--_mid);
  text-decoration: none;
  display: block;
  padding: 0.5rem 0;
  border-top: 1px solid var(--_border);
}
.dw-calc__trade-link:hover { color: var(--_char); }
.dw-calc__trade-link strong { color: var(--_red); }

/* ================================================================
   Trust Icons
   ================================================================ */

.dw-trust-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--dw-border, #D8CDC1);
  border-bottom: 1px solid var(--dw-border, #D8CDC1);
  margin: 1rem 0 2rem;
}
.dw-trust-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--dw-text-mid, #5a5248);
  white-space: nowrap;
}
.dw-trust-icon svg {
  color: var(--dw-text-mid, #5a5248);
  flex-shrink: 0;
}

/* ================================================================
   Standard Size Matrix
   ================================================================ */

.dw-size-matrix {
  padding: 2.5rem 0;
  border-top: 1px solid var(--dw-border, #D8CDC1);
}
.dw-size-matrix__title {
  font-family: var(--dw-font-heading, 'Sora', sans-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dw-charcoal, #171717);
  margin: 0 0 0.5rem;
}
.dw-size-matrix__intro {
  font-size: 0.85rem;
  color: var(--dw-text-mid, #5a5248);
  margin: 0 0 1.25rem;
}
.dw-size-matrix__wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.dw-size-matrix__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
  font-family: var(--dw-font-ui, 'Inter', sans-serif);
  min-width: 560px;
}
.dw-size-matrix__table th {
  text-align: left;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dw-text-light, #8a837a);
  padding: 0.5rem 0.75rem;
  border-bottom: 1.5px solid var(--dw-border, #D8CDC1);
  white-space: nowrap;
}
.dw-size-matrix__table td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--dw-border-light, #ede8e1);
  color: var(--dw-charcoal, #171717);
}
.dw-size-matrix__table td:first-child { white-space: nowrap; }
.dw-size-matrix__table tbody tr:hover td { background: var(--dw-ivory, #F7F2EA); }
.dw-size-matrix__table td:nth-child(4),
.dw-size-matrix__table td:nth-child(5),
.dw-size-matrix__table td:nth-child(6) {
  font-weight: 700;
  color: var(--dw-charcoal, #171717);
}
.dw-size-matrix__note {
  font-size: 0.7rem;
  color: var(--dw-text-light, #8a837a);
  margin: 0.875rem 0 0;
}

/* ================================================================
   Sticky Mobile Cart
   ================================================================ */

.dw-sticky-cart {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--dw-charcoal, #171717);
  color: #fff;
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.2);
}
.dw-sticky-cart.is-visible {
  transform: translateY(0);
}
@media (min-width: 961px) {
  .dw-sticky-cart { display: none; }
}
.dw-sticky-cart__info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.dw-sticky-cart__name {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dw-sticky-cart__price {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--dw-font-heading, 'Sora', sans-serif);
}
.dw-sticky-cart__btn {
  background: var(--dw-red, #FF3B4D);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.7rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--dw-font-ui, 'Inter', sans-serif);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.dw-sticky-cart__btn:hover { background: var(--dw-red-dark, #e02030); }

/* ================================================================
   Product Tabs — custom content styles
   ================================================================ */

.dw-tab h3 {
  font-family: var(--dw-font-heading, 'Sora', sans-serif);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
  color: var(--dw-charcoal, #171717);
}
.dw-tab h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.75rem;
  color: var(--dw-charcoal, #171717);
}
.dw-tab__note {
  font-size: 0.82rem;
  color: var(--dw-text-mid, #5a5248);
  padding-top: 1rem;
  border-top: 1px solid var(--dw-border, #D8CDC1);
  margin-top: 1.5rem;
}

/* Materials compare grid */
.dw-mat-compare {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 600px) {
  .dw-mat-compare { grid-template-columns: 1fr; }
}
.dw-mat-compare__card {
  background: var(--dw-ivory, #F7F2EA);
  border-radius: 8px;
  padding: 1.25rem;
}
.dw-mat-compare__card h4 { font-size: 0.85rem; margin-bottom: 0.35rem; }
.dw-mat-compare__rate {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--dw-red, #FF3B4D);
  margin-bottom: 0.875rem;
  font-family: var(--dw-font-heading, 'Sora', sans-serif);
}
.dw-mat-compare__card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.8rem;
  color: var(--dw-text-mid, #5a5248);
}
.dw-mat-compare__card li {
  padding: 0.2rem 0 0.2rem 1.2em;
  position: relative;
}
.dw-mat-compare__card li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--dw-olive, #8C9A7A);
  font-size: 0.7rem;
}

/* Tab lead text */
.dw-tab__lead {
  font-size: 0.85rem;
  color: var(--dw-text-mid, #5a5248);
  margin: 0 0 1.5rem;
  line-height: 1.6;
}

/* ── Installation cards ───────────────────────────────────────── */
.dw-install-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 860px) {
  .dw-install-cards { grid-template-columns: 1fr; gap: 0.75rem; }
}

.dw-install-card {
  background: var(--dw-ivory, #F7F2EA);
  border-radius: var(--dw-r-md, 8px);
  padding: 1.25rem 1.5rem 1.5rem;
}

.dw-install-card__label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dw-clay, #B47A62);
  padding-bottom: 0.875rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--dw-border, #D8CDC1);
}

.dw-install-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: install-step;
}
.dw-install-steps li {
  counter-increment: install-step;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.81rem;
  color: var(--dw-text-mid, #5a5248);
  line-height: 1.55;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--dw-border-light, #ede8e1);
}
.dw-install-steps li:last-child { border-bottom: none; padding-bottom: 0; }
.dw-install-steps li::before {
  content: counter(install-step);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  background: var(--dw-charcoal, #171717);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* Tab columns */
.dw-tab__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.dw-tab__cols--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) {
  .dw-tab__cols,
  .dw-tab__cols--2 { grid-template-columns: 1fr; }
}
.dw-tab__cols ol,
.dw-tab__cols ul {
  padding-left: 1.25rem;
  font-size: 0.82rem;
  color: var(--dw-text-mid, #5a5248);
  line-height: 1.7;
}
.dw-tab__cols li { margin-bottom: 0.25rem; }

/* FAQ accordion */
.dw-faqs { display: flex; flex-direction: column; gap: 0; }
.dw-faq {
  border-bottom: 1px solid var(--dw-border, #D8CDC1);
}
.dw-faq__q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1rem 0;
  font-family: var(--dw-font-ui, 'Inter', sans-serif);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--dw-charcoal, #171717);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.dw-faq__q:hover { color: var(--dw-red, #FF3B4D); }
.dw-faq__icon {
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
  color: var(--dw-text-light, #8a837a);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.dw-faq__q[aria-expanded="true"] .dw-faq__icon { transform: rotate(45deg); }
.dw-faq__a {
  font-size: 0.82rem;
  color: var(--dw-text-mid, #5a5248);
  padding: 0 0 1rem;
  line-height: 1.7;
}
.dw-faq__a p { margin: 0; }
.dw-faq__a[hidden] { display: none; }

/* ----------------------------------------------------------------
   URGENCY NOTICE
   ---------------------------------------------------------------- */
.dw-calc__urgency {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  background: var(--dw-ivory, #f5f0e8);
  border: 1px solid var(--dw-border-light, #e8e2d9);
  border-radius: var(--dw-r-sm, 6px);
  font-size: 0.8rem;
  color: var(--dw-text-mid, #5a5248);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}
.dw-calc__urgency strong { color: var(--dw-charcoal, #171717); }
.dw-calc__urgency svg { flex-shrink: 0; color: var(--dw-clay, #c07a5a); }

/* ----------------------------------------------------------------
   MATERIAL UPGRADE NUDGE
   ---------------------------------------------------------------- */
.dw-calc__upgrade-nudge {
  padding: 0.625rem 0.875rem;
  background: #fdf8f3;
  border-left: 3px solid var(--dw-clay, #c07a5a);
  border-radius: 0 var(--dw-r-sm, 6px) var(--dw-r-sm, 6px) 0;
  font-size: 0.78rem;
  color: var(--dw-text-mid, #5a5248);
  margin-top: 0.75rem;
  line-height: 1.55;
}
.dw-calc__upgrade-nudge strong { color: var(--dw-charcoal, #171717); }
.dw-calc__upgrade-nudge[hidden] { display: none; }
