/* 1. Cart layout and purchase summary */
#agape-inner .agape-cart-content {
  width: min(1240px, calc(100% - 40px));
  margin: clamp(24px, 4vw, 48px) auto;
  color: #0d2342;
}
.agape-cart-content
  :is(.woocommerce-cart-form, .cart_totals, .wc-empty-cart-message) {
  box-sizing: border-box;
  background: #fff;
  color: #0d2342;
  padding: clamp(16px, 2.5vw, 30px);
  border: 1px solid #dce2ec;
  border-radius: 12px;
}
.agape-cart-content .cart_totals h2 {
  color: #0d2342;
  font:
    700 clamp(22px, 3vw, 30px)/1.2 Georgia,
    serif;
}
.agape-cart-content table.shop_table {
  width: 100%;
  margin: 0;
  background: #fff;
  border: 0;
  color: #243852;
}
.agape-cart-content table.shop_table :is(th, td) {
  padding: 14px 10px;
  border-color: #dce2ec;
}
.agape-cart-content table.shop_table thead th {
  background: #f4f7fb;
  color: #0d2342;
}
.agape-cart-content .product-name a {
  color: #0d2342;
  font-weight: 600;
}
.agape-cart-content .product-thumbnail img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 7px;
}
.agape-cart-content .order-total {
  font-weight: 700;
  color: #0d2342;
}

/* 2. Native quantity, coupon and shipping controls */
.agape-cart-content :is(input.qty, input.input-text, select) {
  box-sizing: border-box;
  max-width: 100%;
  min-height: 44px;
  padding-inline: 10px;
  border: 1px solid #becbd8;
  border-radius: 7px;
  background-color: #fff;
  color: #0d2342;
}
#agape-inner .agape-cart-content .button {
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #b7c6d5;
  border-radius: 7px;
  background: #fff;
  color: #0d2342;
  font-family: inherit;
  font-weight: 700;
}
#agape-inner
  .agape-cart-content
  :is(.wc-proceed-to-checkout a.checkout-button, .return-to-shop a.button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: #d9ae36;
  background: var(--ag-btn-gold, linear-gradient(180deg, #f6d878, #dfa92c));
  color: #081c35;
}
#agape-inner .agape-cart-content .checkout-button {
  width: 100%;
}
#agape-inner .agape-cart-content .button:disabled {
  opacity: 0.55;
}
.agape-cart-content :is(a, button, input, select):focus-visible {
  outline: 3px solid #986c0a;
  outline-offset: 3px;
}

/* 3. Empty cart and narrow screens */
.agape-cart-content .wc-empty-cart-message .cart-empty {
  margin: 0;
}
.agape-cart-content .return-to-shop {
  margin-top: 16px;
}
@media (max-width: 767px) {
  #agape-inner .agape-cart-content {
    width: calc(100% - 24px);
  }
  .agape-cart-content .cart-collaterals .cart_totals {
    width: 100%;
    float: none;
  }
  .agape-cart-content table.shop_table td {
    overflow-wrap: anywhere;
  }
}

/* 4. Compact thumbnails, consistent headings and legible shipping choices */
#agape-inner
  .agape-cart-content
  :is(.woocommerce-cart-form h2, .cart_totals h2) {
  margin: 0 0 14px;
  color: #0d2342;
  font:
    700 clamp(20px, 2vw, 27px)/1.2 Georgia,
    serif;
}
#agape-inner .agape-cart-content td.product-thumbnail img {
  width: 64px !important;
  max-width: 64px !important;
  height: 64px !important;
  object-fit: contain;
  box-shadow: none;
}
#agape-inner
  .agape-cart-content
  .cart_totals
  .woocommerce-shipping-totals
  :is(th, td) {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left !important;
}
#agape-inner
  .agape-cart-content
  .cart_totals
  .woocommerce-shipping-totals
  td::before {
  display: none;
}
#agape-inner .agape-cart-content ul#shipping_method li {
  text-align: left;
  margin: 0 0 8px;
  padding: 0;
  line-height: 1.45;
}
#agape-inner .agape-cart-content .cart_totals {
  margin-top: 0;
}

