/* ============================================
   Deoni Stationery — Main CSS
   Apple-skin · Amazon-brain · Tokopedia-familiar
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
  --primary:       #1a56db;
  --primary-dark:  #1347c0;
  --success:       #0e9f6e;
  --warning:       #d97706;
  --danger:        #dc2626;
  --dark:          #0f172a;
  --body:          #1e293b;
  --muted:         #64748b;
  --light:         #f8fafc;
  --border:        #e2e8f0;
  --white:         #ffffff;
  --radius-sm:     8px;
  --radius:        12px;
  --radius-lg:     16px;
  --radius-xl:     24px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:        0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.12);
  --transition:    .2s cubic-bezier(.4,0,.2,1);
  --deoni-green:   #2d6a1f;
  --deoni-red:     #c0392b;
}

/* ── Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #f1f5f9;
  color: var(--body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.fw-bold, .fw-semibold {
  font-family: 'Poppins', 'Inter', sans-serif;
  color: var(--dark);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }

/* ── Topbar — nomor WA sebelum navbar ────── */
.topbar {
  background: var(--dark);
  color: rgba(255,255,255,.7);
  font-size: 12px;
  padding: 6px 0;
  letter-spacing: .01em;
}
.topbar a { color: #94a3b8; }
.topbar a:hover { color: white; }
.topbar strong { color: white; }

/* ── Navbar ───────────────────────────────── */
.navbar {
  background: rgba(255,255,255,.97) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.navbar-brand img {
  height: 46px;
  max-width: 170px;
  object-fit: contain;
}
.nav-link {
  font-size: .875rem;
  font-weight: 500;
  color: var(--body) !important;
  padding: .45rem .85rem !important;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover { background: var(--light); color: var(--primary) !important; }
.nav-link.active { color: var(--primary) !important; background: #eff6ff; }

/* Search bar — Amazon style prominent */
.navbar-search-wrap {
  flex: 1;
  max-width: 440px;
  margin: 0 1.5rem;
  position: relative;
}
.navbar-search-wrap input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 8px 44px 8px 18px;
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  background: var(--light);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
}
.navbar-search-wrap input:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}
.navbar-search-wrap .search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  z-index: 1050;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
}
.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  color: var(--body);
  transition: background var(--transition);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--light); }
.search-item img { width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius-sm); }

/* Cart icon */
.cart-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.cart-badge {
  position: absolute;
  top: -7px; right: -9px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid white;
}
.cart-badge.show { display: flex; }

/* ── Hero ──────────────────────────────────── */
.hero-slide {
  min-height: 440px;
  position: relative;
  overflow: hidden;
}

/* Hero counter stats */
.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.hero-stat {
  text-align: left;
}
.hero-stat-num {
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  line-height: 1;
}
.hero-stat-label {
  font-size: 11px;
  color: rgba(255,255,255,.7);
  margin-top: 2px;
  letter-spacing: .03em;
}
.hero-stat-divider {
  width: 1px;
  background: rgba(255,255,255,.25);
  align-self: stretch;
}

