/*
 * AMUI v2.0.3
 * Koszyk: finalne czyszczenie układu, bez grupy „Przesyłka ze sklepu”, bez wiersza „Wartość produktów”
 * i z mocniej ustabilizowaną pozycją produktu w układzie Allegro-like.
 */

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

/* Usunięcie elementów, które były mylące dla sklepu jednego sprzedawcy. */
body.woocommerce-cart .amui-cart-delivery-group,
body.woocommerce-cart .cart_totals tr.cart-subtotal,
body.woocommerce-cart .cart_totals tr.woocommerce-cart-form__cart-item--value,
body.woocommerce-cart .cart_totals .cart-subtotal,
body.woocommerce-cart .cart_totals tr.shipping,
body.woocommerce-cart .cart_totals tr.woocommerce-shipping-totals,
body.woocommerce-cart .cart_totals .woocommerce-shipping-destination,
body.woocommerce-cart .cart_totals .woocommerce-shipping-calculator,
body.woocommerce-cart .cart_totals .shipping-calculator-button,
body.woocommerce-cart .cart_totals ul#shipping_method,
body.woocommerce-cart .cart_totals .woocommerce-shipping-methods {
  display: none !important;
}

body.woocommerce-cart {
  background: var(--amui-v203-page) !important;
}

/* Główna siatka: koszyk + panel podsumowania. */
body.woocommerce-cart .ast-container,
body.woocommerce-cart .site-content .ast-container {
  width: min(100%, 1560px) !important;
  max-width: 1560px !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
}

body.woocommerce-cart .entry-content > .woocommerce,
body.woocommerce-cart .ast-woocommerce-container > .woocommerce,
body.woocommerce-cart #primary > .woocommerce,
body.woocommerce-cart .woocommerce.amui-cart-root {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(350px, 400px) !important;
  gap: 20px !important;
  align-items: start !important;
  width: 100% !important;
  max-width: 1512px !important;
  margin: 0 auto !important;
}

body.woocommerce-cart form.woocommerce-cart-form {
  grid-column: 1 !important;
  min-width: 0 !important;
}

body.woocommerce-cart .cart-collaterals {
  grid-column: 2 !important;
  width: 100% !important;
  max-width: 400px !important;
  min-width: 0 !important;
  position: sticky !important;
  top: 94px !important;
  align-self: start !important;
}

/* Górny pasek koszyka zostaje, ale bez sztucznej grupy przesyłki. */
body.woocommerce-cart .amui-cart-selection-bar {
  margin: 0 0 14px !important;
  min-height: 70px !important;
  padding: 16px 24px !important;
  border: 1px solid var(--amui-v203-line) !important;
  background: #fff !important;
}

body.woocommerce-cart .amui-cart-all-toggle strong {
  font-size: 20px !important;
  font-weight: 500 !important;
}

