:root {
  /* Palet warna disesuaikan dengan pusatsparepart.com: hijau sebagai warna utama,
     header & body putih, footer abu-abu terang, heading gelap, tombol pil hijau. */
  --primary: #63cb7e;
  --primary-dark: #00711d;
  --primary-hover: #088027;
  /* Latar tombol/badge bertulisan putih: --primary (#63cb7e) terlalu terang untuk teks putih
     (kontras ~2:1, gagal WCAG), jadi pakai hijau yang lebih gelap (kontras ~5:1). */
  --primary-strong: #088027;
  --secondary: #ececed;
  --heading: #2b2b2b;
  --text-muted: #474747;
  --footer-bg: #ececed;
  --footer-text: #5c5c5c;
}

body { background: #ffffff; color: var(--text-muted); }

/* ---- Logo ---- */
.brand-logo { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; line-height: 1; }
.brand-logo-img { height: 34px; width: auto; }

/* ---- Topbar & Navbar ---- */
.topbar { background: var(--footer-bg); color: var(--text-muted); }
.main-navbar { background: #ffffff; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.main-navbar .nav-link { color: var(--heading); }
.main-navbar .nav-link:hover { color: var(--primary-hover); }
.main-navbar .dropdown-menu { border: none; box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.cart-badge { position: absolute; top: -4px; right: -10px; font-size: .65rem; }


/* ---- Buttons (tombol pil hijau ala Woostify) ---- */
.btn-primary {
  background-color: var(--primary-strong); border-color: var(--primary-strong); color: #fff;
  border-radius: 50px; font-weight: 600;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  background-color: var(--primary-dark) !important; border-color: var(--primary-dark) !important; color: #fff;
}
.btn-outline-primary { color: var(--primary-dark); border-color: var(--primary); border-radius: 50px; font-weight: 600; }
.btn-outline-primary:hover { background-color: var(--primary); border-color: var(--primary); color: #fff; }
.btn-warning { background-color: var(--primary-strong); border-color: var(--primary-strong); color: #fff; border-radius: 50px; font-weight: 600; }
.btn-warning:hover { background-color: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.text-warning { color: var(--primary) !important; }
.bg-warning { background-color: var(--primary-strong) !important; color: #fff !important; }
.text-primary { color: var(--primary-dark) !important; }
.bg-primary { background-color: var(--primary) !important; }
/* .bg-warning & .bg-primary di atas sengaja jadi warna brand (hijau) untuk sisi toko/storefront.
   Badge status admin (mis. "Menunggu Pembayaran") butuh warna amber yang jelas beda dari hijau
   "Dibayar/Selesai", makanya pakai kelas terpisah ini, bukan bg-warning. */
.bg-pending { background-color: #f0a02c !important; color: #2b2b2b !important; }
.border-primary { border-color: var(--primary) !important; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
a { color: var(--primary-dark); }
a:hover { color: var(--primary-hover); }

/* ---- Hero ---- */
.hero { background: linear-gradient(120deg, #f4fbf6, #e6f7ea 70%); }
.hero h1 { color: var(--heading); }
.hero .lead { color: var(--text-muted) !important; }
.hero-icon { font-size: 14rem; color: rgba(99,203,126,.15); }

/* ---- Sections ---- */
.section-title { font-weight: 700; color: var(--heading); border-left: 5px solid var(--primary); padding-left: .6rem; }

/* ---- Category cards ---- */
.category-card {
  display: block; background: #fff; border-radius: 10px; padding: 1.25rem 1rem;
  text-align: center; color: var(--heading); box-shadow: 0 1px 4px rgba(0,0,0,.06); border: 1px solid var(--secondary);
  transition: transform .15s, box-shadow .15s;
}
.category-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.08); color: var(--primary-hover); }
.category-card i { font-size: 1.8rem; color: var(--primary); }

/* ---- Product cards ---- */
.product-card {
  background: #fff; border-radius: 10px; overflow: hidden; border: 1px solid var(--secondary);
  box-shadow: 0 1px 4px rgba(0,0,0,.05); transition: box-shadow .15s, transform .15s;
}
.product-card:hover { box-shadow: 0 8px 20px rgba(0,0,0,.08); transform: translateY(-2px); }
.product-img-wrap { display: block; position: relative; background: var(--secondary); aspect-ratio: 1/1; overflow: hidden; }
.product-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.product-badge { position: absolute; top: 8px; left: 8px; }
.product-badge-stock { position: absolute; top: 8px; right: 8px; }
.product-name {
  display: block; color: var(--heading); text-decoration: none; font-weight: 600; font-size: .92rem;
  min-height: 2.6em; overflow: hidden; margin-top: 2px;
}
.product-name:hover { color: var(--primary-hover); }

/* ---- Promo banner ---- */
.promo-banner { background: linear-gradient(120deg, var(--primary-dark), var(--primary)); }

/* ---- Trust badges ---- */
.trust-badge { background: #fff; border-radius: 10px; padding: 1.5rem 1rem; box-shadow: 0 1px 4px rgba(0,0,0,.06); border: 1px solid var(--secondary); }
.trust-badge i { font-size: 1.8rem; color: var(--primary); }

/* ---- Filter box / cards ---- */
.filter-box { background: #fff; border-radius: 10px; padding: 1.25rem; box-shadow: 0 1px 4px rgba(0,0,0,.06); border: 1px solid var(--secondary); }

/* ---- Product detail ---- */
.product-slider { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.product-slider::-webkit-scrollbar { display: none; }
.product-slider > .col { scroll-snap-align: start; }
.product-rotator { transition: opacity .3s ease; }
.product-rotator.is-fading { opacity: 0; }
.slider-btn { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.product-detail-img { background: var(--secondary); border-radius: 10px; overflow: hidden; }
.product-thumb { width: 64px; height: 64px; object-fit: cover; cursor: pointer; opacity: .7; background: var(--secondary); }
.product-thumb:hover, .product-thumb.active { opacity: 1; border-color: var(--bs-primary) !important; }

.product-description { font-size: .95rem; line-height: 1.7; }
.product-description p { margin-bottom: .9rem; }
.product-description h4, .product-description h5, .product-description h6 {
  color: var(--text-dark, #212529); font-weight: 700; margin: 1.25rem 0 .6rem;
}
.product-description h4:first-child, .product-description h5:first-child, .product-description h6:first-child { margin-top: 0; }
.product-description ul, .product-description ol { margin-bottom: .9rem; padding-left: 1.25rem; }
.product-description li { margin-bottom: .3rem; }
.product-description strong { color: var(--text-dark, #212529); }
.product-description table { margin-bottom: .9rem; }
.product-description table th { background: var(--secondary); font-weight: 700; color: var(--text-dark, #212529); width: 35%; }
.product-description table th, .product-description table td { padding: .5rem .75rem; vertical-align: top; }

/* ---- Blog ---- */
.blog-content { font-size: 1.05rem; line-height: 1.8; color: var(--text-muted); }
.blog-content p { margin-bottom: 1.25rem; }

/* ---- Cart ---- */
.cart-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: var(--secondary); }

/* ---- Social feed (Instagram/TikTok) ---- */
.social-feed { background: #fff; border-top: 1px solid var(--secondary); }
.social-tile { aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--secondary); transition: opacity .15s; }
.social-tile.social-tile-tall { aspect-ratio: 9 / 16; }
.social-tile img { width: 100%; height: 100%; object-fit: cover; }
.social-tile:hover { opacity: .8; }
.social-embed { min-height: 560px; }
.social-embed-ig iframe { width: 100%; max-width: 540px; height: 640px; border: 1px solid var(--secondary); border-radius: 10px; display: block; margin: 0 auto; background: #fff; }
@media (max-width: 575.98px) { .social-embed-ig iframe { height: 520px; } }

/* ---- Searchable select (ketik untuk cari, dipakai di form transaksi admin) ---- */
.searchable-select { position: relative; }
.searchable-select-menu {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 1050; margin-top: 2px;
  background: #fff; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.12);
  max-height: 260px; overflow-y: auto; padding: 4px;
}
.searchable-select-item { padding: .45rem .65rem; font-size: .875rem; border-radius: 6px; cursor: pointer; }
.searchable-select-item:hover, .searchable-select-item.active { background: var(--secondary); }
.searchable-select-empty { padding: .5rem .65rem; font-size: .85rem; color: #8f8f8f; }

/* ---- WhatsApp floating widget ---- */
.whatsapp-widget {
  position: fixed; right: 22px; bottom: 22px; width: 58px; height: 58px; z-index: 1040;
  background: #25d366; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; box-shadow: 0 4px 14px rgba(0,0,0,.25); transition: transform .15s, box-shadow .15s;
}
.whatsapp-widget:hover { color: #fff; transform: scale(1.08); box-shadow: 0 6px 18px rgba(0,0,0,.3); }

/* ---- Footer ---- */
.site-footer { background: var(--footer-bg); }
.site-footer .brand-logo .brand-text { color: var(--heading); }
.footer-heading { color: var(--heading); }
.footer-muted { color: var(--footer-text); }
.footer-links a { color: var(--footer-text); text-decoration: none; font-size: .9rem; line-height: 2; }
.footer-links a:hover { color: var(--primary-hover); }
.social-btn {
  width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--heading);
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; border: 1px solid #ddd;
}
.social-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.footer-category-badge {
  background: #fff !important; color: var(--text-muted) !important; border: 1px solid #ddd;
}
.footer-category-badge:hover { background: var(--primary) !important; color: #fff !important; border-color: var(--primary); }

/* ---- Admin ---- */
.admin-body { background: var(--secondary); }
.admin-login-body { background: linear-gradient(120deg, var(--primary-dark), var(--primary)); min-height: 100vh; }
.admin-sidebar { width: 240px; min-height: 100vh; background: var(--heading); position: sticky; top: 0; }
.admin-sidebar .nav-link { color: #c7c7c7; font-size: .9rem; padding: .45rem .75rem; }
.admin-sidebar .nav-link:hover, .admin-sidebar .nav-link.active { color: #fff; background: var(--primary); border-radius: 6px; }
.admin-sidebar .sidebar-heading {
  color: #7a7a7a; font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; padding: .5rem .75rem .25rem;
}
.admin-topbar { background: #fff; }
.stat-card {
  background: #fff; border-radius: 10px; padding: 1.25rem; box-shadow: 0 1px 4px rgba(0,0,0,.06);
  color: inherit; transition: box-shadow .15s, transform .15s;
}
a.stat-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,.08); transform: translateY(-2px); }
.stat-card i { font-size: 1.6rem; color: var(--primary); }
.stat-value { font-size: 1.4rem; font-weight: 700; margin-top: .4rem; color: var(--heading); }
.stat-label { color: #888; font-size: .85rem; }

/* ---- Kartu ringkasan penjualan (Kelola Pesanan) ---- */
.sales-stat-card {
  display: block; position: relative; overflow: hidden; border-radius: 10px; padding: 1.1rem 1.25rem 2.4rem;
  color: #fff; transition: transform .15s, box-shadow .15s;
}
.sales-stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.15); color: #fff; }
.sales-stat-icon { position: absolute; right: .9rem; top: .9rem; font-size: 2.4rem; opacity: .35; }
.sales-stat-value { font-size: 1.35rem; font-weight: 800; }
.sales-stat-label { font-size: .85rem; opacity: .95; margin-top: .15rem; }
.sales-stat-more {
  position: absolute; left: 0; right: 0; bottom: 0; padding: .45rem 1.25rem; font-size: .78rem;
  background: rgba(0,0,0,.12);
}
.sales-stat-info { background: #17a2b8; }
.sales-stat-success { background: #1fab5a; }
.sales-stat-warning { background: #f0a02c; }
.sales-stat-danger { background: #e0524a; }

/* ---- Halaman Our Customer ---- */
.customer-logo-card {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .75rem 1rem;
  background: #fff;
  border: 1px solid var(--secondary);
  border-radius: .75rem;
  transition: box-shadow .2s, transform .2s;
}
.customer-logo-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.customer-logo-card:hover { box-shadow: 0 .5rem 1rem rgba(0,0,0,.08); transform: translateY(-2px); }
/* ---- Strip kategori: tombol mega menu "Semua Kategori" + pintasan ---- */
.category-strip { background: #fff; border-top: 1px solid var(--secondary); border-bottom: 1px solid var(--secondary); }
.category-menu-btn {
  display: inline-flex; align-items: center; gap: .5rem; border: 0; border-radius: 6px; margin: .4rem 0;
  padding: .45rem .9rem; background: var(--primary-strong); color: #fff; font-weight: 600; font-size: .875rem;
}
.category-menu-btn:hover, .category-menu-btn[aria-expanded="true"] { background: var(--primary-dark); }
.category-quick { display: flex; gap: .25rem; min-width: 0; overflow: hidden; }
.category-quick a, .category-strip-brands {
  white-space: nowrap; padding: .45rem .8rem; border-radius: 6px; font-size: .875rem; font-weight: 500;
  color: var(--heading); text-decoration: none;
}
.category-quick a:hover, .category-quick a.active, .category-strip-brands:hover { background: rgba(99, 203, 126, .14); color: var(--primary-hover); }
.category-strip-brands i { margin-right: .35rem; color: var(--primary-hover); }

.category-mega { width: min(920px, 92vw); padding: 1.25rem 1.5rem 0; border: 1px solid var(--secondary); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.12); margin-top: .35rem !important; }
.category-mega-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #6c757d; margin-bottom: .5rem; display: flex; align-items: center; gap: .4rem; }
.category-mega-title i { color: var(--primary-hover); }
.category-mega-link { display: flex; align-items: center; gap: .6rem; padding: .4rem .5rem; margin: 0 -.5rem; border-radius: 6px; color: var(--heading); text-decoration: none; font-size: .9rem; }
.category-mega-link i { color: var(--primary-hover); width: 1.1rem; text-align: center; }
.category-mega-link:hover, .category-mega-link.active { background: rgba(99, 203, 126, .14); color: var(--primary-hover); }
.category-mega-footer { display: flex; gap: 1.5rem; margin: 1rem -1.5rem 0; padding: .8rem 1.5rem; background: #f7f8f7; border-top: 1px solid var(--secondary); border-radius: 0 0 12px 12px; font-size: .875rem; }
.category-mega-footer a { color: var(--primary-hover); text-decoration: none; font-weight: 600; }
.category-mega-footer i { margin-right: .35rem; }

/* Kategori di menu hamburger (mobile) */
.mobile-cat-title { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #6c757d; margin: .75rem 0 .25rem; }
.mobile-cat-link { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; color: var(--heading); text-decoration: none; font-size: .9rem; }
.mobile-cat-link i { color: var(--primary-hover); width: 1.1rem; text-align: center; }

/* ---- Beranda: hero search, kategori berkelompok, merk populer ---- */
.hero-title { font-size: calc(1.6rem + 1.8vw); line-height: 1.15; }
@media (min-width: 1200px) { .hero-title { font-size: 3rem; } }
.hero-search { position: relative; display: flex; gap: .5rem; max-width: 560px; }
.hero-search > i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.hero-search .form-control { padding: .75rem 1rem .75rem 2.6rem; border-radius: 50px; border: 1px solid var(--secondary); box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.hero-search .btn { padding-left: 1.5rem; padding-right: 1.5rem; }
.hero-quick { display: flex; flex-wrap: wrap; gap: .35rem .9rem; align-items: center; }
.hero-quick a { color: var(--heading); text-decoration: none; border-bottom: 1px dashed currentColor; }
.hero-quick a:hover { color: var(--primary-hover); }

.category-group + .category-group { margin-top: 1.75rem; }
.category-group-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: .75rem; display: flex; align-items: center; gap: .5rem; }
.category-group-title i { color: var(--primary); font-size: 1rem; }
.category-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 991.98px) { .category-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Mobile: 2 baris, digeser ke samping (tidak memanjangkan halaman) */
@media (max-width: 767.98px) {
  .category-tiles {
    grid-template-columns: none; grid-auto-flow: column; grid-template-rows: repeat(2, auto);
    grid-auto-columns: 72%; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--bs-gutter-x, .75rem);
    margin: 0 calc(-1 * var(--bs-gutter-x, .75rem)); padding: 0 var(--bs-gutter-x, .75rem) .5rem; scrollbar-width: none;
  }
  .category-tiles::-webkit-scrollbar { display: none; }
  .category-tile { scroll-snap-align: start; }
}
.category-tile {
  display: flex; align-items: center; gap: .75rem; min-height: 68px; padding: .7rem .85rem;
  background: #fff; border: 1px solid var(--secondary); border-radius: 10px; color: var(--heading); text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.category-tile:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(0,0,0,.07); transform: translateY(-2px); color: var(--primary-hover); }
.category-tile-icon {
  flex: 0 0 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(99, 203, 126, .14); color: var(--primary-hover); font-size: 1.25rem;
}
.category-tile-body { min-width: 0; display: flex; flex-direction: column; }
.category-tile-name { font-weight: 600; font-size: .9rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.category-tile-count { font-size: .75rem; color: #6c757d; margin-top: .1rem; }

.brand-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 767.98px) {
  .brand-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--bs-gutter-x, .75rem)); padding: 0 var(--bs-gutter-x, .75rem) .25rem; }
  .brand-chips::-webkit-scrollbar { display: none; }
}
.brand-chip {
  flex: 0 0 auto; padding: .45rem .9rem; border: 1px solid var(--secondary); border-radius: 50px; background: #fff;
  color: var(--heading); text-decoration: none; font-size: .875rem; font-weight: 600; white-space: nowrap;
}
.brand-chip span { color: var(--text-muted); font-weight: 400; font-size: .75rem; margin-left: .2rem; }
.brand-chip:hover { border-color: var(--primary); color: var(--primary-hover); }
@media (max-width: 575.98px) { .section-title { font-size: 1.35rem; } }
#moreCategories .category-group { margin-top: 1.75rem; }
.category-more-btn[aria-expanded="false"] .when-open, .category-more-btn[aria-expanded="true"] .when-closed { display: none; }
.category-intro { max-width: 900px; font-size: .925rem; line-height: 1.6; }
.spec-table { max-width: 720px; font-size: .875rem; }
.spec-table th { width: 38%; font-weight: 600; color: var(--heading); background: #f7f8f7; }
