/* ==========================================================================
   DANPOL Native Cart & Checkout Polish (Zero JS Overlays)
   Matches DANPOL homepage / shop / single-product design system
   ========================================================================== */

body.woocommerce-cart {
  --dc-ink: #13161c;
  --dc-muted: #5b6370;
  --dc-soft: #7a818d;
  --dc-line: #e6e8ef;
  --dc-line-strong: #d4d9e4;
  --dc-bg: #f6f7f9;
  --dc-surface: #ffffff;
  --dc-blue: #1956d3;
  --dc-blue-dark: #1443a8;
  --dc-blue-soft: #eef4ff;
  background-color: var(--dc-bg) !important;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.woocommerce-cart .site-content,
body.woocommerce-cart #content.site-content {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 36px 0 72px !important;
  background: var(--dc-bg) !important;
}

body.woocommerce-cart .breadcrumb-wrap,
body.woocommerce-cart .printec-breadcrumb {
  display: none !important;
}

body.woocommerce-cart .site-content > .col-full,
body.woocommerce-cart #content > .col-full {
  max-width: 1216px !important;
  width: calc(100% - 48px) !important;
  margin-inline: auto !important;
  padding: 0 !important;
}

body.woocommerce-cart .entry-header,
body.woocommerce-cart .page-header {
  margin-bottom: 24px !important;
}

body.woocommerce-cart .entry-title {
  margin: 0 0 22px !important;
  color: var(--dc-ink) !important;
  font-size: clamp(28px, 3vw, 38px) !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em !important;
}

/* Main 2-column layout: Cart items left, sticky summary right */
body.woocommerce-cart .woocommerce {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.85fr);
  gap: 28px;
  align-items: start;
}

body.woocommerce-cart .woocommerce > .woocommerce-notices-wrapper,
body.woocommerce-cart .woocommerce > .cart-empty,
body.woocommerce-cart .woocommerce > .return-to-shop {
  grid-column: 1 / -1;
}

body.woocommerce-cart .woocommerce-cart-form {
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
}

/* Cart Table Card */
body.woocommerce-cart table.shop_table.cart {
  width: 100% !important;
  table-layout: auto !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background: var(--dc-surface) !important;
  border: 1px solid var(--dc-line) !important;
  border-radius: 16px !important;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(20, 22, 28, 0.04);
  margin: 0 !important;
}

