/*
 * Marketplace UI consistency pass
 * Shared presentation refinements only — no business logic.
 */
:root{
  --mp-radius-xs:10px;
  --mp-radius-sm:13px;
  --mp-radius-md:18px;
  --mp-radius-lg:24px;
  --mp-radius-xl:30px;
  --mp-shadow-soft:0 10px 32px rgba(38,31,53,.055);
  --mp-shadow-float:0 18px 55px rgba(38,31,53,.10);
  --mp-touch:44px;
}

html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{overflow-x:hidden;text-rendering:optimizeLegibility}
img{max-width:100%}
button,input,select,textarea{font:inherit}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:3px solid rgba(103,84,217,.18);outline-offset:2px
}

/* Shared header rhythm */
.topbar{position:relative;z-index:70}
.topline{gap:12px}
.brand{min-width:0}
.brandcopy{min-width:0}
.brandcopy b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.action-chip{min-height:44px;border-radius:14px;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.action-chip:hover{transform:translateY(-1px)}
.search input,.search select,.search button{min-height:44px}
.search{border-radius:15px}
.navstrip{scrollbar-width:none}
.navstrip::-webkit-scrollbar{display:none}

/* Common controls */
button,[role="button"],.btn,.button{touch-action:manipulation}
input,select,textarea{border-radius:12px}
textarea{resize:vertical}

/* Consistent content containment */
main,.page,.page-shell,.market-shell,.account-shell,.orders-shell,.checkout-shell,.product-shell{
  min-width:0
}

/* Cards get a consistent premium edge without overriding intentional colored panels. */
.card,.panel,.summary-card,.account-card,.order-card,.checkout-card{
  background-clip:padding-box
}

/* Toasts should never collide with mobile navigation or safe areas. */
.toast{
  max-width:min(92vw,420px);
  bottom:max(22px,calc(14px + env(safe-area-inset-bottom)))
}

/* Shared bottom navigation polish */
.bottom-nav{
  padding-bottom:max(7px,env(safe-area-inset-bottom));
  box-shadow:0 -10px 34px rgba(32,27,42,.08)
}
.bottom-nav a{min-width:0;min-height:52px}
.bottom-nav a .mp-icon,.bottom-nav a svg{flex:0 0 auto}

/* Modal and drawer ergonomics */
[role="dialog"],.modal,.drawer,.sheet{overscroll-behavior:contain}

/* Better horizontal rails on touch devices */
.category-rail,.product-rail,.recently-viewed-rail,.recommendation-rail{
  -webkit-overflow-scrolling:touch
}

/* Small utility used by several pages after the premium redesigns. */
.mp-scroll-safe{scroll-margin-top:100px}

@media(max-width:1100px){
  .topline{gap:9px}
  .action-chip{padding-left:10px;padding-right:10px}
}

@media(max-width:850px){
  body{padding-bottom:calc(72px + env(safe-area-inset-bottom))}
  .topbar{position:sticky;top:0;background:rgba(255,253,248,.94);-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);border-bottom:1px solid rgba(227,221,229,.78)}
  .topline{min-height:64px;padding-top:max(8px,env(safe-area-inset-top));padding-bottom:8px}
  .brandmark{flex:0 0 auto}
  .brandcopy b{max-width:155px}
  .mobile-search{margin-top:0;padding-bottom:10px}
  .mobile-search.search{width:100%}
  .mobile-search input{font-size:16px} /* prevents iOS zoom */
  input,select,textarea{font-size:16px}
  .navstrip{display:flex;overflow-x:auto;white-space:nowrap;padding-left:14px;padding-right:14px}
  .navstrip a{flex:0 0 auto}
  .bottom-nav{grid-template-columns:repeat(5,minmax(0,1fr));left:0;right:0;bottom:0;border-radius:0}
  .bottom-nav a{font-size:8px;gap:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .bottom-nav a .mp-icon,.bottom-nav a svg{width:19px;height:19px}
  .mp-mobile-drawer{padding-left:16px;padding-right:16px}
  .toast{bottom:calc(82px + env(safe-area-inset-bottom))}
}

@media(max-width:560px){
  :root{--mp-radius-lg:20px;--mp-radius-xl:24px}
  .topline{padding-left:12px!important;padding-right:12px!important}
  .brandcopy b{max-width:118px}
  .brandcopy small{font-size:7px}
  .mp-mobile-menu-button{width:42px;height:42px;flex-basis:42px}
  .topline>.cart.action-chip,.topline>.header-actions .action-chip.cart{min-width:42px;min-height:42px;padding:0 10px}
  .topline>.cart.action-chip>span:last-child,.topline>.header-actions .action-chip.cart>span:last-child{display:none}
  .mobile-search{padding-left:12px!important;padding-right:12px!important}
  .mobile-search.search{border-radius:14px}
  .mobile-search button{min-width:46px}
  .bottom-nav a{padding-left:2px;padding-right:2px}
}

@media(max-width:380px){
  .brandcopy b{max-width:92px}
  .bottom-nav a{font-size:7px}
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}
}

/* Customer-visible choice summary on Marketplace cards. */
.listing-choice-info{display:inline-flex;align-items:center;max-width:100%;box-sizing:border-box;flex-wrap:wrap;padding:6px 9px;border:1px solid #dce8df;border-radius:9px;background:#eff6f0;color:#244735;font-size:12px;font-weight:700;line-height:1.4;margin:6px 0;overflow-wrap:anywhere}
.market-card-body>.listing-choice-info{color:#244735;font-weight:700}

/* Compact customer basket actions, retaining 44px touch targets. */
button[data-basket-icon]{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:44px!important;min-width:44px!important;min-height:44px!important;flex:0 0 auto!important;padding:10px!important;gap:0!important;vertical-align:middle}
button[data-basket-icon] .mp-basket-svg{display:block;width:22px;height:22px;flex:none;pointer-events:none}
button[data-basket-icon]:focus-visible{outline:3px solid #5a8466;outline-offset:3px}
button[data-basket-icon]:disabled{opacity:.6}
.pp-business-documents{scroll-margin-top:90px}.pp-business-documents input[type=file]{max-width:100%;white-space:normal}.pp-business-documents>div{padding:12px 0;border-top:1px solid #e4e8e2}
button[data-basket-icon][aria-busy=true] .mp-basket-svg{animation:mp-basket-pulse .8s ease-in-out infinite alternate}@keyframes mp-basket-pulse{to{opacity:.3}}@media(prefers-reduced-motion:reduce){button[data-basket-icon][aria-busy=true] .mp-basket-svg{animation:none}}
