*{box-sizing:border-box}body{margin:0;font-family:Arial,Helvetica,sans-serif;background:#0b1020;color:#eef3ff}a{color:inherit}.top{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 6%;background:rgba(8,12,25,.92);border-bottom:1px solid #24304f}.brand{font-weight:800;font-size:20px}.nav{display:flex;gap:10px;flex-wrap:wrap}.nav a,.btn{display:inline-block;text-decoration:none;border:0;border-radius:12px;background:#31d0aa;color:#06120f;padding:11px 15px;font-weight:800;cursor:pointer}.nav a{background:#18233d;color:#eaf1ff}.btn.ghost{background:#18233d;color:#fff}.btn.whatsapp{background:#25d366;color:#06240f}.btn.danger,.danger{background:#ff5470!important;color:white!important}.small,.mini{padding:7px 10px;border-radius:9px;font-size:13px}.hero{padding:70px 6%;background:radial-gradient(circle at top right,#1d806d55,transparent 35%),linear-gradient(135deg,#111a33,#0c1224);}.hero h1{font-size:46px;margin:12px 0}.hero p{max-width:720px;line-height:1.6;color:#cdd8ee}.badge{display:inline-block;background:#20304f;border:1px solid #34486f;color:#cfe1ff;border-radius:999px;padding:6px 10px;font-size:12px}.section{padding:32px 6%}.narrow{max-width:820px;margin:auto}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:16px}.card,.form,.success,.alert,.stat{background:#111a33;border:1px solid #26375c;border-radius:18px;padding:18px;box-shadow:0 10px 30px #0004}.card h3{margin-bottom:5px}.card p,.muted{color:#b9c5dc}.form{display:grid;gap:14px}.form label{display:grid;gap:7px;font-weight:700}.form input,.form textarea,.form select{width:100%;background:#0b1020;color:#fff;border:1px solid #33486f;border-radius:12px;padding:12px}.form textarea{min-height:85px}.alert{border-color:#ff5470;color:#ffd9df}.success{border-color:#31d0aa}.footer{padding:25px 6%;color:#9eadc8;text-align:center;border-top:1px solid #24304f}.admin-layout{display:grid;grid-template-columns:230px 1fr;min-height:100vh}.sidebar{background:#080d19;border-right:1px solid #24304f;padding:20px;position:sticky;top:0;height:100vh}.sidebar a{display:block;text-decoration:none;padding:12px;margin:6px 0;border-radius:12px;background:#121d36;color:#eaf1ff}.content{padding:25px;overflow:auto}.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:15px}.stat strong{font-size:26px}.table-wrap{overflow:auto;background:#111a33;border:1px solid #26375c;border-radius:18px}table{width:100%;border-collapse:collapse;min-width:900px}th,td{padding:12px;border-bottom:1px solid #26375c;text-align:left;vertical-align:top}th{background:#172442}.actions{display:flex;gap:6px;flex-wrap:wrap}.inline{display:inline}.inline select{background:#0b1020;color:#fff;border:1px solid #33486f;border-radius:8px;padding:7px}.login{min-height:100vh;display:grid;place-items:center;padding:20px}.login .form{width:min(430px,100%)}@media(max-width:800px){.hero h1{font-size:33px}.top{align-items:flex-start;flex-direction:column}.admin-layout{grid-template-columns:1fr}.sidebar{position:relative;height:auto}.content{padding:15px}.sidebar a{display:inline-block}.table-wrap{border-radius:12px}}
.product-img{width:100%;height:170px;object-fit:cover;border-radius:14px;margin-bottom:12px;background:#0b1020;border:1px solid #26375c}.product-card{overflow:hidden}.thumb{width:78px;height:58px;object-fit:cover;border-radius:10px;border:1px solid #33486f;background:#0b1020}.preview-img{width:min(260px,100%);height:170px;object-fit:cover;border-radius:14px;border:1px solid #33486f;background:#0b1020}.mini-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px;margin:0 0 18px}.mini-product{display:grid;gap:6px;text-decoration:none;background:#111a33;border:1px solid #26375c;border-radius:14px;padding:10px;color:#eef3ff}.mini-product.selected{border-color:#31d0aa;box-shadow:0 0 0 2px #31d0aa33}.mini-product img{width:100%;height:82px;object-fit:cover;border-radius:10px}.mini-product span{font-size:13px;font-weight:800}.mini-product strong{font-size:12px;color:#b9fff0}input[type=file]{padding:10px;background:#0b1020;color:#fff}
/* Compact, same-size product image/layout fix */
.grid{
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:12px;
}
.product-card{
  padding:12px;
  display:flex;
  flex-direction:column;
  min-height:0;
}
.product-img{
  width:100%;
  height:120px;
  aspect-ratio:4/3;
  object-fit:cover;
  object-position:center;
  display:block;
  border-radius:12px;
  margin-bottom:9px;
}
.product-card h3{
  font-size:16px;
  line-height:1.2;
  margin:8px 0 4px;
}
.product-card p{
  font-size:13px;
  line-height:1.35;
  margin:5px 0;
}
.product-card .btn{
  margin-top:auto;
  text-align:center;
}
.product-card .badge{
  align-self:flex-start;
  font-size:11px;
  padding:4px 8px;
}
.section{
  padding:22px 4%;
}
.hero{
  padding:38px 4%;
}
.hero h1{
  font-size:36px;
}
.mini-grid{
  grid-template-columns:repeat(auto-fit,minmax(105px,1fr));
  gap:8px;
}
.mini-product{
  padding:8px;
  border-radius:12px;
}
.mini-product img{
  width:100%;
  height:68px;
  aspect-ratio:4/3;
  object-fit:cover;
  object-position:center;
  display:block;
}
.mini-product span{
  font-size:12px;
  line-height:1.15;
}
.mini-product strong{
  font-size:11px;
}
.thumb{
  width:62px;
  height:46px;
  object-fit:cover;
  object-position:center;
}
.preview-img{
  width:180px;
  max-width:100%;
  height:120px;
  object-fit:cover;
  object-position:center;
}
@media(min-width:1100px){
  .grid{grid-template-columns:repeat(5,1fr)}
}
@media(max-width:600px){
  .grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .product-img{height:95px}
  .product-card{padding:10px;border-radius:14px}
  .product-card h3{font-size:14px}
  .product-card p{font-size:12px}
  .product-card .btn{padding:8px 9px;font-size:12px}
  .hero h1{font-size:28px}
  .mini-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .mini-product img{height:58px}
}


/* HARD MOBILE IMAGE OVERFLOW FIX - added 2026-05-31 */
html,body{width:100%;max-width:100%;overflow-x:hidden;}
img{max-width:100%;height:auto;}
.section{width:100%;max-width:1500px;margin:0 auto;}
.grid{
  width:100%;
  max-width:100%;
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(165px,1fr)) !important;
  gap:12px !important;
  align-items:stretch;
}
.card.product-card,
.product-card{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  overflow:hidden !important;
  padding:10px !important;
  border-radius:14px !important;
}
.product-card .product-img,
.product-img,
.card.product-card > img,
.grid img{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  height:105px !important;
  max-height:105px !important;
  object-fit:cover !important;
  object-position:center !important;
  display:block !important;
  border-radius:11px !important;
  margin:0 0 8px 0 !important;
  position:static !important;
  transform:none !important;
}
.product-card h3{font-size:14px!important;line-height:1.2!important;margin:6px 0 4px!important;white-space:normal;}
.product-card p{font-size:12px!important;line-height:1.3!important;margin:4px 0!important;}
.product-card .badge{font-size:10px!important;padding:3px 7px!important;max-width:100%;overflow:hidden;text-overflow:ellipsis;}
.product-card .btn{font-size:11px!important;padding:7px 8px!important;border-radius:8px!important;}
@media(max-width:760px){
  .top{padding:10px 4%;}
  .brand{font-size:14px;}
  .nav{gap:6px;}
  .nav a{font-size:11px;padding:7px 9px;border-radius:8px;}
  .hero{padding:28px 4%;}
  .hero h1{font-size:24px;}
  .hero p{font-size:13px;}
  .section{padding:18px 4%;}
  .section h2{font-size:18px;}
  .grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:9px!important;}
  .product-img,.product-card .product-img,.card.product-card > img,.grid img{height:88px!important;max-height:88px!important;}
}
@media(max-width:360px){
  .grid{grid-template-columns:1fr !important;}
  .product-img,.product-card .product-img,.card.product-card > img,.grid img{height:120px!important;max-height:120px!important;}
}


