/* Mobile first adjustments */
body{font-size:14px}
.searchbar{min-width:unset;width:100%}
@media (max-width:900px){
  .navbar.glass{padding:12px}
  .nav-center{flex:1;margin:0 8px}
  .searchbar{min-width:unset}
  .hero-slide{height:420px}
  .hero-content h1{font-size:34px}
  /* gunakan grid mobile dengan 4 kolom agar tampilan lebih rapi */
  .products.grid{display:grid;grid-template-columns:repeat(4,minmax(130px,1fr));gap:10px;align-items:flex-start;padding-bottom:10px;width:100%}
  .products.grid .card{min-width:0;min-height:auto;overflow:visible}
  .card{padding:12px;border-radius:18px;gap:10px}
  .product-image, .card img{height:100px;object-fit:cover;border-radius:16px;aspect-ratio:1/1}
  .meta{gap:6px}
  .actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:auto}
  .actions button{padding:10px 12px;font-size:12px;flex:1 1 48%;min-width:0;white-space:nowrap}
  .title, .product-title{font-size:11px;line-height:1.2;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;line-clamp:1;overflow:hidden;text-overflow:ellipsis;min-height:22px;max-height:22px}
  .price{font-size:13px;white-space:nowrap;display:flex;flex-wrap:wrap;align-items:flex-start;gap:4px}
  .price .old{order:1;width:100%;margin-left:0;font-size:11px}
  .cat-grid{gap:8px}
  .cat-item{min-width:0;padding:6px 12px;font-size:11px;max-width:140px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .modal-content{padding:16px}
  .main-image{height:360px}
  .card .title, .title, .product-title{font-size:12px;line-height:1.2;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;min-height:30px}
  .price{font-size:13px}
  .products.grid .card{max-height:none;overflow:visible}
  .specs{max-height:46px;overflow:hidden}
  .specs .chip{font-size:11px;padding:5px 8px}
  .actions button{padding:10px 12px;font-size:12px;flex:1 1 48%;min-width:0;white-space:nowrap}
  /* sembunyikan bottom nav agar mirip desktop */
  .bottom-nav{display:none !important}
}

@media (max-width:768px){
  html, body{overflow-x:hidden;max-width:100vw}
  .products.grid, .product-grid{display:grid;grid-template-columns:repeat(4,minmax(120px,1fr));gap:10px;align-items:flex-start;padding:0 10px 10px;width:100%}
  .products.grid .card, .product-card{padding:10px;border-radius:16px;min-height:auto;gap:8px;height:auto!important;max-height:none;overflow:visible;box-shadow:0 10px 24px rgba(11,17,32,0.08)}
  .product-image, .card img{height:96px;object-fit:cover;border-radius:14px;aspect-ratio:1/1}
  .product-title, .title{font-size:11px;line-height:1.2;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;line-clamp:1;overflow:hidden;text-overflow:ellipsis;min-height:22px;max-height:22px}
  .product-price, .price{font-size:12px;white-space:nowrap;display:flex;flex-wrap:wrap;align-items:flex-start;gap:4px}
  .price .old{order:1;width:100%;margin-left:0;font-size:11px}
  .rating{font-size:11px}
  .specs{max-height:40px;overflow:hidden}
  .specs .chip{font-size:11px;padding:5px 8px;white-space:nowrap;max-width:100%;text-overflow:ellipsis;overflow:hidden;display:inline-block}
  .actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:auto}
  .buy-btn,
  .chat-btn,
  .actions button{flex:1 1 calc(50% - 6px);min-width:0;height:auto;font-size:13px;border-radius:14px;padding:10px 8px;white-space:nowrap}
  .actions button{justify-content:center}
  .price{margin-top:0}
  .card .title{margin-bottom:0}
  .cat-item{padding:6px 10px;font-size:12px}
}


@media (min-width:901px){
  .nav-left{flex:0 0 auto}
  .nav-center{flex:1;display:flex;justify-content:center}
}

@media screen and (max-width:768px){
  html, body{overflow-x:hidden !important;max-width:100vw !important;width:100% !important;}
  .products-grid,
  .products.grid{display:grid !important;grid-template-columns:repeat(4,minmax(120px,1fr)) !important;grid-auto-rows:minmax(0,1fr) !important;align-items:stretch !important;gap:8px !important;padding:8px !important;width:100% !important;}
  .product-card,
  .products.grid .card{background:#fff !important;border-radius:14px !important;overflow:visible !important;display:flex !important;flex-direction:column !important;justify-content:space-between !important;min-height:0 !important;height:auto !important;padding:10px !important;gap:8px !important;box-shadow:0 8px 24px rgba(11,17,32,0.08) !important;}
  .product-image,
  .product-card img,
  .card img{width:100% !important;aspect-ratio:1/1 !important;height:100px !important;object-fit:cover !important;display:block !important;border-radius:12px !important;}
  .title,
  .product-title,
  .product-name{font-size:11px !important;line-height:1.2 !important;font-weight:600 !important;display:-webkit-box !important;-webkit-line-clamp:2 !important;line-clamp:2 !important;-webkit-box-orient:vertical !important;overflow:hidden !important;text-overflow:ellipsis !important;min-height:30px !important;margin-top:4px !important;}
  .product-price,
  .price{font-size:12px !important;font-weight:700 !important;margin-top:3px !important;}
  .actions,
  .product-buttons{display:flex !important;gap:6px !important;margin-top:8px !important;flex-wrap:wrap !important;}
  .buy-btn,
  .chat-btn,
  .actions button{height:auto !important;min-width:0 !important;font-size:12px !important;border-radius:12px !important;padding:10px 8px !important;flex:1 1 calc(50% - 6px) !important;justify-content:center !important;}
  .rating{font-size:10px !important;}
  .specs{max-height:34px !important;overflow:hidden !important;}
  .specs .chip{font-size:10px !important;padding:3px 6px !important;white-space:nowrap !important;text-overflow:ellipsis !important;overflow:hidden !important;display:inline-block !important;}
  .product-card *{max-width:100% !important;word-break:break-word !important;}
  .products.grid .card .badge,
  .product-card .badge{position:absolute !important;left:6px !important;top:6px !important;padding:3px 8px !important;font-size:9px !important;border-radius:10px !important;letter-spacing:0.05em !important;box-shadow:0 4px 12px rgba(11,17,32,0.08) !important;max-width:calc(100% - 12px) !important;white-space:nowrap !important;overflow:hidden !important;text-overflow:ellipsis !important;z-index:10 !important;}
  .products.grid .card .badge.badge-promo,
  .product-card .badge.badge-promo{background:#dc2626 !important;}
  .hero-slide{height:260px !important;}
  .modal-content{max-width:100% !important;padding:12px !important;margin:0 10px !important;}
  .main-image{height:220px !important;}
  .card{padding:8px !important;gap:6px !important;}
  .card .meta{gap:6px !important;}
  .card .title, .title, .product-title{font-size:11px !important;line-height:1.2 !important;display:-webkit-box !important;-webkit-box-orient:vertical !important;-webkit-line-clamp:2 !important;line-clamp:2 !important;overflow:hidden !important;text-overflow:ellipsis !important;height:28px !important;min-height:0 !important;max-height:28px !important;}
  .actions{gap:4px !important;}
  .products.grid .card{align-self:stretch !important;}
  .bottom-nav{display:none !important;}
}

