/*
 * Cart and checkout layout overrides.
 * Loaded after WooCommerce styles so legacy float rules cannot win.
 */

body.pc-cart-page-body .pc-page > .pc-container,
body.pc-checkout-page-body .pc-page > .pc-container,
body.pc-thankyou-page-body .pc-page > .pc-container {
  width: 100% !important;
  max-width: 1280px !important;
  margin-right: auto !important;
  margin-left: auto !important;
  padding-right: 24px !important;
  padding-left: 24px !important;
}

body.pc-cart-page-body .pc-store-content,
body.pc-checkout-page-body .pc-store-content,
body.pc-thankyou-page-body .pc-store-content,
body.pc-cart-page-body .woocommerce,
body.pc-checkout-page-body .woocommerce,
body.pc-thankyou-page-body .woocommerce {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

/* Cart: use flex tracks instead of WooCommerce's legacy floated columns. */
body.pc-cart-page-body .pc-cart__grid {
  display: flex !important;
  width: 100% !important;
  align-items: flex-start !important;
  gap: 40px !important;
}

body.pc-cart-page-body .pc-cart__items {
  flex: 1 1 0 !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
}

body.pc-cart-page-body .pc-cart__summary {
  flex: 0 0 360px !important;
  width: 360px !important;
  max-width: 360px !important;
  min-width: 320px !important;
}

body.pc-cart-page-body .pc-cart__summary .cart-collaterals,
body.pc-cart-page-body .pc-cart__summary .cart_totals,
body.pc-cart-page-body .woocommerce .cart-collaterals,
body.pc-cart-page-body .woocommerce .cart-collaterals .cart_totals {
  display: block !important;
  clear: both !important;
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

body.pc-cart-page-body .pc-cart__summary .cart_totals {
  overflow: visible !important;
  padding: 24px !important;
}

body.pc-cart-page-body .pc-cart__summary .shop_table {
  display: table !important;
  width: 100% !important;
  table-layout: fixed !important;
  margin: 0 !important;
}

body.pc-cart-page-body .pc-cart__summary .shop_table tbody {
  display: table-row-group !important;
}

body.pc-cart-page-body .pc-cart__summary .shop_table tr {
  display: table-row !important;
}

body.pc-cart-page-body .pc-cart__summary .shop_table th,
body.pc-cart-page-body .pc-cart__summary .shop_table td {
  display: table-cell !important;
  width: 50% !important;
  padding: 14px 8px !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
}

body.pc-cart-page-body .pc-cart__summary .shop_table th {
  padding-left: 0 !important;
}

body.pc-cart-page-body .pc-cart__summary .shop_table td {
  padding-right: 0 !important;
  text-align: right !important;
}

body.pc-cart-page-body .pc-cart__summary #shipping_method,
body.pc-cart-page-body .pc-cart__summary #shipping_method li,
body.pc-cart-page-body .pc-cart__summary #shipping_method label {
  width: 100% !important;
  max-width: 100% !important;
  white-space: normal !important;
}

/* Checkout: stable main/details and order-summary columns. */
body.pc-checkout-page-body .pc-checkout {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

body.pc-checkout-page-body .pc-checkout__form,
body.pc-checkout-page-body .pc-checkout__grid {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body.pc-checkout-page-body .pc-checkout__grid {
  display: flex !important;
  align-items: flex-start !important;
  gap: 40px !important;
}

body.pc-checkout-page-body .pc-checkout__main {
  display: block !important;
  flex: 1 1 0 !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
}

body.pc-checkout-page-body .pc-checkout__side {
  display: block !important;
  flex: 0 0 400px !important;
  width: 400px !important;
  max-width: 400px !important;
  min-width: 340px !important;
}

body.pc-checkout-page-body .pc-checkout__main > .pc-panel,
body.pc-checkout-page-body .pc-checkout__side > .pc-panel,
body.pc-checkout-page-body .pc-checkout #customer_details,
body.pc-checkout-page-body .pc-checkout #customer_details > .col-1,
body.pc-checkout-page-body .pc-checkout #customer_details > .col-2 {
  clear: both !important;
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

body.pc-checkout-page-body .pc-checkout #customer_details {
  display: flex !important;
  flex-direction: column !important;
  gap: 24px !important;
}

body.pc-checkout-page-body .pc-checkout #customer_details > .pc-checkout__details-card {
  display: block !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 26px !important;
}

body.pc-checkout-page-body .pc-checkout #customer_details > .pc-checkout__details-card > h2 {
  margin: 0 0 20px !important;
  padding-bottom: 14px !important;
  border-bottom: 1px solid var(--pc-line) !important;
}

body.pc-checkout-page-body .pc-checkout .woocommerce-billing-fields > h3 {
  display: none !important;
}

body.pc-checkout-page-body .pc-checkout .woocommerce-shipping-fields > h3 {
  display: block !important;
  margin: 0 0 18px !important;
  font-size: 1rem !important;
}