/* 5. A compact item row with the native quantity and remove controls */
@media (max-width: 768px) {
  body.woocommerce-cart #agape-inner .agape-page-banner {
    min-height: 0;
    padding: 16px 0;
  }
  body.woocommerce-cart #agape-inner .agape-page-banner__eyebrow {
    margin-bottom: 4px;
  }
  #agape-inner .agape-cart-content {
    margin: 14px auto 24px;
  }
  #agape-inner .agape-cart-content :is(.woocommerce-cart-form, .cart_totals) {
    padding: 12px;
  }
  #agape-inner .agape-cart-content table.shop_table.cart tbody tr.cart_item {
    display: grid !important;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    grid-template-areas: "photo name remove" "photo price price" "photo qty total";
    align-items: center;
    gap: 4px 9px;
    padding: 10px 0;
    border-bottom: 1px solid #dce2ec;
  }
  #agape-inner .agape-cart-content table.cart tr.cart_item > td {
    display: block;
    min-width: 0;
    width: auto !important;
    padding: 0 !important;
    margin: 0;
    border: 0;
    background: transparent;
    text-align: left !important;
  }
  #agape-inner .agape-cart-content table.cart tr.cart_item > td::before {
    display: none;
  }
  #agape-inner .agape-cart-content table.cart tr.cart_item .product-thumbnail {
    grid-area: photo;
  }
  #agape-inner .agape-cart-content td.product-thumbnail img {
    display: block;
    width: 52px !important;
    max-width: 52px !important;
    height: 60px !important;
  }
  #agape-inner .agape-cart-content .cart_item .product-name {
    grid-area: name;
    font-size: 14px;
    line-height: 1.35;
  }
  #agape-inner .agape-cart-content .cart_item .product-remove {
    grid-area: remove;
    justify-self: end;
  }
  #agape-inner .agape-cart-content .cart_item .product-price {
    grid-area: price;
    font-size: 12px;
  }
  #agape-inner .agape-cart-content .cart_item .product-quantity {
    grid-area: qty;
  }
  #agape-inner .agape-cart-content .cart_item .product-subtotal {
    grid-area: total;
    justify-self: end;
    font-weight: 700;
  }
  #agape-inner
    .agape-cart-content
    table.cart
    tr.cart_item
    .product-subtotal::before {
    display: block;
    content: attr(data-title);
    float: none;
    color: #40516b;
    font-size: 11px;
    font-weight: 400;
  }
  #agape-inner .agape-cart-content .quantity input.qty {
    width: 56px;
    min-height: 40px;
  }
  #agape-inner .agape-cart-content .cart_totals table.shop_table td {
    padding: 8px 4px;
  }
  #agape-inner .agape-cart-content .cart-collaterals {
    clear: both;
    margin-top: 12px;
  }
}

/* 6. Align the cart and totals on one baseline and give shipping room. */
#agape-inner .agape-cart-content .kadence-woo-cart-form-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr);
  align-items: start;
  gap: 20px;
}
/* Kadence clearfix boxes otherwise occupy cells in the cart grid. */
#agape-inner .agape-cart-content .kadence-woo-cart-form-wrap::before,
#agape-inner .agape-cart-content .kadence-woo-cart-form-wrap::after {
  content: none;
  display: none;
}
@media (min-width: 961px) {
  #agape-inner .kadence-woo-cart-form-wrap > .woocommerce-cart-form {
    grid-area: 1 / 1;
  }
  #agape-inner .kadence-woo-cart-form-wrap > .cart-collaterals {
    grid-area: 1 / 2;
  }
}
#agape-inner
  .kadence-woo-cart-form-wrap
  > :is(.woocommerce-cart-form, .cart-collaterals),
