/* GTAUP V376 — scoped shop consistency patch. Preserve all game logic and item imagery. */
/* Legacy inline inventory market entry stays clickable for existing JS, but is invisible to users. */
html.gtaup-v376 body #page-upgrader #v302-inventory-panel .panel-head > .v318-buy,
html.gtaup-v376 body #page-upgrader #v302-inventory-panel .panel-head > .g2643-inventory-tabs,
html.gtaup-v376 body #page-upgrader #v302-inventory-panel .panel-head > .g2653-switch,
html.gtaup-v376 body #page-upgrader #v302-inventory-panel .panel-head > [data-gtaup-invtab="buy"]{
  display:none!important;visibility:hidden!important;
}
html.gtaup-v376 body #page-upgrader #v302-inventory-panel .panel-head{justify-content:flex-start!important;gap:8px!important;min-height:49px!important;padding:10px 13px!important}
html.gtaup-v376 body #page-upgrader #v302-inventory-panel .panel-head .panel-title{margin:0!important;max-width:100%!important;white-space:normal!important}
/* The only public entry point to purchasing is the top switch created by V375. */
html.gtaup-v376 body #page-upgrader #v375UpgraderSwitch{margin:6px 0 20px!important;padding:5px!important;gap:4px!important;border-radius:12px!important;background:#191921!important;border:1px solid #3a3547!important;box-shadow:none!important}
html.gtaup-v376 body #page-upgrader #v375UpgraderSwitch button{min-height:43px!important;padding:9px 18px!important;background:transparent!important;border:1px solid transparent!important;color:#aaa6b7!important;border-radius:8px!important;box-shadow:none!important;font-size:12px!important;letter-spacing:.05px!important;transition:background .18s ease,color .18s ease!important}
html.gtaup-v376 body #page-upgrader #v375UpgraderSwitch button.active{background:#514466!important;color:#fff!important;border-color:#78678d!important;box-shadow:none!important}
html.gtaup-v376 body #page-upgrader #v375UpgraderSwitch button:hover:not(.active){background:#272631!important;color:#efedf3!important}
/* One unified subdued palette across the live marketplace and the inactive original route. */
html.gtaup-v376 body #v375MarketView,
html.gtaup-v376 body #page-shop{
 --v376-bg:#17171e;--v376-panel:#202029;--v376-card:#24242e;--v376-input:#171820;
 --v376-line:#3b3948;--v376-line-hover:#6e6280;--v376-text:#eeeaf2;--v376-muted:#a9a3b3;--v376-accent:#806f9b;
 color:var(--v376-text)!important;
}
html.gtaup-v376 body #page-upgrader #v375MarketView{background:transparent!important}
html.gtaup-v376 body #page-upgrader #v375MarketView .v375-market-heading{border-bottom:1px solid #35313d!important;padding:14px 1px 18px!important}
html.gtaup-v376 body #page-upgrader #v375MarketView .v375-market-heading small{color:#aaa0bb!important;letter-spacing:1px!important}
html.gtaup-v376 body #page-upgrader #v375MarketView .v375-market-heading h1{color:#f5f2fa!important;font-size:clamp(24px,2.8vw,33px)!important;letter-spacing:-.65px!important}
html.gtaup-v376 body #page-upgrader #v375MarketView .v375-market-heading p{color:#aaa6b5!important;font-size:12px!important}
html.gtaup-v376 body #page-upgrader #v375MarketView .v375-back{background:#27232e!important;color:#e5e0ea!important;border:1px solid #494050!important;box-shadow:none!important}
html.gtaup-v376 body #page-upgrader #v375MarketView .v375-back:hover{background:#393042!important}
/* Shop shell: remove conspicuous blue block and old purple gradients. */
html.gtaup-v376 body #page-upgrader #v375MarketHost #g2643-shop-host,
html.gtaup-v376 body #page-shop .shop-page-v31{
 background:#1b1b24!important;background-image:none!important;border:1px solid #353440!important;box-shadow:0 12px 30px #08070e33!important;
 border-radius:18px!important;overflow:visible!important;max-height:none!important;
}
html.gtaup-v376 body #page-upgrader #v375MarketHost #g2643-shop-host{padding:22px 20px 24px!important}
html.gtaup-v376 body #page-upgrader #v375MarketHost :is(.g2654-shop-intro,.g2643-buy-intro),
html.gtaup-v376 body #page-shop .shop-head-v31{
 display:flex!important;align-items:center!important;justify-content:space-between!important;gap:13px!important;
 margin:0 0 21px!important;padding:0 0 19px!important;min-height:55px!important;
 border:0!important;border-bottom:1px solid #393541!important;border-radius:0!important;
 background:transparent!important;background-image:none!important;box-shadow:none!important;
}
html.gtaup-v376 body #page-upgrader #v375MarketHost :is(.g2654-shop-intro,.g2643-buy-intro) strong{color:#f2eef6!important;font-weight:850!important;font-size:17px!important;letter-spacing:-.3px!important}
html.gtaup-v376 body #page-upgrader #v375MarketHost :is(.g2654-shop-intro,.g2643-buy-intro) small{display:block!important;color:#9f9ba9!important;font-size:11px!important;margin-top:6px!important;line-height:1.5!important}
html.gtaup-v376 body #page-upgrader #v375MarketHost :is(.g2654-shop-intro,.g2643-buy-intro)>span{color:#a69ab9!important;font-size:10px!important;white-space:nowrap!important}
/* Every category/filter/sort control uses the same single-color active state. */
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) :is(.market-type-tabs-v31,#shopFilters,.filters){
 display:flex!important;align-items:center!important;gap:7px!important;flex-wrap:wrap!important;
 margin:0 0 12px!important;padding:0!important;border:0!important;
 background:transparent!important;background-image:none!important;box-shadow:none!important;
}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) :is(.market-type-tabs-v31 button,#shopFilters .filter,.filter){
 appearance:none!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;
 min-height:36px!important;padding:8px 13px!important;border-radius:9px!important;
 border:1px solid #42404f!important;background:#25252f!important;background-image:none!important;
 color:#c6c0cf!important;font-size:11px!important;line-height:1.3!important;font-weight:700!important;
 text-shadow:none!important;box-shadow:none!important;filter:none!important;
 transition:background-color .15s ease,border-color .15s ease,color .15s ease!important;
}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) :is(.market-type-tabs-v31 button,.filter):not(:disabled):hover{background:#302d3a!important;border-color:#776885!important;color:#fff!important}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) :is(.market-type-tabs-v31 button.active,.filter.active){background:#514566!important;background-image:none!important;border-color:#8979a2!important;color:#fff!important;box-shadow:none!important}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) :is(.market-type-tabs-v31 button:disabled,.filter:disabled){opacity:.52!important;cursor:not-allowed!important}
/* Search / sorting / price row is a simple, consistent control surface. */
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) .shop-toolbar{
 display:grid!important;grid-template-columns:minmax(0,1fr) 132px auto!important;
 gap:9px!important;align-items:center!important;min-width:0!important;
 margin:16px 0 18px!important;padding:13px!important;border-radius:12px!important;
 background:#22222c!important;background-image:none!important;border:1px solid #393745!important;
 box-shadow:none!important;overflow:visible!important;
}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) .shop-toolbar :is(#shopSearch,#shopSort,.search,.sort,.v349-price-trigger){
 width:100%!important;min-width:0!important;min-height:41px!important;height:41px!important;box-sizing:border-box!important;
 background:#191922!important;background-image:none!important;border:1px solid #444150!important;
 border-radius:9px!important;color:#eeeaf2!important;font:650 12px Inter,system-ui,sans-serif!important;
 box-shadow:none!important;outline:0!important;padding:0 12px!important;text-shadow:none!important;
}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) .shop-toolbar #shopSearch::placeholder{color:#9690a0!important}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) .shop-toolbar :is(#shopSearch,#shopSort,.v349-price-trigger):focus-visible{border-color:#9280a8!important;outline:2px solid #76698a66!important;outline-offset:1px!important}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) .shop-toolbar .v349-price-controls{min-width:0!important;position:relative!important}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) .shop-toolbar .v349-price-menu{
 position:absolute!important;top:calc(100% + 8px)!important;right:0!important;z-index:200!important;
 background:#25242e!important;background-image:none!important;color:#f4eff6!important;
 border:1px solid #51495d!important;box-shadow:0 18px 35px #03020799!important;border-radius:12px!important;
 width:min(360px,calc(100vw - 45px))!important;padding:16px!important;
}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) .v349-price-menu b{color:#efebf4!important;font-size:12px!important}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) .v349-price-presets button,
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) .v349-price-menu :is(.v349-price-apply,.v349-price-clear){
 border:1px solid #4c4558!important;border-radius:8px!important;background:#30303a!important;
 background-image:none!important;color:#dcd5e5!important;box-shadow:none!important;font-weight:700!important;
}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) .v349-price-presets button[aria-pressed="true"],
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) .v349-price-menu .v349-price-apply{background:#514566!important;border-color:#8676a0!important;color:white!important}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) .v349-price-fields label{color:#aaa3b4!important}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) .v349-price-fields input{background:#191922!important;color:#f6f0f8!important;border-color:#4a4456!important}
/* Hide the superseded full-width V348 price panel on this page, leave V349 popover active. */
html.gtaup-v376 body #v375MarketHost #shopPriceV348,
html.gtaup-v376 body #page-shop #shopPriceV348{display:none!important}
/* Product grid: neutral panels independent of rarity. Keep each item's original image colors. */
html.gtaup-v376 body #page-upgrader #v375MarketHost #shopGrid,
html.gtaup-v376 body #page-shop #shopGrid{
 display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:12px!important;
 background:transparent!important;padding:0!important;overflow:visible!important;max-height:none!important;
}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid > .shop-item,
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid > .shop-item[data-rarity]{
 --v2654-rarity:#626073!important;--v252-rim:#53505e!important;--rar:#716d7e!important;
 display:flex!important;flex-direction:column!important;min-width:0!important;min-height:295px!important;
 background:#25252f!important;background-image:none!important;border:1px solid #42404e!important;border-left:1px solid #42404e!important;
 border-top:1px solid #42404e!important;border-radius:14px!important;padding:11px!important;
 box-shadow:none!important;outline:none!important;overflow:hidden!important;filter:none!important;
 transition:border-color .15s ease,transform .15s ease!important;
}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid > .shop-item:is(:hover,:focus-within){border-color:#81738f!important;transform:translateY(-2px)!important;box-shadow:0 12px 25px #0004!important}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid > .shop-item::before,
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid > .shop-item::after{content:none!important;display:none!important}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid .shop-item .car-img{
 width:100%!important;min-height:147px!important;height:147px!important;max-height:147px!important;
 flex:0 0 147px!important;display:flex!important;align-items:center!important;justify-content:center!important;
 position:relative!important;box-sizing:border-box!important;overflow:hidden!important;
 padding:9px!important;margin:0 0 12px!important;border:1px solid #363541!important;border-radius:10px!important;
 background:#1d1d27!important;background-image:radial-gradient(ellipse at 50% 110%,#302c38 0%,#1d1d27 65%)!important;
 box-shadow:none!important;filter:none!important;opacity:1!important;
}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid .shop-item .car-img::before,
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid .shop-item .car-img::after{content:none!important;display:none!important}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid .shop-item .car-img img{
 display:block!important;max-width:100%!important;max-height:100%!important;width:100%!important;height:100%!important;
 object-fit:contain!important;object-position:center!important;mix-blend-mode:normal!important;
 border:0!important;background:transparent!important;box-shadow:none!important;
 transform:none!important;filter:drop-shadow(0 9px 11px #0005)!important;
}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid .shop-item .quality-strip-v188,
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid .shop-item .quality-strip-v190{
 min-height:19px!important;padding:0!important;margin:0 0 8px!important;border:0!important;
 background:transparent!important;background-image:none!important;box-shadow:none!important;
}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid .shop-item .quality-strip-v188 :is(span,i),
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid .shop-item .quality-strip-v190 :is(span,i){
 background:#35313c!important;background-image:none!important;color:#bfb4ca!important;border:1px solid #50475c!important;
 box-shadow:none!important;border-radius:6px!important;font-size:9px!important;
}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid .shop-item .car-name{
 color:#eeeaf1!important;font:750 12px/1.4 Inter,system-ui,sans-serif!important;
 min-height:34px!important;height:auto!important;margin:0 0 5px!important;letter-spacing:0!important;text-shadow:none!important;
}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid .shop-item .item-type-chip-v31{
 display:inline-block!important;background:transparent!important;background-image:none!important;
 color:#9c95a9!important;border:0!important;box-shadow:none!important;padding:0!important;
 margin:0 0 8px!important;font-size:10px!important;
}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid .shop-item .car-price{
 color:#f6f2f8!important;font:850 15px/1.3 Inter,system-ui,sans-serif!important;
 margin:0 0 7px!important;letter-spacing:-.2px!important;text-shadow:none!important;
}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid .shop-item .shop-meta{
 width:100%!important;min-height:18px!important;margin-top:auto!important;padding:5px 0 8px!important;
 border:0!important;color:#a7a0b2!important;font-size:10px!important;
}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid .shop-item .owned{color:#a39bab!important}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid .shop-item .buy-btn{
 display:flex!important;align-items:center!important;justify-content:center!important;width:100%!important;
 height:39px!important;min-height:39px!important;border-radius:9px!important;border:1px solid #716084!important;
 background:#514365!important;background-image:none!important;color:#fff!important;
 box-shadow:none!important;text-shadow:none!important;font-size:11px!important;font-weight:800!important;
 padding:6px 10px!important;white-space:normal!important;line-height:1.2!important;
}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid .shop-item .buy-btn:not(:disabled):hover{background:#635276!important;border-color:#a28eb7!important;transform:none!important}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid .shop-item .buy-btn:disabled{
 background:#383440!important;border-color:#4d4453!important;color:#b3a8b7!important;opacity:.66!important;
 cursor:not-allowed!important;
}
html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid .g263-more{
 grid-column:1/-1!important;border:1px solid #51485f!important;background:#272530!important;color:#e5deeb!important;
 border-radius:11px!important;min-height:44px!important;
}
@media(max-width:1250px){html.gtaup-v376 body #page-upgrader #v375MarketHost #shopGrid,html.gtaup-v376 body #page-shop #shopGrid{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
@media(max-width:900px){
 html.gtaup-v376 body #page-upgrader #v375MarketHost #shopGrid,html.gtaup-v376 body #page-shop #shopGrid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important}
 html.gtaup-v376 body #page-upgrader #v375MarketHost #g2643-shop-host{padding:13px!important}
 html.gtaup-v376 body :is(#v375MarketHost,#page-shop) .shop-toolbar{grid-template-columns:minmax(0,1fr) 105px!important;gap:7px!important;padding:9px!important}
 html.gtaup-v376 body :is(#v375MarketHost,#page-shop) .shop-toolbar .v349-price-controls{grid-column:1/-1!important}
 html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid .shop-item .car-img{height:112px!important;min-height:112px!important;max-height:112px!important;flex-basis:112px!important}
 html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid > .shop-item{min-height:270px!important;padding:9px!important}
}
@media(max-width:420px){
 html.gtaup-v376 body :is(#v375MarketHost,#page-shop) :is(.market-type-tabs-v31 button,#shopFilters .filter,.filter){font-size:10px!important;padding:7px 9px!important;min-height:33px!important}
 html.gtaup-v376 body #page-upgrader #v375UpgraderSwitch button{padding:8px 10px!important;font-size:11px!important}
 html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid .shop-item .car-name{font-size:11px!important}
}
@media(prefers-reduced-motion:reduce){html.gtaup-v376 body :is(#v375MarketHost,#page-shop) #shopGrid > .shop-item{transition:none!important;transform:none!important}}
/* Explicit active and purchase controls must outrank old V265/V375 !important rules. */
html.gtaup-v376 body #page-upgrader #v375MarketHost #shopFilters .filter.active,
html.gtaup-v376 body #page-upgrader #v375MarketHost #shopTypeFiltersV31 button.active,
html.gtaup-v376 body #page-shop #shopFilters .filter.active,
html.gtaup-v376 body #page-shop #shopTypeFiltersV31 button.active{
 background:#514566!important;background-image:none!important;border-color:#8979a2!important;color:#fff!important;box-shadow:none!important;
}
html.gtaup-v376 body #page-upgrader #v375MarketHost #shopGrid .shop-item .buy-btn,
html.gtaup-v376 body #page-shop #shopGrid .shop-item .buy-btn{
 background:#514365!important;background-image:none!important;border:1px solid #716084!important;color:#fff!important;
 box-shadow:none!important;text-shadow:none!important;
}
html.gtaup-v376 body #page-upgrader #v375MarketHost #shopGrid .shop-item .buy-btn:disabled,
html.gtaup-v376 body #page-shop #shopGrid .shop-item .buy-btn:disabled{
 background:#383440!important;border-color:#4d4453!important;color:#b3a8b7!important;
}
/* Main marketplace header already explains where the user is: no duplicate title below it. */
html.gtaup-v376 body #page-upgrader #v375MarketHost #g2643-shop-host > .g2654-shop-intro,
html.gtaup-v376 body #page-upgrader #v375MarketHost #g2643-shop-host > .g2643-buy-intro{display:none!important}
html.gtaup-v376 body #page-upgrader :is(#v375MarketView,#v375MarketHost,#g2643-shop-host){min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
@media(max-width:640px){
 html.gtaup-v376 body #page-upgrader #v375MarketHost .v349-price-menu{width:min(345px,calc(100vw - 58px))!important;max-width:calc(100vw - 58px)!important}
}
