/*
 * WooCommerce mobile UX regression recovery.
 * Keeps conservative readability/tap improvements while removing risky table rewrites.
 */

body.woocommerce-checkout .ll-terms-inline-summary{
  margin:8px 0 0;
  color:var(--muted);
  font-size:.94rem;
  line-height:1.55;
}

body.woocommerce-checkout .ll-terms-inline-summary a{
  color:var(--lime);
  text-decoration:underline;
  text-underline-offset:.15em;
}

@media (max-width:1200px){
  body.woocommerce-cart .wp-block-woocommerce-cart :is(.wc-block-cart__sidebar,.wc-block-components-sidebar){
    min-width:0;
  }
}

@media (max-width:980px){
  /* Checkout pages should never be clipped by global Woo overflow rules. */
  body.woocommerce-checkout.woocommerce-page{
    overflow-x:clip !important;
  }

  @supports not (overflow:clip){
    body.woocommerce-checkout.woocommerce-page{
      overflow-x:hidden !important;
    }
  }

  body.woocommerce-checkout .woocommerce,
  body.woocommerce-checkout form.checkout,
  body.woocommerce-checkout #customer_details,
  body.woocommerce-checkout #order_review_heading,
  body.woocommerce-checkout #order_review,
  body.woocommerce-checkout .woocommerce-checkout-review-order,
  body.woocommerce-checkout .woocommerce-checkout-review-order-table,
  body.woocommerce-checkout #payment{
    min-width:0;
    max-width:100%;
    width:100%;
    box-sizing:border-box;
  }

  /* Internal fallback: allow review panel to scroll instead of clipping the page. */
  body.woocommerce-checkout .woocommerce-checkout-review-order{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }
}