body.woocommerce-cart table.shop_table.cart thead th {
  background: #f8f9fc !important;
  border-bottom: 1px solid var(--dc-line) !important;
  padding: 14px 14px !important;
  color: var(--dc-soft) !important;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

body.woocommerce-cart table.shop_table.cart thead th.product-price,
body.woocommerce-cart table.shop_table.cart thead th.product-subtotal {
  text-align: right !important;
}

/* Hide redundant empty Ilość and duplicate Cena columns (single configured print run -> Kwota is the total) */
body.woocommerce-cart table.shop_table.cart th.product-quantity,
body.woocommerce-cart table.shop_table.cart td.product-quantity,
body.woocommerce-cart table.shop_table.cart th.product-price,
body.woocommerce-cart table.shop_table.cart td.product-price {
  display: none !important;
}

body.woocommerce-cart table.shop_table.cart th.product-subtotal,
body.woocommerce-cart table.shop_table.cart td.product-subtotal {
  width: 1%;
  padding-right: 20px !important;
  white-space: nowrap;
}

body.woocommerce-cart table.shop_table.cart td.product-name {
  width: 100%;
  min-width: 280px;
}

body.woocommerce-cart table.shop_table.cart tbody td {
  padding: 20px 14px !important;
  vertical-align: top !important;
  border-bottom: 1px solid #f0f2f6 !important;
  background: transparent !important;
}

body.woocommerce-cart table.shop_table.cart tbody td.product-remove {
  width: 44px;
  padding-left: 16px !important;
  padding-right: 4px !important;
}

body.woocommerce-cart table.shop_table.cart a.remove {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 28px !important;
  height: 28px !important;
  border-radius: 8px !important;
  border: 1px solid var(--dc-line) !important;
  background: #ffffff !important;
  color: var(--dc-soft) !important;
  font-size: 16px !important;
  line-height: 1 !important;
  text-decoration: none !important;
  transition: all 0.15s ease;
}

body.woocommerce-cart table.shop_table.cart a.remove:hover {
  border-color: #fca5a5 !important;
  background: #fef2f2 !important;
  color: #dc2626 !important;
}

body.woocommerce-cart table.shop_table.cart td.product-thumbnail {
  width: 84px;
  padding-left: 8px !important;
  padding-right: 10px !important;
}

body.woocommerce-cart table.shop_table.cart td.product-thumbnail img {
  width: 72px !important;
  height: 72px !important;
  object-fit: contain;
  border-radius: 12px !important;
  border: 1px solid var(--dc-line) !important;
  background: repeating-linear-gradient(135deg, #faf9f6 0 8px, #f4f3ef 8px 16px);
  display: block;
}

/* Product Name + Clean Metadata Grid */
body.woocommerce-cart table.shop_table.cart td.product-name > a {
  display: inline-block;
  color: var(--dc-ink) !important;
  font-size: 17px !important;
  font-weight: 800 !important;
  line-height: 1.25;
  text-decoration: none !important;
  margin-bottom: 10px;
}

body.woocommerce-cart table.shop_table.cart td.product-name > a:hover {
  color: var(--dc-blue) !important;
}

body.woocommerce-cart table.shop_table.cart td.product-name a.wapf-edit-cartitem {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--dc-blue-soft);
  color: var(--dc-blue) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}

body.woocommerce-cart table.shop_table.cart td.product-name dl.variation {
  display: grid !important;
  grid-template-columns: minmax(150px, 46%) minmax(0, 1fr);
  gap: 6px 14px;
  margin: 10px 0 0 !important;
  padding: 12px 14px !important;
  border-radius: 12px;
  background: #f8f9fc;
  border: 1px solid #eef0f6;
  font-size: 13px !important;
  line-height: 1.45 !important;
  width: 100%;
}

/* CRITICAL: disable Printec/WooCommerce clearfix pseudo-elements that otherwise become Grid Item #1 */
body.woocommerce-cart table.shop_table.cart td.product-name dl.variation::before,
body.woocommerce-cart table.shop_table.cart td.product-name dl.variation::after {
  display: none !important;
  content: none !important;
}

body.woocommerce-cart table.shop_table.cart td.product-name dl.variation dt {
  float: none !important;
  clear: none !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--dc-soft) !important;
  font-weight: 600 !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

body.woocommerce-cart table.shop_table.cart td.product-name dl.variation dd {
  float: none !important;
  clear: none !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--dc-ink) !important;
  font-weight: 600 !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

body.woocommerce-cart table.shop_table.cart td.product-name dl.variation dd p {
  margin: 0 !important;
}

/* Price & Subtotal columns */
body.woocommerce-cart table.shop_table.cart td.product-price,
body.woocommerce-cart table.shop_table.cart td.product-subtotal {
  text-align: right !important;
  white-space: nowrap;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--dc-ink) !important;
}

body.woocommerce-cart table.shop_table.cart td.product-subtotal {
  font-size: 16px !important;
  font-weight: 800 !important;
}

/* Coupon & Update Cart row */
body.woocommerce-cart table.shop_table.cart td.actions {
  padding: 16px 20px !important;
  background: #fafbfd !important;
  border-bottom: 0 !important;
}

body.woocommerce-cart table.shop_table.cart td.actions .coupon {
  display: flex !important;
  align-items: center;
  gap: 10px;
  float: left;
  margin: 0 !important;
}

body.woocommerce-cart table.shop_table.cart td.actions .coupon input#coupon_code {
  width: 210px !important;
  padding: 10px 14px !important;
  border: 1.5px solid var(--dc-line-strong) !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: var(--dc-ink) !important;
  font-size: 14px !important;
  height: auto !important;
  margin: 0 !important;
}

body.woocommerce-cart table.shop_table.cart td.actions .coupon input#coupon_code:focus {
  outline: none;
  border-color: var(--dc-blue) !important;
  box-shadow: 0 0 0 3px rgba(25, 86, 211, 0.12);
}

body.woocommerce-cart table.shop_table.cart td.actions button.button {
  padding: 10px 18px !important;
  border-radius: 10px !important;
  background: var(--dc-blue) !important;
  color: #ffffff !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  border: 0 !important;
  cursor: pointer;
  transition: background 0.15s ease;
}

body.woocommerce-cart table.shop_table.cart td.actions button.button:hover:not(:disabled) {
  background: var(--dc-blue-dark) !important;
}

body.woocommerce-cart table.shop_table.cart td.actions button[name="update_cart"] {
  display: none !important;
}

/* ---------- Cart Summary Card (Right Column) ---------- */
body.woocommerce-cart .cart-collaterals {
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
}

body.woocommerce-cart .cart-collaterals .cart_totals {
  width: 100% !important;
  float: none !important;
  background: var(--dc-surface) !important;
  border: 1px solid var(--dc-line) !important;
  border-radius: 16px !important;
  padding: 24px !important;
  box-shadow: 0 4px 16px rgba(20, 22, 28, 0.05) !important;
  position: sticky;
  top: 86px;
}