#agape-inner .agape-cart-content .cart-collaterals .cart_totals {
  box-sizing: border-box;
  float: none;
  width: 100%;
  min-width: 0;
  margin: 0;
}
#agape-inner .agape-cart-content .cart-collaterals {
  padding: 0;
}
#agape-inner .agape-cart-content :is(.woocommerce-cart-form, .cart_totals) {
  padding: clamp(16px, 2vw, 26px);
  border: 1px solid #dce2ec;
  border-radius: 12px;
  background: white;
  box-shadow: 0 2px 6px rgba(13, 35, 66, 0.05);
}
#agape-inner .agape-cart-content :is(.cart-summary h2, .cart_totals h2) {
  margin: 0 0 16px;
  color: #0d2342;
  font:
    700 clamp(20px, 2vw, 26px)/1.2 Georgia,
    serif;
}
#agape-inner .agape-cart-content .product-name a {
  text-decoration: none;
}
#agape-inner .agape-cart-content .product-name a:hover {
  text-decoration: underline;
}
#agape-inner .agape-cart-content .woocommerce-info {
  padding-block: 10px;
  border-radius: 8px;
  background: #edf3f8;
  color: #243852;
}
#agape-inner .agape-cart-content .cart_totals table.shop_table,
#agape-inner .agape-cart-content .cart_totals table.shop_table tbody {
  display: block;
}
#agape-inner .agape-cart-content .cart_totals tr {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #e1e7ed;
}
#agape-inner .agape-cart-content .cart_totals tr :is(th, td) {
  border: 0;
  padding: 0;
}
#agape-inner .agape-cart-content .cart_totals tr.woocommerce-shipping-totals {
  display: block;
}
#agape-inner .agape-cart-content ul#shipping_method {
  margin: 8px 0;
  padding: 0;
}
#agape-inner
  .agape-cart-content
  ul#shipping_method
  li:has(input[type="radio"]) {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 6px 0;
}
#agape-inner .agape-cart-content ul#shipping_method input[type="radio"] {
  margin: 0;
  accent-color: #0d2342;
}
#agape-inner .agape-cart-content .order-total {
  font-size: 18px;
}
#agape-inner .agape-cart-content .wc-proceed-to-checkout {
  padding: 14px 0 0;
}
#agape-inner .agape-cart-content .wc-proceed-to-checkout .checkout-button {
  margin: 0;
}

/* 7. Keep the item list and checkout readable at narrower widths. */
@media (max-width: 960px) {
  #agape-inner .agape-cart-content .kadence-woo-cart-form-wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
}
@media (max-width: 768px) {
  #agape-inner .agape-cart-content :is(.woocommerce-cart-form, .cart_totals) {
    padding: 14px;
  }
  #agape-inner
    .agape-cart-content
    .cart_totals
    tr:not(.woocommerce-shipping-totals)
    td {
    flex: 1;
    text-align: right;
  }
  #agape-inner
    .agape-cart-content
    .cart_totals
    .woocommerce-shipping-totals
    td {
    padding: 0;
  }
  #agape-inner .agape-cart-content .cart_item .product-thumbnail a {
    display: block;
    width: 52px;
    background: #f6f8fb;
    border-radius: 7px;
  }
  #agape-inner .agape-cart-content table.cart td.actions .coupon {
    display: flex;
    width: 100%;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 8px;
  }
  #agape-inner
    .agape-cart-content
    table.cart
    td.actions
    .coupon
    input.input-text {
    flex: 1;
    width: auto;
    min-width: 0;
    margin: 0;
  }
  #agape-inner .agape-cart-content table.cart td.actions .coupon .button {
    width: auto;
    flex: 0 0 auto;
    margin: 0;
  }
}

/* 8. Use the same baseline for both panels and their headings. */
#agape-inner
  .agape-cart-content
  .kadence-woo-cart-form-wrap
  > .cart-collaterals,
#agape-inner .agape-cart-content .cart-collaterals .cart_totals {
  margin-block: 0 !important;
  align-self: start;
  top: auto;
}
#agape-inner .agape-cart-content .cart-collaterals::before,
#agape-inner .agape-cart-content .cart-collaterals::after {
  content: none;
}
#agape-inner .agape-cart-content .cart-summary,
#agape-inner .agape-cart-content .cart_totals > h2:first-child {
  margin-top: 0;
  padding-top: 0;
}

