/* Kadence Child – checkout tiles (mobile-first) */
.kfs-tile{
  display:grid;
  grid-template-columns:20px 32px 1fr;
  align-items:center;
  padding:10px 14px;
  background:#f7f7f7;
  border:1px solid #dcdcdc;
  border-radius:4px;
  margin-bottom:12px;
  cursor:pointer;
}
.kfs-tile input[type="radio"]{
  margin:0;width:20px;height:20px;
}
.kfs-tile .kfs-logo img, .kfs-tile img.kfs-logo{
  width:32px;height:32px;object-fit:contain;
}
@media(min-width:600px){
  /* desktop – extra column for choose-point button (Paczkomat plugin) handled by plugin styles */
}
/* Cart totals fix */
.cart_totals .woocommerce-shipping-totals td{padding-left:0!important;}
.cart_totals .woocommerce-shipping-totals ul li{width:100%;}

/* Payment tiles – FIXED horizontal layout */
.woocommerce ul.payment_methods li{
  display: flex !important;
  flex-direction: row !important; /* Force horizontal layout */
  align-items: center !important;
  width:100%;
  background:#f7f7f7;
  border:1px solid #dcdcdc;
  border-radius:4px;
  padding:10px 14px;
  margin-bottom:12px;
}
.woocommerce ul.payment_methods li > label {
  display: flex !important;
  flex-direction: row !important; /* Force horizontal layout */
  align-items: center !important;
  gap: 10px;
  writing-mode: horizontal-tb !important; /* force horizontal */
  text-orientation: mixed !important;
  direction: ltr !important;
  white-space: normal !important;
  width: 100%;
  flex: 1;
}
.woocommerce ul.payment_methods li input[type="radio"]{
  width:20px;
  height:20px;
  margin:0;
  flex-shrink: 0;
}
.woocommerce ul.payment_methods li img{
  width:32px;
  height:32px;
  object-fit:contain;
  flex-shrink: 0;
}

/* Adjust shipping list width */
.kfs-shipping{width:100%;}
.kfs-shipping .kfs-tile{width:100%;}

/* Hide verbose payment description and ensure horizontal text */
.payment_method_p24-online-payments .payment_box{display:none !important;}
.payment_box, .payment_box *{
  writing-mode:horizontal-tb !important;
  text-orientation: mixed !important;
  direction: ltr !important;
}

/* Force horizontal for ALL payment methods */
.wc_payment_method,
.wc_payment_method.payment_method_p24-online-payments,
.wc_payment_method.payment_method_p24-blik{
  width:100% !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
}
.wc_payment_method > label,
.wc_payment_method.payment_method_p24-online-payments > label,
.wc_payment_method.payment_method_p24-blik > label{
  writing-mode:horizontal-tb !important;
  text-orientation: mixed !important;
  direction: ltr !important;
  transform:none !important;
  display:flex !important;
  flex-direction: row !important;
  align-items:center !important;
  gap:8px;
  padding:10px 14px;
  width:100%;
  flex: 1;
}
.wc_payment_method.payment_method_p24-online-payments img,
.wc_payment_method.payment_method_p24-blik img{
  width:32px;
  height:32px;
  object-fit:contain;
}

/* Paczkomat choose-point button under list */
.easypack-parcel-machine-select{
  float:none !important;
  text-align:left !important;
  margin-top:12px;
}

/* Move InPost choose point button under list, left aligned */
#easypack_show_geowidget{margin-top:12px;display:inline-block;}

/* CRITICAL: Force horizontal layout for ALL payment method labels */
.payment_method_p24-online-payments > label,
.payment_method_p24-blik > label,
.woocommerce ul.payment_methods li label,
.wc_payment_method label{
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  direction: ltr !important;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px;
  width: auto;
  min-width: 0;
}

/* Prevent any vertical text layout */
.payment_method_p24-online-payments,
.payment_method_p24-blik,
.wc_payment_method{
  max-width: none !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  direction: ltr !important;
}

/* ===============================================================
   INPOST BUTTON FIX: Move "Wybierz punkt odbioru" to left side
   =============================================================== */