body.woocommerce-cart .cart-collaterals .cart_totals > h2 {
  margin: 0 0 18px !important;
  padding-bottom: 14px !important;
  border-bottom: 1px solid var(--dc-line) !important;
  color: var(--dc-ink) !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
}

body.woocommerce-cart .cart_totals table.shop_table {
  width: 100% !important;
  border: 0 !important;
  margin: 0 0 18px !important;
}

body.woocommerce-cart .cart_totals table.shop_table tr th,
body.woocommerce-cart .cart_totals table.shop_table tr td {
  padding: 12px 0 !important;
  border: 0 !important;
  border-bottom: 1px solid #f0f2f6 !important;
  vertical-align: top !important;
  background: transparent !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

body.woocommerce-cart .cart_totals table.shop_table tr th {
  color: var(--dc-muted) !important;
  font-weight: 600 !important;
  width: 44%;
  padding-right: 12px !important;
  text-align: left !important;
}

body.woocommerce-cart .cart_totals table.shop_table tr td {
  color: var(--dc-ink) !important;
  font-weight: 700 !important;
  text-align: right !important;
  font-size: 14.5px !important;
}

/* Fix Printec's purple total & keep delivery date clean dark ink (only price amount is big blue) */
body.woocommerce-cart .cart_totals table.shop_table tr.order-total th {
  color: var(--dc-ink) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
}

body.woocommerce-cart .cart_totals table.shop_table tr.order-total td {
  color: var(--dc-ink) !important;
  font-size: 14.5px !important;
  font-weight: 700 !important;
}

body.woocommerce-cart .cart_totals table.shop_table tr.order-total td .woocommerce-Price-amount {
  color: var(--dc-blue) !important;
  font-size: 22px !important;
  font-weight: 850 !important;
  letter-spacing: -0.02em;
}

body.woocommerce-cart .cart_totals table.shop_table tr.shipping ul#shipping_method li label {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin: 0 !important;
  cursor: pointer;
}

body.woocommerce-cart .cart_totals table.shop_table tr.shipping ul#shipping_method {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  text-align: left !important;
}

body.woocommerce-cart .cart_totals table.shop_table tr.shipping ul#shipping_method li {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px !important;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--dc-line);
  background: #f9fafc;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: var(--dc-ink) !important;
}

body.woocommerce-cart .cart_totals table.shop_table tr.shipping ul#shipping_method li input[type="radio"] {
  accent-color: var(--dc-blue);
  margin: 0 !important;
  order: -1;
}

body.woocommerce-cart .cart_totals .woocommerce-shipping-destination {
  margin: 8px 0 0 !important;
  font-size: 12.5px !important;
  line-height: 1.45 !important;
  color: var(--dc-soft) !important;
  font-weight: 400 !important;
  text-align: left !important;
  word-break: normal !important;
}

/* Normalize delivery date & weight rows so they don't blow up to giant 32px font */
body.woocommerce-cart .cart_totals table.shop_table tr td h1,
body.woocommerce-cart .cart_totals table.shop_table tr td h2,
body.woocommerce-cart .cart_totals table.shop_table tr td h3,
body.woocommerce-cart .cart_totals table.shop_table tr td span,
body.woocommerce-cart .cart_totals table.shop_table tr td small {
  font-size: inherit !important;
  line-height: inherit !important;
  font-weight: inherit !important;
}

/* Proceed to checkout CTA button */
body.woocommerce-cart .wc-proceed-to-checkout {
  padding: 6px 0 0 !important;
  margin: 0 !important;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  padding: 15px 22px !important;
  border-radius: 12px !important;
  background: var(--dc-blue) !important;
  color: #ffffff !important;
  font-size: 15.5px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  box-shadow: 0 12px 28px rgba(25, 86, 211, 0.24) !important;
  transition: background 0.15s ease, transform 0.14s ease !important;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
  background: var(--dc-blue-dark) !important;
  transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 1024px) {
  body.woocommerce-cart .woocommerce {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  body.woocommerce-cart .cart-collaterals .cart_totals {
    position: static;
  }
}

@media (max-width: 640px) {
  body.woocommerce-cart .site-content > .col-full,
  body.woocommerce-cart #content > .col-full {
    width: calc(100% - 24px) !important;
  }

  body.woocommerce-cart table.shop_table.cart td.product-name dl.variation {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  body.woocommerce-cart table.shop_table.cart td.actions .coupon {
    float: none;
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 10px !important;
  }

  body.woocommerce-cart table.shop_table.cart td.actions .coupon input#coupon_code,
  body.woocommerce-cart table.shop_table.cart td.actions button.button {
    width: 100% !important;
  }
}
