/* Compact shipping source; quantities appear once a product is in the cart. */
[data-cart-quantity-control][hidden], .header-item-count[hidden] { display: none !important; }
[data-add-cart-form] .product-order-fields { display: flex; align-items: flex-end; gap: 10px; }
[data-add-cart-form] .product-order-fields > div { flex: 0 1 auto; min-width: 0; }
[data-add-cart-form] .product-order-fields > div:first-child { width: 108px; max-width: 48%; }
[data-add-cart-form] .product-order-fields .fixed-warehouse,
[data-add-cart-form] .product-order-fields select { min-height: 32px; height: 32px; padding: 5px 8px; font-size: 13px; line-height: 20px; border-radius: 6px; }
[data-add-cart-form] .product-order-fields select { padding-right: 23px; }
[data-add-cart-form] .product-order-fields > [data-cart-quantity-control] { flex: 1 1 auto; max-width: 150px; }

.header-actions > a { position: relative; }
.header-actions .header-item-count { position: absolute; top: -5px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--red, #ad3027); color: white; font: 600 11px/1 sans-serif; }
@media (max-width: 540px) {
  .product-card [data-add-cart-form] .product-order-fields { flex-wrap: wrap; gap: 5px; }
  .product-card [data-add-cart-form] .product-order-fields > div:first-child { width: 100%; max-width: 100%; }
  .product-card [data-add-cart-form] .product-order-fields .fixed-warehouse,
  .product-card [data-add-cart-form] .product-order-fields select { min-height: 28px; height: 28px; font-size: 11px; padding: 3px 5px; }
  .product-card [data-add-cart-form] .product-order-fields > [data-cart-quantity-control] { width: 100%; }
}

/* The purchase row keeps its height: reveal quantity by sharing the button's space. */
[data-add-cart-form] .cart-actions { --cart-button-share: .8fr; display: grid; grid-template-columns: minmax(0, 0fr) minmax(0, 1fr); align-items: stretch; gap: 0; width: 100%; height: 44px; transition: grid-template-columns 180ms ease, gap 180ms ease; }
[data-add-cart-form][data-in-cart="true"] .cart-actions { grid-template-columns: minmax(0, 1fr) minmax(0, var(--cart-button-share)); gap: 6px; }
.cart-actions .cart-inline-quantity { min-width: 0; overflow: hidden; }
.cart-actions .cart-quantity-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cart-actions .cart-inline-stepper { display: grid; grid-template-columns: 24px minmax(0, 1fr) 24px; align-items: stretch; height: 100%; min-height: 0; border: 1px solid #bfb8ae; border-radius: 6px; background: #fff; overflow: hidden; }
.cart-actions .cart-inline-stepper button { border: 0; background: #fff; color: var(--ink); padding: 0; min-width: 0; font-size: 20px; line-height: 1; }
.cart-actions .cart-inline-stepper button:hover:not(:disabled) { background: #f5efeb; }
.cart-actions .cart-inline-stepper button:disabled { color: #b6b1ab; cursor: default; }
form[data-add-cart-form] .cart-actions input { width: 100%; min-width: 0; min-height: 0; height: 100%; padding: 4px 2px; border: 0; border-radius: 0; text-align: center; font-size: 15px; color: var(--ink); background: #fff; appearance: textfield; -moz-appearance: textfield; }
.cart-actions input::-webkit-inner-spin-button, .cart-actions input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
[data-add-cart-form] .cart-actions .cart-action-button { grid-column: 2; min-width: 0; min-height: 0; height: 44px; width: 100%; padding: 6px 5px; margin: 0; justify-content: center !important; gap: 6px; line-height: 1.2; font-size: 13px; }
.cart-actions .cart-action-button span[data-add-cart-label] { display: block; width: auto; height: auto; min-width: 0; border: 0; border-radius: 0; font: inherit; line-height: inherit; }
.cart-actions .cart-action-icon { display: none; flex: 0 0 auto; width: 20px; height: 20px; }
.product-purchase-card [data-add-cart-form] .cart-actions .cart-action-button { min-height: 44px; font-size: 15px; }
.product-purchase-card .product-order-fields > div:first-child { max-width: 100%; }
.recommendation-content form[data-add-cart-form] { display: block; }
@media (max-width: 540px) {
  .product-card [data-add-cart-form] .cart-actions { --cart-button-share: 28px; }
  .recommendation-card [data-add-cart-form] .cart-actions { --cart-button-share: 32px; }
  .product-card [data-add-cart-form] .cart-actions, .recommendation-card [data-add-cart-form] .cart-actions { gap: 0; }
  .product-card [data-in-cart="true"] .cart-actions, .recommendation-card [data-in-cart="true"] .cart-actions { gap: 4px; }
  .product-card .cart-actions .cart-inline-stepper { grid-template-columns: minmax(0, 1fr); }
  .product-card .cart-inline-stepper button { display: none; }
  .recommendation-card .cart-actions .cart-inline-stepper { grid-template-columns: 18px minmax(0, 1fr) 18px; }
  .product-card [data-add-cart-form] .cart-actions .cart-action-button { font-size: 10px; padding: 5px 2px; }
  .product-card [data-in-cart="true"] .cart-action-icon, .recommendation-card [data-in-cart="true"] .cart-action-icon { display: block; }
  .product-card [data-in-cart="true"] [data-add-cart-label], .recommendation-card [data-in-cart="true"] [data-add-cart-label] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@media (prefers-reduced-motion: reduce) { [data-add-cart-form] .cart-actions { transition: none; } }