/* InPost choose point button - repositioned */
.easypack_show_geowidget,
#easypack_show_geowidget,
.easypack_show_geowidget_modal,
#easypack_js_type_geowidget {
  float: none !important;
  display: block !important;
  margin: 12px 0 0 0 !important;
  text-align: left !important;
  max-width: 200px !important;
  width: auto !important;
  clear: both !important;
}

/* Fix for shipping method rows with InPost button */
.woocommerce-shipping-methods li {
  position: relative;
  overflow: visible !important;
}

/* Ensure button appears below the shipping option */
.woocommerce-shipping-methods li .easypack_show_geowidget {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  width: auto !important;
  margin-top: 8px !important;
}

/* Alternative approach for both checkout and cart */
li:has(.easypack_show_geowidget) {
  flex-wrap: wrap !important;
}

.easypack_show_geowidget {
  flex-basis: 100% !important;
  order: 999 !important;
}

/* ===============================================================
   CART SHIPPING METHODS FIX: Better alignment & layout
   =============================================================== */

/* Cart shipping methods list styling */
.woocommerce-cart .cart_totals .woocommerce-shipping-methods {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.woocommerce-cart .cart_totals .woocommerce-shipping-methods li {
  display: block !important;
  max-width: 100% !important;
  background: #f7f7f7 !important;
  border: 1px solid #dcdcdc !important;
  border-radius: 4px !important;
  padding: 10px 14px !important;
  margin-bottom: 8px !important;
  position: relative !important;
  overflow: visible !important;
}

.woocommerce-cart .cart_totals .woocommerce-shipping-methods li input[type="radio"] {
  width: 20px !important;
  height: 20px !important;
  margin: 0 10px 0 0 !important;
  flex-shrink: 0 !important;
}

.woocommerce-cart .cart_totals .woocommerce-shipping-methods li label {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex: 1 !important;
  margin: 0 !important;
  white-space: normal !important;
}

.woocommerce-cart .cart_totals .woocommerce-shipping-methods li img {
  width: 32px !important;
  height: 32px !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
}

/* Fix InPost button in cart */
.woocommerce-cart .easypack_show_geowidget {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  margin-top: 8px !important;
  width: auto !important;
  max-width: 200px !important;
}

/* Ensure enough space for the button below shipping options */
.woocommerce-cart .cart_totals .woocommerce-shipping-methods li:has(.easypack_show_geowidget) {
  margin-bottom: 50px !important;
}

/* ===============================================================
   CHECKOUT SHIPPING METHODS FIX: Better alignment & layout
   =============================================================== */

/* Checkout shipping methods - consistent with cart */
.woocommerce-checkout .woocommerce-shipping-methods li {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  background: #f7f7f7 !important;
  border: 1px solid #dcdcdc !important;
  border-radius: 4px !important;
  margin-bottom: 12px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 12px 10px !important;
}

.woocommerce-checkout .woocommerce-shipping-methods li input[type="radio"] {
  flex: 0 0 20px !important;
  margin: 0 !important;
  width: 20px !important;
  height: 20px !important;
}

.woocommerce-checkout .woocommerce-shipping-methods li label {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  align-items: center !important;
  column-gap: 6px !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  white-space: normal !important;
  word-break: break-word !important;
  margin: 0 !important;
  padding: 0 !important;
}

.woocommerce-checkout .woocommerce-shipping-methods li label img {
  flex: none !important;
  width: 24px !important;
  height: 24px !important;
  object-fit: contain !important;
}

/* Fix InPost button in checkout */
.woocommerce-checkout .easypack_show_geowidget {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  margin-top: 8px !important;
  width: auto !important;
  max-width: 200px !important;
}

/* Ensure enough space for the button below shipping options */
.woocommerce-checkout .woocommerce-shipping-methods li:has(.easypack_show_geowidget) {
  margin-bottom: 50px !important;
}

/* ===== 2025-06-14 EXTRA FIXES ===== */

/* Keep totals row in one line (checkout & cart) */
.woocommerce-checkout-review-order-table tfoot .order-total td,
.woocommerce-cart .cart_totals .order-total td,
.order-total td {
  white-space: nowrap !important;
}

/* InPost choose-point button left-aligned, no overflow */
.easypack_show_geowidget,
#easypack_show_geowidget,
#easypack_js_type_geowidget {
  position: static !important;
  display: inline-block !important;
  margin: 12px 0 0 0 !important;
  max-width: 100% !important;
  text-align: left !important;
}