body.pc-checkout-page-body .pc-checkout .woocommerce-shipping-fields > h3 label {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  margin: 0 !important;
  cursor: pointer !important;
}

body.pc-checkout-page-body .pc-checkout .woocommerce-shipping-fields > h3 input {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  margin: 0 !important;
}

body.pc-checkout-page-body .pc-checkout .form-row,
body.pc-checkout-page-body .pc-checkout .form-row-first,
body.pc-checkout-page-body .pc-checkout .form-row-last,
body.pc-checkout-page-body .pc-checkout .form-row-wide,
body.pc-checkout-page-body .pc-checkout .woocommerce-input-wrapper,
body.pc-checkout-page-body .pc-checkout input,
body.pc-checkout-page-body .pc-checkout select,
body.pc-checkout-page-body .pc-checkout textarea,
body.pc-checkout-page-body .pc-checkout .select2-container {
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body.pc-checkout-page-body .pc-checkout .pc-panel h2,
body.pc-checkout-page-body .pc-checkout .pc-panel h3,
body.pc-checkout-page-body .pc-checkout .pc-panel p,
body.pc-checkout-page-body .pc-checkout .pc-panel li,
body.pc-checkout-page-body .pc-checkout .pc-panel label {
  width: auto !important;
  max-width: 100% !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
}

/* Compact payment choices: one full-width row per method, logo above label. */
body.pc-checkout-page-body .pc-checkout #payment ul.payment_methods {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
  margin: 14px 0 !important;
  padding: 0 !important;
}

body.pc-checkout-page-body .pc-checkout #payment li.wc_payment_method {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  border: 1px solid var(--pc-line) !important;
  border-radius: var(--pc-radius-lg) !important;
  background: var(--pc-bg) !important;
}

body.pc-checkout-page-body .pc-checkout #payment li.wc_payment_method.pc-pay-selected {
  border-color: var(--pc-orange) !important;
  background: var(--pc-orange-soft) !important;
}

body.pc-checkout-page-body .pc-checkout #payment li.wc_payment_method > input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

body.pc-checkout-page-body .pc-checkout #payment li.wc_payment_method > label {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  text-align: center !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

body.pc-checkout-page-body .pc-checkout #payment li.wc_payment_method > label img {
  display: block !important;
  order: -1 !important;
  width: auto !important;
  height: 28px !important;
  max-width: 120px !important;
  margin: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
}

body.pc-checkout-page-body .pc-checkout #payment .payment_box {
  display: none !important;
}

body.pc-checkout-page-body .pc-checkout #payment .payment_box p:last-child {
  margin-bottom: 0 !important;
}

body.pc-checkout-page-body,
body.pc-checkout-page-body .site,
body.pc-checkout-page-body .pc-page,
body.pc-checkout-page-body .pc-store-content,
body.pc-checkout-page-body .woocommerce,
body.pc-checkout-page-body .woocommerce-checkout,
body.pc-checkout-page-body .woocommerce-checkout-review-order,
body.pc-checkout-page-body #order_review,
body.pc-checkout-page-body #payment {
  max-width: 100% !important;
  min-width: 0 !important;
}

body.pc-checkout-page-body {
  overflow-x: clip !important;
}

body.pc-checkout-page-body .pc-checkout table,
body.pc-checkout-page-body .pc-checkout .shop_table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}

body.pc-checkout-page-body .pc-checkout th,
body.pc-checkout-page-body .pc-checkout td {
  min-width: 0 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

@media (max-width: 1100px) {
  body.pc-cart-page-body .pc-cart__grid,
  body.pc-checkout-page-body .pc-checkout__grid {
    display: block !important;
  }

  body.pc-cart-page-body .pc-cart__summary,
  body.pc-checkout-page-body .pc-checkout__side {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-top: 30px !important;
  }

  body.pc-checkout-page-body .pc-panel--sticky {
    position: static !important;
  }
}

@media (max-width: 720px) {
  body.pc-cart-page-body .pc-page > .pc-container,
  body.pc-checkout-page-body .pc-page > .pc-container,
  body.pc-thankyou-page-body .pc-page > .pc-container {
    padding-right: 16px !important;
    padding-left: 16px !important;
  }

  body.pc-checkout-page-body .pc-checkout__steps {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body.pc-checkout-page-body .pc-checkout__steps li {
    min-width: 0 !important;
    font-size: 0.75rem !important;
  }

  body.pc-checkout-page-body .pc-checkout__steps span {
    flex: 0 0 auto !important;
  }

  body.pc-checkout-page-body .pc-checkout #customer_details > .pc-checkout__details-card {
    padding: 18px !important;
  }

  body.pc-checkout-page-body .pc-checkout .pc-panel,
  body.pc-cart-page-body .pc-cart__summary .cart_totals {
    padding: 18px !important;
  }
}