:root {
  --edcart-green: #0c8f2e;
  --edcart-green-dark: #087525;
  --edcart-orange: #ff6b14;
  --edcart-ink: #111827;
  --edcart-muted: #64748b;
  --edcart-line: #e5e7eb;
  --edcart-soft: #f6f8fb;
  --edcart-white: #fff;
}

body.ed-smart-cart-active,
body.ed-smart-cart-active button,
body.ed-smart-cart-active input {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body.ed-smart-cart-active .hero-section,
body.ed-smart-cart-active .ct-page-title,
body.ed-smart-cart-active .entry-header {
  display: none !important;
}

body.ed-smart-cart-active #main,
body.ed-smart-cart-active .site-main,
body.ed-smart-cart-active .site-main > article {
  min-height: 0 !important;
  flex-grow: 0 !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
}

body.ed-smart-cart-active .ct-container-full {
  width: 100% !important;
  min-height: 0 !important;
  max-width: none !important;
  padding-top: 14px !important;
  padding-right: 0 !important;
  padding-bottom: 0 !important;
  padding-left: 0 !important;
}

body.ed-smart-cart-active .entry-content {
  width: 100% !important;
  min-height: 0 !important;
  max-width: none !important;
}

body.ed-smart-cart-active .entry-content > .woocommerce {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.8fr);
  align-items: start;
  gap: 18px 22px;
  width: min(1280px, calc(100% - 32px)) !important;
  max-width: 1280px !important;
  margin: 0 auto;
  padding: 22px 20px 24px;
}

body.ed-smart-cart-active .ed-store-footer {
  margin-top: 0 !important;
}

body.ed-smart-cart-active .woocommerce-notices-wrapper,
.edcart-heading,
.edcart-service-card,
.edcart-recommendations {
  grid-column: 1 / -1;
}

.edcart-heading,
.edcart-heading * {
  box-sizing: border-box;
}

.edcart-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--edcart-line);
  border-radius: 14px;
  background: var(--edcart-white);
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.04);
}

.edcart-heading > a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  color: var(--edcart-ink);
  background: var(--edcart-soft);
  text-decoration: none !important;
  font-size: 21px;
}

.edcart-heading small,
.edcart-recommendations header small {
  display: block;
  margin-bottom: 2px;
  color: var(--edcart-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.45px;
}

.edcart-heading h1,
.edcart-recommendations h2 {
  margin: 0 !important;
  color: var(--edcart-ink);
  font-size: 23px !important;
  font-weight: 820 !important;
  line-height: 1.15 !important;
  letter-spacing: -0.35px;
}

.edcart-heading > span {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--edcart-green-dark);
  background: #effbef;
  font-size: 10px;
  font-weight: 800;
}

.edcart-service-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr);
  align-items: center;
  gap: 22px;
  padding: 14px 17px;
  border: 1px solid #dce8de;
  border-radius: 14px;
  background: linear-gradient(90deg, #f3fbf4, #fff);
}

.edcart-service-copy {
  display: flex;
  align-items: center;
  gap: 11px;
}

.edcart-clock {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--edcart-green);
  background: var(--edcart-white);
  font-size: 22px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.07);
}

.edcart-service-copy p,
.edcart-shipping-progress p {
  margin: 0;
}

.edcart-service-copy strong {
  display: block;
  color: var(--edcart-ink);
  font-size: 14px;
}

.edcart-service-copy small {
  display: block;
  margin-top: 3px;
  color: var(--edcart-muted);
  font-size: 11px;
  line-height: 1.45;
}

.edcart-shipping-progress p {
  color: #334155;
  font-size: 11px;
  font-weight: 650;
}

.edcart-shipping-progress > div {
  overflow: hidden;
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: #dbe8dd;
}

.edcart-shipping-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--edcart-green);
}

