/*
 * AMUI v2.0.5
 * Finalne wyrównanie koszyka, realny link „Kontynuuj zakupy” i miękkie tło na karcie produktu.
 */

:root {
  --amui-page-soft: #eef0f2;
  --amui-cart-orange: var(--amui-accent, #ff5a00);
  --amui-cart-orange-dark: var(--amui-accent-dark, #e65000);
  --amui-cart-teal: #00796b;
  --amui-cart-text: var(--amui-text, #1f2937);
  --amui-cart-muted: var(--amui-muted, #64748b);
  --amui-cart-line: var(--amui-line, #e2e8f0);
}

/* To samo miękkie tło także na karcie produktu. */
body.single-product,
body.woocommerce.single-product,
body.woocommerce-page.single-product {
  background: var(--amui-page-soft) !important;
  background-color: var(--amui-page-soft) !important;
}

body.single-product::before,
body.woocommerce.single-product::before,
body.woocommerce-page.single-product::before {
  background: var(--amui-page-soft) !important;
  background-color: var(--amui-page-soft) !important;
}

body.single-product .site-content,
body.single-product .content-area,
body.single-product #primary,
body.single-product .ast-woocommerce-container,
body.single-product .entry-content {
  background: transparent !important;
}

/* Koszyk: akcje w jednej osi. */
@media (min-width: 1181px) {
  body.woocommerce-cart table.shop_table.cart tbody tr.cart_item {
    grid-template-columns: 210px minmax(230px, 1fr) 154px minmax(164px, max-content) 54px !important;
    column-gap: 16px !important;
    align-items: center !important;
  }

  body.woocommerce-cart table.shop_table.cart .product-quantity,
  body.woocommerce-cart table.shop_table.cart .product-subtotal,
  body.woocommerce-cart table.shop_table.cart .product-remove {
    grid-row: 1 / span 2 !important;
    align-self: center !important;
    min-height: 52px !important;
  }

  body.woocommerce-cart table.shop_table.cart .product-quantity {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    justify-self: center !important;
  }

  body.woocommerce-cart table.shop_table.cart .product-subtotal {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    justify-self: end !important;
    min-width: 164px !important;
    height: 52px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    transform: none !important;
  }

  body.woocommerce-cart table.shop_table.cart .product-remove {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    justify-self: center !important;
    width: 54px !important;
    min-width: 54px !important;
    height: 52px !important;
  }
}

@media (min-width: 1181px) and (max-width: 1380px) {
  body.woocommerce-cart table.shop_table.cart tbody tr.cart_item {
    grid-template-columns: 185px minmax(205px, 1fr) 142px minmax(150px, max-content) 52px !important;
    column-gap: 14px !important;
  }

  body.woocommerce-cart table.shop_table.cart .product-subtotal {
    min-width: 150px !important;
  }

  body.woocommerce-cart table.shop_table.cart .product-remove {
    width: 52px !important;
    min-width: 52px !important;
  }
}

/* Liczba w kontrolerze ilości: dokładnie w środku pola. */
body.woocommerce-cart table.shop_table.cart .quantity {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 46px !important;
  min-height: 46px !important;
  box-sizing: border-box !important;
}

body.woocommerce-cart table.shop_table.cart .quantity .qty,
body.woocommerce-cart table.shop_table.cart .quantity input.qty,
body.woocommerce-cart table.shop_table.cart input[type="number"].qty {
  display: block !important;
  height: 46px !important;
  min-height: 46px !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 46px !important;
  text-align: center !important;
  vertical-align: middle !important;
  appearance: textfield !important;
  -moz-appearance: textfield !important;
  box-sizing: border-box !important;
}

body.woocommerce-cart table.shop_table.cart .quantity .qty::-webkit-outer-spin-button,
body.woocommerce-cart table.shop_table.cart .quantity .qty::-webkit-inner-spin-button {
  margin: 0 !important;
  -webkit-appearance: none !important;
}

body.woocommerce-cart table.shop_table.cart .amui-qty-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 46px !important;
  line-height: 46px !important;
}

body.woocommerce-cart table.shop_table.cart .amui-qty-btn::before {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  line-height: 1 !important;
}

/* Cena produktu: w osi poziomej z przyciskiem plus. */
body.woocommerce-cart table.shop_table.cart .product-subtotal,
body.woocommerce-cart table.shop_table.cart .product-subtotal * {
  box-sizing: border-box !important;
}

body.woocommerce-cart table.shop_table.cart .product-subtotal .amount,
body.woocommerce-cart table.shop_table.cart .product-subtotal bdi {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  height: 52px !important;
  min-height: 52px !important;
  line-height: 52px !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}

/* Przycisk usuwania: kółko dokładnie w środku swojej kolumny. */
body.woocommerce-cart table.shop_table.cart .product-remove a.remove {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  line-height: 1 !important;
  text-align: center !important;
  transform: none !important;
}

body.woocommerce-cart table.shop_table.cart .product-remove a.remove::before {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  line-height: 1 !important;
  transform: translateY(-1px) !important;
}

/* Prawy panel: zostaje tylko realny link, bez pseudo-elementu. */
body.woocommerce-cart .wc-proceed-to-checkout::after {
  content: none !important;
  display: none !important;
}

body.woocommerce-cart .wc-proceed-to-checkout .amui-cart-continue-link {
  display: flex !important;
  min-height: 54px !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 8px 0 0 !important;
  color: var(--amui-cart-teal) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  text-decoration: none !important;
  font-size: 16px !important;
  font-weight: 900 !important;
  letter-spacing: .16em !important;
  text-transform: uppercase !important;
}

body.woocommerce-cart .wc-proceed-to-checkout .amui-cart-continue-link:hover,
body.woocommerce-cart .wc-proceed-to-checkout .amui-cart-continue-link:focus {
  color: #005f55 !important;
  background: transparent !important;
  text-decoration: none !important;
}

/* Tablet: zachowaj ten sam porządek, ale bez ściskania ceny. */
@media (max-width: 1180px) and (min-width: 761px) {
  body.woocommerce-cart table.shop_table.cart .product-quantity,
  body.woocommerce-cart table.shop_table.cart .product-subtotal,
  body.woocommerce-cart table.shop_table.cart .product-remove {
    align-self: center !important;
  }

  body.woocommerce-cart table.shop_table.cart .product-quantity,
  body.woocommerce-cart table.shop_table.cart .product-remove {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  body.woocommerce-cart table.shop_table.cart .product-subtotal {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-height: 46px !important;
  }
}

@media (max-width: 760px) {
  body.woocommerce-cart table.shop_table.cart .product-quantity,
  body.woocommerce-cart table.shop_table.cart .product-subtotal,
  body.woocommerce-cart table.shop_table.cart .product-remove {
    min-height: 44px !important;
  }

  body.woocommerce-cart table.shop_table.cart .product-subtotal .amount,
  body.woocommerce-cart table.shop_table.cart .product-subtotal bdi {
    height: auto !important;
    min-height: 0 !important;
    line-height: 1.15 !important;
  }
}