/* Brand logos strip */
.brand-logos {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  overflow: hidden;
}
.brand-logos-inner {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.brand-logo-item {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  white-space: nowrap;
}

/* ── Perks / Keunggulan ───────────────────── */
.perks-section {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
}
.perks-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.perks-row > div { padding: 0; }
.perk-card {
  background: var(--light);
  border-radius: var(--radius);
  padding: 1.2rem 1rem;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
}
.perk-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: #c7deff;
  background: white;
}
.perk-icon-wrap {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: .25rem;
}
.perk-icon-wrap.blue   { background: #eff6ff; color: #1a56db; }
.perk-icon-wrap.green  { background: #f0fdf4; color: #059669; }
.perk-icon-wrap.yellow { background: #fffbeb; color: #d97706; }
.perk-icon-wrap.cyan   { background: #ecfeff; color: #0891b2; }
.perk-title { font-weight: 600; font-size: .875rem; color: var(--dark); font-family: 'Poppins', sans-serif; }
.perk-desc  { font-size: .75rem; color: var(--muted); line-height: 1.4; }

/* ── Section titles ────────────────────────── */
.section-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: .35rem;
}
.section-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: .25rem;
}
.section-sub {
  color: var(--muted);
  font-size: .9rem;
}

/* ── Product Cards — Tokopedia-familiar ────── */
.product-card {
  border-radius: var(--radius) !important;
  border: 1px solid var(--border) !important;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  overflow: hidden;
  background: white !important;
  position: relative;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg) !important;
  border-color: #c7deff !important;
}
.product-card img {
  transition: transform .35s ease;
}
.product-card:hover img { transform: scale(1.05); }

/* Badge produk */
.prod-badge {
  position: absolute;
  top: 10px; left: 10px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  letter-spacing: .03em;
  z-index: 2;
  text-transform: uppercase;
}
.prod-badge.terlaris { background: #dc2626; color: white; }
.prod-badge.grosir   { background: #0e9f6e; color: white; }
.prod-badge.new      { background: var(--primary); color: white; }

/* Hover WA button */
.prod-wa-btn {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 10px;
  background: linear-gradient(0deg, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
  transform: translateY(100%);
  transition: transform var(--transition);
  z-index: 3;
}
.product-card:hover .prod-wa-btn { transform: translateY(0); }
.prod-wa-btn a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #25d366;
  color: white;
  border-radius: var(--radius-sm);
  padding: 7px;
  font-size: 12px;
  font-weight: 600;
}
.prod-wa-btn a:hover { background: #1ebe5d; color: white; }

/* Grosir badge inline */
.grosir-hint {
  font-size: 11px;
  color: #059669;
  background: #f0fdf4;
  border-radius: 4px;
  padding: 1px 6px;
  display: inline-block;
}

/* ── Category Cards ────────────────────────── */
.category-card {
  border-radius: var(--radius) !important;
  border: 1px solid var(--border) !important;
  background: white !important;
  transition: all var(--transition);
  cursor: pointer;
}
.category-card:hover {
  background: var(--primary) !important;
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--primary) !important;
}
.category-card:hover i,
.category-card:hover div { color: white !important; }

/* ── AI Search Section ─────────────────────── */
.ai-search-section {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  position: relative;
  overflow: hidden;
}
.ai-search-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(26,86,219,.3) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(14,159,110,.2) 0%, transparent 60%);
}
.ai-search-section > * { position: relative; }

/* ── Urgency / Social proof ────────────────── */
.urgency-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid #fde68a;
}
.urgency-badge .dot {
  width: 6px; height: 6px;
  background: #f59e0b;
  border-radius: 50%;
  animation: blink .8s infinite alternate;
}
@keyframes blink {
  from { opacity: 1; }
  to   { opacity: .3; }
}

.stock-low {
  font-size: 11px;
  color: #dc2626;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stock-low::before {
  content: '';
  width: 6px; height: 6px;
  background: #dc2626;
  border-radius: 50%;
  display: inline-block;
}

/* ── Pricing Table — Amazon-clear ──────────── */
.pricing-table table { font-size: .875rem; }
.price-tier-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.price-tier-tab {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: white;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  color: var(--muted);
}
.price-tier-tab:hover { border-color: var(--primary); color: var(--primary); }
.price-tier-tab.active { background: var(--primary); border-color: var(--primary); color: white; }
.price-display-box {
  background: #eff6ff;
  border: 2px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 12px;
}
.price-display-box .price-main { font-size: 1.8rem; font-weight: 800; color: var(--primary); font-family: 'Poppins', sans-serif; }
.price-display-box .price-unit { font-size: .8rem; color: var(--muted); }
.price-display-box .price-note { font-size: .78rem; color: #059669; font-weight: 600; }
.qty-auto-hint {
  font-size: 11px; color: #059669;
  padding: 4px 10px; background: #f0fdf4;
  border-radius: 8px; margin-top: 6px; display: none;
}
.qty-auto-hint.show { display: block; }

/* ── Testimoni ─────────────────────────────── */
.testi-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  height: 100%;
  transition: box-shadow var(--transition);
}
.testi-card:hover { box-shadow: var(--shadow); }
.testi-stars { color: #f59e0b; font-size: .875rem; margin-bottom: .75rem; }
.testi-text { color: var(--body); font-size: .9rem; line-height: 1.65; margin-bottom: 1rem; }
.testi-avatar {
  width: 40px; height: 40px;
  background: #eff6ff;
  color: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; flex-shrink: 0;
}

/* ── Footer ────────────────────────────────── */
footer {
  background: #0f172a !important;
  color: #94a3b8;
}
footer h5, footer h6 { font-family: 'Poppins', sans-serif; }
footer a.text-muted:hover { color: white !important; }

/* ── Bottom nav mobile — killer feature ────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  z-index: 1000;
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
}
.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
  position: relative;
  text-decoration: none;
}
.bnav-item i { font-size: 1.25rem; }
.bnav-item.active, .bnav-item:hover { color: var(--primary); }
.bnav-item.wa-btn {
  background: #25d366;
  color: white;
  border-radius: var(--radius);
  padding: 6px 14px;
  margin-bottom: 2px;
}
.bnav-item.wa-btn:hover { background: #1ebe5d; color: white; }
.bnav-cart-badge {
  position: absolute;
  top: 1px; right: 6px;
  background: var(--danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 1.5px solid white;
}
.bnav-cart-badge.show { display: flex; }

/* ── AI Chat Widget ────────────────────────── */
.ai-chat-widget { position: fixed; bottom: 80px; right: 20px; z-index: 9999; }
.ai-chat-toggle {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--dark);
  border: none;
  color: white;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  transition: transform var(--transition), box-shadow var(--transition);
}
.ai-chat-toggle:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.ai-chat-box {
  position: absolute;
  bottom: 66px; right: 0;
  width: 340px;
  max-height: 480px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  overflow: hidden;
}
.ai-chat-header { background: var(--dark) !important; }
.ai-chat-messages { flex: 1; overflow-y: auto; max-height: 300px; min-height: 160px; }
.chat-msg { margin-bottom: 10px; }
.chat-msg.user .bubble {
  background: var(--primary); color: white;
  border-radius: 14px 14px 2px 14px;
  padding: 8px 12px; max-width: 80%; margin-left: auto; font-size: 13px;
}
.chat-msg.ai .bubble {
  background: var(--light); color: var(--body);
  border-radius: 14px 14px 14px 2px;
  padding: 8px 12px; max-width: 85%; font-size: 13px; line-height: 1.5;
}

