/* ============================================================
   WIN v2 — Cart.html design mapped onto the classic WooCommerce cart
   Loads after shop.css (the verbatim handoff styles). This layer turns
   the stock [woocommerce_cart] table into the handoff's two-column
   panels: line-item cards on the left, sticky summary on the right.
   ============================================================ */

/* ---- two-column shell ---- */
/* The post-content wrapper caps content at ~1000px — open it up to the wrap. */
.woocommerce-cart .entry-content,
.woocommerce-cart .wp-block-post-content { max-width: none; width: 100%; }
.woocommerce-cart .woocommerce {
  display: grid;
  grid-template-columns: 1fr 392px;
  gap: clamp(22px, 3vw, 40px);
  align-items: start;
  width: 100%;
  max-width: none !important;   /* woocommerce-blocktheme.css caps .woocommerce at 1000px */
}
.woocommerce-cart .woocommerce > .shop-head,
.woocommerce-cart .woocommerce > .woocommerce-notices-wrapper { grid-column: 1 / -1; }
.woocommerce-cart .woocommerce-cart-form { min-width: 0; }
.woocommerce-cart .cart-collaterals {
  position: sticky;
  top: 110px;            /* below the sticky header */
}

/* ---- items table → panel of litem cards ---- */
.woocommerce-cart table.shop_table.cart {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; border-collapse: collapse; width: 100%; margin: 0;
}
.woocommerce-cart table.shop_table.cart thead { display: none; }
.woocommerce-cart table.shop_table.cart tbody { display: block; }
.woocommerce-cart table.shop_table.cart tr.woocommerce-cart-form__cart-item {
  display: grid;
  /* Handoff layout: thumb | info | right-cluster (stepper over line total) | × */
  grid-template-columns: 92px minmax(0, 1fr) auto 36px;
  grid-template-rows: auto auto;
  column-gap: 22px; row-gap: 10px; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid var(--line);
  transition: background .2s;
}
.woocommerce-cart table.shop_table.cart tr.woocommerce-cart-form__cart-item:hover { background: rgba(255,255,255,.015); }
.woocommerce-cart table.shop_table.cart td { border: none; padding: 0; background: none; }

/* thumb */
.woocommerce-cart td.product-thumbnail a { display: block; }
.woocommerce-cart td.product-thumbnail img {
  width: 92px; height: 92px; border-radius: 16px; object-fit: contain; padding: 10px;
  background: radial-gradient(120% 100% at 50% 0%, rgba(168,85,247,.16), transparent 65%), var(--surface-2);
  border: 1px solid var(--line);
}

/* name + meta */
.woocommerce-cart td.product-name {
  min-width: 0;
  font-family: 'Saira Condensed', sans-serif; font-weight: 700; text-transform: uppercase;
  font-size: 20px; line-height: 1.1;
}
.woocommerce-cart td.product-name a { color: var(--text); }
.woocommerce-cart td.product-name a:hover { color: var(--violet); }
.woocommerce-cart td.product-name .litem-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px;
  font-family: 'Hanken Grotesk', system-ui, sans-serif; text-transform: none;
}
.woocommerce-cart td.product-name .litem-brand {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}

