/*
 * Mobile cart and checkout refinement.
 * Intentionally page-scoped: this sheet is loaded only for the cart and checkout.
 */
@media (max-width: 767px) {
  body.woocommerce-cart.uzsoft-mp-cart-enabled,
  body.woocommerce-checkout.uzsoft-mp-v2 {
    background: #f8fafc;
  }

  /* Three steps stay visible as one compact control, rather than a scrollable pill. */
  body.woocommerce-cart.uzsoft-mp-cart-enabled .woo-page-header.page-header-8,
  body.woocommerce-checkout.uzsoft-mp-v2 .woo-page-header.page-header-8 {
    padding: 12px 0 8px;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .woo-page-header.page-header-8 .breadcrumb,
  body.woocommerce-checkout.uzsoft-mp-v2 .woo-page-header.page-header-8 .breadcrumb,
  body.woocommerce-cart.uzsoft-mp-cart-enabled .page-top .breadcrumb,
  body.woocommerce-checkout.uzsoft-mp-v2 .page-top .breadcrumb,
  body.woocommerce-checkout.uzsoft-mp-v2 .checkout-breadcrumbs {
    display: flex;
    flex-wrap: nowrap;
    width: calc(100% - 24px);
    max-width: 520px;
    gap: 3px;
    align-items: stretch;
    overflow: visible;
    margin: 0 auto;
    padding: 3px;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .woo-page-header.page-header-8 .breadcrumb > li,
  body.woocommerce-checkout.uzsoft-mp-v2 .woo-page-header.page-header-8 .breadcrumb > li,
  body.woocommerce-cart.uzsoft-mp-cart-enabled .page-top .breadcrumb > li,
  body.woocommerce-checkout.uzsoft-mp-v2 .page-top .breadcrumb > li,
  body.woocommerce-checkout.uzsoft-mp-v2 .checkout-breadcrumbs > * {
    min-width: 0;
    flex: 1 1 0;
    justify-content: center;
    gap: 0;
    font-size: 12px;
    text-align: center;
    white-space: normal;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .woo-page-header.page-header-8 .breadcrumb > li > a,
  body.woocommerce-checkout.uzsoft-mp-v2 .woo-page-header.page-header-8 .breadcrumb > li > a,
  body.woocommerce-cart.uzsoft-mp-cart-enabled .page-top .breadcrumb > li > a,
  body.woocommerce-checkout.uzsoft-mp-v2 .page-top .breadcrumb > li > a,
  body.woocommerce-checkout.uzsoft-mp-v2 .checkout-breadcrumbs a {
    display: flex;
    min-width: 0;
    min-height: 44px;
    width: 100%;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    font-size: inherit;
    line-height: 1.2;
    white-space: normal;
    border-radius: 8px;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .woo-page-header.page-header-8 .breadcrumb .delimiter,
  body.woocommerce-checkout.uzsoft-mp-v2 .woo-page-header.page-header-8 .breadcrumb .delimiter,
  body.woocommerce-cart.uzsoft-mp-cart-enabled .page-top .breadcrumb .delimiter,
  body.woocommerce-checkout.uzsoft-mp-v2 .page-top .breadcrumb .delimiter {
    display: none !important;
  }

  /* Cart: the product card is the sole frame; the form itself stays unframed. */
  body.woocommerce-cart.uzsoft-mp-cart-enabled .woocommerce {
    width: 100%;
    max-width: 520px;
    padding: 12px 0 28px;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .page-content .elementor > .e-con {
    padding-inline: 0;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .woocommerce > .featured-box,
  body.woocommerce-cart.uzsoft-mp-cart-enabled .woocommerce > .featured-box > .box-content,
  body.woocommerce-cart.uzsoft-mp-cart-enabled .cart-collaterals > .featured-box,
  body.woocommerce-cart.uzsoft-mp-cart-enabled .cart-collaterals > .featured-box > .box-content {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .woocommerce-cart-form {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart,
  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart tbody,
  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart td {
    display: block;
    width: 100%;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart thead {
    display: none;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart tr.cart_item {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(0, 1fr);
    position: relative;
    margin-bottom: 10px;
    padding: 12px;
    border-color: #dbe3ee;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart .product-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: auto;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart .product-remove a {
    width: 44px;
    height: 44px;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart tr.cart_item td.product-thumbnail {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 64px;
    margin: 0;
    padding: 0;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart .product-thumbnail img {
    width: 64px;
    height: 64px;
    padding: 6px;
  }

  /* Porto may place the thumbnail in the name cell; do not constrain its title. */
  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart tr.cart_item td.product-name {
    grid-column: 1 / -1;
    min-height: 76px;
    padding: 0 0 8px 76px;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart .product-name > a {
    max-width: none;
    width: 100%;
    padding-right: 34px;
    font-size: 16px;
    line-height: 1.35;
    text-align: left;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart .product-name:has(.product-thumbnail) > a:not(.product-thumbnail) {
    display: block;
    padding-left: 80px;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart .product-price,
  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart .product-quantity,
  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart .product-subtotal {
    min-height: 48px;
    gap: 10px;
    border-top: 1px solid #eef2f7;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart tr.cart_item td.product-price {
    grid-column: 1 / -1;
    min-height: 28px;
    padding: 0 0 10px 76px;
    border-top: 0;
    justify-content: flex-start;
    color: #475569;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart tr.cart_item td.product-quantity {
    justify-content: flex-start;
    padding: 12px 0 0;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart tr.cart_item td.product-subtotal {
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    padding: 12px 0 0;
    text-align: right;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .uzsoft-mp-cart-notice {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart .product-price::before,
  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart .product-quantity::before {
    display: none;
  }

  /* Porto hides the automatic-update button but otherwise leaves a 170px empty row. */
  body.woocommerce-cart.uzsoft-mp-cart-enabled table.cart tr:has(.update-button-hidden):not(:has(.coupon)) {
    display: none;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart .product-price .amount,
  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart .product-subtotal .amount,
  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart .amount {
    font-variant-numeric: tabular-nums;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart .quantity {
    min-height: 44px;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart .quantity .minus,
  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart .quantity .plus {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart .quantity .qty {
    min-height: 44px;
    font-size: 16px;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart td.actions .coupon .input-text,
  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart td.actions button.button,
  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart td.actions button[name="update_cart"] {
    min-height: 48px;
    font-size: 16px;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .cart-collaterals {
    margin-top: 12px;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .cart-collaterals .cart_totals {
    padding: 16px;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .cart-collaterals .checkout-button {
    min-height: 52px;
    padding: 13px 16px;
    font-size: 16px;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .cart_totals .cart-total,
  body.woocommerce-cart.uzsoft-mp-cart-enabled .cart_totals .cart-total tbody {
    display: block;
    width: 100%;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .cart_totals table.cart-total tr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .cart_totals table.cart-total th,
  body.woocommerce-cart.uzsoft-mp-cart-enabled .cart_totals table.cart-total td {
    display: block;
    width: auto;
    padding: 12px 0;
    border: 0;
    font-size: 15px;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .cart_totals table.cart-total td::before {
    display: none;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .cart_totals table.cart-total .amount {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .cart_totals .wc-proceed-to-checkout {
    margin: 0;
    padding-top: 12px;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .uzsoft-mp-payment-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .uzsoft-mp-payment-chips strong {
    width: 100%;
    margin: 0 0 4px;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .uzsoft-mp-cart-trust {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .uzsoft-mp-cart-trust > span {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 8px;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled .uzsoft-mp-cart-trust small {
    width: 100%;
    font-size: 11px;
    line-height: 1.4;
  }

  /* Checkout: remove Elementor's fixed outer gutter and keep a single 12px page inset. */
  body.woocommerce-checkout.uzsoft-mp-v2 .elementor-widget-shortcode,
  body.woocommerce-checkout.uzsoft-mp-v2 .elementor-widget-shortcode > .elementor-widget-container {
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    margin: 0 !important;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 #main .page-content {
    padding-top: 12px;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 .woocommerce {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 .woocommerce-form-login-toggle,
  body.woocommerce-checkout.uzsoft-mp-v2 form.woocommerce-form-login,
  body.woocommerce-checkout.uzsoft-mp-v2 .woocommerce-NoticeGroup,
  body.woocommerce-checkout.uzsoft-mp-v2 .woocommerce-notices-wrapper {
    width: 100%;
    max-width: 520px;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 #customer_details {
    display: block !important;
    margin: 0;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 #customer_details > .col-lg-7,
  body.woocommerce-checkout.uzsoft-mp-v2 #customer_details > .col-lg-5 {
    width: 100% !important;
    margin: 0 0 12px;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 #customer_details > .col-lg-7 > .align-left,
  body.woocommerce-checkout.uzsoft-mp-v2 #customer_details > .col-lg-5 > .align-left {
    padding: 16px;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
  }

  body.woocommerce-checkout.uzsoft-mp-v2 #order_review,
  body.woocommerce-checkout.uzsoft-mp-v2 #customer_details .box-content {
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 .woocommerce-billing-fields > h3,
  body.woocommerce-checkout.uzsoft-mp-v2 #order_review_heading {
    margin-bottom: 14px;
    font-size: 20px;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 .form-row {
    margin-bottom: 14px;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 .form-row label {
    margin-bottom: 6px;
    font-size: 14px;
    text-transform: none;
    letter-spacing: 0;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 .input-text,
  body.woocommerce-checkout.uzsoft-mp-v2 select,
  body.woocommerce-checkout.uzsoft-mp-v2 textarea {
    min-height: 52px;
    padding: 12px 14px;
    font-size: 16px !important;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 .uzsecure-checkout-note {
    margin: 0 0 12px !important;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 .uzsoft-mp-checkout-contact-items {
    margin-top: 16px;
    padding-top: 16px;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 .uzsoft-mp-checkout-contact-item {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 .uzsoft-mp-checkout-contact-item__image {
    width: 58px;
    height: 54px;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 .uzsoft-mp-checkout-contact-item__name {
    font-size: 14px;
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 .uzsoft-mp-checkout-contact-item__subtotal {
    grid-column: 2;
    font-variant-numeric: tabular-nums;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 .uzsoft-mp-checkout-contact-totals strong {
    font-variant-numeric: tabular-nums;
  }

  /* Native payment controls retain their inputs; the label becomes the full tap target. */
  body.woocommerce-checkout.uzsoft-mp-v2 #payment .wc_payment_methods {
    padding: 0 !important;
    border: 0;
    background: transparent;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 #payment .wc_payment_method {
    margin: 0 0 8px;
    padding: 0;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #fff;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 #payment .wc_payment_method:has(input:checked) {
    border-color: #4f46e5;
    background: #eef2ff;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, .12);
  }

  body.woocommerce-checkout.uzsoft-mp-v2 #payment .porto-radio label,
  body.woocommerce-checkout.uzsoft-mp-v2 #payment .wc_payment_method > label {
    display: flex;
    min-height: 52px;
    align-items: center;
    padding: 12px 12px 12px 44px;
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 #payment .porto-radio:has(input:checked) label {
    color: #3730a3;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 #payment .porto-radio {
    margin: 0;
    padding: 0;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 #payment .porto-radio label::before {
    left: 12px;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 #payment .porto-radio label::after {
    left: 16px;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 #payment .wc_payment_method:focus-within {
    outline: 2px solid #4f46e5;
    outline-offset: 3px;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 #payment label img {
    max-width: 84px;
    max-height: 28px;
    object-fit: contain;
    margin-left: auto;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 .woocommerce-form__label-for-checkbox {
    min-height: 44px;
    line-height: 1.5;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 #payment .payment_box {
    margin: 0 12px 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .78);
  }

  body.woocommerce-checkout.uzsoft-mp-v2 #payment .woocommerce-terms-and-conditions-wrapper {
    margin-top: 14px;
  }

  body.woocommerce-checkout.uzsoft-mp-v2 #payment #place_order {
    min-height: 52px;
    padding: 13px 16px;
    font-size: 16px !important;
  }
}

@media (max-width: 359px) {
  /* Keep the 44px quantity targets and the price separate on narrow phones. */
  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart tr.cart_item td.product-quantity,
  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart tr.cart_item td.product-subtotal {
    grid-column: 1 / -1;
  }

  body.woocommerce-cart.uzsoft-mp-cart-enabled table.shop_table.cart tr.cart_item td.product-subtotal {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
