/* RIVER WEAR unified visual + responsive repair layer.
   Uses the design tokens as the single source of truth. */

html{overflow-x:hidden;background:var(--color-bg-primary)}
body{overflow-x:hidden;background:var(--color-bg-primary);color:var(--color-text-primary);letter-spacing:-.005em}
body::before{display:none}
img,svg,video{max-width:100%}
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,summary:focus-visible{outline:2px solid var(--color-dark);outline-offset:3px}
.container{width:min(calc(100% - 28px),1320px)}
.section{padding:72px 0}
.section-sm{padding:44px 0}
.section-head{gap:18px;margin-bottom:28px}
.section-head h2{max-width:760px}
.eyebrow{color:var(--color-accent-strong);font-size:10px;letter-spacing:.15em}
h1,h2{letter-spacing:-.034em}
h3,h4{letter-spacing:-.016em}
p{line-height:1.7}
.card{background:var(--color-surface-card);border:1px solid var(--color-border);border-radius:var(--radius-xl);box-shadow:none}
.card-hover:hover{box-shadow:var(--shadow-sm)}

/* Header */
.header-wrap{background:rgba(246,243,236,.94);border-bottom:1px solid var(--color-divider);backdrop-filter:blur(18px) saturate(135%)}
.header-wrap.scrolled{background:rgba(251,249,244,.98);box-shadow:0 8px 30px rgba(23,23,20,.05)}
.announcement{min-height:32px;background:var(--color-dark);color:#fff;padding:7px 40px;font-size:10px;letter-spacing:.08em;border-bottom:0}
.navbar{height:70px;gap:10px}
.brand img{height:28px;max-width:148px;object-fit:contain}
.desktop-nav{gap:24px;font-size:11px;letter-spacing:.1em}
.desktop-nav a{padding:25px 0}
.desktop-nav a::after{bottom:18px;background:var(--color-accent-strong)}
.icon-btn{width:40px;height:40px;color:var(--color-text-primary)}
.icon-btn:hover{background:var(--color-surface-card);border-color:var(--color-border)}
.badge-count{top:0;background:var(--color-dark);border-color:var(--color-bg-primary)}
.mobile-menu{width:min(90vw,400px);background:var(--color-surface-elevated)}
.menu-inner{padding:20px 18px 30px}
.mobile-links a{padding:14px 3px;font-size:15px}
.menu-backdrop{background:var(--color-overlay)}
.search-overlay{backdrop-filter:blur(8px)}
.search-panel{background:var(--color-surface-elevated);border-bottom:1px solid var(--color-border);box-shadow:var(--shadow-md)}
.search-head{max-width:880px;margin-inline:auto}
.search-result{border-radius:12px}
.search-result:hover{background:var(--color-bg-secondary)}
.search-result img{border-radius:10px}

/* Buttons + fields */
.btn{min-height:48px;padding:0 21px;border-radius:var(--radius-pill);font-size:12px;font-weight:700;letter-spacing:.025em;box-shadow:none}
.btn-primary{background:var(--color-dark);border-color:var(--color-dark);color:#fff}
.btn-primary:hover{background:#050504;box-shadow:0 10px 26px rgba(23,23,20,.14)}
.btn-secondary{background:transparent;border-color:var(--color-border-strong);color:var(--color-text-primary)}
.btn-secondary:hover{background:var(--color-surface-elevated)}
.btn-quiet{background:var(--color-surface-card);border-color:var(--color-border)}
.chip{padding:10px 15px;background:var(--color-surface-card);border-color:var(--color-border);font-weight:600}
.chip.active{background:var(--color-dark);border-color:var(--color-dark);color:#fff}
.catalog-sort{min-height:44px;background:var(--color-surface-card);border-color:var(--color-border);font-size:12px}
.field input,.field select,.field textarea{width:100%;min-height:50px;background:var(--color-input-bg);border-color:var(--color-border);border-radius:13px;color:var(--color-text-primary)}
.field textarea{min-height:120px;resize:vertical}
.field input:hover,.field select:hover,.field textarea:hover{border-color:var(--color-border-strong)}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--color-accent);box-shadow:var(--color-focus-ring)}
.field label{letter-spacing:.07em}
.check{min-width:0}

/* Hero */
.hero{background:var(--color-bg-primary);border-bottom:0;padding:18px 0 0;overflow:hidden}
.hero-grid{min-height:auto;gap:18px}
.hero-copy{padding:48px 0 28px}
.hero-title{font-size:clamp(3rem,8vw,7rem);max-width:9ch;line-height:.94}
.hero-copy p{max-width:44ch!important;margin-top:12px;font-size:clamp(15px,2vw,18px)!important}
.hero-cta{display:flex;gap:10px;flex-wrap:wrap;margin-top:22px}
.hero-media{min-height:52vh;border-radius:var(--radius-xl);border:1px solid var(--color-border);background:var(--color-bg-secondary);box-shadow:var(--shadow-sm)}
.hero-art{background:radial-gradient(circle at 68% 24%,rgba(199,182,147,.38),transparent 30%),linear-gradient(145deg,#E9E5DC,#FBF9F4 56%,#E4DED3)}
.hero-art::before{border-color:var(--color-border)}
.hero-art::after{color:rgba(23,23,20,.045)}
.hero-art.has-product-image{background-image:linear-gradient(180deg,rgba(17,17,15,.02),rgba(17,17,15,.16)),var(--hero-image);background-size:cover;background-position:center}
.hero-art.has-product-image::before{inset:0;width:auto;aspect-ratio:auto;border:0;border-radius:0;box-shadow:inset 0 0 0 1px rgba(255,255,255,.14);background:linear-gradient(135deg,rgba(255,255,255,.1),transparent 45%)}
.hero-art.has-product-image::after{content:"RIVER WEAR";position:absolute;left:20px;bottom:17px;transform:none;font-family:var(--font-body);font-size:10px;font-weight:700;letter-spacing:.18em;color:#fff;text-shadow:0 1px 8px rgba(0,0,0,.32)}
.marquee{margin-top:16px;padding:11px 0;border-block:1px solid var(--color-divider);background:var(--color-surface-card)}
.marquee-track{font-size:10px;letter-spacing:.08em;color:var(--color-text-secondary)}

/* Catalogue */
.page-hero{padding:52px 0 32px;background:var(--color-bg-primary);border-bottom:1px solid var(--color-divider)}
.page-hero h1{font-size:clamp(2.7rem,7vw,5.5rem);margin-top:6px}
.page-hero p{max-width:58ch;font-size:15px}
.product-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:30px 12px}
.product-card{min-width:0;isolation:isolate}
.product-media{aspect-ratio:4/5;border-radius:15px;background:var(--color-neutral);box-shadow:inset 0 0 0 1px var(--color-border);overflow:hidden}
.product-media::after{content:"";position:absolute;inset:0;pointer-events:none;border:1px solid rgba(23,23,20,.05);border-radius:inherit}
.product-media img{width:100%;height:100%;object-fit:cover;transform:scale(1.001)}
.product-card:hover .product-media img{transform:scale(1.015)}
.product-info{padding:11px 2px 0;min-width:0}
.product-name{font-size:13px;font-weight:650;line-height:1.35;overflow-wrap:anywhere}
.product-color-line{font-size:11px;color:var(--color-muted);margin-top:4px}
.product-meta{margin-top:5px;gap:8px}
.price{font-size:13px;font-weight:700;letter-spacing:-.01em}
.rating{font-size:10px}
.product-badge{top:9px;left:9px;padding:6px 9px;font-size:8px;background:rgba(23,23,20,.9);color:#fff}
.wish-btn{top:9px;right:9px;width:37px;height:37px;background:rgba(255,255,255,.92);border-color:rgba(23,23,20,.08)}
.catalog-empty,.empty{border:1px dashed var(--color-border-strong);background:var(--color-surface-card);border-radius:var(--radius-xl);padding:40px 22px;text-align:center}
.skeleton{border-radius:var(--radius-xl);background:linear-gradient(90deg,#EAE5DC 25%,#F7F4EE 38%,#EAE5DC 62%);background-size:400% 100%;animation:rwSkeleton 1.45s ease infinite}
@keyframes rwSkeleton{0%{background-position:100% 0}100%{background-position:0 0}}

/* Editorial */
.category-tile{aspect-ratio:1/.9;padding:24px;border-radius:var(--radius-xl);background:linear-gradient(145deg,#E8E3DA,#F8F5EF);border-color:var(--color-border)}
.category-tile h3{font-size:clamp(24px,3vw,34px)}
.category-tile:hover{transform:translateY(-3px);box-shadow:var(--shadow-sm)}
.editorial-band{background:var(--color-dark);color:#F8F5EF;margin-block:18px;border:0}
.editorial-band p,.editorial-band .eyebrow{color:rgba(248,245,239,.72)}
.editorial-band h1,.editorial-band h2,.editorial-band h3{color:#F8F5EF}
.campaign-card{min-height:510px;border-radius:var(--radius-xl);border-color:var(--color-border);background:linear-gradient(150deg,#E2DDD3,#F2EEE7)}

/* Product detail */
.product-detail-grid{gap:34px}
.gallery{min-width:0;display:block}
.gallery-main{position:relative}
.gallery-thumbs{display:grid;grid-template-columns:repeat(auto-fit,minmax(78px,1fr));gap:10px;margin-top:12px}
.gallery-thumbs button{display:block;aspect-ratio:4/5;min-width:0;min-height:0;padding:0;border:1px solid transparent;background:transparent;border-radius:12px;overflow:hidden;opacity:.82}
.gallery-thumbs img{display:block;width:100%;height:100%;aspect-ratio:4/5;object-fit:cover}
.admin-brand-wrap{display:flex;align-items:center;min-height:36px}
.admin-brand-wrap img{display:block;height:28px;width:auto;max-width:170px;object-fit:contain}
.gallery-main{overflow:hidden;border-radius:var(--radius-xl);background:var(--color-neutral);border:1px solid var(--color-border)}
.gallery-main img{width:100%;aspect-ratio:4/5;object-fit:cover}
.gallery-thumbs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-top:10px}
.gallery-thumbs button{min-width:0;padding:0;border:1px solid transparent;background:transparent;border-radius:10px;overflow:hidden;opacity:.68}
.gallery-thumbs button:hover{opacity:1}
.gallery-thumbs button.active{opacity:1;border-color:var(--color-dark)}
.gallery-thumbs img{width:100%;aspect-ratio:4/5;object-fit:cover}
.buybox-card{padding:6px 0 0}
.buybox-card h1{font-size:clamp(2.35rem,5vw,4.4rem);margin-top:9px}
.price-lg{font-family:var(--font-body);font-size:clamp(1.3rem,3vw,1.72rem);font-weight:750;letter-spacing:-.03em}
.variant-row{margin:24px 0}
.variant{height:44px;background:var(--color-surface-card);font-size:12px;font-weight:650}
.variant:hover{border-color:var(--color-dark)}
.variant.active{background:var(--color-dark);border-color:var(--color-dark);color:#fff}
.quantity{border-radius:var(--radius-pill)!important;background:var(--color-surface-card);border-color:var(--color-border)!important}
.product-cart-row{margin-top:20px}
.product-action-btn,.product-wishlist-btn{min-height:54px}
.specs-grid{gap:10px}
.notice{border-radius:13px}
.notice.success{background:#EEF4EF;border-color:rgba(72,107,88,.22)}
.notice.error{background:#FAF0EE;border-color:rgba(155,65,58,.22)}
.status.success{background:#EDF4EF;color:#355340}
.status.warning{background:#F8F1E5;color:#76501E}
.status.error{background:#FAEFED;color:#7B322D}
.status.info{background:#EEF3F4;color:#40575D}

/* Cart + checkout */
.cart-line{grid-template-columns:92px minmax(0,1fr) auto;gap:16px;padding:17px 0}
.cart-line img{width:92px;aspect-ratio:4/5;border-radius:12px;background:var(--color-neutral)}
.cart-line>*{min-width:0}
.cart-summary{padding:24px}
.checkout-shell{gap:28px}
.checkout-panel,.checkout-summary{border-radius:var(--radius-xl);border-color:var(--color-border);background:var(--color-surface-card);box-shadow:none}
.checkout-summary{background:var(--color-bg-secondary)}
.checkout-item{grid-template-columns:58px minmax(0,1fr) auto}
.checkout-item>*{min-width:0}
.checkout-item img{border-radius:10px}
.step-icon{background:var(--color-bg-secondary)}
.delivery-option{background:var(--color-surface-card);border-color:var(--color-border-strong)}
.payment-option{background:#F2F5F1;border-color:rgba(72,107,88,.22)}
.review-card{background:var(--color-bg-secondary)}
.checkout-actions{flex-wrap:wrap}

/* Auth + account */
.auth-section{min-height:calc(100vh - 210px)}
.auth-wrap{max-width:620px}
.auth-card{padding:clamp(22px,5vw,42px);box-shadow:var(--shadow-sm)}
.auth-copy{margin:36px 0 26px}
.auth-copy h1{font-size:clamp(2.35rem,6vw,4.2rem)}
.account-shell{gap:26px}
.account-nav{gap:6px;scrollbar-width:none}
.account-nav::-webkit-scrollbar{display:none}
.account-nav a{background:var(--color-surface-card);border-color:var(--color-border);font-weight:600}
.account-nav a[aria-current="page"]{background:var(--color-dark);color:#fff;border-color:var(--color-dark)}
.account-welcome{padding-bottom:18px;border-bottom:1px solid var(--color-divider)}
.account-avatar{width:62px;height:62px;border:1px solid var(--color-border)}
.stat-card{padding:20px;border-color:var(--color-border);background:var(--color-surface-card)}
.stat-value{font-size:30px}
.order-card{padding:17px 0!important;border-bottom:1px solid var(--color-divider)}

/* Tables + admin */
.table-wrap{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;border-color:var(--color-border);border-radius:15px;background:var(--color-surface-card);box-shadow:none}
table{min-width:680px}
th{background:var(--color-bg-secondary);letter-spacing:.08em}
th,td{border-color:var(--color-divider);padding:13px 14px}
tbody tr:hover{background:rgba(255,255,255,.55)}
body.admin-body,.admin-body{background:var(--color-bg-primary)}
.admin-shell{gap:22px}
.admin-sidebar{background:var(--color-dark);border:0;border-radius:17px;padding:13px;box-shadow:var(--shadow-sm)}
.admin-sidebar a{color:rgba(255,255,255,.7);padding:11px 12px;border-radius:10px;font-weight:600}
.admin-sidebar a:hover,.admin-sidebar a.active,.admin-sidebar a[aria-current="page"]{background:rgba(255,255,255,.1);color:#fff}
.admin-main{min-width:0}
.admin-topbar{padding-bottom:15px;border-bottom:1px solid var(--color-divider);flex-wrap:wrap}
.admin-mobile-nav{gap:7px;scrollbar-width:none}
.admin-mobile-nav::-webkit-scrollbar{display:none}
.admin-mobile-nav a{background:var(--color-surface-card);border-color:var(--color-border);font-weight:650}
.admin-shell .card{background:var(--color-surface-card)}
.admin-form-section{padding-block:8px}
.admin-product-form{gap:22px}
.code-block{background:#E9E4DB;color:var(--color-text-primary);border:1px solid var(--color-border)}
.form-grid,.stats-grid{min-width:0}

/* Footer */
.footer{margin-top:82px;background:var(--color-bg-secondary);border-color:var(--color-divider)}
.footer-grid{padding:58px 0 48px;gap:30px}
.footer-brand .brand-wordmark{display:block;height:24px!important;width:auto;max-width:180px;object-fit:contain}
.footer-brand p{max-width:36ch}
.footer-col h4{letter-spacing:.13em}
.footer-col li{font-size:13px}
.footer-bottom{padding:18px 0;border-color:var(--color-divider)}

/* Tablet */
@media (min-width:640px){
  .product-grid{gap:36px 16px}
}
@media (min-width:768px){
  .container{width:min(calc(100% - 48px),1320px)}
  .section{padding:96px 0}
  .section-sm{padding:56px 0}
  .navbar{height:76px}
  .hero{padding-top:22px}
  .hero-grid{grid-template-columns:minmax(0,.86fr) minmax(390px,1.14fr);align-items:stretch;min-height:min(730px,78vh);gap:20px}
  .hero-copy{padding:60px 36px 60px 4px}
  .hero-media{min-height:0}
  .product-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:44px 18px}
  .campaign-card{min-height:580px}
  .product-detail-grid{grid-template-columns:minmax(0,1.16fr) minmax(340px,.84fr);gap:48px}
  .buybox{top:112px}
  .account-shell{grid-template-columns:210px minmax(0,1fr)}
  .account-nav{position:sticky;top:112px}
  .admin-shell{grid-template-columns:225px minmax(0,1fr)}
  .admin-sidebar{position:sticky;top:22px;min-height:calc(100vh - 44px);height:max-content}
}
@media (min-width:1100px){
  .product-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:48px 20px}
  .navbar{height:80px}
  .desktop-nav{gap:28px}
  .hero-copy{padding-right:58px}
}

/* Mobile repair */
@media (max-width:900px){
  .desktop-only{display:none!important}
  .footer-grid{gap:26px}
}
@media (max-width:767px){
  .container{width:min(calc(100% - 24px),1320px)}
  .section{padding:58px 0}
  .section-sm{padding:36px 0}
  .section-head{align-items:flex-start;flex-direction:column;gap:14px;margin-bottom:22px}
  .section-head .btn{max-width:100%}
  .hero{padding-top:0}
  .hero-grid{gap:0}
  .hero-copy{padding:38px 0 28px}
  .hero-title{font-size:clamp(2.9rem,14.5vw,5rem)}
  .hero-media{min-height:56vh;border-radius:18px}
  .page-hero{padding:38px 0 26px}
  .product-detail-grid{gap:22px}
  .buybox-card{padding-top:0}
  .gallery-thumbs{grid-template-columns:repeat(4,minmax(0,1fr))}
  .checkout-shell{grid-template-columns:1fr}
  .checkout-summary,.cart-summary{position:static}
  .checkout-actions{position:static;background:transparent;padding:0;border:0;box-shadow:none}
  .footer{margin-top:60px}
  .footer-grid{grid-template-columns:1fr 1fr}
  .admin-shell{display:block}
  .admin-sidebar{display:none}
  .admin-main{width:100%;min-width:0}
}
@media (max-width:560px){
  .announcement{padding-inline:36px;font-size:9px;white-space:normal}
  .navbar{height:62px;grid-template-columns:minmax(0,1fr) auto}
  .nav-left{min-width:0}
  .nav-left .brand{min-width:0}
  .brand img{max-width:122px;height:24px}
  .nav-actions{gap:0;justify-content:flex-end}
  .icon-btn{width:37px;height:37px}
  .product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 9px}
  .product-media{border-radius:12px}
  .product-info{padding-top:9px}
  .product-name{font-size:12px}
  .product-meta{align-items:flex-start;flex-direction:column;gap:2px}
  .wish-btn{width:34px;height:34px}
  .filter-bar{margin-inline:-12px;padding-inline:12px;width:calc(100% + 24px);overflow-x:auto}
  .catalog-sort{width:100%}
  .gallery-main{border-radius:15px}
  .buybox-card h1{font-size:2.45rem}
  .variant-options{gap:7px}
  .variant{min-width:48px;height:42px;padding-inline:12px}
  .product-cart-row{grid-template-columns:1fr}
  .product-cart-row .quantity{width:max-content;max-width:100%}
  .product-buy-row{grid-template-columns:minmax(0,1fr) 50px}
  .product-wishlist-btn{width:50px;min-width:50px}
  .cart-line{grid-template-columns:74px minmax(0,1fr);gap:11px}
  .cart-line img{width:74px}
  .cart-line>div:last-child{grid-column:2;text-align:left!important;display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
  .checkout-panel,.checkout-summary,.auth-card{padding:17px}
  .checkout-item{grid-template-columns:52px minmax(0,1fr) auto;gap:9px}
  .checkout-item img{width:52px;height:65px}
  .checkout-actions{display:grid;grid-template-columns:1fr;gap:8px}
  .checkout-actions .btn{width:100%}
  .delivery-option{grid-template-columns:1fr auto;padding:14px}
  .delivery-option>input,.delivery-icon{display:none}
  .address-row{display:grid}
  .address-actions{justify-content:flex-start}
  .order-card{grid-template-columns:1fr}
  .order-card>span:last-child,.order-card>div:last-child{text-align:left}
  .footer-grid{grid-template-columns:1fr 1fr;padding-top:44px}
  .footer-brand{grid-column:1/-1}
  .admin-topbar>*{max-width:100%}
  .admin-topbar .btn{width:100%}
  .stats-grid{grid-template-columns:1fr!important}
  .form-grid .two-col,.admin-product-form .two-col{grid-template-columns:1fr!important}
  .table-wrap{border-radius:12px}
}
@media (max-width:420px){
  .container{width:min(calc(100% - 20px),1320px)}
  .hero-title{font-size:clamp(2.65rem,14vw,4rem)}
  .hero-cta{display:grid;grid-template-columns:1fr}
  .hero-cta .btn{width:100%}
  .product-grid{grid-template-columns:1fr;gap:28px}
  .product-media{aspect-ratio:4/5}
  .product-name{font-size:13px}
  .product-meta{flex-direction:row;align-items:center;justify-content:space-between}
  .footer-grid{grid-template-columns:1fr}
  .footer-brand{grid-column:auto}
  .gallery-thumbs{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
  .buybox-card h1{font-size:2.2rem}
  .checkout-item{grid-template-columns:48px minmax(0,1fr)}
  .checkout-item>div:last-child{grid-column:2;text-align:left!important}
  .checkout-item img{width:48px;height:60px}
  .summary-row{font-size:13px}
  .auth-copy h1{font-size:2.2rem}
}
@media (max-width:360px){
  .announcement{padding-inline:32px}
  .brand img{max-width:108px}
  .icon-btn{width:35px;height:35px}
  .btn{padding-inline:16px}
  .page-hero h1{font-size:2.45rem}
  .gallery-thumbs{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (hover:none){
  .btn:hover,.category-tile:hover,.product-card:hover .product-media img,.wish-btn:hover{transform:none}
  .product-card:hover .product-media img.secondary{opacity:0}
  .product-card:hover .product-media img.primary{opacity:1}
}
@media (prefers-reduced-motion:reduce){.skeleton{animation:none}}

/* === Product gallery + brand-logo consistency fix === */
.gallery{
  min-width:0;
  display:flex!important;
  flex-direction:column!important;
  gap:10px!important;
}
.gallery-main{
  position:relative;
  overflow:hidden;
}
.gallery-main img{
  display:block;
  width:100%;
  height:auto;
  aspect-ratio:4/5;
  object-fit:cover;
}
.gallery-thumbs{
  display:flex!important;
  grid-template-columns:none!important;
  align-items:center;
  gap:9px!important;
  flex-wrap:wrap;
  margin-top:2px!important;
}
.gallery-thumbs button{
  display:block;
  flex:0 0 74px;
  width:74px!important;
  min-width:74px!important;
  min-height:92px!important;
  aspect-ratio:4/5!important;
  padding:0!important;
  border:1px solid var(--color-border)!important;
  background:var(--color-surface-card)!important;
  border-radius:10px!important;
  overflow:hidden;
  opacity:.72;
  transition:opacity .18s ease,border-color .18s ease,transform .18s ease;
}
.gallery-thumbs button:hover{opacity:1;transform:translateY(-1px)}
.gallery-thumbs button.active{
  opacity:1;
  border-color:var(--color-dark)!important;
  box-shadow:0 0 0 1px var(--color-dark);
}
.gallery-thumbs img{
  display:block;
  width:100%!important;
  height:100%!important;
  aspect-ratio:4/5!important;
  object-fit:cover!important;
}
.admin-brand-wrap{display:flex;align-items:center;min-height:38px}
.admin-brand-wrap img{display:block;height:30px!important;width:auto!important;max-width:170px!important;object-fit:contain}
.footer-brand .brand-wordmark{display:block;height:24px!important;width:auto!important;max-width:180px!important;object-fit:contain}

@media (max-width:767px){
  .gallery-thumbs{
    gap:7px!important;
    overflow-x:auto;
    flex-wrap:nowrap;
    padding-bottom:3px;
    scrollbar-width:none;
  }
  .gallery-thumbs::-webkit-scrollbar{display:none}
  .gallery-thumbs button{
    flex-basis:62px;
    width:62px!important;
    min-width:62px!important;
    min-height:77px!important;
    border-radius:9px!important;
  }
  .admin-brand-wrap img{height:26px!important;max-width:145px!important}
}
@media (max-width:420px){
  .gallery-thumbs button{
    flex-basis:56px;
    width:56px!important;
    min-width:56px!important;
    min-height:70px!important;
  }
}


/* === 2026-09-24 exact screenshot fixes: admin mobile + product thumbnails === */
/* Force the sidebar brand to remain legible even if an old/cached asset variant is served. */
.admin-sidebar .admin-brand-wrap img{
  filter:brightness(0) invert(1)!important;
  opacity:1!important;
}

/* Product gallery thumbnails: always real image cards, never tiny circular controls. */
.product-detail-grid .gallery{
  width:100%;
  min-width:0;
}
.product-detail-grid .gallery-thumbs{
  width:100%;
  display:flex!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  gap:10px!important;
  margin:12px 0 0!important;
  padding:0!important;
}
.product-detail-grid .gallery-thumbs > button{
  -webkit-appearance:none!important;
  appearance:none!important;
  position:relative!important;
  flex:0 0 76px!important;
  width:76px!important;
  height:96px!important;
  min-width:76px!important;
  min-height:96px!important;
  max-width:76px!important;
  padding:0!important;
  margin:0!important;
  border:1px solid var(--color-border-strong)!important;
  border-radius:9px!important;
  background:var(--color-surface-card)!important;
  overflow:hidden!important;
  box-shadow:none!important;
  opacity:.68!important;
}
.product-detail-grid .gallery-thumbs > button.active{
  opacity:1!important;
  border-color:var(--color-dark)!important;
  box-shadow:0 0 0 1px var(--color-dark)!important;
}
.product-detail-grid .gallery-thumbs > button > img{
  display:block!important;
  width:100%!important;
  height:100%!important;
  min-width:100%!important;
  min-height:100%!important;
  max-width:none!important;
  border:0!important;
  border-radius:0!important;
  object-fit:cover!important;
  aspect-ratio:auto!important;
}

/* Admin: prevent desktop dashboard geometry from leaking into phone view. */
.admin-topbar h1{
  max-width:100%;
  overflow-wrap:anywhere;
}

@media (max-width:767px){
  body:has([data-page^="admin/"]){overflow-x:hidden!important;}
  [data-page^="admin/"] .section{padding:24px 0 42px!important;}
  [data-page^="admin/"] .container{width:calc(100% - 24px)!important;max-width:100%!important;margin-inline:auto!important;}

  [data-page^="admin/"] .admin-topbar{
    width:100%!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    align-items:start!important;
    gap:14px!important;
    margin-bottom:14px!important;
    padding-bottom:16px!important;
  }
  [data-page^="admin/"] .admin-topbar > *{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  [data-page^="admin/"] .admin-topbar h1{
    width:100%!important;
    max-width:100%!important;
    margin:.25rem 0 0!important;
    font-size:clamp(2.4rem,13vw,3.8rem)!important;
    line-height:.92!important;
    letter-spacing:-.045em!important;
    overflow-wrap:anywhere!important;
  }
  [data-page^="admin/"] .admin-topbar > div:last-child{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
  }
  [data-page^="admin/"] .admin-topbar .btn{
    width:100%!important;
    min-width:0!important;
    padding-inline:10px!important;
  }

  [data-page^="admin/"] .admin-mobile-nav{
    display:flex!important;
    width:calc(100% + 24px)!important;
    margin:0 -12px 16px!important;
    padding:2px 12px 10px!important;
    gap:7px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    scrollbar-width:none!important;
  }
  [data-page^="admin/"] .admin-mobile-nav::-webkit-scrollbar{display:none!important;}
  [data-page^="admin/"] .admin-mobile-nav a{
    flex:0 0 auto!important;
    white-space:nowrap!important;
  }

  [data-page^="admin/"] .admin-shell{
    display:block!important;
    width:100%!important;
    min-width:0!important;
  }
  [data-page^="admin/"] .admin-shell > .admin-sidebar{
    display:none!important;
    width:0!important;
    height:0!important;
    min-height:0!important;
    overflow:hidden!important;
    padding:0!important;
    margin:0!important;
    border:0!important;
  }
  [data-page^="admin/"] .admin-shell > div{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  [data-page^="admin/"] .stats-grid{
    grid-template-columns:1fr!important;
  }

  .product-detail-grid .gallery-thumbs{
    width:calc(100% + 12px)!important;
    margin-right:-12px!important;
    padding:0 12px 5px 0!important;
    flex-wrap:nowrap!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    scrollbar-width:none!important;
  }
  .product-detail-grid .gallery-thumbs::-webkit-scrollbar{display:none!important;}
  .product-detail-grid .gallery-thumbs > button{
    flex-basis:70px!important;
    width:70px!important;
    min-width:70px!important;
    max-width:70px!important;
    height:88px!important;
    min-height:88px!important;
  }
}

@media (max-width:380px){
  [data-page^="admin/"] .admin-topbar h1{
    font-size:clamp(2.15rem,12vw,3rem)!important;
  }
  [data-page^="admin/"] .admin-topbar > div:last-child{
    grid-template-columns:1fr!important;
  }
  .product-detail-grid .gallery-thumbs > button{
    flex-basis:64px!important;
    width:64px!important;
    min-width:64px!important;
    max-width:64px!important;
    height:80px!important;
    min-height:80px!important;
  }
}