/* Cell placement on the 2-row grid (handoff's litem layout) */
.woocommerce-cart td.product-thumbnail { grid-column: 1; grid-row: 1 / span 2; }
.woocommerce-cart td.product-name      { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.woocommerce-cart td.product-quantity  { grid-column: 3; grid-row: 1; justify-self: end; }
.woocommerce-cart td.product-subtotal  { grid-column: 3; grid-row: 2; justify-self: end; text-align: right; }
/* unit price is implicit in the design (qty × total) — hide the extra column */
.woocommerce-cart table.shop_table.cart td.product-price { display: none; }

/* quantity: real − / + stepper pill (buttons injected by app.js) */
.woocommerce-cart td.product-quantity .quantity {
  display: inline-flex; align-items: center;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 999px;
  overflow: hidden;
}
.woocommerce-cart td.product-quantity .qty {
  background: none; border: none; outline: none;
  width: 40px; height: 38px; text-align: center; color: var(--text);
  font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px;
  -moz-appearance: textfield; appearance: textfield;
}
.woocommerce-cart td.product-quantity .qty::-webkit-outer-spin-button,
.woocommerce-cart td.product-quantity .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wdg-qty-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  color: var(--text-2); font-size: 17px; font-weight: 700; line-height: 1;
  transition: color .15s, background .15s; border: none; background: none; cursor: pointer;
}
.wdg-qty-btn:hover { color: #fff; background: rgba(255,255,255,.06); }
.wdg-qty-btn:disabled { color: var(--faint); cursor: not-allowed; }

/* line total */
.woocommerce-cart td.product-subtotal {
  font-family: 'Saira Condensed', sans-serif; font-weight: 800; font-size: 22px;
  white-space: nowrap; color: var(--text);
}

/* remove ×: last column, centered across both rows */
.woocommerce-cart td.product-remove {
  grid-column: 4; grid-row: 1 / span 2; align-self: center; justify-self: end;
}
.woocommerce-cart td.product-remove a.remove {
  width: 30px; height: 30px; line-height: 28px; border-radius: 50%;
  color: var(--faint) !important; background: transparent; border: 1px solid var(--line);
  font-size: 18px; transition: color .2s, border-color .2s;
}
.woocommerce-cart td.product-remove a.remove:hover {
  color: var(--magenta) !important; border-color: var(--magenta); background: transparent;
}

/* coupon + update row */
.woocommerce-cart table.shop_table.cart tr:last-child > td.actions {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 20px 24px;
}
.woocommerce-cart td.actions .coupon { display: flex; gap: 10px; flex: 1; min-width: 240px; padding: 0; }
.woocommerce-cart td.actions .coupon input.input-text {
  flex: 1; min-width: 0; background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 13px 20px; color: var(--text); outline: none; font-size: 14.5px;
}
.woocommerce-cart td.actions .coupon input.input-text:focus { border-color: var(--violet); }
.woocommerce-cart td.actions .coupon button,
.woocommerce-cart td.actions > button[name="update_cart"] {
  border: 1px solid var(--line-2); color: var(--text); background: rgba(255,255,255,.02);
  border-radius: 999px; padding: 13px 22px; font-weight: 700; box-shadow: none;
}
.woocommerce-cart td.actions .coupon button:hover,
.woocommerce-cart td.actions > button[name="update_cart"]:hover {
  border-color: var(--violet); background: rgba(168,85,247,.08); transform: none;
}

/* ---- summary panel ---- */
.woocommerce-cart .cart_totals {
  background: var(--surface) !important; border: 1px solid var(--line) !important;
  border-radius: var(--r-lg) !important; padding: 0 !important; overflow: hidden;
  width: 100% !important; float: none !important;   /* WC floats it at 48% by default */
}
.woocommerce-cart .cart_totals > h2 {
  font-family: 'Saira Condensed', sans-serif; text-transform: uppercase; letter-spacing: .03em;
  font-size: 19px; margin: 0; padding: 20px 24px; border-bottom: 1px solid var(--line);
}
.woocommerce-cart .cart_totals table.shop_table {
  border: none; border-radius: 0; background: none; margin: 0; width: 100%;
  display: block;            /* drop table layout so rows can flex within the panel */
  table-layout: fixed;
}
.woocommerce-cart .cart_totals table.shop_table tbody { display: block; width: 100%; }
.woocommerce-cart .cart_totals table.shop_table tr {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 12px 24px; border-bottom: 1px solid var(--line);
}
.woocommerce-cart .cart_totals th,
.woocommerce-cart .cart_totals td { border: none; padding: 0; font-size: 15px; color: var(--text-2); background: none; width: auto; }
.woocommerce-cart .cart_totals th { flex-shrink: 0; }
.woocommerce-cart .cart_totals td { text-align: right; color: var(--text); font-weight: 700; min-width: 0; }
/* shipping row stacks: label on top, options below, full width */
.woocommerce-cart .cart_totals tr.woocommerce-shipping-totals { flex-direction: column; align-items: stretch; }
.woocommerce-cart .cart_totals tr.woocommerce-shipping-totals td { text-align: left; }
.woocommerce-cart .cart_totals .woocommerce-shipping-destination,
.woocommerce-cart .cart_totals .woocommerce-shipping-calculator { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-top: 8px; }
.woocommerce-cart .cart_totals .order-total th,
.woocommerce-cart .cart_totals .order-total td {
  font-family: 'Saira Condensed', sans-serif; text-transform: uppercase;
  background: rgba(255,255,255,.015);
}
.woocommerce-cart .cart_totals .order-total td { font-size: 26px; font-weight: 800; }
.woocommerce-cart .cart_totals .order-total td small { font-size: 13px; color: var(--muted); }

/* shipping methods list inside totals → design's option rows */
.woocommerce-cart .cart_totals .woocommerce-shipping-methods { list-style: none; margin: 8px 0 0; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.woocommerce-cart .cart_totals .woocommerce-shipping-methods li {
  margin: 0; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; transition: border-color .18s, background .18s;
}
.woocommerce-cart .cart_totals .woocommerce-shipping-methods li:has(input:checked) {
  background: rgba(168,85,247,.08); border-color: rgba(168,85,247,.4);
}
.woocommerce-cart .cart_totals .woocommerce-shipping-methods label {
  font-weight: 600; font-size: 13.5px; color: var(--text-2); line-height: 1.35;
  display: inline; margin: 0; min-width: 0;
}
.woocommerce-cart .cart_totals .woocommerce-shipping-methods label .woocommerce-Price-amount { color: var(--text); font-weight: 800; white-space: nowrap; }
.woocommerce-cart .cart_totals .woocommerce-shipping-methods input[type="radio"] { accent-color: #A855F7; margin: 0; flex-shrink: 0; }
/* InPost logo image inside method labels (plugin injects one) */
.woocommerce-cart .cart_totals .woocommerce-shipping-methods label img { max-height: 18px; width: auto; vertical-align: middle; }
/* keep method label + logo within the panel */
.woocommerce-cart .cart_totals .woocommerce-shipping-methods li { min-width: 0; flex-wrap: wrap; }
.woocommerce-cart .cart_totals .woocommerce-shipping-methods label { overflow-wrap: anywhere; }

/* progress bar block (output by wdg hook above the table) */
.woocommerce-cart .cart_totals .ship-bar { margin: 16px 24px 4px; }

/* checkout CTA */
.woocommerce-cart .wc-proceed-to-checkout { padding: 18px 24px 8px; margin: 0; }
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
  width: 100%; justify-content: center; display: inline-flex; align-items: center;
  padding: 16px !important; font-size: 16px !important; margin: 0;
}
.woocommerce-cart .sum-note { margin: 14px 0 0; }
.woocommerce-cart .sum-trust { padding: 16px 24px 22px; }

/* breadcrumb duplicate from the page template is unnecessary on cart */
.woocommerce-cart .woocommerce-breadcrumb { display: none; }

/* ============================================================
   Notices ("dodany do koszyka", info, errors) — WooCommerce ships
   light green/blue/red banners; restyle to the shop's dark surface
   with the brand accent so they belong to the theme.
   ============================================================ */
.wc-block-components-notice-banner,
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  background: var(--surface-2) !important;
  color: var(--text) !important;
  border: 1px solid var(--line-2) !important;
  border-left: 3px solid var(--violet) !important;
  border-radius: var(--r) !important;
  box-shadow: 0 14px 30px -18px rgba(0,0,0,.8);
}
.wc-block-components-notice-banner.is-success { border-left-color: var(--lime) !important; }
.wc-block-components-notice-banner.is-error,
.woocommerce-error { border-left-color: var(--magenta) !important; }
.wc-block-components-notice-banner > .wc-block-components-notice-banner__content { color: var(--text); }
.wc-block-components-notice-banner svg {
  background: var(--grad) !important; fill: #fff !important; border-radius: 50%;
}
.wc-block-components-notice-banner.is-success svg { background: var(--lime) !important; fill: #10241a !important; }
.wc-block-components-notice-banner a,
.woocommerce-message a,
.woocommerce-info a,
.woocommerce-error a { color: var(--violet) !important; font-weight: 700; }
.wc-block-components-notice-banner a.wc-forward.wp-element-button,
.wc-block-components-notice-banner a.wc-forward,
.woocommerce a.button.wc-forward,
.woocommerce-message a.button,
.woocommerce-error a.button,
.woocommerce-info a.button {
  display: inline-block !important;
  background: var(--grad) !important; color: #fff !important; border-radius: 999px !important;
  padding: 9px 18px !important; font-weight: 700 !important; text-decoration: none !important;
  float: none; margin-left: auto; font-size: 13.5px !important; line-height: 1.2 !important;
}
.woocommerce-message::before,
.woocommerce-info::before { color: var(--violet); }
.woocommerce-error::before { color: var(--magenta); }

/* ---- responsive ---- */
@media (max-width: 1000px) {
  .woocommerce-cart .woocommerce { grid-template-columns: 1fr; }
  .woocommerce-cart .cart-collaterals { position: static; }
}
/* WooCommerce smallscreen.css (≤768px) stacks rows, hides thumbnails and adds
   "Produkt:" data-title labels — override it back to the handoff's mobile
   layout: 72px disc thumb + info, qty + line total on a dashed row below. */
@media (max-width: 768px) {
  .woocommerce-cart table.shop_table.cart tr.woocommerce-cart-form__cart-item {
    display: grid !important;
    grid-template-columns: 72px 1fr !important;
    gap: 10px 14px; padding: 16px;
  }
  .woocommerce-cart table.shop_table.cart td { display: block !important; text-align: left !important; }
  .woocommerce-cart table.shop_table.cart td::before { display: none !important; }  /* kill "Produkt:" labels */
  .woocommerce-cart td.product-thumbnail { display: block !important; grid-row: 1; }
  .woocommerce-cart td.product-thumbnail img { width: 72px; height: 72px; border-radius: 13px; }
  .woocommerce-cart td.product-name { font-size: 17px; grid-column: 2; grid-row: 1; }
  .woocommerce-cart table.shop_table.cart td.product-price { display: none !important; }
  .woocommerce-cart td.product-remove {
    position: static; grid-column: 2; grid-row: 1; align-self: start; justify-self: end;
  }
  .woocommerce-cart td.product-quantity,
  .woocommerce-cart td.product-subtotal {
    display: flex !important; align-items: center;
    border-top: 1px dashed var(--line); padding-top: 10px !important;
  }
  .woocommerce-cart td.product-quantity { grid-column: 1; grid-row: 2; }
  .woocommerce-cart td.product-subtotal { grid-column: 2; grid-row: 2; justify-content: flex-end; }
  .woocommerce-cart td.actions .coupon { flex-direction: column; }
  .woocommerce-cart td.actions .coupon button,
  .woocommerce-cart td.actions > button[name="update_cart"] { width: 100%; }
}

/* ============================================================
   WCAG AA + touch-target overrides (impeccable critique 2026-06-05)
   Last stylesheet in the cascade — final word. Deepen the action
   gradient for white-text contrast and enforce ≥44px targets on the
   mobile cart (remove ×, qty, checkout CTA).
   ============================================================ */
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.woocommerce .button.alt,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.wc-block-components-notice-banner a.wc-forward {
  background: var(--grad-action) !important;
}
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
  font-size: 16px !important;
  font-weight: 800 !important;
  min-height: 48px;
  align-items: center;
  display: inline-flex;
  justify-content: center;
}
@media (max-width: 768px) {
  .woocommerce-cart td.product-remove a.remove {
    width: 44px !important; height: 44px !important; line-height: 42px; font-size: 22px;
  }
  .woocommerce-cart td.product-quantity .qty { height: 44px !important; width: 88px !important; font-size: 16px; }
}
