/* Keep the native delete link and its accessible label; only change presentation. */
body#cart .product-line__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 9rem 2.75rem;
  gap: 1rem;
  min-width: 0;
  align-self: stretch;
  align-items: start;
}

body#cart .product-line__content-left,
body#cart .product-line__content-right {
  min-width: 0;
  margin-block-end: 0;
}

/* Three independent cells keep the native quantity controls from shrinking or overlapping. */
body#cart .product-line__quantity-button .quantity-button__group {
  display: grid;
  grid-template-columns: 44px minmax(40px, 1fr) 44px;
  width: 100%;
  min-width: 128px;
  height: 44px;
  isolation: isolate;
}

body#cart .product-line__quantity-button .quantity-button__group > .btn {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--os-line, #dbe2e9);
  background: #fff;
  color: var(--os-ink, #172238);
}

body#cart .product-line__quantity-button .quantity-button__group > .btn:first-child { border-radius: 10px 0 0 10px; }
body#cart .product-line__quantity-button .quantity-button__group > .btn:last-child { border-radius: 0 10px 10px 0; }
body#cart .product-line__quantity-button .quantity-button__group > .btn:hover { background: var(--os-soft, #f8fafc); }
body#cart .product-line__quantity-button .quantity-button__group > input {
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 0;
  margin: 0;
  padding: 0 4px;
  border: 1px solid var(--os-line, #dbe2e9);
  border-inline: 0;
  border-radius: 0;
  background: #fff;
  color: var(--os-ink, #172238);
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

body#cart .product-line__quantity-button .quantity-button__group > :focus-visible { z-index: 2; outline: 2px solid var(--os-ink, #172238); outline-offset: 2px; }

body#cart .product-line__actions {
  grid-column: 3;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
}

body#cart .product-line__actions :is(.js-remove-from-cart, [data-service-remove]) {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 8px;
  font-size: 0;
  border: 0;
  background: transparent;
  color: var(--ostrzalnia-steel, #5f6a72);
  text-decoration: none;
  transition: color .18s ease, background-color .18s ease;
}

body#cart .product-line__actions :is(.js-remove-from-cart, [data-service-remove])::before,
body#cart .product-line__actions :is(.js-remove-from-cart, [data-service-remove])::after {
  content: '';
  position: absolute;
  inset: 10px;
  width: 24px;
  height: 24px;
  background: currentColor;
  pointer-events: none;
}

body#cart .product-line__actions :is(.js-remove-from-cart, [data-service-remove])::before {
  -webkit-mask: url('../img/trash-body.svg') center / contain no-repeat;
  mask: url('../img/trash-body.svg') center / contain no-repeat;
}

body#cart .product-line__actions :is(.js-remove-from-cart, [data-service-remove])::after {
  -webkit-mask: url('../img/trash-lid.svg') center / contain no-repeat;
  mask: url('../img/trash-lid.svg') center / contain no-repeat;
  transform-origin: 19px 5px;
  transition: transform .22s ease;
}

body#cart .product-line__actions :is(.js-remove-from-cart, [data-service-remove]):is(:hover, :focus-visible, :active) {
  color: var(--ostrzalnia-price, #d2071d);
  background: #fff0f1;
}

body#cart .product-line__actions :is(.js-remove-from-cart, [data-service-remove]):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

body#cart .product-line__actions :is(.js-remove-from-cart, [data-service-remove]):is(:hover, :focus-visible, :active)::after {
  transform: translateY(-2px) rotate(22deg);
}

@media (max-width: 767.98px) {
  body#cart .product-line { gap: .75rem; }
  body#cart .product-line__img { width: 4.5rem; }
  body#cart .product-line__content {
    grid-template-columns: minmax(0, 1fr) 2.75rem;
    gap: .75rem .5rem;
  }
  body#cart .product-line__content-left { grid-column: 1; }
  body#cart .product-line__content-right { grid-column: 1; }
  body#cart .product-line__quantity-button { width: 100%; max-width: 9rem; }
  body#cart .product-line__actions {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  body#cart .product-line__actions :is(.js-remove-from-cart, [data-service-remove]),
  body#cart .product-line__actions :is(.js-remove-from-cart, [data-service-remove])::after { transition: none; }
}

/* Service tools follow the same quantity / line price / remove layout as retail. */
body#cart .ostrzalnia-cart-service__items .ost-cart-service-row {
  display:grid;grid-template-columns:minmax(0,1fr) 9rem 2.75rem;gap:1rem;align-items:start;padding:1.25rem 0;
}
body#cart .ost-cart-service-row__amount {min-width:0;display:grid;gap:.55rem;justify-items:start}
body#cart .ost-cart-service-row__amount .product-line__quantity-button {width:9rem;max-width:100%}
body#cart .ostrzalnia-cart-service__price {display:block;max-width:none;text-align:left}
body#cart :is(.product-line__price,.ostrzalnia-cart-service__price) {color:var(--ostrzalnia-orange-text,#c94f00);font-size:1.25rem;font-weight:700;line-height:1.4;font-variant-numeric:tabular-nums}
body#cart .product-line__item--prices:empty {display:none}
body#cart .ostrzalnia-cart-group-title {font-size:1.05rem;font-weight:700;color:var(--os-ink,#172238)}
body#cart [data-cart-service-items][aria-busy=true] :is(button,input) {pointer-events:none;opacity:.5}
body#cart .product-line__quantity-button .quantity-button__group > .btn:disabled {color:#94a3b8;cursor:not-allowed;background:#f8fafc}
@media(max-width:767.98px) {
  body#cart .ostrzalnia-cart-service__items .ost-cart-service-row {grid-template-columns:minmax(0,1fr) 2.75rem;gap:.75rem .5rem}
  body#cart .ost-cart-service-row__amount {grid-column:1}
  body#cart .ost-cart-service-row .product-line__actions {grid-column:2;grid-row:1 / span 2;align-self:end}
}