/* Ensure shipping list is full width on mobile & prevent overflow */
@media (max-width: 600px) {
  .woocommerce-checkout .woocommerce-shipping-methods li,
  .woocommerce-cart .cart_totals .woocommerce-shipping-methods li {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 10px !important;
  }
  /* Button responsive */
  .easypack_show_geowidget,
  #easypack_show_geowidget,
  #easypack_js_type_geowidget {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    float: none !important;
    margin: 12px 0 !important;
    box-sizing: border-box !important;
  }
  /* Order total cell padding */
  .woocommerce-checkout-review-order-table tfoot .order-total th,
  .woocommerce-checkout-review-order-table tfoot .order-total td {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}

/* ===== Cart totals shipping width fix ===== */
.woocommerce-cart .cart_totals .woocommerce-shipping-methods,
.woocommerce-cart .cart_totals .woocommerce-shipping-methods li {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Ensure order-total row spans full width inside cart_totals */
.cart_totals .order-total td,
.cart_totals .order-total th {
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Cart shipping cell padding fix */
.cart_totals .woocommerce-shipping-totals td {
  padding-right: 0 !important;
}

/* Force li flex-basis */
.cart_totals .woocommerce-shipping-methods li {
  flex: 0 0 100% !important;
}

/* ===============================================================
   CART SHIPPING VISIBILITY TWEAK – 2025-06-15-b
   Przywraca pełną widoczność etykiet w kafelkach metod wysyłki.
   =============================================================== */
/* Powrót do dynamicznego układu kolumn */
.woocommerce-cart .cart_totals table{
  table-layout:auto !important;
}
/* Zezwól na widoczność zawartości komórki */
.woocommerce-cart .cart_totals .woocommerce-shipping-totals td:last-child{
  overflow:visible !important;
}
/* Kafelki i etykiety – łamanie wierszy zamiast obcinania */
.woocommerce-cart .cart_totals .woocommerce-shipping-methods li,
.woocommerce-cart .cart_totals .woocommerce-shipping-methods li label{
  white-space:normal !important;
  overflow:visible !important;
  flex-wrap:wrap !important;
}

/* ===============================================================
   CART SHIPPING TILE FLEX LAYOUT – 2025-06-15-c
   • Flex-box układ z wymuszonym zawijaniem długich etykiet.
   • Kafelki zostają w obrębie prawej kolumny bez obcinania.
   =============================================================== */
/* Ustaw tabelę znów na fixed – zapobiega rozciąganiu kolumn */
.woocommerce-cart .cart_totals table { table-layout: fixed !important; }

/* Komórka z listą wysyłek wykorzystuje pełną szerokość, bez marginesów */
.woocommerce-cart .cart_totals .woocommerce-shipping-totals td:last-child {
  width: 100% !important;
  max-width: 100% !important;
  padding-right: 0 !important;
}

/* Kontener <li> – kafelek wysyłki */
.woocommerce-cart .cart_totals .woocommerce-shipping-methods li {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  box-sizing: border-box !important;
  gap: 8px !important;              /* odstęp pomiędzy elementami */
}

/* Radio button – stała szerokość */
.woocommerce-cart .cart_totals .woocommerce-shipping-methods li input[type="radio"] {
  flex: 0 0 20px !important;        /* nie rośnie, nie kurczy */
  margin: 0 !important;
}

/* Label – elastyczny, z możliwością zawijania */
.woocommerce-cart .cart_totals .woocommerce-shipping-methods li label {
  flex: 1 1 auto !important;        /* wypełnia pozostałe miejsce */
  min-width: 0 !important;          /* pozwala textowi się kurczyć/wrapować */
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: normal !important;   /* pozwala na zawijanie */
  word-wrap: break-word !important;
}

/* Logo – stała szerokość, nie wypycha tekstu */
.woocommerce-cart .cart_totals .woocommerce-shipping-methods li img {
  flex: 0 0 26px !important;
  width: 26px !important;
  height: 26px !important;
  object-fit: contain !important;
}

/* ===============================================================
   CART SHIPPING TILE – GRID LABEL 2025-06-15-d
   • Etykieta (label) jako 2-kolumnowa siatka: 1fr (tekst) + auto (logo).
   • Tekst może się zawijać, logo trzyma się prawej krawędzi kafelka.
   • Dodatkowo delikatnie zmniejszamy font-size, by zmieścić długie nazwy.
   =============================================================== */
.woocommerce-cart .cart_totals .woocommerce-shipping-methods li label{
  display:grid !important;
  grid-template-columns: 1fr auto !important;
  align-items:center !important;
  column-gap:6px !important;
  font-size:14px !important;      /* mniejsze, ale wciąż czytelne */
  line-height:1.4 !important;
}

/* Upewnij się, że logo w label nie kurczy tekstu */
.woocommerce-cart .cart_totals .woocommerce-shipping-methods li label img{
  width:24px !important;
  height:24px !important;
  flex:none !important;
}

/* ===============================================================
   DESKTOP (≥992 px) – PROSTE LISTY WYSYŁKI 2025-06-15-e
   Przywracamy klasyczny, nie-kafelkowy wygląd opcji wysyłki
   tylko dla desktopu, aby długie teksty mieściły się w kolumnie.
   =============================================================== */
@media (min-width: 992px){
  /* ===== FINAL DESKTOP TILE LAYOUT ===== */
  .woocommerce-cart .cart_totals .woocommerce-shipping-totals td.shipping:last-child{
    display:block!important;
    padding:0!important;
  }
  
  .woocommerce-cart .cart_totals .woocommerce-shipping-methods{
    width:100%!important;
    list-style:none;
    margin:0!important;
    padding:0!important;
  }
  
  .woocommerce-cart .cart_totals .woocommerce-shipping-methods li{
    width:100%!important;
    box-sizing:border-box!important;
    background:#ffffff!important;
    border:1px solid #bfbfbf!important;
    border-radius:0!important;
    margin-bottom:12px!important;
    display:flex!important;
    align-items:center!important;
    gap:10px!important;
    padding:5px 0!important;
    position:relative!important;
  }
  
  .woocommerce-cart .cart_totals .woocommerce-shipping-methods li input[type="radio"]{
    flex:0 0 20px!important;
    margin:0!important;
    width:20px!important;
    height:20px!important;
  }
  
  .woocommerce-cart .cart_totals .woocommerce-shipping-methods li label{
    flex:1 1 auto!important;
    min-width:0!important;
    display:flex!important;
    align-items:center!important;
    gap:8px!important;
    font-size:14px!important;
    line-height:1.4!important;
    white-space:normal!important;
    word-break:break-word!important;
    margin:0!important;
    padding:0!important;
  }
  
  .woocommerce-cart .cart_totals .woocommerce-shipping-methods li label img{
    flex:none!important;
    width:24px!important;
    height:24px!important;
    object-fit:contain!important;
    position:static!important;
    transform:none!important;
    margin:0!important;
  }
  
  /* Usuń absolutne pozycjonowanie logo */
  .woocommerce-cart .cart_totals .woocommerce-shipping-methods li{
    padding-right:0!important;
  }
  
  /* Zapewnij, że InPost button jest pod opcją */
  .woocommerce-cart .cart_totals .woocommerce-shipping-methods li:has(.easypack_show_geowidget) {
    margin-bottom: 50px !important;
  }
  
  /* Ikona InPost po prawej, nie wychodzi poza kafelek */
  .woocommerce-cart .cart_totals .woocommerce-shipping-methods li .kfs-logo{
    flex:none!important;
    margin-left:auto!important;
    position:static!important;
  }
  .woocommerce-cart .cart_totals .woocommerce-shipping-methods li .kfs-logo img{
    width:24px!important;
    height:24px!important;
    object-fit:contain!important;
  }
}

/* ================= MOBILE CHECKOUT REVIEW TABLE FIX ================= */
@media(max-width:600px){
  /* Hide th and make td block */
  .woocommerce-checkout-review-order-table tr.shipping > th{display:none!important;}
  .woocommerce-checkout-review-order-table tr.shipping > td{
    display:block!important;
    width:100%!important;
    padding:0!important;
  }
  /* List 100% */
  .woocommerce-checkout-review-order-table .woocommerce-shipping-methods,
  .woocommerce-checkout-review-order-table .woocommerce-shipping-methods li{
    width:100%!important;
    max-width:100%!important;
  }
  /* ensure review-order table can expand */
  .woocommerce-checkout-review-order-table{table-layout:auto!important;}
  /* full-width choose-point button */
  .woocommerce-checkout .easypack_show_geowidget{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    white-space:normal!important;
  }
  /* add bottom margin under shipping UL for button not to overlap */
  .woocommerce-checkout-review-order-table .woocommerce-shipping-methods{margin-bottom:10px!important;}
}

/* ================= MOBILE CHECKOUT – full-width columns & components (2025-06-15-g) ================= */
@media (max-width:600px){
  /* Hide table header row – frees 1st column */
  .woocommerce-checkout-review-order-table thead{display:none!important;}

  /* Let table auto size – no fixed 50/50 split */
  .woocommerce-checkout-review-order-table{
    width:100%!important;
    table-layout:auto!important;
  }
  /* Allow cells to wrap long text/values */
  .woocommerce-checkout-review-order-table td{
    white-space:normal!important;
    word-break:break-word!important;
  }

  /* Shipping method list occupies full width */
  .woocommerce-checkout-review-order-table .woocommerce-shipping-methods,
  .woocommerce-checkout-review-order-table .woocommerce-shipping-methods li{
    width:100%!important;
    max-width:100%!important;
  }

  /* Paczkomat choose-point button below list, full width */
  .woocommerce-checkout .easypack_show_geowidget{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    margin-top:8px!important;
    white-space:normal!important;
  }

  /* Margin below list so button doesn't overlap separator */
  .woocommerce-checkout-review-order-table .woocommerce-shipping-methods{margin-bottom:10px!important;}
}

/* === 2025-06-16 MOBILE CHECKOUT POLISH === */
/* Prevent line-break inside prices (e.g. 65,00 zł) */
.woocommerce-checkout-review-order-table .woocommerce-Price-amount bdi {
  white-space: nowrap !important;
}

/* Mobile: make each shipping tile occupy full width and hide the separate price column */
@media (max-width: 768px) {
  .woocommerce-checkout .woocommerce-shipping-methods li {
    width: 100% !important;
    display: block !important;
  }
  /* (2025-06-16) DO NOT hide entire shipping cell – it contains the radio list */
}

/* === 2025-06-16 CHECKOUT SHIPPING TILE STYLE === */
.woocommerce-checkout .woocommerce-shipping-methods li{
  width:100%!important;
  max-width:100%!important;
  box-sizing:border-box!important;
  background:#f7f7f7!important;
  border:1px solid #dcdcdc!important;
  border-radius:4px!important;
  margin-bottom:12px!important;
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  padding:12px 10px!important;
}
.woocommerce-checkout .woocommerce-shipping-methods li input[type="radio"]{
  flex:0 0 20px!important;
  margin:0!important;
  width:20px!important;
  height:20px!important;
}
.woocommerce-checkout .woocommerce-shipping-methods li label{
  flex:1 1 auto!important;
  min-width:0!important;
  display:grid!important;
  grid-template-columns:1fr auto!important;
  align-items:center!important;
  column-gap:6px!important;
  font-size:14px!important;
  line-height:1.4!important;
  white-space:normal!important;
  word-break:break-word!important;
  margin:0!important;
  padding:0!important;
}
.woocommerce-checkout .woocommerce-shipping-methods li label img{
  flex:none!important;
  width:24px!important;
  height:24px!important;
  object-fit:contain!important;
}

/* Force shipping row break-out below items (mobile) */
@media(max-width:600px){
  .woocommerce-checkout-review-order-table tr.shipping{
    display:block!important;
  }
  .woocommerce-checkout-review-order-table tr.shipping > td{
    display:block!important;
    width:100%!important;
  }
}


