/* Native cart preview: content refreshes through WooCommerce cart fragments. */
.hafu-cart-preview { position: relative; display: flex; align-items: center; padding-right: 17px; }
.hafu-cart-preview-toggle { position: absolute; right: -3px; top: 8px; width: 24px; height: 36px; padding: 0; display: grid; place-items: center; color: inherit; border-radius: 3px; }
.hafu-cart-preview-toggle > svg { width: 13px; height: 13px; }
.hafu-cart-preview-toggle:hover, .hafu-cart-preview-toggle:focus-visible { background: #ffffff21; }
.hafu-cart-preview-panel { position: absolute; z-index: 50; right: -8px; top: calc(100% + 10px); width: 420px; max-width: calc(100vw - 28px); color: #333; background: #fff; border: 1px solid #e8e8e8; border-radius: 3px; box-shadow: 0 3px 16px #0003; text-align: left; font-size: 14px; line-height: 20px; }
.hafu-cart-preview-panel::before { content: ''; position: absolute; right: 36px; top: -9px; width: 16px; height: 16px; transform: rotate(45deg); background: #fff; border-left: 1px solid #e8e8e8; border-top: 1px solid #e8e8e8; }
.hafu-cart-preview-content h2 { margin: 0; padding: 16px 14px 9px; color: #888; font-size: 14px; line-height: 20px; font-weight: 400; letter-spacing: 0; }
.hafu-cart-preview-items { list-style: none; padding: 0; margin: 0; max-height: min(380px, 55vh); overflow-y: auto; overscroll-behavior: contain; }
.hafu-cart-preview-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; margin: 0; }
.hafu-cart-preview-item:hover { background: #fafafa; }
.hafu-cart-preview-product { display: flex; align-items: center; min-width: 0; flex: 1; gap: 10px; color: #333; }
.hafu-cart-preview-image { display: block; width: 48px; height: 48px; flex: 0 0 48px; border: 1px solid #eee; background: #fff; }
.hafu-cart-preview-image img { display: block; width: 100% !important; height: 100% !important; object-fit: contain !important; }
.hafu-cart-preview-name { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 400; line-height: 20px; }
.hafu-cart-preview-name small { display: block; margin-top: 3px; color: #888; font-size: 12px; line-height: 16px; }
.hafu-cart-preview-product:hover .hafu-cart-preview-name { color: var(--pink); }
.hafu-cart-preview-price { flex: 0 0 auto; color: var(--pink); font-size: 14px; font-weight: 400; line-height: 20px; white-space: nowrap; }
.hafu-cart-preview-price .amount { font-size: inherit; font-weight: inherit; }
.hafu-cart-preview-price .woocommerce-Price-currencySymbol { font-size: inherit; }
.hafu-cart-preview-footer { border-top: 1px solid #f3f3f3; padding: 13px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hafu-cart-preview-footer > span { font-size: 12px; line-height: 18px; }
.hafu-cart-preview-footer small { display: block; font-size: 11px; color: #888; }
.hafu-cart-preview-view { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 8px 16px; border-radius: 2px; color: #fff; background: var(--pink); white-space: nowrap; font-size: 14px; line-height: 20px; }
.hafu-cart-preview-view:hover { background: var(--pink-dark); }
.hafu-cart-preview-empty { padding: 26px 18px 30px; text-align: center; }
.hafu-cart-preview-empty > svg { width: 52px; height: 52px; margin: 0 auto 12px; color: #e3a6c1; }
.hafu-cart-preview-empty p { margin: 0 0 10px; font-size: 14px; }
.hafu-cart-preview-empty a { color: var(--pink); font-size: 14px; text-decoration: underline; }
@media (max-width: 800px) {
  .hafu-cart-preview { padding-right: 12px; }
  .hafu-cart-preview-toggle { top: 4px; right: -7px; height: 36px; }
  .hafu-cart-preview-panel { position: fixed; top: var(--hafu-preview-top, 86px); right: 12px; left: 12px; width: auto; max-width: none; max-height: calc(100dvh - var(--hafu-preview-top, 86px) - 12px); overflow-y: auto; }
  .hafu-cart-preview-panel::before { display: none; }
  .hafu-cart-preview-items { max-height: 45dvh; }
  .hafu-cart-preview-item { padding: 10px 12px; gap: 8px; }
  .hafu-cart-preview-image { width: 44px; height: 44px; flex-basis: 44px; }
  .hafu-cart-preview-name { font-size: 13px; line-height: 18px; }
  .hafu-cart-preview-price { font-size: 13px; }
  .hafu-cart-preview-footer { padding: 12px; }
}
