/**
 * Versora Commerce V2 — Phase 6 Mobile UX & Micro-interactions.
 * Presentation only. No WooCommerce financial/payment behavior is replaced.
 */

.vsr-commerce-v2 .vsr-commerce-v2-mobile-only { display: none; }
.vsr-commerce-v2 .vsr-commerce-mobile-live {
  position: fixed !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.vsr-commerce-v2 .vsr-commerce-mobile-dock {
  display: none;
}

.vsr-commerce-v2 .vsr-commerce-v2-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid var(--vsr-v2-border, #dbe2e8);
  border-radius: 12px;
  background: #fff;
  color: #26313d;
  font: inherit;
  font-size: .69rem;
  font-weight: 850;
  line-height: 1.2;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.vsr-commerce-v2 .vsr-commerce-v2-mobile-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform .2s ease;
}
.vsr-commerce-v2 .vsr-commerce-v2-mobile-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

/* Touch devices: remove desktop hover jumps and enlarge actionable targets. */
@media (hover: none), (pointer: coarse) {
  .vsr-commerce-v2 :where(a,button,input[type="button"],input[type="submit"],input[type="reset"],select) {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(245,163,0,.12);
  }
  .vsr-commerce-v2 :where(.vsr-v2-btn,.button,.checkout-button,#place_order,.wc-block-components-button) {
    min-height: 46px;
  }
  .vsr-commerce-v2 :where(.vsr-v2-btn,.button,.checkout-button,#place_order,.wc-block-components-button):hover {
    transform: none !important;
  }
  .vsr-commerce-v2 .vsr-cart-v2-qty__btn { min-width: 44px; min-height: 44px; }
  .vsr-commerce-v2 .vsr-cart-v2-remove { min-width: 44px; min-height: 44px; justify-content: center; }
}

/* Lightweight route transition, enabled only when JS is available. */
html.vsr-commerce-v2-mobile-js:not(.vsr-reduce-motion) .vsr-commerce-v2 .vsr-commerce-page > :where(section,div.vsr-v2-shell) {
  animation: tnrCommerceV2Rise .32s cubic-bezier(.2,.72,.28,1) both;
}
html.vsr-commerce-v2-mobile-js:not(.vsr-reduce-motion) .vsr-commerce-v2 .vsr-commerce-page > :where(section,div.vsr-v2-shell):nth-child(2) { animation-delay: .035s; }
html.vsr-commerce-v2-mobile-js:not(.vsr-reduce-motion) .vsr-commerce-v2 .vsr-commerce-page > :where(section,div.vsr-v2-shell):nth-child(3) { animation-delay: .065s; }
@keyframes tnrCommerceV2Rise {
  from { opacity: .01; transform: translate3d(0,8px,0); }
  to { opacity: 1; transform: translate3d(0,0,0); }
}

/* Cart updating/removal feedback. */
.vsr-commerce-v2-cart .vsr-cart-v2-stage,
.vsr-commerce-v2-cart .vsr-cart-v2-item,
.vsr-commerce-v2-cart .vsr-cart-v2-summary__card { transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease; }
.vsr-commerce-v2-cart.vsr-commerce-v2-mobile-busy .vsr-cart-v2-stage { cursor: progress; }
.vsr-commerce-v2-cart.vsr-commerce-v2-mobile-busy .vsr-cart-v2-layout { opacity: .72; }
.vsr-commerce-v2-cart .vsr-cart-v2-item.is-removing { opacity: .36; transform: scale(.985); }
.vsr-commerce-v2-cart .vsr-cart-v2-qty__btn:active { transform: scale(.92); }

/* Checkout busy state also covers the mobile action dock. */
.vsr-commerce-v2-checkout.vsr-commerce-v2-mobile-submitting .vsr-commerce-mobile-dock__action,
.vsr-commerce-v2-checkout.vsr-checkout-v2-is-updating .vsr-commerce-mobile-dock__action {
  pointer-events: none;
  opacity: .68;
}

/* Shop mobile polish: rails are intentionally horizontal and snap naturally. */
.vsr-commerce-v2-shop .vsr-shop-v2-filter__rail,
.vsr-commerce-v2-shop [data-vsr-shop-category-rail] {
  scroll-snap-type: inline proximity;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}
.vsr-commerce-v2-shop .vsr-shop-v2-filter__rail::-webkit-scrollbar,
.vsr-commerce-v2-shop [data-vsr-shop-category-rail]::-webkit-scrollbar { display: none; }
.vsr-commerce-v2-shop .vsr-shop-v2-filter__rail > *,
.vsr-commerce-v2-shop [data-vsr-shop-category-rail] > * { scroll-snap-align: center; }

@media (max-width: 767px) {
  html.vsr-commerce-v2-has-mobile-dock body.vsr-commerce-v2 {
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }

  .vsr-commerce-v2 .vsr-commerce-v2-mobile-only,
  .vsr-commerce-v2 .vsr-commerce-v2-mobile-toggle { display: inline-flex; }

  .vsr-commerce-v2 :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea) {
    font-size: 16px !important; /* prevents iOS input zoom */
  }

  .vsr-commerce-v2 :where(.vsr-v2-btn,.button,.checkout-button,#place_order,.wc-block-components-button) {
    min-height: 50px;
    border-radius: 14px !important;
  }

  /* Bottom action dock. */
  .vsr-commerce-v2 .vsr-commerce-mobile-dock {
    position: fixed;
    z-index: 2147482000;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(209,217,225,.92);
    background: rgba(255,255,255,.94);
    box-shadow: 0 -18px 42px rgba(15,23,42,.12);
    backdrop-filter: blur(18px) saturate(1.12);
    -webkit-backdrop-filter: blur(18px) saturate(1.12);
    transform: translate3d(0,0,0);
    transition: transform .22s ease, opacity .22s ease, visibility .22s ease;
  }
  .vsr-commerce-v2 .vsr-commerce-mobile-dock.is-suppressed,
  .vsr-commerce-v2 .vsr-commerce-mobile-dock.is-empty {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(0,110%,0);
  }
  .vsr-commerce-v2 .vsr-commerce-mobile-dock__inner {
    width: min(100%, 680px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0,.74fr) minmax(170px,1.26fr);
    align-items: center;
    gap: 10px;
  }
  .vsr-commerce-v2 .vsr-commerce-mobile-dock__summary {
    min-width: 0;
    display: grid;
    gap: 2px;
    padding-inline: 2px;
  }
  .vsr-commerce-v2 .vsr-commerce-mobile-dock__summary span {
    color: #6d7885;
    font-size: .61rem;
    font-weight: 800;
  }
  .vsr-commerce-v2 .vsr-commerce-mobile-dock__summary strong {
    overflow: hidden;
    color: #111923;
    font-size: .85rem;
    font-weight: 950;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
  }
  .vsr-commerce-v2 .vsr-commerce-mobile-dock__action {
    min-height: 54px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border: 0;
    border-radius: 15px;
    background: linear-gradient(135deg,#f5a300,#ffc647);
    box-shadow: 0 12px 28px rgba(245,163,0,.26);
    color: #171007 !important;
    font: inherit;
    font-size: .76rem;
    font-weight: 950;
    text-decoration: none !important;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .vsr-commerce-v2 .vsr-commerce-mobile-dock__action::after {
    content: '←';
    font-size: 1rem;
    line-height: 1;
  }
  .vsr-commerce-v2 .vsr-commerce-mobile-dock__action:active { transform: scale(.985); }
  .vsr-commerce-v2 .vsr-commerce-mobile-dock__action[aria-disabled="true"],
  .vsr-commerce-v2 .vsr-commerce-mobile-dock__action:disabled { opacity: .58; cursor: wait; }

  /* Cart: compact cards, persistent action, collapsible breakdown. */
  .vsr-commerce-v2-cart .vsr-cart-v2-hero__inner,
  .vsr-commerce-v2-cart .vsr-cart-v2-stage > .vsr-v2-shell { width: min(100% - 24px, var(--vsr-v2-shell,1180px)); }
  .vsr-commerce-v2-cart .vsr-cart-v2-hero { padding-block: 32px 28px; }
  .vsr-commerce-v2-cart .vsr-cart-v2-hero__copy > p { font-size: .83rem; line-height: 1.9; }
  .vsr-commerce-v2-cart .vsr-cart-v2-progress { padding: 15px; }
  .vsr-commerce-v2-cart .vsr-cart-v2-progress__steps { overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; }
  .vsr-commerce-v2-cart .vsr-cart-v2-progress__steps::-webkit-scrollbar { display: none; }
  .vsr-commerce-v2-cart .vsr-cart-v2-item { border-radius: 17px; }
  .vsr-commerce-v2-cart .vsr-cart-v2-item__top { align-items: flex-start; }
  .vsr-commerce-v2-cart .vsr-cart-v2-qty { min-height: 46px; border-radius: 13px; }
  .vsr-commerce-v2-cart .vsr-cart-v2-qty .qty { min-height: 44px !important; }
  .vsr-commerce-v2-cart .vsr-cart-v2-coupon__field input { min-height: 50px !important; }
  .vsr-commerce-v2-cart .vsr-cart-v2-summary__head { align-items: center; }
  .vsr-commerce-v2-cart .vsr-cart-v2-summary__head > div:first-child { flex: 1 1 auto; min-width: 0; }
  .vsr-commerce-v2-cart .vsr-cart-v2-summary__head .vsr-cart-v2-summary__secure { display: none; }
  .vsr-commerce-v2-cart .vsr-cart-v2-summary__rows {
    max-height: 620px;
    overflow: hidden;
    opacity: 1;
    transition: max-height .24s ease, opacity .18s ease, padding .24s ease;
  }
  .vsr-commerce-v2-cart .vsr-cart-v2-summary__card.is-mobile-order-collapsed .vsr-cart-v2-summary__rows {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    pointer-events: none;
  }
  .vsr-commerce-v2-cart .vsr-cart-v2-summary__checkout .checkout-button { min-height: 54px; }
  .vsr-commerce-v2-cart .vsr-cart-v2-summary__trust { padding-top: 13px; }

  /* Checkout: collapse only the order table, NEVER payment/terms/place-order. */
  .vsr-commerce-v2-checkout .vsr-checkout-v2-hero__inner,
  .vsr-commerce-v2-checkout .vsr-checkout-v2-stage__shell { width: min(100% - 24px, var(--vsr-v2-shell,1180px)); }
  .vsr-commerce-v2-checkout .vsr-checkout-v2-card__header--summary { align-items: center; grid-template-columns: auto minmax(0,1fr) auto; }
  .vsr-commerce-v2-checkout .vsr-checkout-v2-card__header--summary > div { min-width: 0; }
  .vsr-commerce-v2-checkout .vsr-checkout-v2-summary-card table.woocommerce-checkout-review-order-table {
    max-height: 760px;
    opacity: 1;
    transform-origin: top center;
    transition: opacity .18s ease, transform .18s ease;
  }
  .vsr-commerce-v2-checkout .vsr-checkout-v2-summary-card.is-mobile-order-collapsed table.woocommerce-checkout-review-order-table {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
  .vsr-commerce-v2-checkout #payment.woocommerce-checkout-payment { border-radius: 17px !important; }
  .vsr-commerce-v2-checkout #payment ul.payment_methods > li.wc_payment_method { border-radius: 14px; }
  .vsr-commerce-v2-checkout #payment .wc_payment_method > label { min-height: 48px; display: flex !important; align-items: center; }
  .vsr-commerce-v2-checkout #payment .place-order #place_order { min-height: 56px; }
  .vsr-commerce-v2-checkout .woocommerce-invalid :where(input,select,textarea) { scroll-margin-top: 92px; }

  /* WooCommerce Blocks: mobile dock only, no React-owned DOM collapsing. */
  .vsr-commerce-v2-checkout .wc-block-components-checkout-place-order-button { min-height: 56px !important; }

  /* Shop: make the finder + cards easier to use with thumbs. */
  .vsr-commerce-v2-shop .vsr-shop-v2-hero__inner,
  .vsr-commerce-v2-shop .vsr-shop-v2-filter__shell,
  .vsr-commerce-v2-shop .vsr-shop-v2-catalog > .vsr-v2-shell { width: min(100% - 24px, var(--vsr-v2-shell,1180px)); }
  .vsr-commerce-v2-shop .vsr-shop-v2-filter__shell { min-height: 68px; gap: 10px; }
  .vsr-commerce-v2-shop .vsr-shop-v2-filter__rail { gap: 8px; }
  .vsr-commerce-v2-shop .vsr-shop-v2-filter__rail a { min-height: 44px; display: inline-flex; align-items: center; }
  .vsr-commerce-v2-shop [data-vsr-shop-view] { min-width: 44px; min-height: 44px; }
  .vsr-commerce-v2-shop .vsr-shop-v2-card :where(a,.button) { min-height: 46px; }
}

@media (max-width: 420px) {
  .vsr-commerce-v2 .vsr-commerce-mobile-dock__inner { grid-template-columns: minmax(0,.68fr) minmax(164px,1.32fr); }
  .vsr-commerce-v2 .vsr-commerce-mobile-dock__summary strong { font-size: .78rem; }
  .vsr-commerce-v2 .vsr-commerce-mobile-dock__action { padding-inline: 10px; font-size: .7rem; }
  .vsr-commerce-v2-cart .vsr-cart-v2-item { grid-template-columns: 72px minmax(0,1fr); gap: 11px; padding: 14px; }
  .vsr-commerce-v2-cart .vsr-cart-v2-item__media,
  .vsr-commerce-v2-cart .vsr-cart-v2-item__media img { min-height: 74px; }
  .vsr-commerce-v2-cart .vsr-cart-v2-summary__head,
  .vsr-commerce-v2-checkout .vsr-checkout-v2-card__header { padding-inline: 14px; }
  .vsr-commerce-v2 .vsr-commerce-v2-mobile-toggle { padding-inline: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  html.vsr-commerce-v2-mobile-js .vsr-commerce-v2 .vsr-commerce-page > :where(section,div.vsr-v2-shell) { animation: none !important; }
  .vsr-commerce-v2 .vsr-commerce-mobile-dock,
  .vsr-commerce-v2 .vsr-commerce-v2-mobile-toggle svg,
  .vsr-commerce-v2-cart .vsr-cart-v2-stage,
  .vsr-commerce-v2-cart .vsr-cart-v2-item,
  .vsr-commerce-v2-cart .vsr-cart-v2-summary__rows,
  .vsr-commerce-v2-checkout .vsr-checkout-v2-summary-card table.woocommerce-checkout-review-order-table { transition: none !important; }
}
