
:root{
 --bg:#f6f8fc;--card:#fff;--ink:#17223a;--muted:#7b879b;--line:#e5eaf2;
 --blue:#5264e8;--blue2:#7484f4;--soft:#edf0ff;--shadow:0 8px 28px rgba(25,40,80,.07);
}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--ink);
font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;-webkit-font-smoothing:antialiased}
button,input{font:inherit}.app{max-width:820px;margin:auto;min-height:100vh;padding-bottom:92px}
.topbar{height:72px;position:sticky;top:0;z-index:20;display:flex;justify-content:space-between;align-items:center;
padding:12px 18px;background:rgba(246,248,252,.92);backdrop-filter:blur(16px);border-bottom:1px solid rgba(229,234,242,.7)}
.brand{font-size:22px;font-weight:950;letter-spacing:.09em}.brand-sub{font-size:8px;letter-spacing:.15em;color:var(--muted);margin-top:1px}
.icon-btn{border:0;background:#fff;box-shadow:var(--shadow);height:42px;min-width:48px;border-radius:15px;position:relative;color:var(--ink)}
.cart-top b{font-size:11px;margin-left:3px}.hero{margin:18px;border-radius:28px;overflow:hidden;position:relative;min-height:258px;
background:linear-gradient(135deg,#e8ebff 0%,#e9f6ff 100%);padding:26px 24px;box-shadow:0 12px 34px rgba(70,95,180,.08)}
.hero-glow{position:absolute;width:240px;height:240px;border-radius:50%;right:-70px;top:-80px;background:rgba(255,255,255,.7)}
.hero-mark{position:absolute;right:22px;bottom:-30px;font-size:190px;line-height:1;font-weight:1000;color:rgba(82,100,232,.09);font-style:italic}
.hero-content{position:relative;z-index:2;max-width:610px}.eyebrow{font-size:11px;font-weight:900;letter-spacing:.16em;color:var(--blue)}
.hero h1{font-size:28px;line-height:1.08;margin:10px 0 10px;letter-spacing:-.025em}.hero h1 strong{font-weight:900}
.hero p{font-size:13px;line-height:1.5;color:#5f6b80;max-width:530px;margin:0}
.hero-tags{display:flex;flex-wrap:wrap;gap:7px;margin-top:18px}.hero-tags span{font-size:10px;background:rgba(255,255,255,.65);padding:8px 10px;border-radius:11px;color:#4d5b72}
.search-box{margin:0 18px 20px;height:52px;border:1px solid var(--line);background:#fff;border-radius:17px;display:flex;align-items:center;padding:0 14px;gap:9px;box-shadow:0 4px 18px rgba(25,40,80,.035)}
.search-icon{font-size:23px;color:var(--muted);line-height:1}.search-box input{border:0;outline:0;width:100%;color:var(--ink);background:transparent;font-size:14px}
.clear-btn{border:0;background:#edf0f5;color:#718097;border-radius:50%;width:24px;height:24px;line-height:20px;padding:0}.hidden{display:none!important}
.block{margin-top:22px}.section-title{display:flex;align-items:center;justify-content:space-between;padding:0 18px;margin-bottom:11px}
.section-title>div{display:flex;align-items:baseline;gap:8px}.section-title h2{font-size:18px;margin:0;letter-spacing:-.015em}.section-title button{border:0;background:transparent;color:var(--blue);font-size:12px;font-weight:800}
.count{font-size:11px;color:var(--muted)}.category-row{display:flex;gap:9px;overflow-x:auto;padding:0 18px 5px;scrollbar-width:thin;scrollbar-color:#aab4d0 transparent}.category-row::-webkit-scrollbar{height:8px}.category-row::-webkit-scrollbar-thumb{background:#aab4d0;border-radius:8px}
.category{flex:0 0 148px;width:148px;min-width:148px;height:94px;border:1px solid var(--line);border-radius:17px;background:#fff;text-align:left;padding:12px;display:flex;flex-direction:column;justify-content:space-between;box-shadow:0 4px 16px rgba(25,40,80,.03)}
.category.active{border-color:#cbd0ff;background:var(--soft)}.cat-icon{font-size:19px}.cat-name{font-size:11px;line-height:1.22;font-weight:750;color:#37445b;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;word-break:normal}
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;padding:0 18px}.card{background:#fff;border:1px solid var(--line);border-radius:19px;overflow:hidden;box-shadow:0 4px 18px rgba(25,40,80,.035);position:relative}
.card-photo{height:174px;background:#f1f4f9;display:flex;align-items:center;justify-content:center;position:relative}.card-photo img{width:100%;height:100%;object-fit:contain}
.photo-empty{font-size:30px;opacity:.22}.card-body{padding:12px 12px 13px}.card-name{font-size:13px;line-height:1.28;font-weight:800;min-height:50px}
.card-model{font-size:10px;color:var(--muted);line-height:1.25;margin-top:4px;min-height:25px}.card-bottom{display:flex;align-items:end;justify-content:space-between;gap:5px;margin-top:10px}
.price{font-size:15px;font-weight:950;letter-spacing:-.02em}.unit{font-size:9px;color:var(--muted);margin-top:2px}.add-btn{width:35px;height:35px;border:0;border-radius:12px;background:var(--blue);color:#fff;font-size:22px;line-height:1;box-shadow:0 6px 14px rgba(82,100,232,.22)}
.detail{padding:16px 18px 25px}.back{border:0;background:transparent;color:var(--blue);padding:4px 0 13px;font-size:13px;font-weight:800}.detail-photo{height:330px;border-radius:24px;background:#fff;border:1px solid var(--line);display:flex;align-items:center;justify-content:center;overflow:hidden}.detail-photo img{max-width:100%;max-height:100%;object-fit:contain}
.detail h1{font-size:23px;line-height:1.13;margin:17px 0 8px}.detail-brand{color:var(--blue);font-weight:800;font-size:12px}.meta{font-size:12px;line-height:1.65;color:var(--muted);margin-top:10px}.options{margin-top:18px}.options-title{font-weight:850;font-size:14px;margin-bottom:8px}
.option{border:1px solid var(--line);background:#fff;border-radius:15px;padding:13px;margin-top:8px;display:flex;align-items:center;justify-content:space-between}.option b{font-size:14px}.primary{width:100%;border:0;background:var(--blue);color:#fff;border-radius:16px;padding:15px;font-weight:850;margin-top:14px;box-shadow:0 8px 20px rgba(82,100,232,.2)}
.cart-header{display:flex;align-items:center;justify-content:space-between}.cart-clear{border:0;background:#fff;color:#d55d68;border:1px solid #f0d9dc;border-radius:10px;padding:7px 9px;font-size:11px}
.cart-item{display:grid;grid-template-columns:58px 1fr auto;gap:10px;align-items:center;padding:13px 0;border-bottom:1px solid var(--line)}.cart-thumb{width:58px;height:58px;border-radius:12px;background:#f0f3f8;display:flex;align-items:center;justify-content:center;overflow:hidden}.cart-thumb img{width:100%;height:100%;object-fit:contain}
.cart-name{font-size:12px;font-weight:800;line-height:1.3}.cart-price{font-size:11px;color:var(--muted);margin-top:4px}.qty{display:flex;align-items:center;gap:7px}.qty button{width:28px;height:28px;border:0;border-radius:9px;background:#f0f3f8;color:#3b4860}.remove{border:0;background:transparent;margin-left:2px}
.total-box{margin-top:17px;background:#fff;border:1px solid var(--line);border-radius:18px;padding:15px}.total-line{display:flex;justify-content:space-between;font-size:13px;color:var(--muted)}.total-line.final{color:var(--ink);font-weight:900;font-size:17px;margin-top:10px}
.empty{text-align:center;padding:70px 25px;color:var(--muted)}.empty-icon{font-size:45px;opacity:.5;margin-bottom:10px}
.bottom-nav{position:fixed;z-index:30;bottom:0;left:50%;transform:translateX(-50%);width:min(820px,100%);display:grid;grid-template-columns:repeat(4,1fr);
background:rgba(255,255,255,.96);border-top:1px solid var(--line);padding:8px 8px calc(8px + env(safe-area-inset-bottom));backdrop-filter:blur(14px)}
.bottom-nav button{border:0;background:transparent;color:#768298;font-size:10px;display:flex;flex-direction:column;align-items:center;gap:3px;position:relative}.bottom-nav button.active{color:var(--blue)}.nav-icon{font-size:18px;line-height:18px}.bottom-nav em{position:absolute;top:-1px;margin-left:24px;background:var(--blue);color:#fff;border-radius:10px;font-size:8px;font-style:normal;padding:2px 5px}
@media(min-width:650px){.grid{grid-template-columns:repeat(3,minmax(0,1fr))}.card-photo{height:190px}}

/* v3: stable horizontal category rail and non-overflowing cards */
.category-row{overflow-x:auto;overflow-y:hidden;touch-action:pan-x pan-y;overscroll-behavior-x:contain;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch}
.category{scroll-snap-align:start;flex-shrink:0;overflow:hidden}
.card-name{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}
.card-model{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}

.packaging-select{margin-top:16px}.pack-option{width:100%;display:flex;justify-content:space-between;align-items:center;border:1px solid #e0e5ef;background:#fff;border-radius:12px;padding:11px 12px;margin:7px 0;text-align:left;cursor:pointer}.pack-option.selected{border-color:#5365ed;background:#f0f2ff;box-shadow:0 0 0 1px #5365ed inset}.pack-option span{font-weight:750}.pack-option b{white-space:nowrap}.buy-qty{display:flex;justify-content:space-between;align-items:center;margin:15px 0;padding:12px;border:1px solid #e2e7ef;border-radius:12px;background:#fff}.buy-qty small{color:#758198}.buy-qty .qty{display:flex;align-items:center;gap:10px}.buy-qty .qty button{width:34px;height:34px;border:0;border-radius:10px;background:#f1f4f9;font-size:20px}.buy-qty .qty b{min-width:22px;text-align:center}

/* Storefront navigation and visible category controls. */
#catalogSection{scroll-margin-top:84px}
.category-controls{display:flex;justify-content:flex-end;gap:8px;padding:0 18px 8px}
.category-controls button{width:36px;height:32px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--blue);cursor:pointer}
.category-controls button:disabled{opacity:.35;cursor:default}
button{cursor:pointer}

.availability{display:inline-block;font-size:12px;padding:4px 8px;border-radius:8px;background:#eaf4ee;color:#22683d}.availability.expected{background:#fff1c2;color:#805000}.availability.unavailable{background:#eee;color:#555}button:disabled{opacity:.55;cursor:not-allowed}

.buy-qty .qty input{width:84px;min-width:0;text-align:center;font:inherit;font-weight:700;padding:8px 2px;border:1px solid #dce1eb;border-radius:8px;background:#fff;color:inherit}.selected-summary{font-size:13px;line-height:1.5;color:#526078;margin:8px 0 16px;overflow-wrap:anywhere}.buy-qty{gap:12px;flex-wrap:wrap}

.company-logo{display:block;width:auto;height:48px;max-width:min(220px,55vw);object-fit:contain;object-position:left center}.brand-wrap{min-width:0}