/* 9. Reserve the display serif for headings; align all monetary values. */
#agape-inner .agape-cart-content {
  font:
    400 14px/1.5 Arial,
    Helvetica,
    sans-serif;
  color: #243852;
}
#agape-inner
  .agape-cart-content
  :is(td, th, label, input, select, .amount, bdi, del, ins) {
  font-family: inherit;
}
#agape-inner .agape-cart-content :is(.amount, bdi, .input-text.qty) {
  font-size: inherit;
  font-variant-numeric: lining-nums tabular-nums;
}
#agape-inner .agape-cart-content table.shop_table :is(td, th) {
  font-size: 14px;
  line-height: 1.45;
  vertical-align: middle;
}
#agape-inner .agape-cart-content .amount {
  white-space: nowrap;
}
#agape-inner .agape-cart-content .product-price del {
  color: #586779;
}
#agape-inner .agape-cart-content .product-price ins {
  text-decoration: none;
  font-weight: 600;
}
#agape-inner .agape-cart-content .order-total :is(td, th) {
  font-size: 16px;
}
#agape-inner .agape-cart-content .input-text.qty {
  text-align: center;
  padding: 0 4px;
}
@media (min-width: 769px) {
  #agape-inner
    .agape-cart-content
    table.cart
    :is(.product-price, .product-subtotal) {
    text-align: right;
  }
  #agape-inner .agape-cart-content table.cart .product-quantity {
    text-align: center;
  }
}

/* 10. Center button labels and keep coupon controls on the same baseline. */
#agape-inner
  .agape-cart-content
  :is(button.button, a.checkout-button, .return-to-shop a.button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  box-sizing: border-box;
  min-height: 44px;
  height: auto;
  padding: 10px 16px !important;
  margin-block: 0;
  border-radius: 7px;
  font:
    600 14px/1.35 Arial,
    Helvetica,
    sans-serif !important;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
}
#agape-inner .agape-cart-content .actions .coupon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
#agape-inner .agape-cart-content .coupon .input-text {
  height: 44px;
  box-sizing: border-box;
  margin: 0;
  font-size: 14px;
}
#agape-inner .agape-cart-content .actions .button:disabled {
  background: #f1f4f7;
  border-color: #d9e1e8;
  color: #5d6b7a;
  opacity: 1;
}
#agape-inner .agape-cart-content .cart_totals .checkout-button {
  color: #081c35;
  font-weight: 700 !important;
}

/* 11. Keep insurance copy readable after the widget refreshes. */
#agape-inner
  .agape-cart-content
  :is(
    .insureship-widget-title,
    .insureship-widget-title-text,
    .insureship-widget > h2,
    .insureship-widget > h2 > span
  ) {
  color: #0d2342 !important;
  -webkit-text-fill-color: #0d2342 !important;
  font:
    600 14px/1.4 Arial,
    Helvetica,
    sans-serif !important;
}
#agape-inner
  .agape-cart-content
  :is(.insureship-widget-desc, .insureship-widget > p) {
  color: #40516b !important;
  -webkit-text-fill-color: #40516b !important;
  font:
    400 13px/1.5 Arial,
    Helvetica,
    sans-serif !important;
}

/* 12. Start each panel with its heading at the same inset. */
#agape-inner .agape-cart-content .cart-collaterals .cart_totals {
  display: flex;
  flex-direction: column;
}
#agape-inner .agape-cart-content .cart_totals > h2 {
  order: -2;
  margin-bottom: 8px !important;
}
#agape-inner .agape-cart-content .woocommerce-cart-form .cart-summary,
#agape-inner .agape-cart-content .cart-summary > h2,
#agape-inner .agape-cart-content .cart_totals > h2 {
  margin-block-start: 0 !important;
  padding-block-start: 0 !important;
}
@media (min-width: 961px) {
  #agape-inner .agape-cart-content .woocommerce-cart-form,
  #agape-inner .agape-cart-content .cart-collaterals .cart_totals {
    padding-block-start: 24px !important;
  }
}

/* 13. Place the totals table immediately below the aligned heading. */
#agape-inner .agape-cart-content .cart_totals > table.shop_table {
  order: -1;
  margin-block: 0;
}
#agape-inner .agape-cart-content .cart_totals > :is(p:empty, br) {
  display: none;
}
#agape-inner .agape-cart-content .cart_totals tr.cart-subtotal {
  padding-top: 6px;
}