/* HARD FIX 2026-05-30: stop product images from overflowing cards */
html, body { max-width:100%; overflow-x:hidden !important; }
img, svg, video { max-width:100% !important; }
.grid { width:100% !important; display:grid !important; grid-template-columns:repeat(auto-fit, minmax(165px, 1fr)) !important; gap:12px !important; align-items:stretch !important; }
.card, .product-card { width:100% !important; max-width:100% !important; min-width:0 !important; overflow:hidden !important; }
.product-card { padding:10px !important; display:flex !important; flex-direction:column !important; }
.product-card > .product-img, img.product-img { width:100% !important; min-width:0 !important; max-width:100% !important; height:118px !important; max-height:118px !important; object-fit:cover !important; object-position:center !important; display:block !important; border-radius:12px !important; margin:0 0 8px 0 !important; }
.product-card h3 { font-size:14px !important; line-height:1.2 !important; margin:7px 0 4px !important; word-break:break-word !important; }
.product-card p { font-size:12px !important; line-height:1.3 !important; margin:4px 0 !important; }
.product-card .btn { padding:8px 9px !important; font-size:12px !important; margin-top:auto !important; }
.product-card .badge { font-size:10px !important; padding:4px 7px !important; max-width:100% !important; overflow:hidden !important; text-overflow:ellipsis !important; }
.mini-product, .mini-product img { max-width:100% !important; overflow:hidden !important; }
.mini-product img { height:64px !important; object-fit:cover !important; }
.thumb { width:58px !important; height:44px !important; object-fit:cover !important; }
.preview-img { width:180px !important; height:120px !important; object-fit:cover !important; }
@media(max-width:700px){
  .top{padding:10px 4% !important;}
  .brand{font-size:13px !important;}
  .nav{gap:5px !important;}
  .nav a{padding:7px 9px !important;font-size:11px !important;border-radius:8px !important;}
  .hero{padding:26px 4% !important;}
  .hero h1{font-size:24px !important;}
  .section{padding:18px 4% !important;}
  .section h2{font-size:18px !important;}
  .grid{grid-template-columns:repeat(2, minmax(0,1fr)) !important; gap:9px !important;}
  .product-card{border-radius:12px !important;padding:8px !important;}
  .product-card > .product-img, img.product-img{height:86px !important; max-height:86px !important; border-radius:10px !important;}
  .product-card h3{font-size:12px !important;}
  .product-card p{font-size:10px !important;}
  .product-card .btn{font-size:10px !important;padding:6px 7px !important;}
  .mini-grid{grid-template-columns:repeat(2, minmax(0,1fr)) !important;}
}
@media(min-width:1000px){ .grid{grid-template-columns:repeat(4, minmax(0,1fr)) !important;} }
@media(min-width:1300px){ .grid{grid-template-columns:repeat(5, minmax(0,1fr)) !important;} }
