* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #e53935;
  --primary-dark: #b71c1c;
  --secondary: #1565c0;
  --accent: #ff6f00;
  --bg: #f5f5f5;
  --white: #ffffff;
  --text: #212121;
  --text-muted: #757575;
  --border: #e0e0e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --radius: 8px;
}

body { font-family: 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); }

a { text-decoration: none; color: inherit; }

/* NAVBAR */
.navbar {
  background: var(--primary);
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.navbar-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px; height: 64px;
}
.logo {
  font-size: 22px; font-weight: 800; color: white; white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
}
.logo span { color: #ffeb3b; }
.search-bar {
  flex: 1; display: flex; max-width: 600px;
}
.search-bar input {
  flex: 1; padding: 10px 16px; border: none; border-radius: 4px 0 0 4px;
  font-size: 14px; outline: none;
}
.search-bar button {
  padding: 10px 20px; background: var(--accent); color: white;
  border: none; border-radius: 0 4px 4px 0; cursor: pointer; font-size: 16px;
}
.search-bar button:hover { background: #e65100; }
.nav-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.nav-btn {
  background: none; border: none; color: white; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; font-size: 11px; gap: 2px;
  position: relative;
}
.nav-btn svg { width: 22px; height: 22px; }
.cart-badge {
  position: absolute; top: -4px; right: -4px;
  background: #ffeb3b; color: #212121; border-radius: 50%;
  width: 18px; height: 18px; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* CATEGORY NAV */
.cat-nav {
  background: var(--primary-dark);
  padding: 0 24px;
}
.cat-nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; gap: 4px; overflow-x: auto;
}
.cat-nav a {
  color: rgba(255,255,255,0.85); padding: 10px 16px;
  font-size: 13px; white-space: nowrap; border-radius: 4px;
  transition: background 0.2s;
}
.cat-nav a:hover, .cat-nav a.active { background: rgba(255,255,255,0.15); color: white; }

/* CONTAINER */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* BANNER */
.banner-section { padding: 16px 0; }
.banner-slider {
  border-radius: 12px; overflow: hidden; position: relative;
  background: linear-gradient(135deg, #1565c0 0%, #e53935 100%);
  height: 280px; display: flex; align-items: center;
}
.banner-content {
  padding: 40px 48px; color: white; flex: 1;
}
.banner-content .tag {
  background: #ffeb3b; color: #212121; padding: 4px 12px;
  border-radius: 20px; font-size: 12px; font-weight: 700; display: inline-block; margin-bottom: 12px;
}
.banner-content h1 { font-size: 32px; font-weight: 800; line-height: 1.2; margin-bottom: 8px; }
.banner-content p { font-size: 15px; opacity: 0.9; margin-bottom: 20px; }
.banner-content .btn-banner {
  background: #ffeb3b; color: #212121; padding: 12px 28px;
  border-radius: 6px; font-weight: 700; font-size: 14px; display: inline-block;
  transition: transform 0.2s;
}
.banner-content .btn-banner:hover { transform: scale(1.05); }
.banner-img {
  width: 320px; height: 100%; object-fit: cover; opacity: 0.3;
}
.banner-dots {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px;
}
.banner-dots span {
  width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.5);
}
.banner-dots span.active { background: white; width: 24px; border-radius: 4px; }

/* PROMO STRIP */
.promo-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 16px 0;
}
.promo-card {
  background: white; border-radius: var(--radius); padding: 16px;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}
.promo-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.12); }
.promo-icon { font-size: 28px; }
.promo-card h4 { font-size: 13px; font-weight: 700; }
.promo-card p { font-size: 11px; color: var(--text-muted); }

/* SECTION */
.section { padding: 24px 0; }
.section-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.section-title {
  font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: ""; width: 4px; height: 20px; background: var(--primary); border-radius: 2px;
}
.see-all {
  color: var(--primary); font-size: 13px; font-weight: 600;
}
.see-all:hover { text-decoration: underline; }

/* CATEGORY GRID */
.cat-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px;
}
.cat-item {
  background: white; border-radius: var(--radius); padding: 20px 12px;
  text-align: center; box-shadow: var(--shadow); cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cat-item:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,0.12); }
