/* Wrapper całego koszyka */
.custom-cart-wrapper {
  border: 4px solid var(--wp--preset--color--fiolet);
  border-radius: 20px;
  padding: 40px;
}

/* Tytuł */
.custom-cart-title {
  margin: 0 0 16px 0;
}

/* Szary separator */
.cart-separator {
  border: 0;
  border-top: 1px solid rgba(22, 22, 22, 0.2);
  margin: 20px 0;
}

/* Brak borderów w shop_table */
.shop_table,
.shop_table th,
.shop_table td,
.shop_table thead th,
.shop_table tbody tr,
.shop_table tfoot th,
.shop_table tfoot td {
  border: 0 !important;
  box-shadow: none !important;
}
.shop_table { border-collapse: collapse; border-spacing: 0; }

/* Układ totals: desktop vs mobile */
.totals-label--mobile { 
    display: none;
 }

.totals-label__gross { 
    margin: 0; 
    margin-bottom: 8px;
} 

.totals-label__net {
  font-size: 15px;
  color: rgba(22, 22, 22, 0.4);
  line-height: 1.2;
}

/* Tabela koszyka — bez miniatury */
.custom-cart-table th.product-thumbnail,
.custom-cart-table td.product-thumbnail {
  display: none !important;
}

.custom-cart-table .product-name{
    font-weight: 600;
}

/* Ukrycie zbędnych kontenerów */
.shop_table .actions { display: none !important; }
.cart-collaterals .cart_totals { display: none !important; }


/* Dopasowanie układu po usunięciu thumbnaila */
.custom-cart-table th,
.custom-cart-table td {
  vertical-align: middle;
}

/* --- Kontroler ilości: − [input] + --- */
.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

/* przyciski minus/plus */
.qty-btn {
  padding: 12px;
  border: unset;
  background: transparent;
  line-height: 1;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.qty-btn:focus {outline: unset;}

/* wrapper Woo */
.quantity.quantity--styled {
  display: inline-flex;
  align-items: center;
}

/* sam input qty */
.quantity .qty {
  width: 46px;
  height: 46px;
  text-align: center;
  border: 1px solid rgba(22, 22, 22, 0.4);
  border-radius: 10px;
  padding: 0;
  appearance: textfield;
  -moz-appearance: textfield;
}
.quantity .qty::-webkit-outer-spin-button,
.quantity .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* zmniejsz czcionkę labelki screen-reader-only */
.quantity label.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }

td.product-quantity { white-space: nowrap; }

/* Wiersz sum */
.custom-cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 50px;
  margin: 48px 0 0 0;
}

/* Totals */
.custom-cart-row--totals .totals-left .totals-label {
  font-weight: 600;
  line-height: 1.2;
}
.custom-cart-row--totals .totals-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.cart-grand-total {
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 600;
}

/* Kupony + przyciski z prawej */
.custom-cart-row--coupons-buttons .coupons-left {
  flex: 1;
}
.custom-cart-row--coupons-buttons .custom-coupon {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  position: relative;
}
.custom-cart-row--coupons-buttons .custom-coupon .input-text {
  min-width: 220px;
}
.custom-cart-row--coupons-buttons .buttons-right {
  display: flex;
  gap: 12px;
}


/* input #coupon_code */
.custom-coupon #coupon_code.input-text {
  height: 46px;
  border: 1px solid rgba(22, 22, 22, 0.2);
  border-radius: 40px;
  padding: 0 30px;
  font-size: 14px;
  line-height: 46px; /* lepsza pionowa optyka tekstu */
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}

.applied-coupons{
  margin: 16px 0;
}

.applied-coupons .coupon-label{
  display: block;
}

.applied-coupons .coupon-html{
  display: block;
  color: var(--wp--preset--color--fiolet);
}

/* --- Przycisk "Zastosuj kupon" nachodzi na input od prawej (desktop) --- */
@media (min-width: 1001px) {
    .custom-coupon .custom-btn {
        position: absolute;
        right: 6px;                
        top: 50%;
        transform: translateY(-50%);
        z-index: 1;
    }
    .custom-cart-row--coupons-buttons .coupons-left {
        max-width: 400px;
    }
    .custom-coupon #coupon_code.input-text{
         padding-right: 170px;
    }
}


@media (max-width: 768px) {
  .custom-cart-row {
    flex-direction: column;
    align-items: stretch;
    margin-top: 0;
  }
  .custom-cart-row--totals .totals-right,
  .custom-cart-row--coupons-buttons .buttons-right {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  /* chowamy lewy label */
  .totals-label--desktop { display: none; }

  /* pokazujemy label nad sumą (po prawej) */
  .totals-label--mobile { display: block; }

  /* układ sekcji  koncowej ceny */
  .custom-cart-row--totals .totals-right {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 48px;
    align-items: start;
    justify-items: start;
    margin-bottom: 50px;
  }
  /* zawartość każdego <td> układamy w kolumnie */
  .woocommerce-page .shop_table.shop_table_responsive tr td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    text-align: left !important;
    padding: 1em 40px;
    margin: 0 -40px;
  }
}
