/* Keep payment-provider content at its natural height, including an empty message. */
.single-product #payment-method-message { height: auto !important; min-height: 0; }
.woocommerce div.product form.cart .quantity:has(input[type="hidden"]) { display: none; }
.mi-details-body, .mi-product-description { min-width: 0; }

@media (max-width: 767px) {
  /* Keep logo and account controls on one row, including at 320px. */
  .mi-headrow { column-gap: 12px; }
  .mi-headrow .mi-logo.mi-original-brand {
    width: clamp(140px, 46vw, 190px);
    min-width: 0;
    flex: 0 1 auto;
  }
  .mi-headrow .mi-actions { gap: 12px; margin-left: auto; }
  .mi-actions > a { min-width: 40px; min-height: 44px; }
  .mi-search { height: 48px; }
  .mi-search button { min-width: 48px; padding-inline: 12px; }
  .mi-search input[type="search"] { padding-inline: 12px; }
  body:not(.wp-admin) input:is([type="text"],[type="search"],[type="email"],[type="tel"],[type="password"],[type="number"]),
  body:not(.wp-admin) select,
  body:not(.wp-admin) textarea,
  .mi-checkout-refined .wc-blocks-components-select .wc-blocks-components-select__select {
    font-size: 16px !important;
  }
  .mi-nav { gap: 12px; }
  .mi-nav > details { flex: 1; min-width: 0; }
  .mi-nav summary { padding: 13px 8px 13px 0; min-height: 44px; }
  .mi-nav > a.mi-nav-promo,
  .mi-nav > a.mi-nav-last { display: flex; align-items: center; min-height: 44px; margin-left: 0; font-size: 11px; }
  .mi-mega a { min-height: 44px; display: flex; align-items: center; font-size: 13px; overflow-wrap: anywhere; }
  .mi-brands { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; padding-inline: 0; font-size: 20px; }
  .mi-brands a { min-width: 0; min-height: 44px; display: flex; align-items: center; justify-content: center; }
  .mi-filterbar label { font-size: 12px; }
  .mi-filterbar select, .mi-filterbar input, .mi-filterbar button { min-height: 44px; }
  .mi-filterbar .mi-check { min-height: 44px; align-items: center; }
  .mi-filterbar .mi-check input { min-height: 0; width: 20px; height: 20px; }
  .mi-newsletter-input { flex-wrap: wrap; gap: 10px; }
  .mi-newsletter-input input, .mi-newsletter-input button { width: 100%; border-radius: 4px !important; }
  .mi-newsletter-consent { font-size: 13px !important; }
  .mi-footer a, .mi-footer p { overflow-wrap: anywhere; }

  /* A compact support link cannot cover the primary purchase controls. */
  .mi-whatsapp-float { width: 48px; height: 48px; padding: 0; justify-content: center; gap: 0; border-radius: 50%; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .mi-whatsapp-float::before { position: absolute; top: 4px; right: 4px; border: 2px solid #102b50; box-sizing: content-box; }
  .mi-whatsapp-float svg { width: 23px; height: 23px; }
  .mi-whatsapp-float > span { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .woocommerce-cart .mi-whatsapp-float,
  body:has(.mi-nav details[open]) .mi-whatsapp-float { display: none; }

  /* Product reading and buying. */
  .woocommerce div.product .product_title { overflow-wrap: anywhere; font-size: 24px; }
  .woocommerce div.product form.cart { padding: 0; }
  .woocommerce div.product form.cart::before, .woocommerce div.product form.cart::after { display: none; }
  .woocommerce div.product form.cart .button { margin: 0; font-size: 15px; }
  .woocommerce div.product form.cart .quantity { margin: 0; flex: 0 0 auto; }
  .woocommerce div.product form.cart .quantity .qty { min-height: 52px; }
  .mi-quick-facts dt { font-size: 12px; letter-spacing: 0; }
  .mi-quick-facts dd { font-size: 13px; }
  .mi-spec-link, .mir-jump { font-size: 13px; min-height: 44px; display: flex; align-items: center; }
  .woocommerce div.product p.stock, .mip-until { font-size: 13px; }
  .mi-purchase-help strong, .mi-purchase-help a, .mi-purchase-help .mi-small-link { font-size: 13px !important; }
  .mi-purchase-help a { display: inline-flex; align-items: center; min-height: 44px; }
  .mi-product-description { font-size: 15px; }
  .woocommerce table.shop_attributes { table-layout: fixed; width: 100%; }
  .woocommerce table.shop_attributes th, .woocommerce table.shop_attributes td { overflow-wrap: anywhere; font-size: 13px; }
  .woocommerce .mir-card h3 { font-size: 12px; line-height: 1.6; }
  .mir-tag, .mir-brand { font-size: 10px; }
  .mir-reason, .mir-stock, .mir-heading > p, .mir-pair-summary p { font-size: 12px; }
  .mir-detail, .mir-help { min-height: 44px; display: inline-flex; align-items: center; font-size: 13px; }
  .mi-product-reviews { padding: 18px 14px; }
  .mi-product-reviews .comment-form-cookies-consent { font-size: 13px; line-height: 1.7; }

  /* Cart cards: image + readable name, with the line total underneath. */
  .woocommerce-cart .wc-block-cart table.wc-block-cart-items .wc-block-cart-items__row {
    grid-template-columns: 64px minmax(0,1fr);
    column-gap: 14px;
    row-gap: 12px;
    padding-block: 20px;
  }
  .woocommerce-cart .wc-block-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image {
    grid-column: 1 / 2; grid-row: 1 / span 2; width: 64px;
    padding: 0 !important;
  }
  .woocommerce-cart .wc-block-cart-item__image img { width: 64px; height: 64px; object-fit: contain; padding: 4px; }
  .woocommerce-cart .wc-block-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__product {
    grid-column: 2 / 3; grid-row: 1 / 2; min-width: 0;
    padding: 0 !important;
  }
  .woocommerce-cart .wc-block-cart-item__product .wc-block-components-product-name { font-size: 14px !important; line-height: 1.55 !important; overflow-wrap: anywhere; }
  .woocommerce-cart .wc-block-components-product-metadata__description { display: none; }
  .woocommerce-cart .wc-block-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total {
    grid-column: 2 / 3; grid-row: 2 / 3; display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 10px 0 0 !important; border-top: 1px solid #dce5f0; font-size: 15px;
  }
  .woocommerce-cart .wc-block-cart-item__total::before { content: "Totale prodotto"; font-size: 12px; color: #526783; }
  .wc-block-components-quantity-selector { min-height: 44px; }
  .wc-block-components-quantity-selector input, .wc-block-components-quantity-selector button { min-height: 44px; }
  .wc-block-cart-item__remove-link { min-width: 44px; min-height: 44px; }
  .woocommerce-cart .wc-block-components-button.contained { font-size: 15px !important; }
  .woocommerce-cart .wc-block-components-totals-item { font-size: 14px !important; }
  .woocommerce-cart .wc-block-components-totals-footer-item { font-size: 20px !important; }
  .mi-checkout-steps { font-size: 11px; gap: 16px; }
  .mi-checkout-intro p { font-size: 14px; }
  .mi-checkout-intro a { font-size: 13px; min-height: 44px; display: inline-flex; align-items: center; }

  /* Checkout: touch-friendly fields and a legible order summary. */
  .mi-checkout-refined .wc-block-components-checkbox label { font-size: 13px; }
  .mi-checkout-refined .wc-block-checkout__terms { font-size: 13px !important; }
  .mi-checkout-refined .wc-block-components-validation-error { font-size: 13px; }
  .mi-checkout-refined .wc-block-components-totals-item { font-size: 14px !important; }
  .mi-checkout-refined .wc-block-components-totals-footer-item { font-size: 21px !important; }
  .mi-checkout-refined .wc-block-components-order-summary .wc-block-components-product-name { font-size: 13px !important; }
  .mi-checkout-refined .wc-block-components-order-summary .wc-block-components-order-summary-item { display: grid; grid-template-columns: 52px minmax(0,1fr); gap: 10px 12px; }
  .mi-checkout-refined .wc-block-components-order-summary .wc-block-components-order-summary-item__image { grid-column: 1; grid-row: 1 / span 2; width: 52px; min-width: 52px; }
  .mi-checkout-refined .wc-block-components-order-summary .wc-block-components-order-summary-item__image img { width: 52px; height: 52px; }
  .mi-checkout-refined .wc-block-components-order-summary .wc-block-components-order-summary-item__description { grid-column: 2; grid-row: 1; }
  .mi-checkout-refined .wc-block-components-order-summary .wc-block-components-order-summary-item__total-price { grid-column: 2; grid-row: 2; padding: 0; text-align: left; font-size: 14px; }
  .mi-checkout-refined .wc-block-components-order-summary .wc-block-components-order-summary-item__quantity { color: #fff !important; background: #102b50 !important; }
  .mi-checkout-refined .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-totals-wrapper:not(:empty) { padding: 16px !important; }
  .mi-checkout-refined .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-totals-wrapper:empty { padding: 0 !important; border: 0; }
  .mi-checkout-refined .wp-block-woocommerce-checkout-order-summary-block { background: #fff; }
  .mi-checkout-refined .wc-block-components-order-summary .wc-block-components-order-summary-item .wc-block-cart-item__prices { font-size: 13px !important; }
  .mi-checkout-refined .wc-block-components-panel__button { min-height: 44px; }
}

@media (max-width: 359px) {
  .mi-nav { gap: 8px; }
  .mi-nav > a.mi-nav-last { max-width: 76px; text-align: center; line-height: 1.4; }
  .mi-newsletter { padding: 24px 20px; }
  .mi-checkout-refined .mi-checkout-steps { gap: 16px; }
  .mi-checkout-refined .wc-block-components-checkout-step__title { font-size: 17px !important; }
}

@media (max-width: 767px) {
  .mi-consent { grid-template-columns: minmax(0,1fr); }
  .mi-consent > div { min-width: 0; }
  .mi-consent p { overflow-wrap: break-word; font-size: 14px; line-height: 1.65; }
  .mi-consent-actions button { min-width: 0; min-height: 44px; white-space: normal; font-size: 13px; }
  .mi-consent-actions button[data-consent] { color: #102b50; background: #fff; border: 1px solid #b9c8db; }
  .mi-consent-actions button[data-consent="accept"], .mi-consent-actions button[data-consent="save"] { color: #fff; background: #215bff; border-color: #215bff; }
  .mi-consent-actions button:focus-visible { outline: 2px solid #215bff; outline-offset: 3px; }
}
@media (max-width: 400px) {
  .mi-consent .mi-consent-actions { grid-template-columns: minmax(0,1fr); }
  .mi-consent-actions button { grid-column: 1 !important; width: 100%; }
}

@media (max-width: 767px) {
  .woocommerce-account .woocommerce-MyAccount-navigation li a { font-size: 13px; min-height: 48px; display: flex; align-items: center; line-height: 1.5; }
  .woocommerce-account .woocommerce-info { padding: 16px !important; font-size: 14px; }
  .woocommerce-account .woocommerce-info::before { display: none; }
  .woocommerce-account .woocommerce-info .button { display: block; float: none; width: 100%; min-height: 44px; margin: 0 0 12px; font-size: 13px; white-space: normal; }
  .woocommerce-account table.woocommerce-orders-table tbody th.woocommerce-orders-table__cell-order-number { display: block; padding: 14px 12px; text-align: right !important; font-size: 14px; }
  .woocommerce-account table.woocommerce-orders-table tbody th.woocommerce-orders-table__cell-order-number::before { content: attr(data-title) ': '; float: left; font-weight: 600; }
  .woocommerce-account .mi-order-product { font-size: 12px; line-height: 1.6; }
  .woocommerce-account .mi-order-product small { font-size: 11px; }
}

@media (max-width: 767px) {
 .mi-subcats a { min-height: 44px; display: inline-flex; align-items: center; font-size: 12px; }
 .woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 12px !important; line-height: 1.55 !important; }
 .woocommerce ul.products li.product .button { min-height: 44px; font-size: 12px; display: flex; justify-content: center; align-items: center; }
 .mi-stock { font-size: 11px; }
 .mi-product-brand { font-size: 10px; }
}