.cat-item .icon { font-size: 32px; margin-bottom: 8px; }
.cat-item span { font-size: 12px; font-weight: 600; color: var(--text); }

/* PRODUCT GRID */
.product-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.product-card {
  background: white; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer; position: relative;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }
.product-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--primary); color: white; padding: 3px 8px;
  border-radius: 4px; font-size: 11px; font-weight: 700; z-index: 1;
}
.product-badge.premium { background: #6a1b9a; }
.product-badge.baru { background: #00897b; }
.product-badge.second { background: #5d4037; }
.product-img {
  width: 100%; height: 180px; object-fit: cover;
}
.product-info { padding: 12px; }
.product-name {
  font-size: 13px; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 6px;
}
.product-price { font-size: 16px; font-weight: 800; color: var(--primary); }
.product-original {
  font-size: 11px; color: var(--text-muted); text-decoration: line-through; margin-right: 4px;
}
.product-discount {
  font-size: 11px; color: var(--accent); font-weight: 700;
}
.product-rating {
  display: flex; align-items: center; gap: 4px; margin-top: 6px;
}
.stars { color: #ffa000; font-size: 12px; }
.rating-count { font-size: 11px; color: var(--text-muted); }
.product-sold { font-size: 11px; color: var(--text-muted); }
.btn-cart {
  width: 100%; padding: 8px; background: var(--primary); color: white;
  border: none; border-radius: 0 0 var(--radius) var(--radius);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.btn-cart:hover { background: var(--primary-dark); }

/* SEARCH PAGE */
.search-layout {
  display: grid; grid-template-columns: 240px 1fr; gap: 20px; padding: 20px 0;
}
.filter-panel {
  background: white; border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); height: fit-content; position: sticky; top: 80px;
}
.filter-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.filter-group { margin-bottom: 20px; }
.filter-group h4 { font-size: 13px; font-weight: 700; margin-bottom: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.filter-group label {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 4px 0; cursor: pointer;
}
.filter-group input[type="checkbox"] { accent-color: var(--primary); width: 15px; height: 15px; }
.price-inputs { display: flex; gap: 8px; align-items: center; }
.price-inputs input {
  flex: 1; padding: 8px; border: 1px solid var(--border); border-radius: 4px;
  font-size: 12px; outline: none;
}
.price-inputs input:focus { border-color: var(--primary); }
.btn-filter {
  width: 100%; padding: 10px; background: var(--primary); color: white;
  border: none; border-radius: 6px; font-weight: 600; cursor: pointer; margin-top: 8px;
}
.btn-filter:hover { background: var(--primary-dark); }
.btn-reset {
  width: 100%; padding: 8px; background: none; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 6px; font-size: 13px; cursor: pointer; margin-top: 6px;
}

.search-results-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.results-count { font-size: 14px; color: var(--text-muted); }
.sort-select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; outline: none; cursor: pointer;
}
.no-results {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.no-results .icon { font-size: 48px; margin-bottom: 12px; }

/* PRODUCT DETAIL */
.detail-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding: 24px 0;
}
.gallery { position: sticky; top: 80px; }
.main-img {
  width: 100%; border-radius: var(--radius); overflow: hidden;
  background: white; box-shadow: var(--shadow); margin-bottom: 12px;
}
.main-img img { width: 100%; height: 380px; object-fit: cover; }
.thumb-list { display: flex; gap: 8px; }
.thumb {
  width: 72px; height: 72px; border-radius: 6px; overflow: hidden;
  border: 2px solid transparent; cursor: pointer; transition: border-color 0.2s;
}
.thumb.active { border-color: var(--primary); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.detail-info { }
.detail-badge {
  display: inline-block; background: var(--primary); color: white;
  padding: 4px 12px; border-radius: 4px; font-size: 12px; font-weight: 700; margin-bottom: 12px;
}
.detail-name { font-size: 22px; font-weight: 700; line-height: 1.3; margin-bottom: 12px; }
.detail-rating {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
  padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.detail-stars { color: #ffa000; font-size: 16px; }
.detail-rating-num { font-weight: 700; }
.detail-reviews { color: var(--text-muted); font-size: 13px; }
.detail-sold { color: var(--text-muted); font-size: 13px; }
.detail-sold::before { content: "|"; margin-right: 12px; }

.price-box { margin-bottom: 20px; }
.price-row { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.original-price { font-size: 14px; color: var(--text-muted); text-decoration: line-through; }
.discount-badge {
  background: var(--accent); color: white; padding: 3px 8px;
  border-radius: 4px; font-size: 13px; font-weight: 700;
}
.current-price { font-size: 32px; font-weight: 800; color: var(--primary); }
.savings { font-size: 13px; color: #2e7d32; font-weight: 600; }

.specs-box {
  background: #f8f9fa; border-radius: var(--radius); padding: 16px; margin-bottom: 20px;
}
.specs-box h4 { font-size: 13px; font-weight: 700; margin-bottom: 8px; color: var(--text-muted); }
.specs-box p { font-size: 13px; line-height: 1.6; }

.stock-info { font-size: 13px; margin-bottom: 16px; }
.stock-info span { color: #2e7d32; font-weight: 600; }

.qty-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.qty-label { font-size: 14px; font-weight: 600; }
.qty-control { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.qty-btn {
  width: 36px; height: 36px; background: #f5f5f5; border: none;
  font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.qty-btn:hover { background: var(--border); }
.qty-num { width: 48px; text-align: center; font-size: 15px; font-weight: 600; border: none; outline: none; }

.action-btns { display: flex; gap: 12px; margin-bottom: 24px; }
.btn-buy {
  flex: 1; padding: 14px; background: var(--primary); color: white;
  border: none; border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: background 0.2s;
}
.btn-buy:hover { background: var(--primary-dark); }
.btn-add-cart {
  flex: 1; padding: 14px; background: white; color: var(--primary);
  border: 2px solid var(--primary); border-radius: 8px; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: background 0.2s;
}
.btn-add-cart:hover { background: #ffebee; }

.guarantee-row {
  display: flex; gap: 16px; padding: 16px; background: #e8f5e9;
  border-radius: var(--radius); margin-bottom: 24px; flex-wrap: wrap;
}
.guarantee-item {
  display: flex; align-items: center; gap: 6px; font-size: 12px; color: #2e7d32;
  text-decoration: none; font-weight: 600;
}
.guarantee-item:hover { text-decoration: underline; }

.desc-section { margin-top: 8px; }
.desc-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.desc-section p { font-size: 14px; line-height: 1.7; color: #424242; }

/* TOAST */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #323232; color: white; padding: 12px 24px; border-radius: 24px;
  font-size: 14px; z-index: 9999; transition: transform 0.3s ease; white-space: nowrap;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* FOOTER */
footer {
  background: #212121; color: #bdbdbd; padding: 40px 24px 20px; margin-top: 40px;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px;
}
.footer-brand .logo { font-size: 20px; margin-bottom: 12px; }
.footer-brand p { font-size: 13px; line-height: 1.6; }
.footer-col h4 { color: white; font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { font-size: 13px; color: #bdbdbd; }
.footer-col ul li a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid #424242; padding-top: 20px;
  text-align: center; font-size: 12px;
}

/* =============================================================
   RESPONSIVE — Mobile / Tablet / Laptop / Desktop
   Breakpoints:
   xs  : max 480px   → HP kecil
   sm  : max 640px   → HP besar
   md  : max 768px   → Tablet portrait
   lg  : max 1024px  → Tablet landscape / laptop kecil
   xl  : 1025px+     → Laptop / Desktop (default di atas)
   ============================================================= */

/* ---- Desktop / Laptop (≥1025px) — sudah di-handle default ---- */

/* ---- Laptop kecil / Tablet landscape (≤1024px) ---- */
@media (max-width: 1024px) {
  .navbar-inner { gap: 12px; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
  .detail-layout { gap: 20px; }
  .main-img img { height: 320px; }
  .promo-strip { grid-template-columns: repeat(2, 1fr); }
  .banner-slider { height: 240px; }
  .banner-content { padding: 32px 36px; }
  .banner-content h1 { font-size: 26px; }
}

/* ---- Tablet portrait (≤768px) ---- */
@media (max-width: 768px) {
  /* Navbar */
  .navbar { padding: 0 12px; }
  .navbar-inner { height: 56px; gap: 8px; }
  .logo { font-size: 17px; }
  .logo span { display: none; }        /* sembunyikan "Line" di tablet */
  .search-bar { max-width: none; }
  .nav-actions { gap: 10px; }
  .nav-btn { font-size: 10px; }
  .nav-btn svg { width: 20px; height: 20px; }

  /* Category nav */
  .cat-nav { padding: 0 8px; }
  .cat-nav-inner { gap: 2px; }
  .cat-nav a { padding: 8px 12px; font-size: 12px; }

  /* Banner */
  .banner-slider { height: 200px; border-radius: 8px; }
  .banner-content { padding: 24px 20px; }
  .banner-content h1 { font-size: 20px; }
  .banner-content p { font-size: 13px; }
  .banner-img { display: none; }

  /* Grids */
  .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cat-item { padding: 14px 8px; }
  .cat-item .icon { font-size: 26px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .promo-strip { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .promo-card { padding: 12px; }
  .promo-icon { font-size: 22px; }

  /* Search / Filter */
  .search-layout { grid-template-columns: 1fr; }
  .filter-panel { position: static; }

  /* Product Detail */
  .detail-layout { grid-template-columns: 1fr; gap: 16px; }
  .gallery { position: static; }
  .main-img img { height: 260px; }
  .current-price { font-size: 26px; }
  .action-btns { flex-direction: row; }

  /* Footer */
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 20px; }
}

/* ---- HP besar (≤640px) ---- */
@media (max-width: 640px) {
  .navbar-inner { height: 52px; }
  .logo { font-size: 15px; }
  .search-bar input { font-size: 13px; padding: 8px 12px; }
  .search-bar button { padding: 8px 14px; font-size: 14px; }

  .banner-slider { height: 170px; }
  .banner-content { padding: 16px; }
  .banner-content h1 { font-size: 17px; }
  .banner-content p { display: none; }
  .banner-content .btn-banner { padding: 9px 18px; font-size: 13px; }

  .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .product-img { height: 150px; }
  .product-name { font-size: 12px; }
  .product-price { font-size: 14px; }

  .promo-strip { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .promo-card h4 { font-size: 12px; }

  .footer-inner { grid-template-columns: 1fr 1fr; gap: 16px; }
  .footer-brand p { display: none; }
}

/* ---- HP kecil (≤480px) ---- */
@media (max-width: 480px) {
  /* Navbar — sembunyikan teks nav, hanya ikon */
  .nav-btn span:last-child { display: none; }
  .logo { font-size: 14px; }

  /* Banner lebih ringkas */
  .banner-slider { height: 150px; border-radius: 6px; }
  .banner-content h1 { font-size: 15px; }
  .banner-content .tag { font-size: 10px; padding: 3px 8px; }
  .banner-content .btn-banner { padding: 8px 14px; font-size: 12px; }

  /* Grids 2 kolom */
  .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .cat-item { padding: 10px 4px; }
  .cat-item .icon { font-size: 22px; margin-bottom: 4px; }
  .cat-item span { font-size: 10px; }

  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .product-img { height: 130px; }
  .product-info { padding: 8px; }
  .product-name { font-size: 11px; -webkit-line-clamp: 2; }
  .product-price { font-size: 13px; }
  .product-original, .product-discount, .product-sold { font-size: 10px; }
  .btn-cart { font-size: 11px; padding: 7px; }

  .promo-strip { grid-template-columns: 1fr 1fr; gap: 6px; }
  .promo-card { padding: 10px; gap: 8px; }
  .promo-icon { font-size: 18px; }
  .promo-card h4 { font-size: 11px; }
  .promo-card p { display: none; }

  /* Detail produk */
  .detail-name { font-size: 17px; }
  .current-price { font-size: 22px; }
  .action-btns { flex-direction: column; gap: 8px; }
  .btn-buy, .btn-add-cart { font-size: 14px; padding: 12px; }
  .guarantee-row { gap: 10px; }

  /* Footer 1 kolom */
  .footer-inner { grid-template-columns: 1fr; gap: 16px; }
  footer { padding: 24px 12px 16px; }
}