/* ── Cart ──────────────────────────────────── */
.cart-item-row { border-bottom: 1px solid var(--border); padding: 14px 0; }
.cart-item-row:last-child { border-bottom: none; }
.cart-item-img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); flex-shrink: 0; }
.cart-qty-input { width: 60px; text-align: center; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px 6px; font-size: 14px; font-weight: 600; }
.cart-total-box { background: #eff6ff; border: 2px solid #bfdbfe; border-radius: var(--radius); padding: 16px 20px; }
.cart-empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.cart-empty-state i { font-size: 3.5rem; opacity: .25; }
.cart-toast {
  position: fixed; bottom: 90px; right: 20px;
  background: var(--dark); color: white;
  padding: 10px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  z-index: 9999; opacity: 0;
  transform: translateY(10px);
  transition: all .25s; pointer-events: none;
}
.cart-toast.show { opacity: 1; transform: translateY(0); }

/* ── Admin utils ───────────────────────────── */
.sidebar-nav .nav-link { color: var(--body); border-radius: var(--radius-sm); font-size: .875rem; }
.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active { background: #eff6ff; color: var(--primary); font-weight: 600; }
.img-source-tabs { display: flex; gap: 0; margin-bottom: 8px; }
.img-source-tab { flex: 1; padding: 5px 10px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); background: var(--light); cursor: pointer; text-align: center; transition: all .15s; }
.img-source-tab:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.img-source-tab:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.img-source-tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.img-url-preview { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); border: 2px solid var(--border); margin-top: 6px; display: none; }
.img-url-preview.show { display: block; }

/* ── Responsive ────────────────────────────── */
@media (max-width: 991px) {
  .navbar-search-wrap { max-width: 100%; margin: 8px 0; }
}

@media (max-width: 767px) {
  .bottom-nav { display: block; }
  body { padding-bottom: 70px; }
  .ai-chat-widget { bottom: 86px; right: 16px; }
  .perks-row { grid-template-columns: repeat(2, 1fr) !important; }
  .hero-slide { min-height: 280px; }
  .hero-stats { gap: 1.2rem; }
  .hero-stat-num { font-size: 1.2rem; }
  .section-title { font-size: 1.2rem; }
  section.py-5 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
  .container { padding-left: 14px; padding-right: 14px; }
  .ai-chat-box { width: 300px; right: -8px; max-height: 420px; }
  .ai-search-input-group { flex-direction: column; gap: 8px; }
  .ai-search-input-group input { width: 100% !important; max-width: 100% !important; }
  .ai-suggestion-tags { display: none; }
  .brand-logos-inner { gap: 1rem; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding: 0 14px; }
}

@media (max-width: 575px) {
  .hero-slide { min-height: 240px; }
  .hero-stat-divider { display: none; }
  .navbar-brand img { height: 38px; }
  .prod-wa-btn { display: none; }
}

@media (min-width: 992px) {
  .product-card:hover { transform: translateY(-5px); }
  .filter-sticky { top: 80px; }
  .hero-slide { min-height: 460px; }
}