body.ed-smart-cart-active .woocommerce-cart-form {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

/* Blocksy wraps the form and totals together. Make that wrapper the full
   cart grid so neither column gets squeezed inside the first parent track. */
body.ed-smart-cart-active .ct-woocommerce-cart-form {
  display: grid !important;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.8fr) !important;
  align-items: start;
  gap: 22px !important;
  width: 100% !important;
  max-width: none !important;
}

body.ed-smart-cart-active table.shop_table.cart {
  width: 100% !important;
  max-width: none !important;
  overflow: hidden;
  margin: 0 !important;
  border: 1px solid var(--edcart-line) !important;
  border-radius: 15px;
  background: var(--edcart-white);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

body.ed-smart-cart-active table.shop_table.cart thead {
  background: var(--edcart-soft);
}

body.ed-smart-cart-active table.shop_table.cart th {
  padding: 12px 10px !important;
  color: var(--edcart-muted);
  font-size: 10px !important;
  font-weight: 750 !important;
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

body.ed-smart-cart-active table.shop_table.cart td {
  padding: 13px 10px !important;
  border-color: #edf0f3 !important;
  color: var(--edcart-ink);
  vertical-align: middle !important;
}

body.ed-smart-cart-active .product-thumbnail img {
  width: 78px !important;
  height: 78px !important;
  padding: 4px;
  border-radius: 11px;
  background: var(--edcart-soft);
  object-fit: contain;
}

body.ed-smart-cart-active .product-name a {
  color: var(--edcart-ink) !important;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}

body.ed-smart-cart-active .product-price,
body.ed-smart-cart-active .product-subtotal {
  color: var(--edcart-ink);
  font-size: 13px;
  font-weight: 800;
}

body.ed-smart-cart-active .woocommerce-cart-form .quantity {
  position: relative !important;
  display: inline-flex !important;
  align-items: center;
  width: 112px !important;
  height: 40px !important;
  min-width: 112px;
  border: 1.5px solid #b8d7c0;
  border-radius: 10px;
  background: #f7fff8;
}

body.ed-smart-cart-active .woocommerce-cart-form .quantity .qty {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 36px !important;
  border: 0 !important;
  border-radius: 9px !important;
  outline: 0 !important;
  color: var(--edcart-green-dark) !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: center !important;
  text-indent: 0 !important;
  -webkit-text-fill-color: var(--edcart-green-dark) !important;
  font-size: 14px !important;
  font-weight: 850 !important;
  line-height: 38px !important;
  opacity: 1 !important;
  appearance: textfield;
  -moz-appearance: textfield;
}

body.ed-smart-cart-active .woocommerce-cart-form .quantity .qty::-webkit-outer-spin-button,
body.ed-smart-cart-active .woocommerce-cart-form .quantity .qty::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

body.ed-smart-cart-active .woocommerce-cart-form .quantity .ct-decrease,
body.ed-smart-cart-active .woocommerce-cart-form .quantity .ct-increase {
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  z-index: 3 !important;
  display: grid !important;
  place-items: center;
  width: 36px !important;
  height: 38px !important;
  padding: 0 !important;
  color: var(--edcart-green-dark) !important;
  background: transparent !important;
  cursor: pointer;
  font-family: inherit !important;
  font-size: 19px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}

body.ed-smart-cart-active .woocommerce-cart-form .quantity .ct-decrease {
  right: auto !important;
  left: 0 !important;
  border-right: 1px solid #d9eadc;
}

body.ed-smart-cart-active .woocommerce-cart-form .quantity .ct-increase {
  right: 0 !important;
  left: auto !important;
  border-left: 1px solid #d9eadc;
}

body.ed-smart-cart-active .woocommerce-cart-form .quantity .ct-decrease::before {
  content: "−" !important;
  font-family: inherit !important;
}

body.ed-smart-cart-active .woocommerce-cart-form .quantity .ct-increase::before {
  content: "+" !important;
  font-family: inherit !important;
}

body.ed-smart-cart-active .product-remove a {
  display: grid !important;
  place-items: center;
  width: 30px !important;
  height: 30px !important;
  border-radius: 50%;
  color: #b42318 !important;
  background: #fff1f0;
  text-decoration: none !important;
}

body.ed-smart-cart-active td.actions {
  padding: 12px !important;
  background: #fbfcfd;
}

body.ed-smart-cart-active td.actions .coupon {
  display: inline-flex;
  align-items: stretch;
}

body.ed-smart-cart-active td.actions .coupon input.input-text {
  min-height: 42px;
  padding: 9px 13px !important;
  border: 1px solid #d7dee7 !important;
  border-radius: 9px 0 0 9px !important;
  color: var(--edcart-ink) !important;
  background: var(--edcart-white) !important;
  font-size: 13px;
}

body.ed-smart-cart-active td.actions .coupon button[name="apply_coupon"] {
  min-height: 42px;
  padding: 9px 17px !important;
  border: 1px solid var(--edcart-orange) !important;
  border-radius: 0 9px 9px 0 !important;
  color: var(--edcart-white) !important;
  background: var(--edcart-orange) !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

body.ed-smart-cart-active td.actions .coupon button[name="apply_coupon"]:hover {
  border-color: #ea580c !important;
  background: #ea580c !important;
}

body.ed-smart-cart-active button[name="update_cart"] {
  border-radius: 9px !important;
  background: #e9eef4 !important;
  color: #334155 !important;
  font-size: 11px !important;
}

body.ed-smart-cart-active .cart-collaterals,
body.ed-smart-cart-active .ct-woocommerce-cart-form > .cart_totals {
  grid-column: 2;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

body.ed-smart-cart-active .cart_totals {
  position: sticky;
  top: 18px;
  float: none !important;
  width: 100% !important;
  padding: 17px;
  border: 1px solid var(--edcart-line);
  border-radius: 15px;
  background: var(--edcart-white);
  box-shadow: 0 5px 22px rgba(15, 23, 42, 0.06);
}

body.ed-smart-cart-active .cart_totals h2 {
  margin: 0 0 12px !important;
  color: var(--edcart-ink);
  font-size: 18px !important;
  font-weight: 820 !important;
}

body.ed-smart-cart-active .cart_totals table {
  margin-bottom: 13px !important;
}

body.ed-smart-cart-active .cart_totals th,
body.ed-smart-cart-active .cart_totals td {
  padding: 10px 0 !important;
  border-color: #edf0f3 !important;
  font-size: 12px;
}

/* Consolidate WooCommerce tax rows into the single branded VAT row above. */
body.ed-smart-cart-active .cart_totals tr[class*="tax-rate"],
body.ed-smart-cart-active .cart_totals tr.tax-total {
  display: none !important;
}

body.ed-smart-cart-active .cart_totals .edcart-vat-row {
  display: table-row !important;
}

body.ed-smart-cart-active .cart_totals .edcart-vat-row th,
body.ed-smart-cart-active .cart_totals .edcart-vat-row td {
  color: var(--edcart-green-dark);
  font-weight: 800;
}

body.ed-smart-cart-active .cart_totals .order-total .includes_tax {
  display: none !important;
}

body.ed-smart-cart-active .wc-proceed-to-checkout {
  padding: 8px 0 0 !important;
}

body.ed-smart-cart-active .checkout-button {
  width: 100%;
  min-height: 48px;
  margin: 0 !important;
  border-radius: 11px !important;
  color: var(--edcart-white) !important;
  background: var(--edcart-green) !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  box-shadow: 0 8px 20px rgba(12, 143, 46, 0.2);
}

body.ed-smart-cart-active .checkout-button:hover {
  background: var(--edcart-green-dark) !important;
}

.edcart-recommendations {
  min-width: 0;
  margin-top: 8px;
  padding: 18px;
  border: 1px solid var(--edcart-line);
  border-radius: 16px;
  background: var(--edcart-white);
}

.edcart-recommendations header {
  margin-bottom: 14px;
}

.edcart-recommendations h2 {
  font-size: 21px !important;
}

.edcart-recommendation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.edcart-rec-card,
.edcart-rec-card * {
  box-sizing: border-box;
}

.edcart-rec-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 9px;
  border: 1px solid #e8ecf1;
  border-radius: 13px;
  background: var(--edcart-white);
}

.edcart-rec-image {
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  margin-bottom: 8px;
  border-radius: 10px;
  background: var(--edcart-soft);
}

.edcart-rec-image img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  padding: 4px;
  object-fit: contain;
}

.edcart-rec-card h3 {
  display: -webkit-box;
  overflow: hidden;
  min-height: 35px;
  margin: 0 0 9px !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  line-height: 1.4 !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.edcart-rec-card h3 a {
  color: var(--edcart-ink) !important;
  text-decoration: none !important;
}

.edcart-rec-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.edcart-rec-bottom > span {
  color: var(--edcart-ink);
  font-size: 13px;
  font-weight: 850;
}

.edcart-rec-bottom del {
  display: none;
}

.edcart-rec-add {
  display: grid;
  place-items: center;
  min-width: 68px;
  min-height: 35px;
  padding: 6px 10px;
  border: 1.5px solid var(--edcart-green);
  border-radius: 9px;
  color: var(--edcart-green) !important;
  background: var(--edcart-white);
  text-decoration: none !important;
  font-size: 10px;
  font-weight: 850;
}

.edcart-rec-add:hover,
.edcart-rec-add.added {
  color: var(--edcart-white) !important;
  background: var(--edcart-green);
}

@media (max-width: 900px) {
  body.ed-smart-cart-active .entry-content > .woocommerce {
    grid-template-columns: 1fr;
  }

  body.ed-smart-cart-active .woocommerce-cart-form,
  body.ed-smart-cart-active .cart-collaterals,
  body.ed-smart-cart-active .ct-woocommerce-cart-form > .cart_totals {
    grid-column: 1;
  }

  body.ed-smart-cart-active .ct-woocommerce-cart-form {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  body.ed-smart-cart-active .cart_totals {
    position: static;
  }

  .edcart-recommendation-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  body.ed-smart-cart-active .ct-container-full {
    padding-top: 4px !important;
    padding-bottom: 0 !important;
  }

  body.ed-smart-cart-active .entry-content {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.ed-smart-cart-active .entry-content > .woocommerce {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    gap: 11px;
    padding: 8px 8px 0;
  }

  .edcart-heading {
    gap: 8px;
    padding: 8px;
    border-radius: 11px;
  }

  .edcart-heading > a {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  .edcart-heading h1 {
    font-size: 17px !important;
  }

  .edcart-heading small {
    display: none;
  }

  .edcart-heading > span {
    font-size: 9px;
  }

  .edcart-service-card {
    grid-template-columns: 1fr;
    gap: 11px;
    padding: 11px;
    border-radius: 12px;
  }

  .edcart-service-copy strong {
    font-size: 13px;
  }

  body.ed-smart-cart-active table.shop_table.cart,
  body.ed-smart-cart-active table.shop_table.cart tbody,
  body.ed-smart-cart-active table.shop_table.cart tr,
  body.ed-smart-cart-active table.shop_table.cart td {
    display: block;
    width: 100%;
  }

  body.ed-smart-cart-active table.shop_table.cart thead {
    display: none;
  }

  body.ed-smart-cart-active table.shop_table.cart tr.cart_item {
    position: relative;
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    grid-template-areas:
      "image name"
      "image subtotal";
    gap: 7px 11px;
    padding: 13px 10px;
    border-bottom: 1px solid var(--edcart-line);
  }

  body.ed-smart-cart-active tr.cart_item > td {
    padding: 0 !important;
    border: 0 !important;
  }

  body.ed-smart-cart-active tr.cart_item > .product-thumbnail {
    grid-area: image;
  }

  body.ed-smart-cart-active tr.cart_item > .product-name {
    display: grid;
    grid-area: name;
    gap: 10px;
    min-width: 0;
  }

  body.ed-smart-cart-active tr.cart_item > .product-name > a {
    display: -webkit-box;
    overflow: hidden;
    padding-right: 0;
    font-size: 13px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body.ed-smart-cart-active tr.cart_item > .product-name > .price {
    display: none !important;
  }

  /* Blocksy already supplies one compact mobile quantity/price/remove row.
     Keep it, and hide the duplicated desktop cells below. */
  body.ed-smart-cart-active .product-name .product-mobile-actions {
    display: flex !important;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
  }

  body.ed-smart-cart-active .product-name .product-mobile-actions .quantity {
    flex: 0 0 auto;
  }

  body.ed-smart-cart-active .product-name .product-mobile-actions .remove {
    display: grid !important;
    place-items: center;
    flex: 0 0 30px;
    width: 30px !important;
    height: 30px !important;
    margin-left: auto;
    border-radius: 50%;
    color: #b42318 !important;
    background: #fff1f0;
  }

  body.ed-smart-cart-active tr.cart_item > .product-quantity,
  body.ed-smart-cart-active tr.cart_item > .product-remove {
    display: none !important;
  }

  body.ed-smart-cart-active tr.cart_item > .product-subtotal {
    display: flex !important;
    grid-area: subtotal;
    align-items: center;
    justify-content: flex-end;
    min-height: 24px;
    text-align: right;
  }

  body.ed-smart-cart-active tr.cart_item > .product-subtotal::before,
  body.ed-smart-cart-active tr.cart_item > .product-name::before,
  body.ed-smart-cart-active tr.cart_item > .product-thumbnail::before {
    display: none !important;
    content: none !important;
  }

  body.ed-smart-cart-active .product-thumbnail img {
    width: 74px !important;
    height: 74px !important;
  }

  body.ed-smart-cart-active .woocommerce-cart-form .quantity {
    width: 106px !important;
    min-width: 106px;
    height: 38px !important;
  }

  body.ed-smart-cart-active .woocommerce-cart-form .quantity .qty {
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 34px !important;
    line-height: 36px !important;
  }

  body.ed-smart-cart-active .woocommerce-cart-form .quantity .ct-decrease,
  body.ed-smart-cart-active .woocommerce-cart-form .quantity .ct-increase {
    width: 34px !important;
    height: 36px !important;
  }

  body.ed-smart-cart-active .ct-product-multiply-symbol {
    color: var(--edcart-muted);
    font-size: 12px;
  }

  body.ed-smart-cart-active td.actions .coupon {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    margin-bottom: 8px;
  }

  body.ed-smart-cart-active td.actions .coupon input {
    width: 100% !important;
    min-width: 0 !important;
  }

  body.ed-smart-cart-active td.actions .coupon button[name="apply_coupon"] {
    min-width: 126px;
    padding-right: 12px !important;
    padding-left: 12px !important;
  }

  body.ed-smart-cart-active .cart_totals {
    padding: 14px;
    border-radius: 13px;
  }

  .edcart-recommendations {
    width: 100%;
    overflow: hidden;
    margin-top: 0;
    padding: 14px 10px;
    border-radius: 13px;
  }

  .edcart-recommendations h2 {
    font-size: 18px !important;
  }

  .edcart-recommendation-grid {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    margin-right: -10px;
    padding: 0 10px 7px 0;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .edcart-recommendation-grid::-webkit-scrollbar {
    display: none;
  }

  .edcart-rec-card {
    flex: 0 0 142px;
    scroll-snap-align: start;
  }

  body.ed-smart-cart-active .wc-proceed-to-checkout {
    position: fixed;
    right: 8px;
    bottom: 72px;
    left: 8px;
    z-index: 120;
    padding: 7px !important;
    border: 1px solid #d9eadd;
    border-radius: 13px;
    background: var(--edcart-white);
    box-shadow: 0 -4px 22px rgba(15, 23, 42, 0.13);
  }
}

@media (prefers-reduced-motion: reduce) {
  .edcart-rec-add,
  body.ed-smart-cart-active .checkout-button {
    transition: none;
  }
}
