/* Cart UX Controller 1.4.1 — mobile compact lists */
@media (max-width: 767px) {
  .cart-ux-mobile-hidden { display: none !important; }

  .cart-ux-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 42px;
    margin: 10px 0 4px;
    padding: 9px 12px;
    border: 1px solid #dfe5eb;
    border-radius: 9px;
    background: #f7f9fb;
    color: #182230;
    font-size: 11px;
    font-weight: 750;
  }

  /* Carrello mobile */
  body#cart .cart-item,
  body.page-cart .cart-item { padding: 14px 10px; overflow: hidden; }

  body#cart .cart-item .product-line-grid,
  body.page-cart .cart-item .product-line-grid {
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    min-width: 0;
  }

  body#cart .cart-item .product-line-grid-left,
  body.page-cart .cart-item .product-line-grid-left { width: 66px; min-width: 0; }

  body#cart .cart-item .product-image,
  body.page-cart .cart-item .product-image { width: 64px; height: 64px; padding: 5px; }

  body#cart .cart-item .product-line-grid-body,
  body.page-cart .cart-item .product-line-grid-body { min-width: 0; overflow: hidden; }

  body#cart .cart-item .product-title h6,
  body.page-cart .cart-item .product-title h6 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    max-height: 2.5em;
    overflow: hidden;
    white-space: normal;
    font-size: 11px;
    line-height: 1.25;
  }

  body#cart .cart-item .product-line-grid-right,
  body.page-cart .cart-item .product-line-grid-right { grid-column: 1 / -1; width: 100%; margin-top: 9px; }

  body#cart .cart-item .product-line-actions > .row > .hidden-md-up,
  body.page-cart .cart-item .product-line-actions > .row > .hidden-md-up { display: none; }

  body#cart .cart-item .product-line-actions > .row,
  body.page-cart .cart-item .product-line-actions > .row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    grid-template-rows: auto auto;
    gap: 8px 10px;
    width: 100%;
    margin: 0;
  }

  body#cart .cart-item .tvcart-incr-decr-price,
  body.page-cart .cart-item .tvcart-incr-decr-price {
    grid-column: 1 / -1;
    grid-row: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 104px;
    align-items: center;
    gap: 10px;
    width: 100%;
  }

  body#cart .cart-item .product-price,
  body.page-cart .cart-item .product-price { position: static; width: 100%; text-align: left; }

  body#cart .cart-item .product-price strong,
  body.page-cart .cart-item .product-price strong { display: block; font-size: 17px; white-space: nowrap; }

  body#cart .cart-item .bootstrap-touchspin,
  body.page-cart .cart-item .bootstrap-touchspin { justify-self: end; width: 104px; min-width: 104px; height: 34px; }

  body#cart .cart-item .js-cart-line-product-quantity,
  body.page-cart .cart-item .js-cart-line-product-quantity { height: 34px; font-size: 12px; }

  body#cart .cart-item .input-group-btn-vertical,
  body.page-cart .cart-item .input-group-btn-vertical { height: 34px; }

  body#cart .cart-item .btn-touchspin,
  body.page-cart .cart-item .btn-touchspin { height: 17px; }

  body#cart .cart-item .tv-cart-delete-icon-wrapper,
  body.page-cart .cart-item .tv-cart-delete-icon-wrapper {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    width: 34px;
  }

  body#cart .cart-item .remove-from-cart,
  body.page-cart .cart-item .remove-from-cart { width: 32px; height: 32px; }

  /* Checkout mobile */
  body#checkout #js-checkout-summary #cart-summary-product-list .media-list,
  body.page-order #js-checkout-summary #cart-summary-product-list .media-list { width: 100%; margin: 0; padding: 0; }

  body#checkout #js-checkout-summary #cart-summary-product-list .media-list > li.media,
  body.page-order #js-checkout-summary #cart-summary-product-list .media-list > li.media {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 12px 0;
    overflow: hidden;
    border-bottom: 1px solid #e8edf2;
  }

  body#checkout #js-checkout-summary li.media > .media-left,
  body.page-order #js-checkout-summary li.media > .media-left {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    min-width: 70px;
    margin: 0;
    padding: 0;
  }

  body#checkout #js-checkout-summary .media-object,
  body.page-order #js-checkout-summary .media-object { width: 64px; height: 64px; padding: 5px; object-fit: contain; }

  body#checkout #js-checkout-summary li.media > .media-body,
  body.page-order #js-checkout-summary li.media > .media-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title title" "quantity price";
    align-items: center;
    gap: 7px 12px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }

  body#checkout #js-checkout-summary .tvproduct-name,
  body#checkout #js-checkout-summary .product-title,
  body#checkout #js-checkout-summary .product-title > a,
  body.page-order #js-checkout-summary .tvproduct-name,
  body.page-order #js-checkout-summary .product-title,
  body.page-order #js-checkout-summary .product-title > a {
    grid-area: title;
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  body#checkout #js-checkout-summary .product-title h6,
  body.page-order #js-checkout-summary .product-title h6 {
    display: -webkit-box !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    width: 100%;
    max-width: 100%;
    max-height: 2.56em;
    margin: 0;
    overflow: hidden;
    white-space: normal !important;
    overflow-wrap: anywhere;
    font-size: 11px;
    line-height: 1.28;
    font-weight: 700;
  }

  body#checkout #js-checkout-summary .product-quantity,
  body.page-order #js-checkout-summary .product-quantity {
    grid-area: quantity;
    justify-self: start;
    min-height: 22px;
    margin: 0;
    padding: 3px 8px;
    font-size: 9px;
  }

  body#checkout #js-checkout-summary .product-price,
  body.page-order #js-checkout-summary .product-price {
    grid-area: price;
    position: static !important;
    float: none !important;
    display: block;
    justify-self: end;
    align-self: center;
    min-width: 48px;
    margin: 0;
    text-align: right;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
  }

  body#checkout #js-checkout-summary .media-body > br,
  body.page-order #js-checkout-summary .media-body > br { display: none !important; }

  .cart-ux-mobile-toggle > * { pointer-events: none; }
}

/* Il banner promozionale PayPal richiede almeno 420px. Nasconde solo il messaggio, non il metodo di pagamento. */
@media (max-width: 419px) {
  [paypal-messaging-banner] { display: none !important; }
}

