#tdh-mobile-cart { display: none; }
#tdh-mobile-cart-preview { box-sizing: border-box; width: min(90vw, 600px); max-width: calc(100vw - 24px); max-height: 85vh; padding: 16px; border: 1px solid #d5dcc9; background: #fff; color: #222; font-family: var(--wd-text-font, "Manrope", Arial, sans-serif); }
#tdh-mobile-cart-preview::backdrop { background: #222a; }
#tdh-mobile-cart-preview img { display: block; width: 100%; max-height: 65vh; object-fit: contain; }
#tdh-mobile-cart-preview .tdh-mobile-cart-close { display: block; margin: 0 0 12px auto; min-height: 44px; padding: 8px 14px; background: #222; color: #e7eed5; border: 0; text-transform: none; font-size: 16px; cursor: pointer; }
#tdh-mobile-cart-preview p { margin: 12px 0 0; color: #222; font-size: 14px; }
@media (max-width: 767px) {
  #tdh-mobile-cart:not([hidden]) {
    box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px;
    position: fixed; left: 0; right: auto; bottom: var(--tdh-cart-toolbar, 0px); z-index: 390;
    width: 100%; max-width: 100vw; min-width: 0; margin: 0;
    padding: 6px 12px calc(6px + var(--tdh-cart-safe, env(safe-area-inset-bottom, 0px)));
    background: #fff; color: #222; border-top: 1px solid #d5dcc9;
    box-shadow: 0 -5px 22px #22222212;
    font-family: var(--wd-text-font, "Manrope", Arial, sans-serif);
    max-height: 65vh; max-height: 65dvh; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  }
  #tdh-mobile-cart *, #tdh-mobile-cart *::before, #tdh-mobile-cart *::after { box-sizing: border-box; min-width: 0; max-width: 100%; }
  #tdh-mobile-cart [hidden] { display: none !important; }
  #tdh-mobile-cart.tdh-mobile-cart-scrolling { visibility: hidden; pointer-events: none; }
  #tdh-mobile-cart .tdh-mobile-cart-info { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(0, auto); align-items: center; gap: 8px; font-size: 12px; line-height: 1.25; }
  #tdh-mobile-cart .tdh-mobile-cart-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
  #tdh-mobile-cart .tdh-mobile-cart-image { width: 34px; height: 36px; min-height: 0; padding: 0; margin: 0; border: 1px solid #d5dcc9; border-radius: 0; background: #fff; cursor: zoom-in; }
  #tdh-mobile-cart .tdh-mobile-cart-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
  #tdh-mobile-cart .tdh-mobile-cart-attributes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: 6px; }
  #tdh-mobile-cart .tdh-mobile-cart-attributes label { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 0; font-size: 10px; line-height: 1.2; color: #222; white-space: normal; overflow-wrap: anywhere; }
  #tdh-mobile-cart .tdh-mobile-cart-choice { display: flex; align-items: center; position: relative; min-height: 38px; padding: 3px 24px 3px 8px; border: 1px solid #d5dcc9; background: #fff; }
  #tdh-mobile-cart .tdh-mobile-cart-choice::after { content: "⌄"; position: absolute; right: 8px; font-size: 16px; pointer-events: none; }
  #tdh-mobile-cart .tdh-mobile-cart-choice-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; white-space: normal; font-size: 13px; line-height: 1.25; }
  /* Keep the native mobile picker, with a wrapping visual label above it. */
  #tdh-mobile-cart .tdh-mobile-cart-attributes select { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; margin: 0; opacity: 0; font-size: 16px; cursor: pointer; }
  #tdh-mobile-cart .tdh-mobile-cart-choice:focus-within { outline: 2px solid #222; outline-offset: 1px; }
  #tdh-mobile-cart .tdh-mobile-cart-price { max-width: 90px; font-weight: 600; overflow-wrap: anywhere; white-space: normal; }
  #tdh-mobile-cart .tdh-mobile-cart-price * { white-space: normal; overflow-wrap: anywhere; }
  #tdh-mobile-cart .tdh-mobile-cart-price del { opacity: .65; font-weight: 400; }
  #tdh-mobile-cart .tdh-mobile-cart-price ins { background: none; color: #222; }
  #tdh-mobile-cart .tdh-mobile-cart-actions { display: flex; align-items: stretch; gap: 8px; }
  #tdh-mobile-cart .tdh-mobile-cart-quantity { display: flex; align-items: center; margin: 0; flex: 0 0 56px; }
  #tdh-mobile-cart .tdh-mobile-cart-quantity > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #tdh-mobile-cart input { display: block; margin: 0; width: 56px; height: 42px; padding: 4px; text-align: center; border: 1px solid #d5dcc9; border-radius: 0; background: #fff; color: #222; font-size: 16px; }
  #tdh-mobile-cart .tdh-mobile-cart-buy { flex: 1 1 0; width: auto; min-height: 42px; padding: 5px 8px; margin: 0; border: 1px solid #222; border-radius: 0; background: #222; color: #e7eed5; font-family: var(--wd-title-font, "Barlow", Arial, sans-serif); font-size: 14px; line-height: 1.25; font-weight: 600; text-transform: none; white-space: normal; overflow-wrap: anywhere; cursor: pointer; }
  #tdh-mobile-cart .tdh-mobile-cart-buy:disabled { opacity: .55; cursor: wait; }
  #tdh-mobile-cart input:focus-visible, #tdh-mobile-cart button:focus-visible { outline: 2px solid #222; outline-offset: 2px; }
  body.tdh-mobile-cart-active { padding-bottom: var(--tdh-cart-space, 0px); }
  body.tdh-mobile-cart-active #ht-ctc-chat { bottom: calc(var(--tdh-cart-space, 130px) + 12px) !important; }
}
