/* Header, footer & kartu produk CompuParts yang dipakai di semua halaman.
   Semua class ber-prefix cp- supaya tidak bentrok dengan Bootstrap di halaman lama. */
:root {
  --cp-blue: #0063f4;
  --cp-blue-dark: #0052cc;
  --cp-blue-soft: #d0eafd;
  --cp-blue-tint: #eef3fb;
  --cp-card: #f9f9f9;
  --cp-muted: #7a7b7a;
  --cp-strike: #cacaca;
  --cp-red: #fd1718;
}

.cp-header, .cp-footer, .cp-product { font-family: "Montserrat", sans-serif; color: #000; }
.cp-header *, .cp-footer *, .cp-product * { box-sizing: border-box; }
.cp-header p, .cp-header h4, .cp-footer p, .cp-footer h4, .cp-product p { margin: 0; }
.cp-header a, .cp-footer a, a.cp-product { color: inherit; text-decoration: none; }
.cp-header img, .cp-footer img, .cp-product img { display: block; }
.cp-container { width: 1180px; max-width: calc(100% - 32px); margin-inline: auto; }

/* ---------- Header ---------- */
/* Menu menempel di atas saat scroll: bar biru (48px) ikut tergulir, baris logo + menu tetap terlihat */
.cp-header { position: -webkit-sticky; position: sticky; top: -48px; z-index: 1000; background: #fff; transition: box-shadow .2s ease; }
.cp-header.is-stuck { box-shadow: 0 8px 24px -14px rgba(15, 23, 42, .35); }
.cp-header .cp-mobile-nav { max-height: calc(100vh - 90px); overflow-y: auto; }
/* overflow-x: hidden di body bisa mematikan position: sticky; clip memotong luberan tanpa membuat area scroll baru */
body { overflow-x: clip; }
/* CSS lama halaman dalam mengunci tinggi body = tinggi layar; header sticky hanya menempel di dalam induknya, jadi body harus setinggi isi */
body { height: auto !important; min-height: 100%; }
.cp-topbar {
  background: var(--cp-blue); height: 48px;
  display: flex; align-items: center; justify-content: center; gap: 75px; overflow: hidden;
}
.cp-topbar__item {
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  font-family: "Poppins", sans-serif; font-weight: 500; font-size: 12px; line-height: 28px; letter-spacing: .06px;
  color: #fff; white-space: nowrap;
}
.cp-topbar__item img { width: 24px; height: 24px; }
.cp-topbar__track { display: flex; align-items: center; gap: 75px; }
.cp-topbar__item--dup { display: none; }
.cp-navbar { background: #fff; padding: 24px 0 18px; }
.cp-navbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cp-brand { width: 174px; height: 69px; border-radius: 9px; overflow: hidden; position: relative; flex-shrink: 0; }
.cp-brand img { position: absolute; left: -.23px; top: -3.84px; width: 74px; height: 74px; max-width: none; }
.cp-nav { display: flex; align-items: center; gap: 22px; padding: 8px; }
.cp-nav__link { font-size: 14px; text-align: center; line-height: 24px; color: #000; min-width: 72px; transition: color .15s; }
.cp-nav__link:hover { color: var(--cp-blue); }
.cp-nav__link--active { font-weight: 700; color: var(--cp-blue) !important; }
.cp-actions { display: flex; align-items: center; gap: 16px; }
.cp-search { display: flex; align-items: center; gap: 7px; background: #f9f9f9; border-radius: 12px; padding: 3px 7px; margin: 0; }
.cp-search form { display: contents; }
.cp-search input {
  width: 137px; height: 40px; padding: 0 12px; border: 0; background: transparent; outline: none; box-shadow: none;
  font-family: "Poppins", sans-serif; font-weight: 500; font-size: 12px; letter-spacing: .06px; color: #000;
}
.cp-search input::placeholder { color: #8a8a8a; }
.cp-icon-btn { display: block; width: 24px; height: 24px; position: relative; background: none; border: 0; padding: 0; cursor: pointer; }
.cp-icon-btn img { width: 24px; height: 24px; }
.cp-cart-count {
  position: absolute; top: -6px; right: -8px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--cp-red); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.cp-account { position: relative; }
.cp-account__name { font-size: 12px; font-weight: 600; color: var(--cp-blue); text-transform: capitalize; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-account__toggle { display: flex; align-items: center; gap: 6px; }
.cp-account__menu {
  display: none; position: absolute; right: 0; top: 100%; padding-top: 8px; z-index: 60; min-width: 190px;
}
.cp-account__menu-inner { background: #fff; border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.12); padding: 8px 0; }
.cp-account:hover .cp-account__menu, .cp-account:focus-within .cp-account__menu { display: block; }
.cp-account__menu a { display: block; padding: 8px 16px; font-size: 13px; }
.cp-account__menu a:hover { background: var(--cp-blue-tint); color: var(--cp-blue); }
.cp-burger { display: none; }
.cp-mobile-nav { display: none; border-top: 1px solid #eee; background: #fff; }
.cp-mobile-nav.is-open { display: block; }
.cp-mobile-nav a { display: block; padding: 12px 16px; font-size: 14px; border-bottom: 1px solid #f2f2f2; }
.cp-mobile-nav a.cp-nav__link--active { background: var(--cp-blue-tint); }
.cp-mobile-nav .cp-search { margin: 12px 16px; }
.cp-mobile-nav .cp-search input { width: 100%; }

/* ---------- Kartu produk ---------- */
.cp-product {
  width: 200px; flex-shrink: 0; background: var(--cp-card); border: 1px solid #eceff3; border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 16px; height: 100%;
  transition: transform .15s, box-shadow .15s;
}
.cp-product:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); color: inherit; }
.cp-product--fluid { width: 100%; }
/* Foto di dalam kartu (berjarak dari tepi). Latar putih foto dibaurkan ke warna kartu (multiply) supaya kartu terlihat utuh */
.cp-product__img { position: relative; width: 100%; aspect-ratio: 200 / 180; flex-shrink: 0; overflow: hidden; background: transparent; }
.cp-product__img img { position: absolute; inset: 14px 14px 0; width: calc(100% - 28px); height: calc(100% - 14px); object-fit: contain; max-width: none; mix-blend-mode: multiply; }
.cp-product__badge {
  position: absolute; left: 8px; top: 8px; z-index: 1; padding: 2px 8px; border-radius: 4px;
  background: var(--cp-red); color: #fff; font-size: 10px; font-weight: 700;
}
.cp-product__info { width: calc(100% - 36px); display: flex; flex-direction: column; gap: 16px; flex: 1; justify-content: space-between; }
.cp-product__meta { display: flex; flex-direction: column; gap: 4px; }
.cp-product__name {
  font-weight: 600; font-size: 12px; line-height: 1.22; min-height: calc(3 * 1.22em);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.cp-tag {
  align-self: flex-start; height: 13.336px; padding: 0 7.845px; display: flex; align-items: center;
  border: .31px solid var(--cp-blue); border-radius: 2px;
  color: var(--cp-blue); font-weight: 600; font-size: 8px; letter-spacing: .24px; white-space: nowrap;
}
.cp-product__prices { display: flex; flex-direction: column; gap: 4px; }
.cp-price-old { height: 15px; font-weight: 600; font-size: 12px; color: var(--cp-strike); text-decoration: line-through; }
.cp-price { font-weight: 700; font-size: 20px; }
.cp-price--cfp { font-size: 16px; color: var(--cp-blue); }
.cp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 24px; }

/* ---------- Footer ---------- */
.cp-footer { background: var(--cp-blue-soft); margin-top: 64px; padding: 50px 0; }
.cp-footer__inner { width: 1188px; max-width: calc(100% - 32px); margin-inline: auto; display: flex; flex-direction: column; gap: 48px; }
.cp-footer__top { display: flex; justify-content: space-between; align-items: center; gap: 40px; }
.cp-footer__about { width: 400px; max-width: 100%; display: flex; flex-direction: column; gap: 25px; }
.cp-footer__logo { width: 140px; height: 139px; object-fit: cover; }
.cp-footer__about p { color: var(--cp-blue); font-weight: 500; font-size: 16px; line-height: 26px; letter-spacing: .16px; }
.cp-footer__cols { width: 559px; display: flex; gap: 42px; align-items: flex-start; }
.cp-footer__col { flex: 1 0 0; display: flex; flex-direction: column; gap: 20px; color: var(--cp-blue); }
.cp-footer__col h4 { font-weight: 700; font-size: 20px; line-height: 28px; margin-bottom: -4px; color: var(--cp-blue); }
.cp-footer__col a { font-weight: 500; font-size: 16px; line-height: 24px; color: var(--cp-blue); }
.cp-footer__col a:hover { text-decoration: underline; }
.cp-socials { display: flex; gap: 12px; align-items: center; }
.cp-social { width: 50px; height: 50px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; }
.cp-social img { width: 26px; height: 26px; object-fit: contain; }
.cp-footer__bottom { display: flex; flex-direction: column; align-items: center; gap: 32px; border-top: 1px solid rgba(0, 99, 244, .35); padding-top: 32px; }
.cp-copyright { color: var(--cp-blue); font-weight: 500; font-size: 18px; line-height: 30px; text-align: center; }
.cp-copyright a { text-decoration: underline !important; color: var(--cp-blue); }

/* ---------- Layar kecil ---------- */
@media (max-width: 1240px) {
  .cp-topbar__track { gap: 24px; }
  .cp-nav, .cp-actions .cp-search { display: none; }
  .cp-burger { display: block; }
  .cp-footer__top { flex-direction: column; align-items: flex-start; }
  .cp-footer__cols { width: 100%; }
}
@media (max-width: 720px) {
  /* bar biru berjalan (marquee); dua set isi identik digeser -50% supaya putarannya menyambung */
  .cp-topbar { justify-content: flex-start; }
  .cp-topbar__track { gap: 0; width: max-content; animation: cp-marquee 20s linear infinite; }
  .cp-topbar__item, .cp-topbar__item--dup { display: flex; padding: 0 22px; }
  .cp-topbar:hover .cp-topbar__track { animation-play-state: paused; }
  .cp-navbar { padding: 12px 0; }
  .cp-brand { width: 74px; }
  .cp-account__name { display: none; }
  .cp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .cp-price { font-size: 16px; }
  .cp-copyright { font-size: 14px; }
}

/* Halaman lama punya mt-5/pt-5 di wrapper teratas untuk mengimbangi header lama yang fixed.
   Header baru tidak fixed, jadi offset itu dinetralkan. */
.cp-header + div, .cp-header + section { margin-top: 0 !important; padding-top: 32px !important; }
.cp-header + div > div:first-child, .cp-header + section > div:first-child { margin-top: 0 !important; padding-top: 0 !important; }

/* Ikon sosmed dari admin berwarna putih, jadi lingkarannya biru */
.cp-social { background: var(--cp-blue); transition: transform .2s, background .2s; }
.cp-social:hover { background: var(--cp-blue-dark); transform: translateY(-2px); }
.cp-social img { width: 20px; height: 20px; }

/* ---------- Responsif tambahan ---------- */
@media (max-width: 1240px) {
  .cp-footer { padding: 40px 0; }
  .cp-footer__inner { gap: 32px; }
}
@media (max-width: 720px) {
  .cp-footer { margin-top: 40px; padding: 32px 0 24px; }
  .cp-footer__top { gap: 28px; }
  .cp-footer__about { gap: 16px; }
  .cp-footer__logo { width: 88px; height: 88px; }
  .cp-footer__about p { font-size: 14px; line-height: 22px; }
  .cp-footer__cols { gap: 24px; }
  .cp-footer__col { gap: 12px; }
  .cp-footer__col h4 { font-size: 16px; line-height: 24px; margin-bottom: 0; }
  .cp-footer__col a { font-size: 14px; line-height: 20px; }
  .cp-social { width: 40px; height: 40px; }
  .cp-footer__bottom { padding-top: 20px; }
  .cp-copyright { font-size: 12px; line-height: 20px; }
  .cp-product__info { width: calc(100% - 24px); gap: 10px; }
  .cp-product__name { font-size: 11px; }
  .cp-tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

  /* Bootstrap gx-5 (3rem) lebih lebar dari padding container di HP sehingga halaman meluber */
  .row.gx-5 { --bs-gutter-x: 1.5rem; }
}

@keyframes cp-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .cp-topbar__track { animation: none !important; }
}

/* Deretan tombol Brand di halaman pencarian / kategori / brand */
.nav-scroll .nav-pills-tab { gap: 10px; flex-wrap: nowrap; }
.nav-scroll .nav-pills-tab .nav-link {
  font-family: "Montserrat", sans-serif; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em;
  padding: 10px 22px; border: 0 !important; border-radius: 999px; background: #ececec; color: #1e293b; white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav-scroll .nav-pills-tab .nav-link:hover { background: #dfe6f1; color: var(--cp-blue); }
.nav-scroll .nav-pills-tab .nav-link.active { background: var(--cp-blue); color: #fff; }

/* Jarak atas halaman dalam di HP lebih rapat */
@media (max-width: 720px) {
  .cp-header + div, .cp-header + section { padding-top: 16px !important; }
}
/* Baris Brand / Category di detail produk bisa diklik */
.cat a { text-decoration: none; }
.cat a:hover span { text-decoration: underline; }

/* Pagination daftar produk: tombol bulat terpisah, aktif biru */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.pagination .page-item .page-link {
  min-width: 40px; height: 40px; padding: 0 12px; margin: 0 !important;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #e2e8f0 !important; border-radius: 10px !important; background: #fff;
  font-family: "Montserrat", sans-serif; font-size: 14px; font-weight: 600; line-height: 1; color: #1e293b;
  box-shadow: none !important; transition: background .15s, color .15s, border-color .15s;
}
.pagination .page-item .page-link:hover { background: var(--cp-blue-tint); border-color: var(--cp-blue) !important; color: var(--cp-blue); }
.pagination .page-item.active .page-link { background: var(--cp-blue); border-color: var(--cp-blue) !important; color: #fff; }
.pagination .page-item.disabled .page-link { background: #f8fafc; color: #cbd5e1; pointer-events: none; }
.pagination .page-item:first-child .page-link, .pagination .page-item:last-child .page-link { font-size: 18px; }

/* Rating & jumlah terjual (kartu produk + detail produk) */
.cp-stats { display: flex; align-items: center; flex-wrap: nowrap; white-space: nowrap; overflow: hidden; gap: 4px; margin-top: 4px; font-family: "Montserrat", sans-serif; font-size: 11px; line-height: 16px; color: #475569; }
.cp-stats svg { flex-shrink: 0; }
.cp-stats b { color: #1e293b; font-weight: 700; }
.cp-stats__muted { color: #94a3b8; }
.cp-stats__sep { color: #cbd5e1; margin: 0 2px; }
.cp-stats--detail { flex-wrap: wrap; white-space: normal; font-size: 13.5px; line-height: 20px; margin: 6px 0 10px; gap: 6px; }
.cp-stats--detail svg { width: 17px; height: 17px; }