@media (max-width:700px){
  /* Force Woo notice icon dots to stay visible on mobile. */
  body.woocommerce-page :is(.woocommerce-message,.woocommerce-info,.woocommerce-error){
    position:relative;
    padding-left:48px !important;
  }

  body.woocommerce-page :is(.woocommerce-message,.woocommerce-info,.woocommerce-error)::before{
    content:"" !important;
    display:block !important;
    visibility:visible !important;
    opacity:1 !important;
    position:absolute !important;
    left:18px !important;
    top:50% !important;
    transform:translateY(-50%) !important;
    width:14px !important;
    height:14px !important;
    border-radius:50% !important;
    border:2px solid var(--notice-accent,var(--lime)) !important;
    background:#0B0B0B !important;
    box-shadow:
      0 0 0 3px var(--notice-glow,rgba(167,210,45,.2)) !important,
      0 0 10px rgba(167,210,45,.35) !important;
    pointer-events:none;
  }

  body.woocommerce-page .woocommerce-error::before{
    box-shadow:
      0 0 0 3px var(--notice-glow,rgba(214,75,75,.2)) !important,
      0 0 10px rgba(214,75,75,.35) !important;
  }

  body.woocommerce-checkout .ll-checkout-header:before{
    opacity:var(--ll-mobile-glow-opacity);
  }

  body.woocommerce-checkout .ll-checkout-header:after{
    opacity:.45;
  }

  body.woocommerce-checkout .ll-checkout-header .ll-cart-header__actions,
  body.woocommerce-checkout .woocommerce-billing-fields,
  body.woocommerce-checkout .woocommerce-shipping-fields,
  body.woocommerce-checkout .woocommerce-additional-fields,
  body.woocommerce-checkout .woocommerce-checkout-review-order,
  body.woocommerce-checkout #payment{
    box-shadow:var(--ll-mobile-elevation);
    border-radius:14px;
  }

  body.woocommerce-checkout .woocommerce,
  body.woocommerce-checkout form.checkout,
  body.woocommerce-checkout #customer_details,
  body.woocommerce-checkout #order_review,
  body.woocommerce-checkout .woocommerce-checkout-review-order,
  body.woocommerce-checkout #payment{
    min-width:0;
    max-width:100%;
    width:100%;
    box-sizing:border-box;
  }

  body.woocommerce-checkout,
  body.woocommerce-checkout.woocommerce-page,
  body.woocommerce-checkout .ct-page-title,
  body.woocommerce-checkout .ct-content-container,
  body.woocommerce-checkout .ct-content-area,
  body.woocommerce-checkout .content-area,
  body.woocommerce-checkout .site-main,
  body.woocommerce-checkout main.site-main,
  body.woocommerce-checkout .ct-order-review,
  body.woocommerce-checkout #order_review,
  body.woocommerce-checkout .woocommerce-checkout-review-order{
    overflow-x:clip !important;
    min-width:0;
    max-width:100%;
  }

  @supports not (overflow:clip){
    body.woocommerce-checkout,
    body.woocommerce-checkout.woocommerce-page,
    body.woocommerce-checkout .ct-page-title,
    body.woocommerce-checkout .ct-content-container,
    body.woocommerce-checkout .ct-content-area,
    body.woocommerce-checkout .content-area,
    body.woocommerce-checkout .site-main,
    body.woocommerce-checkout main.site-main,
    body.woocommerce-checkout .ct-order-review,
    body.woocommerce-checkout #order_review,
    body.woocommerce-checkout .woocommerce-checkout-review-order{
      overflow-x:hidden !important;
    }
  }

  body.woocommerce-checkout .woocommerce-billing-fields,
  body.woocommerce-checkout .woocommerce-shipping-fields,
  body.woocommerce-checkout .woocommerce-additional-fields,
  body.woocommerce-checkout .woocommerce-checkout-review-order{
    padding:18px 14px 14px;
  }

  body.woocommerce-checkout .form-row label{
    font:700 .86rem/1.35 Inter,Montserrat,sans-serif;
    letter-spacing:.03em;
    text-transform:none;
    color:var(--ll-mobile-muted);
  }

  body.woocommerce-checkout .woocommerce-form__label{
    font-size:.96rem;
    letter-spacing:.01em;
  }

  body.woocommerce-checkout .woocommerce-checkout-review-order-table{
    width:100%;
    max-width:100%;
    min-width:0;
    table-layout:fixed !important;
    overflow:hidden !important;
  }

  body.woocommerce-checkout .woocommerce-checkout-review-order-table tr:not(.woocommerce-shipping-totals):not(.shipping) > :is(th,td):first-child{
    width:68%;
    max-width:68%;
  }

  body.woocommerce-checkout .woocommerce-checkout-review-order-table tr:not(.woocommerce-shipping-totals):not(.shipping) > :is(th,td):last-child{
    width:32%;
    max-width:32%;
    text-align:right;
  }

  body.woocommerce-checkout .woocommerce-checkout-review-order-table tr:is(.woocommerce-shipping-totals,.shipping) > :is(th,td){
    width:auto;
    max-width:none;
  }

  body.woocommerce-checkout .woocommerce-checkout-review-order-table tr:is(.woocommerce-shipping-totals,.shipping) > td{
    text-align:left;
    overflow-wrap:normal;
    word-break:normal;
  }

  body.woocommerce-checkout .woocommerce-checkout-review-order-table th,
  body.woocommerce-checkout .woocommerce-checkout-review-order-table td{
    padding:8px 6px;
    font-size:.84rem;
    line-height:1.3;
    overflow-wrap:anywhere;
    word-break:break-word;
  }

  body.woocommerce-checkout .woocommerce-checkout-review-order-table thead th{
    font-size:.62rem;
    letter-spacing:.06em;
  }

  body.woocommerce-checkout .woocommerce-checkout-review-order-table .product-name{
    white-space:normal;
    overflow-wrap:anywhere;
    word-break:break-word;
  }

  body.woocommerce-checkout .woocommerce-checkout-review-order-table .product-total,
  body.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot td:last-child,
  body.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot .amount{
    white-space:nowrap;
    width:auto;
    text-align:right;
  }

  body.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot td:last-child > strong{
    white-space:nowrap;
  }

  body.woocommerce-checkout .woocommerce-checkout-review-order-table small.includes_tax{
    display:block;
    margin-top:4px;
    white-space:normal;
    overflow-wrap:anywhere;
    word-break:break-word;
    text-align:right;
  }

  body.woocommerce-checkout .woocommerce-shipping-totals li{
    display:flex;
    align-items:flex-start;
    flex-wrap:wrap;
    gap:8px;
    line-height:1.45;
  }

  body.woocommerce-checkout .woocommerce-shipping-totals li input[type="radio"]{
    flex:0 0 auto;
    margin-top:3px;
  }

  body.woocommerce-checkout .woocommerce-shipping-totals li label{
    flex:1 1 220px;
    min-width:0;
    white-space:normal;
    overflow-wrap:break-word;
    word-break:normal;
  }

  body.woocommerce-checkout .woocommerce-shipping-totals li :is(.amount,.woocommerce-Price-amount){
    margin-left:auto;
    flex:0 0 auto;
    white-space:nowrap;
  }

  body.woocommerce-checkout #payment ul.payment_methods{
    gap:10px;
  }

  body.woocommerce-checkout #payment ul.payment_methods li{
    padding:12px 10px;
  }

  body.woocommerce-checkout #payment ul.payment_methods li label{
    font:700 .9rem/1.45 Inter,Montserrat,sans-serif;
    letter-spacing:.03em;
    text-transform:none;
  }

  /* Bank Deposit mobile: centered panel + hidden native radio + custom indicator. */
  body.woocommerce-checkout #payment{
    overflow:hidden;
  }

  body.woocommerce-checkout .woocommerce-checkout-payment{
    margin-inline:0 !important;
  }

  body.woocommerce-checkout .woocommerce-checkout-payment .place-order{
    padding-inline:0 !important;
  }

  body.woocommerce-checkout #payment ul.payment_methods li.payment_method_bacs{
    position:relative;
    width:100% !important;
    margin:0 auto !important;
    padding:12px 10px !important;
    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    text-align:center !important;
    box-sizing:border-box !important;
  }

  body.woocommerce-checkout #payment ul.payment_methods li.payment_method_bacs > input.input-radio{
    position:absolute !important;
    opacity:0 !important;
    width:1px !important;
    height:1px !important;
    margin:0 !important;
    pointer-events:none !important;
  }

  body.woocommerce-checkout #payment ul.payment_methods li.payment_method_bacs > label{
    width:calc(100% - 20px) !important;
    margin:0 auto !important;
    display:flex !important;
    justify-content:center !important;
    align-items:center !important;
    gap:10px !important;
    text-align:center !important;
  }

  body.woocommerce-checkout #payment ul.payment_methods li.payment_method_bacs > label::before{
    content:"";
    display:inline-block;
    width:14px;
    min-width:14px;
    height:14px;
    border-radius:999px;
    border:2px solid rgba(167,210,45,.78);
    background:#0B0B0B;
    box-shadow:
      0 0 0 3px rgba(167,210,45,.18),
      0 0 10px rgba(167,210,45,.3);
  }

  body.woocommerce-checkout #payment ul.payment_methods li.payment_method_bacs > input.input-radio:checked + label::before{
    background:var(--lime);
    border-color:var(--lime);
    box-shadow:
      0 0 0 3px rgba(167,210,45,.22),
      0 0 12px rgba(167,210,45,.38);
  }

  body.woocommerce-checkout #payment ul.payment_methods li.payment_method_bacs > input.input-radio:focus-visible + label{
    outline:2px solid rgba(167,210,45,.38);
    outline-offset:2px;
    border-radius:8px;
  }

  body.woocommerce-checkout #payment ul.payment_methods li.payment_method_bacs .payment_box{
    width:calc(100% - 20px) !important;
    max-width:calc(100% - 20px) !important;
    margin:10px auto 0 !important;
    padding:12px 14px !important;
    box-sizing:border-box !important;
    text-align:center !important;
  }

  body.woocommerce-checkout #payment ul.payment_methods li.payment_method_bacs .payment_box p{
    margin:0 !important;
    text-align:center !important;
  }

  body.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper{
    margin-top:14px;
    font-size:.96rem;
    line-height:1.55;
  }

  body.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper .woocommerce-form__label{
    margin-bottom:8px;
  }

  body.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper .woocommerce-terms-and-conditions{
    display:block !important;
    max-height:0;
    overflow:hidden;
    margin:0;
    padding:0;
    border:0;
  }

  body.woocommerce-checkout .ll-terms-inline-summary{
    margin:6px 0 0;
    color:var(--ll-mobile-muted);
    font-size:.9rem;
    line-height:1.55;
  }

  body.woocommerce-checkout .ll-terms-inline-summary a{
    color:var(--lime);
    text-decoration:underline;
    text-underline-offset:.15em;
  }

  body.woocommerce-checkout #place_order{
    min-height:52px;
  }

  body.woocommerce-cart .ll-cart-header{
    overflow:visible;
    isolation:isolate;
  }

  body.woocommerce-cart .ll-cart-header:before,
  body.woocommerce-cart .ll-cart-header:after{
    inset:0 calc(50% - 50vw);
  }

  body.woocommerce-cart .ll-cart-header:before{
    opacity:.46;
  }

  body.woocommerce-cart .ll-cart-header:after{
    opacity:.4;
  }

  body.woocommerce-cart td.actions .coupon{
    display:grid;
    gap:10px;
  }

  body.woocommerce-cart td.actions .coupon input.input-text{
    width:100%;
    min-width:0;
  }

  body.woocommerce-cart td.actions :is(button, .button, input[type="submit"]){
    width:100%;
    min-height:44px;
    margin-left:0;
  }

  body.woocommerce-cart .quantity{
    min-height:44px;
  }

  body.woocommerce-cart .quantity .qty{
    min-height:38px;
  }

  body.woocommerce-cart .product-mobile-actions{
    display:flex !important;
    align-items:center;
    flex-wrap:nowrap;
    gap:10px;
    width:100%;
    min-width:0;
  }

  body.woocommerce-cart .product-mobile-actions .quantity,
  body.woocommerce-cart .product-mobile-actions :is(a.remove, a.remove_from_cart_button){
    visibility:visible !important;
    opacity:1 !important;
    pointer-events:auto !important;
  }

  body.woocommerce-cart .product-mobile-actions .quantity{
    flex:0 0 auto;
  }

  body.woocommerce-cart .product-mobile-actions .ct-product-multiply-symbol{
    display:none !important;
  }

  body.woocommerce-cart .product-mobile-actions :is(.woocommerce-Price-amount, .amount){
    margin-left:auto;
    color:var(--lime);
    font-weight:900;
    white-space:nowrap;
    font-variant-numeric:tabular-nums;
  }

  body.woocommerce-cart .product-mobile-actions :is(a.remove, a.remove_from_cart_button){
    position:static !important;
    inset:auto !important;
    margin:0 0 0 8px !important;
    flex:0 0 auto;
    align-self:center;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:34px;
    min-width:34px;
    height:34px;
    padding:0 !important;
    line-height:0 !important;
    font-size:0 !important;
  }

  /* Keep the trash glyph optically centered inside the red circle. */
  body.woocommerce-cart .product-mobile-actions :is(a.remove, a.remove_from_cart_button) :is(svg, .ct-icon){
    display:block;
    width:13px;
    min-width:13px;
    height:13px;
    margin:0;
    transform:none !important;
  }

  body.woocommerce-cart .ll-remove-duplicate,
  body.woocommerce-cart .ll-qty-duplicate{
    display:none !important;
  }

  body.woocommerce-account .woocommerce-MyAccount-navigation a{
    font-size:.72rem;
    letter-spacing:.08em;
  }

  body.woocommerce-account .woocommerce-MyAccount-content{
    padding:18px 14px;
    border-radius:14px;
    box-shadow:var(--ll-mobile-elevation);
  }

  /* TeraWallet mobile: stacked tabs + compact card spacing. */
  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container{
    min-width:0;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .woo-wallet-header h2{
    font-size:clamp(1.35rem, 7.4vw, 1.75rem);
    letter-spacing:.06em;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .woo-wallet-header p{
    font-size:.94rem;
    line-height:1.55;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .woo-wallet-top-section{
    margin-bottom:16px;
    border-radius:14px;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .woo-wallet-balance-card{
    padding:24px 14px;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .woo-wallet-balance-card h3{
    font-size:.64rem;
    letter-spacing:.14em;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .woo-wallet-balance-card .woo-wallet-price{
    font-size:clamp(2rem, 11vw, 2.7rem);
    line-height:1.02;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .woo-wallet-nav-tabs{
    display:grid !important;
    grid-template-columns:1fr;
    border-radius:0;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .woo-wallet-nav-item-wrapper{
    width:100%;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .woo-wallet-nav-tab{
    justify-content:flex-start;
    min-height:50px;
    padding:12px 14px;
    border-right:0;
    font-size:.67rem;
    letter-spacing:.09em;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .woo-wallet-submenu .woo-wallet-submenu-item{
    font-size:.62rem;
    letter-spacing:.08em;
    padding:10px 14px;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .woo-wallet-content-area{
    border-radius:14px;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .woo-wallet-form-wrapper{
    padding:16px 14px;
    border-radius:12px;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .woo-wallet-section-title{
    padding:16px 14px !important;
    font-size:.63rem;
    letter-spacing:.12em;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .woo-wallet-form-wrapper :is(input[type="number"],input[type="text"],input[type="email"],textarea,select),
  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .select2-container .select2-selection--single{
    min-height:44px;
    margin-bottom:12px !important;
    font-size:.95rem;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .woo-wallet-form-wrapper textarea{
    min-height:110px;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .woo-wallet-form-wrapper :is(input[type="submit"], .button){
    width:100%;
    min-height:44px;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .woo-wallet-content-area,
  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .woo-wallet-transactions-list{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .dataTables_wrapper{
    min-width:0;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    padding-top:10px;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .dt-controls{
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:8px;
    padding:0 12px 10px;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .dataTables_filter,
  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .dataTables_length,
  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .dataTables_info,
  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .dataTables_paginate{
    float:none !important;
    width:100%;
    text-align:left;
    padding:0 12px !important;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container .dataTables_filter input{
    width:100% !important;
    min-height:42px;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woo-wallet-my-wallet-container table.dataTable{
    min-width:560px;
  }
}
