/* Viewport and capability driven layout. OS detection never fixes the aspect ratio. */
:root{--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px)}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-top:20px}
body{min-height:100vh;min-height:100svh}
img,svg{max-width:100%}
button,a,input,select,textarea{touch-action:manipulation}
.hero-copy,.header-main>*,.detail-info,.cart-item>div,.admin-main,.editor-columns>*,.contact-banner>div{min-width:0}
.product-name,.cart-item strong,.detail-info h2,.detail-description,.stock-row strong{overflow-wrap:anywhere}
.photo-thumbs{overflow-x:auto;max-width:100%;padding-bottom:4px;overscroll-behavior-x:contain}
.photo-thumbs>button{flex-shrink:0}
.side-panel{overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;padding-bottom:calc(24px + var(--safe-bottom))}
.product-dialog,.editor-dialog{overflow:auto;overscroll-behavior:contain;max-height:90vh;max-height:min(92dvh,calc(var(--visual-viewport-height,100dvh) - 24px))}
button#floating-cart{right:max(24px,var(--safe-right));bottom:calc(24px + var(--safe-bottom))}
html.keyboard-open button#floating-cart{display:none!important}
@media(pointer:coarse){
 .icon-button,.quantity button,.row-actions .icon-button,.photo-thumbs>button{min-width:44px;min-height:44px}
 .add-button,.primary,.secondary,.filter-tabs button,.text-button,.desktop-categories button,.admin-sidebar nav>button,.mini-action{min-height:44px}
 .product-card:hover{transform:none}
 .product-image:hover>img{transform:none}
 input,select,textarea,.searchbox input,.admin-search input,.login-card input,.editor-columns input,.editor-columns textarea,.editor-columns select{font-size:16px}
}
@media(min-width:701px) and (max-width:1100px){
 .product-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .category-tiles{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:700px){
 .wrap{width:auto;margin-left:max(16px,var(--safe-left));margin-right:max(16px,var(--safe-right))}
 .topline{padding-top:var(--safe-top)}
 .topline .wrap>span{font-size:10px;text-align:center;line-height:1.5;padding-block:6px}
 .header-main{gap:12px;padding-block:16px 12px}
 .brand{font-size:25px;min-width:0;gap:8px}
 .brand-bottom{font-size:14px}
 .brand>img{width:34px;height:38px}
 .cart-toggle{font-size:11px;gap:7px;padding-left:8px}
 .cart-toggle>.icon{width:23px;height:23px}
 .searchbox{flex:1 1 100%;min-width:0}
 .searchbox input{font-size:16px;min-height:46px}
 .searchbox kbd{display:none}
 .store-nav{gap:12px;scrollbar-width:thin;overscroll-behavior-x:contain}
 .department-button{font-size:12px;min-height:46px;flex-shrink:0}
 .desktop-categories button{font-size:12px}
 .hero{margin-top:16px;min-height:0;border-radius:14px}
 .hero-copy{padding:26px 22px 20px}
 .hero h1{font-size:clamp(27px,7.5vw,36px);line-height:1.18;letter-spacing:-1px}
 .hero .eyebrow{font-size:9px;line-height:1.5;letter-spacing:1px}
 .hero-store-name{font-size:15px}
 .hero-subtitle{font-size:12px;line-height:1.6}
 .hero-description{font-size:12px;line-height:1.65;max-width:none;margin-bottom:16px}
 .hero-cta{font-size:13px;min-height:46px}
 .hero-small{font-size:11px;max-width:none;margin-top:12px}
 .hero-art{position:relative;width:100%;height:155px;inset:auto;overflow:hidden;margin-top:-6px;pointer-events:none}
 .hero-art>img{width:235px;max-width:70%;max-height:180px;object-fit:contain}
 .hero-art:before{width:160px;height:140px;filter:blur(55px)}
 .orbit-one{width:180px;height:180px}.orbit-two{width:260px;height:260px}
 .trust-strip{gap:16px 12px;padding-block:20px}
 .trust-strip>div,.trust-strip>div:first-child{font-size:11px;align-items:flex-start}
 .trust-strip strong{font-size:10px;line-height:1.5}
 .trust-strip .icon{flex-shrink:0;margin-top:3px}
 .section-top{flex-wrap:wrap;gap:8px}
 .section-top .eyebrow{font-size:9px;line-height:1.6;letter-spacing:1px}
 .section-top h2{font-size:23px}
 .category-tile strong{font-size:12px}.category-tile small{font-size:10px}
 .category-tile{padding:14px 6px;min-width:0}
 .filter-tabs{padding-bottom:5px;overscroll-behavior-x:contain;scrollbar-width:thin}
 .filter-tabs button{font-size:12px;min-height:44px;flex-shrink:0}
 .sort-label{font-size:12px}.sort-label select{font-size:16px;min-height:44px}
 .catalog-section .section-top>.muted{font-size:11px;max-width:none;text-align:left}
 .demo-note{font-size:11px;line-height:1.6}
 .product-grid{gap:12px}
 .product-image{aspect-ratio:1.1;padding:20px 12px}
 .condition-badge{font-size:9px;max-width:calc(100% - 16px)}
 .product-body{padding:13px 11px}
 .product-category{font-size:9px;line-height:1.6;letter-spacing:0}
 .product-name{font-size:13px;line-height:1.45;height:3em}
 .stock{font-size:10px;line-height:1.5;min-height:30px;align-items:flex-start}
 .stock>span{flex-shrink:0;margin-top:5px}
 .product-price strong{font-size:22px}.product-price small{font-size:10px;line-height:1.5}
 .add-button{font-size:11px;line-height:1.4;min-height:46px;padding:9px 5px;gap:5px}
 .add-button .icon{width:16px;height:16px;flex-shrink:0}
 .contact-banner{padding:20px;gap:12px}.contact-banner>div:nth-child(2){min-width:0;flex:1 1 180px}
 .contact-banner h2{font-size:20px;line-height:1.35}.contact-banner p:not(.eyebrow){font-size:12px;line-height:1.7}
 .contact-banner>.secondary{font-size:13px;white-space:normal}
 .footer-main>div{font-size:12px}.footer-main p,.footer-main>a:last-child{font-size:12px}
 .footer-bottom{font-size:10px;padding-bottom:calc(24px + var(--safe-bottom))}
 .side-panel{top:var(--visual-viewport-top,0px);bottom:auto;height:100vh;height:min(100dvh,var(--visual-viewport-height,100dvh));width:min(450px,100%);padding:calc(16px + var(--safe-top)) max(16px,var(--safe-right)) calc(24px + var(--safe-bottom)) max(16px,var(--safe-left))}
 .departments{width:min(340px,100%)}
 .panel-heading{position:sticky;top:calc(-16px - var(--safe-top));background:#15111d;padding-block:8px;z-index:2}
 .panel-heading h2{font-size:24px}
 .cart-item{grid-template-columns:64px minmax(0,1fr);gap:12px}
 .cart-item>img{width:64px;height:72px}.cart-item strong{font-size:14px}.cart-item small{font-size:12px}.cart-item b{font-size:15px}
 .quantity{gap:8px;flex-wrap:wrap}.quantity span{font-size:14px}.quantity .icon{width:16px;height:16px}
 .cart-bottom label{font-size:13px}.cart-bottom input,.cart-bottom textarea,.cart-bottom select{font-size:16px}
 .cart-bottom .small-text{font-size:12px;line-height:1.6}.whatsapp-button{font-size:13px}
 .product-dialog,.editor-dialog{max-width:calc(100% - 24px - var(--safe-left) - var(--safe-right));padding:22px 16px;border-radius:14px}
 .dialog-close{position:sticky;top:0;margin-left:auto;display:grid;z-index:3}
 .detail-info h2{font-size:25px}.detail-description{font-size:14px;line-height:1.7}
 .detail-info dl>div{font-size:13px}.detail-info dd{overflow-wrap:anywhere}
 .detail-info>.muted{font-size:12px}.detail-info>.primary,.detail-info>.secondary{font-size:13px}
 button#floating-cart{left:max(12px,var(--safe-left));right:max(12px,var(--safe-right));width:auto;bottom:calc(12px + var(--safe-bottom));min-height:58px;font-size:14px}
 #floating-cart-total{font-size:15px}#floating-cart-count{font-size:12px;height:auto;min-height:24px;padding:2px 6px}
 body.has-cart-dock{padding-bottom:calc(96px + var(--safe-bottom))}
 .toast{bottom:calc(84px + var(--safe-bottom));font-size:13px}
 /* The owner console uses the same viewport/safe-area rules. */
 .login-layout{padding:calc(24px + var(--safe-top)) max(16px,var(--safe-right)) calc(24px + var(--safe-bottom)) max(16px,var(--safe-left));gap:22px}
 .login-card{padding:24px;min-width:0}.login-card h2{font-size:25px}.login-card>.muted{font-size:13px}
 .login-card form>label,.account-card label,.editor-columns label{font-size:13px}
 .login-card input,.editor-columns input,.editor-columns textarea,.editor-columns select,.account-card input{font-size:16px}
 .admin-sidebar{padding-left:max(16px,var(--safe-left));padding-right:max(16px,var(--safe-right));padding-top:calc(17px + var(--safe-top))}
 .admin-sidebar nav>button{font-size:12px;min-height:44px}
 #admin-content{padding:22px max(16px,var(--safe-right)) 30px max(16px,var(--safe-left))}
 .admin-page-heading{flex-wrap:wrap}.admin-page-heading>.primary{font-size:12px;min-height:44px}
 .admin-page-heading p:not(.eyebrow){font-size:12px;max-width:none}
 .metric-grid>article{padding:15px 12px;min-width:0}.metric-grid p{font-size:12px}.metric-grid small{font-size:10px}.metric-grid .metric-money{font-size:clamp(17px,5vw,23px);white-space:normal;overflow-wrap:anywhere}
 .welcome-band p,.demo-admin p{font-size:12px}.welcome-band strong{font-size:14px}.demo-admin>div{min-width:0}
 .table-scroll{max-width:100%;overscroll-behavior-x:contain}.admin-main{min-width:0}
 .admin-search input,.product-toolbar select{font-size:16px}.admin-search{min-width:0;flex-basis:100%}
 .editor-dialog .panel-heading{position:static}.editor-columns label{line-height:1.5}.form-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 .editor-footer{padding-bottom:var(--safe-bottom)}.editor-footer button{font-size:13px;min-height:44px}
}
@media(max-width:359px){
 .product-grid{grid-template-columns:minmax(0,1fr)}
 .product-image{aspect-ratio:1.45}.product-name{font-size:15px}
 .hero h1{font-size:26px}.hero-copy{padding-inline:18px}
 .brand{font-size:23px}.brand>img{width:28px}.brand-bottom{font-size:13px}
 .cart-toggle{gap:5px;font-size:10px}.cart-toggle strong{font-size:11px}
 .category-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}
 .metric-grid{grid-template-columns:minmax(0,1fr)}
}
@media(orientation:landscape) and (max-height:550px) and (max-width:1000px){
 .hero{grid-template-columns:1.2fr 1fr;min-height:0}
 .hero-copy{padding:24px}.hero-art{position:relative;width:100%;height:100%;inset:auto;align-self:center;min-height:200px}
 .hero-art>img{width:min(100%,280px);max-height:240px}.hero h1{font-size:30px}.hero-small{margin-top:8px}
 .hero-label,.hero-coordinate,.art-stamp{display:none}
 .trust-strip{grid-template-columns:repeat(4,minmax(0,1fr))}
 .product-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .product-dialog #product-detail{grid-template-columns:1fr 1fr;gap:20px}
 .detail-gallery>img{height:180px;max-height:180px}
 .side-panel{top:var(--visual-viewport-top,0px);bottom:auto;height:100vh;height:min(100dvh,var(--visual-viewport-height,100dvh));padding-bottom:calc(24px + var(--safe-bottom))}
 .login-layout{padding-block:20px;align-content:start}.login-brand-area>div,.login-brand-area>.muted{display:none}
}