/* 14. Match the insurance amount to its label in both widget templates. */
#agape-inner
  .agape-cart-content
  :is(.insureship-widget-title, .insureship-widget > h2) {
  align-items: center;
  column-gap: 5px;
}
#agape-inner
  .agape-cart-content
  :is(.insureship-widget-price-display, .insureship-widget > h2 > span > span) {
  align-self: center;
  margin: 0 !important;
  padding: 0 !important;
  font: inherit !important;
  color: inherit !important;
  -webkit-text-fill-color: currentColor !important;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}

/* 15. A single compact empty state, including the native shop link. */
#agape-inner .agape-cart-content .woocommerce:has(> .wc-empty-cart-message) {
  box-sizing: border-box;
  max-width: 680px;
  margin-inline: auto;
  padding: clamp(20px, 4vw, 32px);
  background: #fff;
  border: 1px solid #dce2ec;
  border-radius: 12px;
  text-align: center;
}
#agape-inner .agape-cart-content .wc-empty-cart-message,
#agape-inner .agape-cart-content .wc-empty-cart-message .cart-empty {
  display: block;
  min-height: 0;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none;
  color: #0d2342;
  font:
    700 clamp(19px, 3vw, 24px)/1.3 Georgia,
    serif;
}
#agape-inner .agape-cart-content .wc-empty-cart-message::before,
#agape-inner .agape-cart-content .cart-empty::before {
  content: none !important;
}
#agape-inner .agape-cart-content .return-to-shop {
  margin: 14px 0 0;
}
#agape-inner .agape-cart-content .woocommerce-notices-wrapper:empty {
  display: none;
}

#agape-cart-removal [hidden] {
  display: none !important;
}

/* 16. Keep the empty panel consistent after a cart fragment refresh. */
#agape-inner
  .agape-cart-content
  .woocommerce:has(.wc-empty-cart-message)
  .cart-empty {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none;
}
#agape-inner
  .agape-cart-content
  .woocommerce:has(.wc-empty-cart-message)
  .cart-empty::before,
#agape-inner .agape-cart-content .woocommerce-notices-wrapper:empty {
  display: none !important;
}

/* 17. Override the store notice colors for loyalty points only. */
#agape-inner
  .agape-cart-content
  :is(.woocommerce-info, .wc-block-components-notice-banner.is-info):has(
    .acfw-notice-text
  ) {
  min-height: 0;
  padding: 10px 14px !important;
  margin: 0 0 14px;
  background: #fff !important;
  border: 1px solid #dce2ec !important;
  border-inline-start: 1px solid #dce2ec !important;
  border-radius: 8px;
  box-shadow: none !important;
  color: #243852 !important;
  font:
    500 14px/1.4 Arial,
    Helvetica,
    sans-serif;
}
#agape-inner
  .agape-cart-content
  :is(.woocommerce-info, .wc-block-components-notice-banner.is-info):has(
    .acfw-notice-text
  )::before {
  content: none !important;
}
#agape-inner
  .agape-cart-content:has(.wc-empty-cart-message)
  :is(.woocommerce-info, .wc-block-components-notice-banner.is-info):has(
    .acfw-notice-text
  ) {
  display: none;
}

/* 16. Compact PayPal express buttons in the cart only. */
#agape-inner .agape-cart-content .wc-proceed-to-checkout {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
#agape-inner .agape-cart-content .wc-proceed-to-checkout > :is(.ppcp-messages, .ppc-button-wrapper) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
}
#agape-inner .agape-cart-content .wc-proceed-to-checkout .ppc-button-wrapper {
  padding-top: 10px !important;
  border-top: 1px solid #e1e7ed;
}
#agape-inner .agape-cart-content .wc-proceed-to-checkout #ppc-button-ppcp-gateway-v6 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
}
#agape-inner .agape-cart-content .wc-proceed-to-checkout #ppc-button-ppcp-gateway-v6 > :is(paypal-button, venmo-button, paypal-pay-later-button) {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 40px !important;
  margin: 0 !important;
  --paypal-button-border-radius: 7px !important;
}
#agape-inner .agape-cart-content .wc-proceed-to-checkout #ppc-button-ppcp-gateway-v6 > paypal-pay-later-button {
  grid-column: 1 / -1;
}
@media (max-width: 420px) {
  #agape-inner .agape-cart-content .wc-proceed-to-checkout #ppc-button-ppcp-gateway-v6 {
    grid-template-columns: minmax(0, 1fr);
  }
}
