.aa-product-calculator {
  margin: 0 0 1.25rem;
  padding: 0;
}

.aa-product-calculator__section {
  margin: 0 0 1rem;
  padding: 0.75rem 0 0;
  border: 0;
  border-top: 1px solid var(--aa-color-border-input, #e2e2e2);
}

.aa-product-calculator__section-legend,
.aa-product-calculator__address-legend {
  padding: 0;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--aa-color-heading, #222);
}

.aa-product-calculator__dimensions .aa-product-calculator__field:last-child {
  margin-bottom: 0;
}

.aa-product-calculator__addons {
  margin-bottom: 1rem;
}

.aa-product-calculator__services
  .aa-product-calculator__addon-block:last-child {
  margin-bottom: 0;
}

.aa-product-calculator__field {
  margin-bottom: 0.75rem;
}

.aa-product-calculator__field label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  color: var(--aa-color-heading, #222);
}

.aa-product-calculator__unit {
  font-weight: 400;
  color: var(--aa-color-meta, #666);
}

.aa-product-calculator__input {
  width: 100%;
  max-width: 12rem;
  box-sizing: border-box;
  min-height: var(--aa-input-min-height, 2.5rem);
  padding: var(--aa-input-padding, 0.5rem 0.75rem);
  font-size: var(--aa-input-font-size, 1rem);
  border: 1px solid var(--aa-color-border-input, #ccc);
  border-radius: var(--aa-radius-sm, 3px);
}

.aa-product-calculator__input--wide {
  max-width: 100%;
}

.aa-product-calculator__addon-block {
  margin-bottom: 0.75rem;
}

.aa-product-calculator__addon {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.aa-product-calculator__addon input[type="checkbox"] {
  margin: 0.2rem 0 0;
  flex-shrink: 0;
}

.aa-product-calculator__addon-label {
  flex: 1 1 12rem;
  line-height: 1.4;
}

.aa-product-calculator__addon-price {
  font-weight: 600;
  color: var(--aa-color-primary, #13aff0);
  white-space: nowrap;
}

.aa-product-calculator__address {
  margin: 0.5rem 0 0.75rem;
  padding: 0.75rem 0 0;
  border: 0;
  border-top: 1px dashed var(--aa-color-border-input, #e2e2e2);
}

.aa-product-calculator__same-as-delivery {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.35rem 0 0.5rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.aa-product-calculator__same-as-delivery[hidden] {
  display: none;
}

.aa-product-calculator__same-as-delivery input {
  margin-top: 0.2rem;
}

.aa-product-calculator__error {
  margin: 0 0 0.75rem;
  color: #c0392b;
  font-size: 0.95rem;
}

.aa-product-calculator__price {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.aa-product-calculator__price-label {
  font-weight: 600;
  margin-right: 0.35rem;
}

.aa-product-calculator__price-value {
  color: var(--aa-color-primary, #13aff0);
  font-weight: 600;
}

form.cart .single_add_to_cart_button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Cart / checkout line summary */
.woocommerce table.cart td.product-name dl.variation:has(.aa-calc-line-details),
.woocommerce-checkout-review-order-table
  dl.variation:has(.aa-calc-line-details) {
  display: block;
  margin: 0.65rem 0 0;
  padding: 0;
}

.woocommerce
  table.cart
  td.product-name
  dl.variation:has(.aa-calc-line-details)
  dt,
.woocommerce-checkout-review-order-table
  dl.variation:has(.aa-calc-line-details)
  dt {
  display: none;
}

.woocommerce
  table.cart
  td.product-name
  dl.variation:has(.aa-calc-line-details)
  dd,
.woocommerce-checkout-review-order-table
  dl.variation:has(.aa-calc-line-details)
  dd {
  display: block;
  float: none;
  margin: 0;
  padding: 0;
}

.woocommerce
  table.cart
  td.product-name
  dl.variation:has(.aa-calc-line-details)
  dd
  p,
.woocommerce-checkout-review-order-table
  dl.variation:has(.aa-calc-line-details)
  dd
  p {
  margin: 0;
}

.aa-calc-line-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #555;
}

.aa-calc-line-details--checkout {
  margin-top: 0;
  padding: 1rem;
  background: #f8f8f8;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  gap: 1rem;
}

.aa-calc-line-details__product {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.45;
  color: #333;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #e8e8e8;
}

.aa-calc-line-details__dims-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
}

.aa-calc-line-details__dims-text {
  color: #333;
}

.woocommerce table.cart .aa-calc-line-details__dims-row .aa-calc-line-details__addon-price {
  display: none;
}

.aa-calc-line-details--checkout
  .aa-calc-line-details__item
  + .aa-calc-line-details__item {
  padding-top: 0.85rem;
  border-top: 1px solid #e8e8e8;
}

.aa-calc-line-details__item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.aa-calc-line-details--checkout .aa-calc-line-details__item:has(.aa-calc-line-details__list) {
  gap: 0.15rem;
}

.aa-calc-line-details__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #888;
}

.aa-calc-line-details__value {
  color: #333;
}

.aa-calc-line-details__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.aa-calc-line-details__list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.3rem 0;
}

.aa-calc-line-details--checkout .aa-calc-line-details__list li {
  padding: 0.2rem 0;
}

.aa-calc-line-details--checkout .aa-calc-line-details__list li:first-child {
  padding-top: 0;
}

.aa-calc-line-details__addon-name {
  flex: 1 1 auto;
  color: #333;
}

.aa-calc-line-details__addon-price {
  flex: 0 0 auto;
  color: #13aff0;
  font-weight: 600;
  white-space: nowrap;
}

.aa-calc-line-details__addon-price .woocommerce-Price-amount {
  font-weight: inherit;
}

/* Checkout: hide duplicate totals, align content flush */
.aa-calc-checkout-summary h3#order_review_heading {
  margin-bottom: 0.75rem;
}

.aa-calc-checkout-summary
  #order_review
  .woocommerce-checkout-review-order-table {
  width: 100%;
  margin: 0 0 2px;
}

.aa-calc-checkout-summary
  .woocommerce
  #order_review
  table.shop_table
  tbody
  td,
.aa-calc-checkout-summary
  .woocommerce
  #order_review
  table.shop_table
  tbody
  th {
  padding: 0;
  background: transparent;
  border: none;
}

.aa-calc-checkout-summary
  #order_review
  .woocommerce-checkout-review-order-table
  tfoot {
  display: none;
}

.aa-calc-checkout-summary #order_review #payment,
.aa-calc-checkout-summary #order_review .woocommerce-checkout-payment {
  margin-top: 0;
  padding-top: 0;
}

.aa-calc-checkout-summary
  #order_review
  .woocommerce-checkout-review-order-table
  thead {
  display: none;
}

.aa-calc-checkout-summary
  #order_review
  .woocommerce-checkout-review-order-table
  thead
  th,
.aa-calc-checkout-summary
  #order_review
  .woocommerce-checkout-review-order-table
  tbody
  td.product-name {
  max-width: none;
  width: 100%;
  padding: 0;
  text-align: left;
}

.aa-calc-checkout-summary
  #order_review
  .woocommerce-checkout-review-order-table
  dl.variation {
  margin: 0;
}

.aa-calc-checkout-summary
  .woocommerce-checkout-review-order-table
  thead
  .product-total,
.aa-calc-checkout-summary
  .woocommerce-checkout-review-order-table
  tbody
  .product-total {
  display: none;
}

.aa-calc-checkout-summary
  .woocommerce-checkout-review-order-table
  tfoot
  tr.cart-subtotal,
.aa-calc-checkout-summary
  .woocommerce-checkout-review-order-table
  tfoot
  tr.order-total {
  display: none;
}

.aa-calc-line-details__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 0.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid #e8e8e8;
  font-weight: 600;
  color: #333;
}

.aa-calc-line-details__total-label {
  font-size: 0.875rem;
}

.aa-calc-line-details__total-value {
  text-align: right;
  white-space: nowrap;
}

.aa-calc-line-details__total-value .includes_tax,
.aa-calc-line-details__total-value .includes-tax {
  font-weight: 400;
  font-size: 0.8125rem;
}

/* Order confirmation / account order view */
.woocommerce-table__line-item .product-name .wc-item-meta,
.woocommerce-order-details .wc-item-meta {
  margin: 0.35em 0 0;
  padding: 0;
  list-style: none;
}

.woocommerce-table__line-item .product-name .wc-item-meta li,
.woocommerce-order-details .wc-item-meta li {
  margin: 0;
  padding: 0;
}

.aa-calc-line-details-wrap {
  list-style: none;
}

@media (max-width: 768px) {
  .aa-product-calculator__input {
    max-width: 100%;
  }

  .aa-product-calculator__addon {
    align-items: flex-start;
  }

  .aa-product-calculator__addon-price {
    width: 100%;
    padding-left: 1.45rem;
  }
}
