/* Koszyk i zamówienie (Woo + moduły Divi) w stylu sklepu: czarne przyciski-pigułki, pola-pigułki, spokojne komunikaty.
   Moduły Divi mają własne kolory i rozmiary, stąd !important. */

/* pola: przeglądarka nie podmienia tła przy autouzupełnianiu (żółte) */
body.woocommerce-checkout input:-webkit-autofill,
body.woocommerce-checkout input:-webkit-autofill:hover,
body.woocommerce-checkout input:-webkit-autofill:focus,
body.woocommerce-checkout select:-webkit-autofill,
body.woocommerce-account input:-webkit-autofill,
body.woocommerce-cart input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  box-shadow: 0 0 0 1000px #fff inset !important;
  -webkit-text-fill-color: #111 !important;
  caret-color: #111;
  transition: background-color 9999s ease-out 0s;
}

/* przyciski: czarne pigułki */
body.woocommerce-cart .et_pb_button,
body.woocommerce-cart .button,
body.woocommerce-cart a.checkout-button,
body.woocommerce-checkout .et_pb_button,
body.woocommerce-checkout .button,
body.woocommerce-checkout #place_order {
  height: auto;
  min-height: 0;
  padding: 3px 26px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #111 !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 1.6 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
body.woocommerce-cart .et_pb_button:hover,
body.woocommerce-cart .button:hover,
body.woocommerce-checkout .et_pb_button:hover,
body.woocommerce-checkout #place_order:hover { background: #3a3a3c !important; }
body.woocommerce-cart .button::after,
body.woocommerce-cart .et_pb_button::after,
body.woocommerce-checkout .et_pb_button::after,
body.woocommerce-checkout #place_order::after { display: none !important; }
body.woocommerce-cart .button:disabled,
body.woocommerce-cart .button[disabled] { background: #c8c8cc !important; opacity: 1; cursor: not-allowed; }
/* "Kupuję i płacę" i "Przejdź do płatności" na całą szerokość kolumny, pod polem zgody */
body.woocommerce-checkout #place_order,
body.woocommerce-cart a.checkout-button { display: inline-flex !important; float: none !important; width: auto; }
body.woocommerce-checkout #payment .place-order { padding: 0 !important; margin: 20px 0 0; }

/* pole zgody na regulamin: osobny wiersz nad przyciskiem */
body.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper { margin: 0 0 4px; }
body.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper .form-row { display: block; margin: 0 !important; padding: 0 !important; }
body.woocommerce-checkout .woocommerce-form__label-for-checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.5; color: #424245; }
body.woocommerce-checkout .woocommerce-form__label-for-checkbox input { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; }
body.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper a,
body.woocommerce-checkout .woocommerce-privacy-policy-text a { color: #0066cc !important; }
body.woocommerce-checkout .woocommerce-privacy-policy-text { font-size: 13px; line-height: 1.6; color: #6e6e73; }
body.woocommerce-checkout .woocommerce-privacy-policy-text p { margin: 0 0 14px; padding: 0; }

/* komunikaty (brak metod płatności, kupon, błędy): szare, bez niebieskiego bloku */
body.woocommerce-checkout .woocommerce-info,
body.woocommerce-checkout .woocommerce-message,
body.woocommerce-checkout li.woocommerce-notice,
body.woocommerce-cart .woocommerce-info,
body.woocommerce-cart .woocommerce-message {
  margin: 0 0 20px !important; padding: 16px 20px !important; border: 0 !important; border-radius: 14px;
  background: #f5f5f7 !important; color: #1d1d1f !important; font-size: 15px !important; line-height: 1.6 !important; list-style: none;
}
body.woocommerce-checkout .woocommerce-error,
body.woocommerce-cart .woocommerce-error {
  margin: 0 0 20px !important; padding: 16px 20px 16px 36px !important; border: 0 !important; border-radius: 14px;
  background: #fdecee !important; color: #1d1d1f !important; font-size: 15px; line-height: 1.6;
}
body.woocommerce-checkout .woocommerce-info::before,
body.woocommerce-checkout .woocommerce-message::before,
body.woocommerce-cart .woocommerce-info::before,
body.woocommerce-cart .woocommerce-message::before { display: none !important; }
body.woocommerce-checkout .woocommerce-info a,
body.woocommerce-cart .woocommerce-info a { color: #0066cc; }

/* nagłówki sekcji równo z polami */
body.woocommerce-checkout .et_pb_wc_checkout_billing h3,
body.woocommerce-checkout .et_pb_wc_checkout_order_details h3,
body.woocommerce-checkout #order_review_heading { padding-left: 0 !important; font-size: 22px; font-weight: 600; color: #1d1d1f; }

/* pole ilości w koszyku jak na karcie produktu */
body.woocommerce-cart .quantity input.qty {
  width: 84px !important; height: 44px; padding: 0 12px !important; text-align: center;
  border: 1px solid #c8c8c8 !important; border-radius: 999px !important; background: #fff !important; font-size: 16px !important;
}
body.woocommerce-cart input[type="text"][name="coupon_code"] {
  height: 50px; padding: 0 20px !important; border: 1px solid #c8c8c8 !important; border-radius: 999px !important; background: #fff !important;
}

/* rozmiar napisów w przyciskach i linkach przy komunikatach (Divi na telefonie nadpisuje mniejszym) */
body.woocommerce-checkout #page-container .et_pb_section [class*="et_pb_wc_checkout_payment_info"] #payment #place_order,
body.woocommerce-checkout #et-boc #payment #place_order,
body.woocommerce-checkout #et-boc #payment .button,
body.woocommerce-cart #et-boc .cart_totals a.checkout-button,
body.woocommerce-cart #et-boc .actions .button { font-size: 16px !important; letter-spacing: 0 !important; }
body.woocommerce-checkout .woocommerce-info a,
body.woocommerce-checkout .woocommerce-info { font-size: 15px !important; font-weight: 400; }

/* padding przycisków: selektory Divi (moduł płatności i koszyka) mają własny padding z !important - przebijamy ich specyficzność */
body.woocommerce-checkout #page-container .et_pb_section [class*="et_pb_wc_checkout_payment_info"] #payment #place_order,
body.woocommerce-checkout #page-container .et_pb_section [class*="et_pb_wc_checkout"] .button,
body.woocommerce-cart #page-container .et_pb_section [class*="et_pb_wc_cart"] .button,
body.woocommerce-cart #page-container .et_pb_section [class*="et_pb_wc_cart"] a.checkout-button {
  padding: 3px 26px !important;
  line-height: 1.6 !important;
  height: auto !important;
  min-height: 0 !important;
}

/* "Kupuję i płacę": przycisk główny - pigułka 40 px na całą szerokość kolumny (wyjątek od zwartych przycisków) */
body.woocommerce-checkout #page-container .et_pb_section [class*="et_pb_wc_checkout_payment_info"] #payment #place_order,
body.woocommerce-checkout #et-boc #payment #place_order {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px !important;
  padding: 0 32px !important;
  line-height: 1.2 !important;
}

/* wybór wysyłki: przyciski-pigułki jak "Kupuję jako" (zaznaczony = czarny); zdanie o aktualizacji metod ukryte */
#et-boc ul#shipping_method { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 !important; padding: 0 !important; list-style: none; }
#et-boc ul#shipping_method li { margin: 0 !important; padding: 0 !important; list-style: none; }
#et-boc ul#shipping_method li input.shipping_method { position: absolute; opacity: 0; pointer-events: none; }
#et-boc ul#shipping_method li label {
  display: inline-block; margin: 0 !important; padding: 3px 26px !important; border: 1px solid #c8c8c8; border-radius: 999px;
  background: #fff; color: #111 !important; font-size: 15px !important; font-weight: 500 !important; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
#et-boc ul#shipping_method li label .amount,
#et-boc ul#shipping_method li label bdi { font-weight: 700; }
#et-boc ul#shipping_method li input.shipping_method:checked + label { background: #111; border-color: #111; color: #fff !important; }
#et-boc ul#shipping_method li input.shipping_method:focus-visible + label { outline: 2px solid #0066cc; outline-offset: 2px; }
#et-boc ul#shipping_method li:only-child label { cursor: default; }
/* jedna jedyna metoda: bez pigułki wyboru - sam tekst */
#et-boc tr.woocommerce-shipping-totals td > p,
#et-boc tr.shipping td > p,
#et-boc tr.woocommerce-shipping-totals td > .woocommerce-shipping-destination,
#et-boc tr.woocommerce-shipping-totals td > small { display: none !important; }

/* podsumowanie zamówienia: stałe proporcje kolumn (produkt szeroki, kwota wąska); wysyłka w osobnym wierszu na całą szerokość,
   żeby pigułki wyboru nie rozpychały kolumny z kwotą kosztem nazwy produktu */
#et-boc table.woocommerce-checkout-review-order-table { table-layout: fixed; width: 100%; }
#et-boc table.woocommerce-checkout-review-order-table th.product-name,
#et-boc table.woocommerce-checkout-review-order-table td.product-name { width: 68%; }
#et-boc table.woocommerce-checkout-review-order-table th.product-total,
#et-boc table.woocommerce-checkout-review-order-table td.product-total { width: 32%; text-align: right; white-space: nowrap; }
#et-boc table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals { display: block; border-top: 1px solid #e5e5ea; }
#et-boc table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals th,
#et-boc table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals td { display: block; width: 100% !important; border: 0; text-align: left; white-space: normal; }
#et-boc table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals th { padding-bottom: 6px; }
#et-boc table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals td { padding-top: 0; }
#et-boc table.woocommerce-checkout-review-order-table td.product-name .product-quantity { white-space: nowrap; }

/* kwoty w wierszach sum wyrównane do prawej jak kwota produktu; na telefonie pigułki wysyłki na całą szerokość */
#et-boc table.woocommerce-checkout-review-order-table tfoot tr:not(.woocommerce-shipping-totals) th { width: 68%; }
#et-boc table.woocommerce-checkout-review-order-table tfoot tr:not(.woocommerce-shipping-totals) td { width: 32%; text-align: right; white-space: nowrap; }
@media (max-width: 600px) {
  #et-boc ul#shipping_method { flex-direction: column; align-items: stretch; }
  #et-boc ul#shipping_method li label { display: block; width: 100%; box-sizing: border-box; padding: 6px 20px !important; }
}

/* podsumowanie zamówienia w układzie flex (zamiast tabeli): każdy wiersz na całą szerokość, wysyłka zawsze w pełnej szerokości */
#et-boc table.woocommerce-checkout-review-order-table,
#et-boc table.woocommerce-checkout-review-order-table thead,
#et-boc table.woocommerce-checkout-review-order-table tbody,
#et-boc table.woocommerce-checkout-review-order-table tfoot { display: block; width: 100%; }
#et-boc table.woocommerce-checkout-review-order-table tr { display: flex; flex-wrap: wrap; width: 100%; box-sizing: border-box; }
#et-boc table.woocommerce-checkout-review-order-table th,
#et-boc table.woocommerce-checkout-review-order-table td { box-sizing: border-box; }
#et-boc table.woocommerce-checkout-review-order-table th.product-name,
#et-boc table.woocommerce-checkout-review-order-table td.product-name,
#et-boc table.woocommerce-checkout-review-order-table tfoot tr:not(.woocommerce-shipping-totals) th { flex: 1 1 0; min-width: 0; width: auto; }
#et-boc table.woocommerce-checkout-review-order-table th.product-total,
#et-boc table.woocommerce-checkout-review-order-table td.product-total,
#et-boc table.woocommerce-checkout-review-order-table tfoot tr:not(.woocommerce-shipping-totals) td { flex: 0 0 auto; width: auto; min-width: 96px; text-align: right; white-space: nowrap; }
#et-boc table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals { display: block; }
#et-boc table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals th,
#et-boc table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals td { display: block; width: 100% !important; flex: none; }
