/* ============================================================
   Webbing — WooCommerce cart/checkout mobile layout fixes (v1.0.44)
   ============================================================ */

/* Общая защита WooCommerce-блоков от выхода за контейнер */
.webbing-cart .woocommerce,
.webbing-cart .woocommerce-cart-form,
.webbing-cart .cart-collaterals,
.webbing-cart .cart_totals,
.webbing-checkout .woocommerce,
.webbing-checkout form.checkout.woocommerce-checkout,
.webbing-checkout #customer_details,
.webbing-checkout .webbing-order-block,
.webbing-checkout #order_review_heading,
.webbing-checkout #order_review,
.webbing-checkout .woocommerce-checkout-review-order,
.webbing-checkout #payment {
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100%;
  box-sizing: border-box !important;
}

.webbing-cart,
.webbing-checkout {
  overflow-x: hidden;
}

/* Корзина: итоговая таблица не должна наследовать карточную мобильную раскладку товаров */
.webbing-cart .cart_totals {
  overflow: hidden;
}

.webbing-cart .cart_totals table.shop_table {
  width: 100% !important;
  table-layout: auto !important;
  border-collapse: collapse !important;
}

.webbing-cart .cart_totals table.shop_table tbody tr,
.webbing-cart .cart_totals table.shop_table tr {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 10px 14px !important;
  align-items: start !important;
  width: 100% !important;
}

.webbing-cart .cart_totals table.shop_table th,
.webbing-cart .cart_totals table.shop_table td {
  display: block !important;
  min-width: 0 !important;
  max-width: none !important;
  width: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  overflow-wrap: anywhere;
  word-break: normal;
}

.webbing-cart .cart_totals table.shop_table th {
  justify-self: start;
  text-align: left !important;
}

.webbing-cart .cart_totals table.shop_table td {
  justify-self: end;
  text-align: right !important;
  white-space: normal !important;
}

.webbing-cart .cart_totals table.shop_table .order-total td {
  white-space: nowrap !important;
}

.webbing-cart .cart_totals table.shop_table .shipping,
.webbing-cart .cart_totals table.shop_table .woocommerce-shipping-totals {
  grid-template-columns: 1fr !important;
}

.webbing-cart .cart_totals table.shop_table .shipping td,
.webbing-cart .cart_totals table.shop_table .woocommerce-shipping-totals td {
  justify-self: stretch !important;
  text-align: left !important;
  max-width: 100% !important;
}

.webbing-cart .cart_totals .shipping ul,
.webbing-cart .cart_totals .woocommerce-shipping-methods {
  width: 100%;
}

/* Checkout: поля, Select2 и блок оплаты не должны расширять колонку */
.webbing-checkout #customer_details,
.webbing-checkout #customer_details .col-1,
.webbing-checkout #customer_details .col-2 {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.webbing-checkout .woocommerce-billing-fields,
.webbing-checkout .woocommerce-shipping-fields,
.webbing-checkout .woocommerce-additional-fields {
  padding: 20px !important;
  box-sizing: border-box !important;
}

.webbing-checkout .form-row,
.webbing-checkout #payment .form-row {
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.webbing-checkout .form-row input.input-text,
.webbing-checkout .form-row input[type="text"],
.webbing-checkout .form-row input[type="email"],
.webbing-checkout .form-row input[type="tel"],
.webbing-checkout .form-row input[type="number"],
.webbing-checkout .form-row select,
.webbing-checkout .form-row textarea,
.webbing-checkout .select2-container,
.webbing-checkout .select2-container--default .select2-selection--single {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.webbing-checkout .select2-container {
  width: 100% !important;
}

.webbing-checkout .select2-container--default .select2-selection--single {
  display: flex !important;
  align-items: center !important;
  padding: 0 38px 0 14px !important;
}

.webbing-checkout .select2-container--default .select2-selection--single .select2-selection__rendered {
  padding: 0 !important;
  line-height: 1.4 !important;
  min-width: 0 !important;
}

.webbing-checkout .select2-container--default .select2-selection--single .select2-selection__arrow {
  right: 10px !important;
}

/* Checkout: блок заказа/оплаты */
.webbing-checkout .webbing-order-block,
.webbing-checkout .woocommerce-checkout-review-order {
  overflow: hidden;
}

.webbing-checkout .webbing-order-block * {
  min-width: 0;
}

.webbing-checkout .woocommerce-checkout-review-order-table {
  width: 100% !important;
  max-width: 100% !important;
}

.webbing-checkout .woocommerce-checkout-review-order-table th,
.webbing-checkout .woocommerce-checkout-review-order-table td {
  overflow-wrap: anywhere;
}

.webbing-checkout .woocommerce-checkout-review-order-table .product-name {
  min-width: 0 !important;
  width: auto !important;
}

.webbing-checkout .woocommerce-checkout-review-order-table .product-total {
  width: auto !important;
  min-width: max-content !important;
  white-space: nowrap !important;
}

.webbing-checkout #payment {
  overflow: hidden;
}

.webbing-checkout #payment ul.payment_methods,
.webbing-checkout #payment .place-order {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.webbing-checkout #payment .payment_box {
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-wrap: anywhere;
}

@media (max-width: 1024px) {
  .webbing-checkout form.checkout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 18px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .webbing-checkout form.checkout .webbing-order-block,
  .webbing-checkout form.checkout #order_review_heading,
  .webbing-checkout form.checkout #order_review,
  .webbing-checkout form.checkout #customer_details {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }

  .webbing-checkout .webbing-order-block {
    position: static !important;
  }
}

@media (max-width: 768px) {
  .webbing-checkout .container,
  .webbing-cart .container {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .webbing-cart .cart_totals,
  .webbing-checkout #customer_details,
  .webbing-checkout .webbing-order-block {
    width: 100% !important;
  }

  .webbing-checkout form.checkout #order_review_heading {
    padding: 24px 24px 14px !important;
  }

  .webbing-checkout .woocommerce-checkout-review-order {
    padding: 0 24px 24px !important;
  }

  .webbing-checkout #payment .payment_box {
    padding-left: 0 !important;
  }
}

@media (max-width: 480px) {
  .webbing-checkout .container,
  .webbing-cart .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .webbing-cart .cart_totals,
  .webbing-checkout #customer_details,
  .webbing-checkout .webbing-order-block {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .webbing-cart .cart_totals table.shop_table tbody tr,
  .webbing-cart .cart_totals table.shop_table tr {
    grid-template-columns: minmax(0, 1fr) max-content !important;
    gap: 8px 10px !important;
  }

  .webbing-cart .cart_totals table.shop_table .shipping,
  .webbing-cart .cart_totals table.shop_table .woocommerce-shipping-totals {
    grid-template-columns: 1fr !important;
  }

  .webbing-checkout form.checkout #order_review_heading {
    padding: 22px 22px 12px !important;
  }

  .webbing-checkout .woocommerce-checkout-review-order {
    padding: 0 22px 22px !important;
  }
}
