
:root{--black:#101010;--white:#fff;--paper:#f7f7f7;--line:#e7e7e7;--muted:#707070}
*{box-sizing:border-box}
body{margin:0;font-family:Inter,Arial,"Noto Sans Khmer",sans-serif;color:var(--black);background:#fff}
a{color:inherit}
.wrap{width:min(1080px,calc(100% - 40px));margin:auto}
.site-header{position:sticky;top:0;z-index:30;background:#0b0b0b;color:#fff;border-bottom:1px solid #292929}
.site-nav{min-height:72px;display:flex;align-items:center;justify-content:space-between;gap:18px}
.site-brand{display:flex;align-items:center;gap:11px;text-decoration:none;font-weight:800;letter-spacing:-.4px}
.site-brand img{width:44px;height:44px;object-fit:contain;border-radius:50%}
.site-links{display:flex;align-items:center;gap:18px}
.site-links a{font-size:13px;color:#ddd;text-decoration:none}
.site-links a:hover{color:#fff}
.site-tools{display:flex;align-items:center;gap:8px}
.site-btn{border:1px solid #555;background:transparent;color:#fff;padding:9px 12px;border-radius:3px;font-size:12px;cursor:pointer;text-decoration:none}
.cart-trigger{position:relative}
.cart-count{display:inline-grid;place-items:center;min-width:18px;height:18px;padding:0 4px;border-radius:20px;background:#fff;color:#111;font-size:10px;font-weight:800;margin-left:4px}
.hero{background:#0b0b0b;color:#fff;padding:66px 0 72px}
.hero-inner{display:flex;align-items:center;justify-content:space-between;gap:38px}
.hero h1{font-size:clamp(44px,7vw,76px);line-height:.98;letter-spacing:-3.8px;margin:10px 0 18px;max-width:700px}
.hero p{max-width:570px;color:#c7c7c7;line-height:1.8;margin:0 0 25px}
.hero-logo{width:min(190px,28vw);height:auto;border-radius:50%;border:1px solid #333}
.eyebrow{font-size:11px;letter-spacing:2px;text-transform:uppercase;color:#888;font-weight:700}
.primary-btn{display:inline-flex;background:#fff;color:#111;padding:13px 18px;text-decoration:none;font-size:13px;font-weight:800;border-radius:3px;border:0;cursor:pointer}
section{padding:62px 0}
h2{font-size:clamp(28px,4vw,38px);letter-spacing:-1.4px;margin:0 0 10px}
.section-intro{color:var(--muted);line-height:1.75;max-width:660px;margin:0 0 28px;font-size:14px}
.category-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.category-card{display:block;border:1px solid var(--line);padding:22px;text-decoration:none;min-height:145px;transition:.2s}
.category-card:hover{border-color:#999;transform:translateY(-3px)}
.category-card .symbol{font-size:25px;margin-bottom:18px;color:#555}
.category-card strong{display:block;font-size:16px}
.category-card small{display:block;color:#777;margin-top:8px}
.about-section{background:#f6f6f6}
.about-grid{display:grid;grid-template-columns:1.2fr .8fr;gap:32px;align-items:center}
.about-list{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.about-tile{padding:17px;background:#fff;border:1px solid #e7e7e7;font-weight:700;font-size:13px}
.about-tile span{display:block;color:#777;font-weight:400;margin-top:6px;line-height:1.5}
.contact-section{background:#0b0b0b;color:#fff;text-align:center}
.contact-section p{color:#c7c7c7;line-height:1.8}
.contact-actions{display:flex;justify-content:center;align-items:center;gap:8px;flex-wrap:wrap;margin-top:18px;font-size:14px;line-height:1.8}
.contact-prompt{color:#d0d0d0;font-weight:400}
.contact-inline-link{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border:1px solid #454545;border-radius:6px;color:#fff;text-decoration:none;font-size:13px;font-weight:600;transition:background .18s ease,border-color .18s ease,color .18s ease}
.contact-inline-link svg{width:14px;height:14px;flex:0 0 14px;fill:currentColor}
.contact-inline-link--telegram{color:#fff;border-color:#454545}
.contact-inline-link--telegram:hover,.contact-inline-link--email:hover{background:rgba(255,255,255,.10);border-color:#fff;color:#fff}
.contact-inline-link:focus-visible{outline:2px solid #fff;outline-offset:3px}
.contact-separator{color:#777;margin-left:-5px;margin-right:-5px}
.site-footer{background:#0b0b0b;color:#999;border-top:1px solid #292929;padding:22px 0;text-align:center;font-size:12px}
.category-hero{background:#f6f6f6;padding:48px 0}
.category-hero h1{font-size:clamp(38px,6vw,60px);letter-spacing:-2.5px;margin:10px 0}
.category-hero p{color:#666;line-height:1.8;max-width:680px}
.catalog{padding:38px 0 72px}
.catalog-tools{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:20px}
.catalog-tools p{font-size:13px;color:#777}
.catalog-search{width:min(340px,100%);padding:12px 14px;border:1px solid #ddd;font:inherit;font-size:13px}
.product-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:15px}
.product-card{border:1px solid var(--line);padding:18px;background:#fff;transition:.2s;display:flex;flex-direction:column}
.product-card:hover{border-color:#aaa;transform:translateY(-2px);box-shadow:0 12px 28px #0000000a}
.product-visual{height:145px;background:#f3f3f3;display:grid;place-items:center;font-weight:800;font-size:28px;letter-spacing:-1px;margin-bottom:16px}
.product-card h3{font-size:17px;margin:0 0 7px}
.product-card p{font-size:13px;color:#666;line-height:1.65;margin:0;min-height:43px}
.product-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:14px 0}.product-price{font-size:20px;font-weight:800;color:#111}.stock-note{display:inline-flex;align-items:center;border-radius:999px;background:#e9fbf1;color:#087443;padding:6px 10px;font-size:11px;font-weight:800;margin:0;white-space:nowrap}
.product-actions{display:flex;gap:8px;margin-top:auto;flex-wrap:wrap}
.add-cart,.details-btn{border:1px solid #111;background:#111;color:#fff;padding:11px 12px;font-size:12px;font-weight:700;cursor:pointer}
.details-btn{background:#fff;color:#111}
.add-cart:hover{background:#444}
.details-btn:hover{background:#f4f4f4}
.no-results{display:none;padding:28px;text-align:center;color:#777;border:1px dashed #ccc;grid-column:1/-1}
.cart-overlay{position:fixed;inset:0;background:#0008;z-index:80;display:none}
.cart-overlay.open{display:block}
.cart-panel{position:fixed;z-index:81;right:0;top:0;height:100%;width:min(460px,100%);background:#fff;transform:translateX(105%);transition:transform .25s;display:flex;flex-direction:column;box-shadow:-10px 0 40px #0002}
.cart-panel.open{transform:translateX(0)}
.cart-head{padding:20px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center}
.cart-head h2{font-size:22px;margin:0}
.icon-button{border:1px solid #ddd;background:white;padding:8px 11px;cursor:pointer}
.cart-items{padding:12px 20px;overflow:auto;flex:1}
.cart-row{display:grid;grid-template-columns:1fr auto;gap:12px;padding:15px 0;border-bottom:1px solid var(--line)}
.cart-row strong{font-size:14px}
.cart-row small{display:block;color:#777;margin-top:5px}
.qty-controls{display:flex;align-items:center;gap:8px;margin-top:9px}
.qty-controls button{width:26px;height:26px;border:1px solid #ddd;background:#fff;cursor:pointer}
.remove-item{border:0;background:none;color:#777;text-decoration:underline;cursor:pointer;font-size:11px}
.cart-empty{color:#777;text-align:center;padding:40px 10px}
.cart-foot{border-top:1px solid var(--line);padding:18px 20px}
.checkout-form{display:grid;gap:9px;margin-top:14px}
.checkout-form input,.checkout-form textarea{width:100%;padding:11px 12px;border:1px solid #ddd;font:inherit;font-size:13px}
.checkout-form textarea{min-height:65px;resize:vertical}
.telegram-checkout{background:#111;color:#fff;border:0;padding:14px;font-weight:800;cursor:pointer}
.telegram-checkout:disabled{opacity:.4;cursor:not-allowed}
.disclaimer{font-size:10px;color:#777;line-height:1.5;margin:9px 0 0}
.toast{position:fixed;bottom:20px;left:50%;transform:translate(-50%,20px);background:#111;color:#fff;padding:12px 16px;font-size:13px;opacity:0;pointer-events:none;transition:.2s;z-index:100}
.toast.show{opacity:1;transform:translate(-50%,0)}
.details-modal{position:fixed;inset:0;background:#0008;z-index:90;display:none;place-items:center;padding:18px}
.details-modal.open{display:grid}
.details-box{background:#fff;width:min(460px,100%);padding:24px;position:relative}
.details-box h3{margin:0 0 10px;font-size:22px}
.details-box p{color:#666;line-height:1.7;font-size:14px}
@media(max-width:720px){.site-nav{min-height:65px}.site-brand img{width:40px;height:40px}.site-links{display:none}.hero-inner{flex-direction:column-reverse;align-items:flex-start}.hero-logo{width:120px}.hero{padding:48px 0}.hero h1{letter-spacing:-2.3px}.category-grid{grid-template-columns:repeat(2,1fr)}.about-grid{grid-template-columns:1fr}.product-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:470px){.wrap{width:calc(100% - 28px)}.catalog-tools{align-items:stretch;flex-direction:column}.catalog-search{width:100%}.product-grid{grid-template-columns:1fr}.product-visual{height:125px}.category-grid{gap:9px}.category-card{padding:17px;min-height:135px}.hero h1{font-size:46px}}

/* Cart control polish: make Remove a clear, easy-to-tap action. */
.cart-row .remove-item{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:30px;padding:4px 8px;margin-left:2px;
  border:0!important;background:transparent!important;
  color:#666!important;text-decoration:underline;
  font:inherit;font-size:12px;line-height:1.2;cursor:pointer;
  border-radius:2px;
}
.cart-row .remove-item:hover{color:#111!important;background:#f3f3f3!important}
.cart-row .qty-controls button[data-action="minus"],
.cart-row .qty-controls button[data-action="plus"]{
  width:32px;height:32px;display:inline-grid;place-items:center;
  border:1px solid #ddd;background:#fff;cursor:pointer;font-size:16px;
}
.cart-row .qty-controls button:focus-visible,
.cart-row .remove-item:focus-visible{outline:2px solid #111;outline-offset:2px}

/* Homepage hero refresh: clean background image, editable HTML copy, no baked-in text */
.hero{
 position:relative;isolation:isolate;overflow:hidden;color:#fff;
 min-height:590px;padding:76px 0 58px;
 background:#090a0b url("workspace-cover.png") center 54%/cover no-repeat;
}
.hero-overlay{position:absolute;inset:0;z-index:-1;
 background:linear-gradient(90deg,rgba(5,6,7,.94) 0%,rgba(5,6,7,.82) 42%,rgba(5,6,7,.40) 100%),
            linear-gradient(0deg,rgba(5,6,7,.58),transparent 45%);
}
.hero-inner{display:flex;align-items:center;justify-content:flex-start;min-height:455px}
.hero-content{width:min(760px,100%);padding:10px 0}
.hero .eyebrow{font-size:11px;font-weight:800;letter-spacing:2.2px;color:#e6e6e6;margin:0 0 22px}
.hero h1{font-size:clamp(46px,6.4vw,78px);line-height:.99;letter-spacing:-3.6px;margin:0 0 22px;max-width:780px;color:#fff}
.hero p{max-width:570px;color:#e0e0e0;line-height:1.7;font-size:16px;margin:0 0 27px}
.hero-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.hero .primary-btn,.hero .secondary-btn{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:0 22px;border-radius:5px;font-weight:800;text-decoration:none}
.hero .primary-btn{background:#fff;color:#111;border:1px solid #fff}
.hero .secondary-btn{background:rgba(10,10,10,.35);color:#fff;border:1px solid rgba(255,255,255,.72)}
.hero .primary-btn:hover{background:#eaeaea}
.hero .secondary-btn:hover{background:rgba(255,255,255,.12)}
.hero-features{display:flex;gap:0;align-items:center;margin-top:48px;flex-wrap:wrap}
.hero-features>div{display:flex;align-items:center;gap:10px;padding:0 22px;border-right:1px solid rgba(255,255,255,.35);font-size:12px}
.hero-features>div:first-child{padding-left:0}
.hero-features>div:last-child{border:0}
.hero-features b,.hero-features small{display:block;color:#fff}
.hero-features b{font-size:12px;margin-bottom:3px}
.hero-features small{font-size:11px;color:#ddd}
.feature-icon{width:30px;height:30px;border:1px solid rgba(255,255,255,.8);border-radius:50%;display:grid;place-items:center;font-size:15px}
@media(max-width:720px){
 .hero{min-height:600px;padding:58px 0 42px;background-position:62% center}
 .hero-overlay{background:linear-gradient(90deg,rgba(5,6,7,.92),rgba(5,6,7,.62)),linear-gradient(0deg,rgba(5,6,7,.45),transparent)}
 .hero-inner{min-height:500px;align-items:center}
 .hero-content{padding:0}
 .hero h1{font-size:clamp(42px,10vw,58px);letter-spacing:-2.5px}
 .hero p{font-size:14px}
 .hero-features{margin-top:35px;gap:16px}
 .hero-features>div{padding:0 12px 0 0;border:0}
}
@media(max-width:430px){
 .hero{min-height:620px}
 .hero .primary-btn,.hero .secondary-btn{width:100%}
 .hero-features{gap:14px}
 .hero-features>div{min-width:calc(50% - 8px)}
}

/* Responsive layout refinements */
html{scroll-behavior:smooth;scroll-padding-top:90px}
body{min-width:320px;overflow-x:hidden}
img,svg,video,canvas{max-width:100%;height:auto}
button,input,textarea,select{max-width:100%;font:inherit}
.wrap{width:min(1080px,calc(100% - 40px))}
.site-nav{flex-wrap:nowrap}
.site-brand{min-width:0;flex-shrink:0}
.site-links{min-width:0}
.site-tools{flex-shrink:0}
.hero{background-size:cover;background-repeat:no-repeat}
.hero-inner{width:min(1080px,calc(100% - 40px))}
.category-card,.product-card{min-width:0;overflow-wrap:anywhere}
.product-card h3,.product-card p{overflow-wrap:anywhere}
.product-actions>*{min-height:40px}
.cart-panel{max-height:100dvh;overflow:hidden}
.cart-items{min-height:0}
.cart-foot{max-height:48dvh;overflow:auto}
.checkout-form input,.checkout-form textarea{min-width:0}
.details-box{max-height:calc(100dvh - 36px);overflow:auto}
:focus-visible{outline:2px solid #555;outline-offset:3px}

@media(max-width:900px){
 .site-nav{gap:12px}
 .site-links{gap:12px}
 .site-links a{font-size:12px;white-space:nowrap}
 .site-brand img{width:40px;height:40px}
 .site-btn{padding:8px 10px}
 .hero{background-position:58% center}
 .hero h1{max-width:650px}
 .hero-features{row-gap:14px}
 .about-grid{gap:22px}
}
@media(max-width:720px){
 .site-nav{min-height:0;padding-top:11px;padding-bottom:10px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:9px 12px}
 .site-brand{grid-column:1;grid-row:1}
 .site-tools{grid-column:2;grid-row:1;gap:6px}
 .site-links{grid-column:1/-1;grid-row:2;display:flex;gap:18px;width:100%;overflow-x:auto;overscroll-behavior-x:contain;padding:3px 0 5px;scrollbar-width:thin}
 .site-links a{font-size:12px;flex:0 0 auto}
 .hero{min-height:560px;padding:48px 0 36px;background-position:65% center}
 .hero-overlay{background:linear-gradient(90deg,rgba(5,6,7,.90) 0%,rgba(5,6,7,.72) 58%,rgba(5,6,7,.48) 100%),linear-gradient(0deg,rgba(5,6,7,.48),transparent 55%)}
 .hero-inner{min-height:470px;align-items:center}
 .hero-content{width:100%}
 .hero h1{font-size:clamp(38px,8vw,56px);letter-spacing:-2px;line-height:1.02}
 .hero p{font-size:14px;line-height:1.65}
 .hero-features{margin-top:28px;gap:14px 18px}
 .hero-features>div{padding:0;border:0;min-width:calc(33.333% - 14px)}
 section{padding:48px 0}
 .category-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .about-grid{grid-template-columns:1fr}
 .product-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .catalog-tools{align-items:stretch}
 .catalog-search{width:100%}
}
@media(max-width:480px){
 .wrap,.hero-inner{width:calc(100% - 28px)}
 .site-brand{font-size:14px;gap:8px}
 .site-brand img{width:36px;height:36px}
 .site-btn{padding:8px 9px;font-size:11px}
 .site-links{gap:15px}
 .hero{min-height:590px;padding:42px 0 30px;background-position:68% center}
 .hero-inner{min-height:510px}
 .hero h1{font-size:clamp(35px,9.5vw,46px);letter-spacing:-1.7px}
 .hero .primary-btn,.hero .secondary-btn{min-height:44px;padding:0 14px;font-size:12px}
 .hero-actions{gap:8px}
 .hero-features{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 10px}
 .hero-features>div{min-width:0;gap:7px}
 .feature-icon{width:27px;height:27px;flex:0 0 27px}
 .hero-features b{font-size:11px}
 .hero-features small{font-size:10px}
 h2{font-size:29px}
 .category-grid{gap:9px}
 .category-card{padding:15px;min-height:125px}
 .category-card strong{font-size:14px}
 .category-card small{font-size:11px;line-height:1.45}
 .product-grid{grid-template-columns:1fr}
 .product-card{padding:15px}
 .product-visual{height:135px}
 .product-actions{gap:7px}
 .product-actions>*{flex:1 1 auto}
 .about-list{grid-template-columns:1fr}
 .cart-head,.cart-items{padding-left:15px;padding-right:15px}
 .cart-foot{padding:14px 15px}
 .qty-controls{flex-wrap:wrap}
 .contact-actions{flex-direction:row;align-items:center;gap:7px;font-size:13px}
 .contact-inline-link{padding:4px 8px}
}
@media(prefers-reduced-motion:reduce){
 html{scroll-behavior:auto}
 *,*::before,*::after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}
}

/* Consistent category line icons */
.category-card .symbol{display:flex;align-items:center;justify-content:center}
.category-card .symbol svg{width:34px;height:34px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.category-card:hover .symbol{transform:translateY(-2px)}
.category-card .symbol{transition:transform .2s ease}

/* Category photo covers */
.category-card{overflow:hidden;display:flex;flex-direction:column;align-items:stretch}
.category-card .category-cover{width:100%;height:76px;overflow:hidden;border-radius:12px;background:#f5f7fa;margin-bottom:12px}
.category-card .category-cover img{display:block;width:100%;height:100%;object-fit:cover}
.category-card strong,.category-card small{display:block}
@media(max-width:600px){.category-card .category-cover{height:64px}}

/* ONCE Electronic category cards — clean photo-led layout */
#products{background:#fff}
#products .category-grid{
 display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:20px;
 align-items:stretch;margin-top:26px
}
#products .category-card{
 grid-column:span 2;position:relative;display:flex;flex-direction:column;
 min-width:0;min-height:0;padding:18px 18px 17px;border:1px solid #e5e7eb;
 border-radius:20px;background:#fff;box-shadow:0 5px 14px rgba(15,23,42,.07);
 text-decoration:none;overflow:hidden;transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease
}
#products .category-card:nth-child(4){grid-column:2 / span 2}
#products .category-card:nth-child(5){grid-column:4 / span 2}
#products .category-card:hover{transform:translateY(-4px);border-color:#d1d5db;box-shadow:0 12px 24px rgba(15,23,42,.10)}
#products .category-card .category-cover{
 width:100%;height:156px;margin:0 0 14px;border-radius:13px;background:#f7f8fa;overflow:hidden
}
#products .category-card .category-cover img{width:100%;height:100%;display:block;object-fit:cover}
#products .category-card strong{font-size:21px;line-height:1.2;letter-spacing:-.45px;color:#111827;padding-right:42px}
#products .category-card small{font-size:14px;line-height:1.45;color:#4b5563;margin-top:7px;padding-right:42px}
#products .category-card:after{
 content:"→";position:absolute;right:18px;bottom:17px;width:42px;height:42px;
 display:flex;align-items:center;justify-content:center;border:1px solid #e5e7eb;
 border-radius:50%;background:#fff;color:#111827;font-size:23px;line-height:1;
 box-shadow:0 2px 6px rgba(0,0,0,.08)
}
@media(max-width:900px){
 #products .category-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
 #products .category-card,#products .category-card:nth-child(4),#products .category-card:nth-child(5){grid-column:auto}
 #products .category-card .category-cover{height:132px}
 #products .category-card strong{font-size:18px}
}
@media(max-width:560px){
 #products .category-grid{grid-template-columns:1fr;gap:12px}
 #products .category-card{padding:14px;border-radius:16px}
 #products .category-card .category-cover{height:150px}
 #products .category-card strong{font-size:18px}
 #products .category-card small{font-size:13px}
 #products .category-card:after{width:36px;height:36px;right:14px;bottom:14px}
}

/* Subtle frame around category product photos */
#products .category-card .category-cover{
  border:1px solid #e5e7eb;
  box-sizing:border-box;
  background:#f8fafc;
}
#products .category-card .category-cover img{
  border-radius:12px;
}

/* ONCE Electronic social links */
.social-heading{margin:28px 0 14px;font-size:16px;font-weight:650}
.social-links{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin:0 auto}
.social-link{display:inline-flex;align-items:center;gap:9px;padding:9px 14px;border:1px solid rgba(128,128,128,.25);border-radius:999px;text-decoration:none;color:inherit;background:rgba(255,255,255,.06);font-size:13px;font-weight:600;transition:transform .18s ease,border-color .18s ease}
.social-link:hover{transform:translateY(-2px);border-color:currentColor}
.social-icon{display:inline-flex;align-items:center;justify-content:center;width:23px;height:23px;border-radius:50%;font-size:14px;font-weight:800;background:#f1f5f9;color:#111827}
.social-link.telegram .social-icon{background:#229ED9;color:white}
.social-link.facebook .social-icon{background:#1877F2;color:white;font-family:Arial,sans-serif;font-size:17px}
.social-link.youtube .social-icon{background:#ff0033;color:white;font-size:10px}
.social-link.tiktok .social-icon{background:#111;color:white;font-size:16px}
.site-footer .social-links{margin-top:14px}
.site-footer .social-link{font-size:12px;padding:7px 11px}
@media(max-width:480px){.social-links{gap:8px}.social-link{padding:8px 11px;font-size:12px}}

/* Footer contains copyright only; social links appear once in Contact. */
.site-footer .social-links{display:none!important}

/* Arduino & ESP32 product images and stock labels */
.product-visual img{width:100%;height:100%;object-fit:contain;display:block;padding:9px;box-sizing:border-box}
.stock-note.in-stock{display:inline-flex;align-items:center;width:max-content;max-width:100%;padding:5px 9px;border-radius:999px;background:#ecfdf3;color:#167344;font-size:11px;font-weight:700;letter-spacing:.2px}
.product-placeholder{display:flex;align-items:center;justify-content:center;color:#64748b;font-size:24px;font-weight:700;background:#f8fafc}

/* Smaller, balanced product photos across Arduino & ESP32 cards */
.product-card .product-visual img{
  width:82%;
  height:82%;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  padding:0;
  margin:auto;
}

/* Product card image layout fix: keep every photo inside its own image frame */
.product-card{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  min-width:0;
}
.product-card .product-visual{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:190px;
  min-height:190px;
  flex:0 0 190px;
  margin:0 0 16px;
  padding:10px;
  box-sizing:border-box;
  overflow:hidden;
  background:#f7f8fa;
  border:1px solid #e8eaee;
  border-radius:12px;
}
.product-card .product-visual img{
  position:static;
  display:block;
  width:100%;
  height:100%;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  padding:0;
  margin:0;
  box-sizing:border-box;
}
.product-card h3{
  position:static;
  margin:0 0 7px;
  line-height:1.3;
}
.product-card p{
  position:static;
  margin:0 0 14px;
  min-height:43px;
}
.product-card .stock-note{
  align-self:flex-start;
  margin:0 0 14px;
}
.product-card .product-actions{
  margin-top:auto;
}
@media(max-width:700px){
  .product-card .product-visual{
    height:165px;
    min-height:165px;
    flex-basis:165px;
  }
}

/* Product prices */
.product-card .product-price{
  margin:0 0 12px;
  color:#111827;
  font-size:20px;
  line-height:1.2;
  font-weight:750;
  letter-spacing:-.35px;
}

/* Add-to-cart microinteraction */
.cart-trigger{transform-origin:center;will-change:transform}
.product-card .add-cart{transition:transform .16s ease,background .16s ease}
.product-card .add-cart:active{transform:scale(.96)}
@media(prefers-reduced-motion:reduce){
 .product-card .add-cart,.cart-trigger{transition:none!important}
}

@media(max-width:520px){.product-meta{align-items:flex-start}.product-price{font-size:18px}}


/* Consistent product-card information alignment across every catalog page */
.product-card h3{min-height:2.6em}
.product-card p{min-height:3.3em}
.product-card .product-meta{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:10px;min-height:38px;margin:14px 0 18px}
.product-card .product-price{margin:0;white-space:nowrap}
.product-card .stock-note{margin:0 0 0 auto;white-space:nowrap}
@media(max-width:520px){.product-card .product-meta{align-items:center}.product-card h3{min-height:2.6em}}


/* Arduino & ESP32: keep price and stock badge in one aligned row */
.product-card .product-meta{
  display:flex;
  flex-direction:row;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  width:100%;
  min-height:38px;
  margin:14px 0 18px;
}
.product-card .product-meta .product-price{
  margin:0;
  line-height:1.2;
  white-space:nowrap;
}
.product-card .product-meta .stock-note{
  margin:0 0 0 auto;
  align-self:center;
  white-space:nowrap;
}
.product-card .product-actions{margin-top:auto}


/* Product catalog: keep every description to exactly two lines maximum.
   Full descriptions remain available through each product's Details view. */
.product-card > p{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  line-clamp:2;
  overflow:hidden;
  height:calc(1.65em * 2);
  min-height:calc(1.65em * 2);
  max-height:calc(1.65em * 2);
}

/* Compact product cards: reduce overall card height while preserving alignment */
.product-card{padding:14px!important}
.product-card .product-visual{
  height:155px;
  min-height:155px;
  flex-basis:155px;
  margin-bottom:12px;
}
.product-card h3{margin-bottom:5px}
.product-card > p{
  margin-bottom:6px;
  height:calc(1.65em * 2);
  min-height:calc(1.65em * 2);
  max-height:calc(1.65em * 2);
}
.product-card .product-meta{min-height:34px;margin:8px 0 12px}
.product-card .product-actions{gap:7px}
.product-card .product-actions>*{min-height:38px}
@media(max-width:700px){
  .product-card .product-visual{height:135px;min-height:135px;flex-basis:135px}
}

/* Homepage global product search */
.home-search-wrap{max-width:620px;margin:0 0 28px;position:relative}
.home-search-wrap>label{display:block;font-size:13px;font-weight:700;margin-bottom:8px}
.home-search-control{display:flex;align-items:center;border:1px solid #d9d9d9;background:#fff}
.home-search-control:focus-within{border-color:#111;box-shadow:0 0 0 2px #1111}
.home-search-control input{width:100%;min-width:0;padding:14px 15px;border:0;outline:0;font:inherit;font-size:14px;background:transparent}
.home-search-control span{padding:0 15px;font-size:24px;color:#777}
.home-search-results{display:none;position:absolute;z-index:20;top:100%;left:0;right:0;max-height:340px;overflow:auto;background:#fff;border:1px solid #ddd;border-top:0;box-shadow:0 12px 24px #00000012}
.home-search-results.show{display:block}
.home-search-result{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 15px;border-bottom:1px solid #eee;text-decoration:none}
.home-search-result:last-child{border-bottom:0}
.home-search-result:hover{background:#f7f7f7}
.home-search-result strong{display:block;font-size:13px}
.home-search-result small{display:block;color:#777;font-size:11px;margin-top:4px}
.home-search-empty{padding:15px;color:#777;font-size:13px}
@media(max-width:520px){.home-search-wrap{max-width:none}.home-search-result{align-items:flex-start}}


/* 3D Printing feature cards: give the supplied poster artwork more room */
.product-card[data-id="3d-printing-pla-filament"] .product-visual,
.product-card[data-id="3d-printing-service-hour"] .product-visual{
  height:320px;
  min-height:320px;
  flex-basis:320px;
  padding:4px;
  margin-bottom:16px;
  background:#f7f9fc;
}
.product-card[data-id="3d-printing-pla-filament"] .product-visual img,
.product-card[data-id="3d-printing-service-hour"] .product-visual img{
  width:100%;
  height:100%;
  object-fit:contain;
  padding:0;
}
@media(max-width:640px){
  .product-card[data-id="3d-printing-pla-filament"] .product-visual,
  .product-card[data-id="3d-printing-service-hour"] .product-visual{
    height:260px;
    min-height:260px;
    flex-basis:260px;
  }
}


/* ONCE Electronic refreshed cart drawer */
.cart-panel{
  width:min(860px,100%);
  max-width:100vw;
  background:#fff;
  border-left:1px solid #e5ebf5;
}
.cart-head{
  flex:0 0 auto;
  padding:22px 28px;
  gap:16px;
  justify-content:flex-start;
  border-bottom:1px solid #e8edf5;
}
.cart-heading-mark{
  width:58px;height:58px;flex:0 0 58px;border-radius:16px;
  display:grid;place-items:center;background:linear-gradient(145deg,#2998ff,#0752d9);
  color:#fff;font-size:28px;box-shadow:0 7px 18px #0752d933;
}
.cart-heading-copy{flex:1;min-width:0}
.cart-heading-copy h2{font-size:27px;line-height:1.15;color:#101d38;margin:0 0 5px}
.cart-heading-copy p{font-size:14px;color:#64748b;margin:0}
.cart-head .icon-button{
  width:44px;height:44px;padding:0;border:1px solid #dce4f0;border-radius:12px;
  color:#15213a;font-size:28px;line-height:1;background:#fff;
}
.cart-items{padding:4px 28px 12px;flex:1 1 auto;min-height:100px}
.cart-row{
  display:grid;
  grid-template-columns:28px 94px minmax(130px,1fr) 142px 112px 30px;
  align-items:center;gap:14px;padding:18px 0;border-bottom:1px solid #e7edf5;
}
.cart-select-mark{
  width:27px;height:27px;border-radius:7px;background:#0865ed;color:white;
  display:grid;place-items:center;font-size:17px;font-weight:800;
}
.cart-thumb{
  width:94px;height:94px;border-radius:15px;background:#f0f5ff;border:1px solid #dfe9fb;
  display:grid;place-items:center;overflow:hidden;color:#2563eb;font-size:30px;
}
.cart-thumb img{width:100%;height:100%;object-fit:contain;padding:7px;box-sizing:border-box}
.cart-product-info{min-width:0}
.cart-product-info>strong{display:block;color:#101d38;font-size:16px;line-height:1.3}
.cart-category{display:inline-block!important;width:max-content;max-width:100%;padding:5px 9px;margin-top:7px!important;border-radius:8px;background:#edf4ff;color:#405879!important;font-size:12px!important}
.cart-unit-price{margin-top:6px;color:#075fe5;font-size:18px;font-weight:800}
.cart-quantity label,.cart-subtotal label{display:block;color:#64748b;font-size:12px;margin-bottom:7px}
.cart-quantity .qty-controls{
  display:flex;align-items:center;justify-content:space-between;gap:0;margin:0;
  height:38px;border:1px solid #d6dfed;border-radius:10px;overflow:hidden;
}
.cart-quantity .qty-controls button{
  width:38px;height:38px;border:0;background:#f8faff;color:#075fe5;font-size:20px;font-weight:700;
}
.cart-quantity .qty-controls span{min-width:28px;text-align:center;color:#15213a;font-weight:700}
.cart-subtotal strong{display:block;color:#101d38;font-size:17px;white-space:nowrap}
.cart-row .remove-item{
  width:30px;height:36px;padding:0;text-decoration:none;color:#64748b;font-size:23px;
  border:0;background:transparent;line-height:1;
}
.cart-row .remove-item:hover{color:#dc2626}
.cart-empty{display:flex;flex-direction:column;align-items:center;gap:9px;padding:58px 15px;color:#64748b}
.cart-empty-icon{font-size:42px}
.cart-empty strong{font-size:18px;color:#17243d}
.cart-empty small{font-size:13px}
.cart-foot{
  flex:0 0 auto;padding:18px 28px 22px;border-top:1px solid #e7edf5;background:#fff;
  max-height:48vh;overflow-y:auto;
}
.cart-checkout-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(220px,.85fr);gap:18px;align-items:stretch}
.checkout-form{display:grid;gap:9px;margin:0}
.checkout-form input,.checkout-form textarea{
  width:100%;padding:12px 14px;border:1px solid #d5deeb;border-radius:10px;
  font:inherit;font-size:14px;color:#17243d;background:#fff;box-sizing:border-box;outline:none;
}
.checkout-form input:focus,.checkout-form textarea:focus{border-color:#2683f6;box-shadow:0 0 0 3px #2683f61a}
.checkout-form textarea{min-height:76px;resize:vertical}
.cart-summary{
  padding:15px;border:1px solid #e3eaf5;border-radius:14px;background:#fbfdff;
  box-shadow:0 4px 14px #122b4d0a;
}
.cart-summary h3{margin:0 0 17px;color:#101d38;font-size:17px}
.cart-summary-line{display:flex;justify-content:space-between;gap:8px;color:#64748b;font-size:13px;padding-bottom:13px;border-bottom:1px solid #e6edf6}
.cart-summary-line strong{color:#17243d}
.cart-summary-total{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:13px;padding:11px 12px;border-radius:10px;background:#eaf3ff;color:#101d38;font-size:16px}
.cart-summary-total strong:last-child{color:#075fe5;font-size:23px;white-space:nowrap}
.telegram-checkout{
  display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:58px;margin-top:15px;
  border:0;border-radius:12px;background:linear-gradient(105deg,#168df4,#0754db);
  color:#fff;font-size:17px;font-weight:800;box-shadow:0 7px 18px #0754db2b;
}
.telegram-checkout span{font-size:22px}
.telegram-checkout:hover{filter:brightness(1.04)}
.telegram-checkout:disabled{opacity:.4;box-shadow:none}
.disclaimer{font-size:11px;color:#718096;line-height:1.55;margin:9px 0 0;text-align:center}
.cart-trust-row{
  display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:15px;padding:12px 8px;
  border-radius:13px;background:#f0f6ff;
}
.cart-trust-row>div{display:flex;align-items:center;justify-content:center;gap:9px;min-width:0;padding:2px 8px}
.cart-trust-row>div+div{border-left:1px solid #d5e2f5}
.cart-trust-row b{color:#0872ec;font-size:24px}
.cart-trust-row span{display:flex;flex-direction:column;gap:3px;min-width:0}
.cart-trust-row strong{font-size:11px;color:#17243d}
.cart-trust-row small{font-size:10px;color:#64748b}
@media(max-width:700px){
  .cart-panel{width:100%;height:100dvh}
  .cart-head{padding:15px 16px}
  .cart-heading-mark{width:46px;height:46px;flex-basis:46px;font-size:22px;border-radius:13px}
  .cart-heading-copy h2{font-size:22px}
  .cart-heading-copy p{font-size:12px}
  .cart-items{padding:0 16px 10px}
  .cart-row{
    grid-template-columns:22px 66px minmax(0,1fr) 28px;
    gap:9px;padding:13px 0;
  }
  .cart-select-mark{width:21px;height:21px;font-size:13px;border-radius:6px}
  .cart-thumb{width:66px;height:66px;border-radius:11px}
  .cart-product-info>strong{font-size:14px}
  .cart-category{font-size:10px!important;padding:4px 6px}
  .cart-unit-price{font-size:15px}
  .cart-quantity{grid-column:3;grid-row:2;display:flex;align-items:center;gap:9px;margin-top:-3px}
  .cart-quantity label{margin:0}
  .cart-quantity .qty-controls{height:31px;width:108px}
  .cart-quantity .qty-controls button{width:31px;height:31px;font-size:17px}
  .cart-subtotal{grid-column:2/4;grid-row:3;display:flex;align-items:center;gap:8px;margin-top:-4px}
  .cart-subtotal label{margin:0}
  .cart-subtotal strong{font-size:14px}
  .cart-row .remove-item{grid-column:4;grid-row:1}
  .cart-foot{padding:13px 16px 16px;max-height:52vh}
  .cart-checkout-grid{grid-template-columns:1fr;gap:10px}
  .checkout-form{grid-template-columns:1fr 1fr}
  .checkout-form textarea{grid-column:1/-1}
  .cart-summary{padding:11px 13px}
  .cart-summary h3{margin-bottom:10px}
  .cart-summary-total{margin-top:8px;padding:8px 10px}
  .cart-summary-total strong:last-child{font-size:20px}
  .telegram-checkout{min-height:50px;font-size:15px;margin-top:11px}
  .cart-trust-row{display:none}
}
@media(max-width:390px){
  .checkout-form{grid-template-columns:1fr}
  .checkout-form textarea{grid-column:auto}
  .cart-foot{max-height:58vh}
}


/* Compact cart sizing, following the supplied reference */
.cart-panel{width:min(680px,100%);}
.cart-head{padding:16px 20px;gap:12px}
.cart-heading-mark{width:48px;height:48px;flex-basis:48px;border-radius:13px;font-size:23px}
.cart-heading-copy h2{font-size:23px;margin-bottom:3px}
.cart-heading-copy p{font-size:12px}
.cart-head .icon-button{width:38px;height:38px;font-size:24px}
.cart-items{padding:0 20px 8px}
.cart-row{
  grid-template-columns:23px 70px minmax(100px,1fr) 112px 86px 26px;
  gap:10px;padding:12px 0;
}
.cart-select-mark{width:22px;height:22px;font-size:14px;border-radius:6px}
.cart-thumb{width:70px;height:70px;border-radius:12px}
.cart-product-info>strong{font-size:14px}
.cart-category{font-size:10px!important;padding:4px 7px;margin-top:5px!important}
.cart-unit-price{font-size:16px;margin-top:4px}
.cart-quantity label,.cart-subtotal label{font-size:11px;margin-bottom:5px}
.cart-quantity .qty-controls{height:32px}
.cart-quantity .qty-controls button{width:32px;height:32px;font-size:18px}
.cart-quantity .qty-controls span{font-size:13px}
.cart-subtotal strong{font-size:15px}
.cart-row .remove-item{font-size:20px}
.cart-foot{padding:13px 20px 15px;max-height:42vh}
.cart-checkout-grid{gap:12px}
.checkout-form{gap:7px}
.checkout-form input,.checkout-form textarea{padding:9px 11px;font-size:12px;border-radius:8px}
.checkout-form textarea{min-height:62px}
.cart-summary{padding:11px;border-radius:11px}
.cart-summary h3{font-size:15px;margin-bottom:12px}
.cart-summary-line{font-size:12px;padding-bottom:9px}
.cart-summary-total{font-size:14px;padding:8px 9px;margin-top:9px}
.cart-summary-total strong:last-child{font-size:20px}
.telegram-checkout{min-height:46px;margin-top:11px;border-radius:9px;font-size:15px}
.disclaimer{font-size:10px;margin-top:7px}
.cart-trust-row{display:none!important}
@media(max-width:700px){
  .cart-head{padding:12px 14px}
  .cart-heading-mark{width:42px;height:42px;flex-basis:42px;font-size:20px}
  .cart-heading-copy h2{font-size:20px}
  .cart-items{padding:0 14px 7px}
  .cart-row{grid-template-columns:20px 58px minmax(0,1fr) 24px;gap:8px;padding:10px 0}
  .cart-thumb{width:58px;height:58px}
  .cart-product-info>strong{font-size:13px}
  .cart-unit-price{font-size:14px}
  .cart-quantity{grid-column:3;grid-row:2;gap:7px}
  .cart-quantity .qty-controls{height:28px;width:96px}
  .cart-quantity .qty-controls button{width:28px;height:28px;font-size:16px}
  .cart-subtotal{grid-column:2/4;grid-row:3}
  .cart-foot{padding:10px 14px 12px;max-height:48vh}
  .cart-checkout-grid{grid-template-columns:1fr;gap:8px}
  .checkout-form{grid-template-columns:1fr 1fr}
  .checkout-form textarea{grid-column:1/-1}
  .cart-summary{padding:9px 11px}
  .cart-summary h3{font-size:14px;margin-bottom:8px}
  .cart-summary-total{margin-top:6px}
  .telegram-checkout{min-height:43px;font-size:14px;margin-top:9px}
  .disclaimer{font-size:9px}
}

/* Khmer typography and spacing */
html[lang="km"] body,
html[lang="km"] button,
html[lang="km"] input,
html[lang="km"] textarea{
  font-family:"Noto Sans Khmer","Khmer OS System","Leelawadee UI",system-ui,sans-serif;
}
html[lang="km"] .cart-heading-copy h2,
html[lang="km"] .cart-heading-copy p,
html[lang="km"] .cart-product-info,
html[lang="km"] .cart-summary,
html[lang="km"] .checkout-form,
html[lang="km"] .telegram-checkout,
html[lang="km"] .disclaimer{
  line-height:1.65;
}
html[lang="km"] .product-card h3,
html[lang="km"] .product-card p{
  line-height:1.8;
}