/* Lista produktów: jedna czytelna karta, bez nakładania ceny na ilość. */
body.woocommerce-cart table.shop_table.cart,
body.woocommerce-cart table.shop_table.cart tbody {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

body.woocommerce-cart table.shop_table.cart tbody tr.cart_item {
  position: relative !important;
  display: grid !important;
  grid-template-columns: 230px minmax(260px, 1fr) 164px minmax(158px, max-content) 52px !important;
  grid-template-rows: auto auto !important;
  column-gap: 20px !important;
  row-gap: 8px !important;
  align-items: center !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 156px !important;
  margin: 0 !important;
  padding: 22px 24px !important;
  border: 1px solid var(--amui-v203-line) !important;
  border-top: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

body.woocommerce-cart table.shop_table.cart tbody tr.cart_item:first-of-type {
  border-top: 1px solid var(--amui-v203-line) !important;
}

body.woocommerce-cart table.shop_table.cart tbody tr.cart_item td {
  display: block !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-sizing: border-box !important;
}

body.woocommerce-cart table.shop_table.cart .product-thumbnail {
  grid-column: 1 !important;
  grid-row: 1 / span 2 !important;
  align-self: center !important;
}

body.woocommerce-cart .amui-cart-thumb-wrap {
  display: grid !important;
  grid-template-columns: 26px 150px !important;
  gap: 18px !important;
  align-items: center !important;
  width: 100% !important;
}

body.woocommerce-cart .amui-cart-thumb-media {
  display: grid !important;
  place-items: center !important;
  width: 150px !important;
  height: 118px !important;
  background: #fff !important;
}

body.woocommerce-cart table.cart img,
body.woocommerce-cart table.shop_table.cart .product-thumbnail img,
body.woocommerce-cart .amui-cart-thumb-media img {
  width: 150px !important;
  height: 118px !important;
  max-width: 150px !important;
  object-fit: contain !important;
  border: 0 !important;
  background: transparent !important;
}

body.woocommerce-cart table.shop_table.cart .product-name {
  grid-column: 2 !important;
  grid-row: 1 !important;
  align-self: end !important;
  min-width: 0 !important;
  width: 100% !important;
}

body.woocommerce-cart table.shop_table.cart .product-name a,
body.woocommerce-cart table.shop_table.cart .product-name a:visited {
  display: block !important;
  max-width: 100% !important;
  min-width: 0 !important;
  color: var(--amui-v203-text) !important;
  font-size: 17px !important;
  line-height: 1.34 !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
  hyphens: none !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
}

body.woocommerce-cart table.shop_table.cart .product-price {
  grid-column: 2 !important;
  grid-row: 2 !important;
  align-self: start !important;
  color: var(--amui-v203-muted) !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
  white-space: nowrap !important;
}

body.woocommerce-cart table.shop_table.cart .product-quantity {
  grid-column: 3 !important;
  grid-row: 1 / span 2 !important;
  justify-self: end !important;
  align-self: center !important;
  min-width: 154px !important;
}

body.woocommerce-cart table.shop_table.cart .quantity {
  width: 154px !important;
  max-width: 154px !important;
  height: 46px !important;
  min-height: 46px !important;
}

body.woocommerce-cart table.shop_table.cart .amui-qty-btn {
  width: 46px !important;
  height: 46px !important;
  min-height: 46px !important;
  flex: 0 0 46px !important;
}

body.woocommerce-cart table.shop_table.cart .quantity .qty {
  width: 62px !important;
  max-width: 62px !important;
  height: 46px !important;
  min-height: 46px !important;
  flex: 0 0 62px !important;
  font-size: 15px !important;
}

body.woocommerce-cart table.shop_table.cart .product-subtotal {
  grid-column: 4 !important;
  grid-row: 1 / span 2 !important;
  justify-self: end !important;
  align-self: center !important;
  min-width: 158px !important;
  width: max-content !important;
  max-width: none !important;
  padding-left: 8px !important;
  color: var(--amui-v203-text) !important;
  font-size: 25px !important;
  line-height: 1.1 !important;
  font-weight: 600 !important;
  letter-spacing: -.03em !important;
  text-align: right !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

body.woocommerce-cart table.shop_table.cart .product-subtotal .amount,
body.woocommerce-cart table.shop_table.cart .product-subtotal bdi {
  display: inline !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

body.woocommerce-cart table.shop_table.cart .product-remove {
  grid-column: 5 !important;
  grid-row: 1 / span 2 !important;
  justify-self: center !important;
  align-self: center !important;
  width: 44px !important;
  min-width: 44px !important;
}

body.woocommerce-cart table.shop_table.cart .product-remove a.remove {
  display: inline-flex !important;
  width: 42px !important;
  height: 42px !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid #d8dee6 !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #7b8794 !important;
  font-size: 0 !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

body.woocommerce-cart table.shop_table.cart .product-remove a.remove::before {
  content: "×" !important;
  font-family: Arial, sans-serif !important;
  font-size: 26px !important;
  line-height: 1 !important;
  filter: none !important;
  opacity: 1 !important;
}

body.woocommerce-cart table.shop_table.cart .product-remove a.remove:hover {
  border-color: var(--amui-v203-orange) !important;
  color: var(--amui-v203-orange) !important;
}

/* Prawy panel: tylko suma + CTA, bez wiersza wartości produktów. */
body.woocommerce-cart .cart-collaterals .cart_totals {
  width: 100% !important;
  max-width: 400px !important;
  border: 1px solid var(--amui-v203-line) !important;
  background: #fff !important;
  overflow: hidden !important;
}

body.woocommerce-cart .cart_totals table.shop_table {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 26px 30px 0 !important;
  border: 0 !important;
}

body.woocommerce-cart .cart_totals table.shop_table tbody {
  display: block !important;
  width: 100% !important;
}

body.woocommerce-cart .cart_totals table.shop_table tr.order-total {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) max-content !important;
  gap: 16px !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 0 18px !important;
  border: 0 !important;
}

body.woocommerce-cart .cart_totals table.shop_table tr.order-total th,
body.woocommerce-cart .cart_totals table.shop_table tr.order-total td {
  display: block !important;
  width: auto !important;
  min-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

body.woocommerce-cart .cart_totals table.shop_table tr.order-total th {
  color: var(--amui-v203-text) !important;
  font-size: 16px !important;
  font-weight: 400 !important;
}

body.woocommerce-cart .cart_totals table.shop_table tr.order-total td,
body.woocommerce-cart .cart_totals table.shop_table tr.order-total strong,
body.woocommerce-cart .cart_totals table.shop_table tr.order-total .amount,
body.woocommerce-cart .cart_totals table.shop_table tr.order-total bdi {
  color: #455a64 !important;
  font-size: clamp(28px, 2.2vw, 34px) !important;
  line-height: 1 !important;
  font-weight: 700 !important;
  letter-spacing: -.04em !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

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

body.woocommerce-cart .wc-proceed-to-checkout {
  padding: 0 30px 24px !important;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
  width: 100% !important;
  min-height: 48px !important;
  font-size: 16px !important;
  letter-spacing: .13em !important;
}

body.woocommerce-cart .wc-proceed-to-checkout::after {
  min-height: 52px !important;
  font-size: 16px !important;
  letter-spacing: .15em !important;
}

/* Breakpointy: nie wciskaj pięciu kolumn, gdy brakuje realnego miejsca. */
@media (max-width: 1320px) {
  body.woocommerce-cart .entry-content > .woocommerce,
  body.woocommerce-cart .ast-woocommerce-container > .woocommerce,
  body.woocommerce-cart #primary > .woocommerce,
  body.woocommerce-cart .woocommerce.amui-cart-root {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 370px) !important;
    gap: 18px !important;
  }

  body.woocommerce-cart table.shop_table.cart tbody tr.cart_item {
    grid-template-columns: 205px minmax(230px, 1fr) 150px minmax(140px, max-content) 46px !important;
    column-gap: 16px !important;
    padding: 20px !important;
  }

  body.woocommerce-cart .amui-cart-thumb-wrap {
    grid-template-columns: 24px 132px !important;
    gap: 12px !important;
  }

  body.woocommerce-cart .amui-cart-thumb-media,
  body.woocommerce-cart table.cart img,
  body.woocommerce-cart table.shop_table.cart .product-thumbnail img,
  body.woocommerce-cart .amui-cart-thumb-media img {
    width: 132px !important;
    height: 108px !important;
    max-width: 132px !important;
  }

  body.woocommerce-cart table.shop_table.cart .product-subtotal {
    font-size: 23px !important;
    min-width: 140px !important;
  }
}

@media (max-width: 1180px) {
  body.woocommerce-cart .entry-content > .woocommerce,
  body.woocommerce-cart .ast-woocommerce-container > .woocommerce,
  body.woocommerce-cart #primary > .woocommerce,
  body.woocommerce-cart .woocommerce.amui-cart-root {
    display: block !important;
    max-width: 920px !important;
  }

  body.woocommerce-cart .cart-collaterals {
    position: relative !important;
    top: auto !important;
    max-width: none !important;
    margin-top: 18px !important;
  }

  body.woocommerce-cart .cart-collaterals .cart_totals {
    max-width: none !important;
  }

  body.woocommerce-cart table.shop_table.cart tbody tr.cart_item {
    grid-template-columns: 205px minmax(0, 1fr) 150px 46px !important;
    grid-template-rows: auto auto auto !important;
  }

  body.woocommerce-cart table.shop_table.cart .product-thumbnail { grid-column: 1 !important; grid-row: 1 / span 3 !important; }
  body.woocommerce-cart table.shop_table.cart .product-name { grid-column: 2 !important; grid-row: 1 !important; }
  body.woocommerce-cart table.shop_table.cart .product-price { grid-column: 2 !important; grid-row: 2 !important; }
  body.woocommerce-cart table.shop_table.cart .product-quantity { grid-column: 3 !important; grid-row: 1 / span 3 !important; justify-self: center !important; }
  body.woocommerce-cart table.shop_table.cart .product-subtotal { grid-column: 2 !important; grid-row: 3 !important; justify-self: start !important; font-size: 24px !important; }
  body.woocommerce-cart table.shop_table.cart .product-remove { grid-column: 4 !important; grid-row: 1 / span 3 !important; }
}

@media (max-width: 760px) {
  body.woocommerce-cart .ast-container,
  body.woocommerce-cart .site-content .ast-container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  body.woocommerce-cart .amui-cart-selection-bar {
    padding: 14px 16px !important;
  }

  body.woocommerce-cart table.shop_table.cart tbody tr.cart_item {
    grid-template-columns: 104px minmax(0, 1fr) 40px !important;
    grid-template-rows: auto auto auto auto !important;
    gap: 10px 12px !important;
    padding: 16px !important;
  }

  body.woocommerce-cart table.shop_table.cart .product-thumbnail { grid-column: 1 !important; grid-row: 1 / span 4 !important; }
  body.woocommerce-cart table.shop_table.cart .product-name { grid-column: 2 !important; grid-row: 1 !important; align-self: start !important; }
  body.woocommerce-cart table.shop_table.cart .product-price { grid-column: 2 !important; grid-row: 2 !important; }
  body.woocommerce-cart table.shop_table.cart .product-quantity { grid-column: 2 / span 2 !important; grid-row: 3 !important; justify-self: start !important; }
  body.woocommerce-cart table.shop_table.cart .product-subtotal { grid-column: 2 / span 2 !important; grid-row: 4 !important; justify-self: start !important; font-size: 22px !important; }
  body.woocommerce-cart table.shop_table.cart .product-remove { grid-column: 3 !important; grid-row: 1 !important; }

  body.woocommerce-cart .amui-cart-thumb-wrap {
    grid-template-columns: 22px 74px !important;
    gap: 8px !important;
  }

  body.woocommerce-cart .amui-cart-thumb-media,
  body.woocommerce-cart table.cart img,
  body.woocommerce-cart table.shop_table.cart .product-thumbnail img,
  body.woocommerce-cart .amui-cart-thumb-media img {
    width: 74px !important;
    height: 74px !important;
    max-width: 74px !important;
  }

  body.woocommerce-cart table.shop_table.cart .product-name a {
    font-size: 15px !important;
  }
}
