/* ============================================================
   LINGPEDIA — style.css
   Theme: dark (default) | light via [data-theme="light"]
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --primary:       #2563eb;
  --primary-h:     #1d4ed8;
  --primary-bg:    rgba(37,99,235,.12);

  /* dark */
  --bg:            #0f1117;
  --bg2:           #161b27;
  --bg-card:       #1a2035;
  --bg-sidebar:    #111827;
  --bg-hover:      rgba(255,255,255,.05);
  --border:        rgba(255,255,255,.08);
  --text:          #e2e8f0;
  --text-soft:     #94a3b8;
  --text-muted:    #64748b;
  --navbar-bg:     rgba(17,24,39,.97);
  --input-bg:      #1e293b;
  --shadow:        0 4px 24px rgba(0,0,0,.45);
  --shadow-sm:     0 2px 10px rgba(0,0,0,.3);
}

[data-theme="light"] {
  --bg:            #f1f5f9;
  --bg2:           #e8edf5;
  --bg-card:       #ffffff;
  --bg-sidebar:    #ffffff;
  --bg-hover:      rgba(0,0,0,.04);
  --border:        rgba(0,0,0,.09);
  --text:          #1e293b;
  --text-soft:     #64748b;
  --text-muted:    #94a3b8;
  --navbar-bg:     rgba(255,255,255,.97);
  --input-bg:      #f8fafc;
  --shadow:        0 4px 24px rgba(0,0,0,.08);
  --shadow-sm:     0 2px 10px rgba(0,0,0,.06);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; min-height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .2s, color .2s;
}

/* Halaman storefront (fk-page): body jadi flex column agar footer selalu
   menempel di bawah viewport pada konten pendek, dan sidebar bisa stretch
   penuh hingga footer pada konten panjang. Khusus fk-page supaya tidak
   mempengaruhi layout admin panel yang pakai struktur berbeda. */
body.fk-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  background: var(--navbar-bg) !important;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 8px 0;
  z-index: 1030;
  transition: background .2s, border-color .2s;
}

.nav-logo-icon {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: .85rem;
  flex-shrink: 0;
}

.nav-brand-name {
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
  white-space: nowrap;
}

.navbar-brand { gap: 10px !important; }

.nav-link {
  color: var(--text-soft) !important;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px !important;
  border-radius: 8px;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text) !important; background: var(--bg-hover); }

.navbar-toggler {
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  padding: 5px 9px !important;
  background: transparent !important;
}
.navbar-toggler:focus { box-shadow: none !important; }
.navbar-toggler i { color: var(--text); font-size: 1rem; }

/* ── Theme Toggle ───────────────────────────────────────────── */
.theme-toggle {
  width: 34px; height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  color: var(--text-soft);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: all .15s;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--primary-bg); color: var(--primary); border-color: var(--primary); }

/* ── Navbar: akun / login-daftar (pojok kanan atas) ─────────── */
.fk-nav-account-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  color: var(--text);
  font-size: 12.5px; font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  transition: all .15s;
}
.fk-nav-account-pill span { overflow: hidden; text-overflow: ellipsis; }
.fk-nav-account-pill i { font-size: 15px; color: var(--primary); flex-shrink: 0; }
.fk-nav-account-pill:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }

.fk-nav-login-link {
  font-size: 13px; font-weight: 600;
  color: var(--text-soft);
  text-decoration: none;
  padding: 0 4px;
  white-space: nowrap;
  transition: color .15s;
}
.fk-nav-login-link:hover { color: var(--primary); }

.fk-nav-register-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 14px;
  border-radius: 9px;
  background: var(--primary); color: #fff;
  font-size: 12.5px; font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s;
}
.fk-nav-register-btn:hover { background: var(--primary-h); color: #fff; }

@media (max-width: 400px) {
  .fk-nav-login-link { display: none; }
}

/* ── Layout ─────────────────────────────────────────────────── */
.fk-layout {
  display: flex;
  align-items: stretch;  /* sidebar & main sama tinggi mengikuti baris terpanjang */
  flex: 1 0 auto;         /* isi sisa ruang di body.fk-page agar footer menempel bawah */
}

/* ── Sidebar ────────────────────────────────────────────────── */
/* Wrapper luar: hanya menyediakan lebar + background + border, dan
   stretch (align-items:stretch) mengikuti tinggi baris .fk-layout,
   sehingga selalu menyentuh footer tanpa celah. */
.fk-sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  transition: background .2s, border-color .2s, left .25s ease;
  flex-shrink: 0;
  /* Fixed penuh: sidebar diam di layar, hanya area kontennya yang
     scroll sendiri jika menu lebih panjang dari tinggi layar. */
  position: fixed;
  top: 57px;
  left: 0;
  height: calc(100vh - 57px);
  overflow-y: auto;
  z-index: 1010;
}

.fk-sidebar-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 24px 12px 20px;
  gap: 0;
}

.fk-sidebar-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-bottom: 20px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.fk-avatar {
  width: 56px; height: 56px;
  border-radius: 14px;
  object-fit: cover;
  border: 1.5px solid var(--border);
}

.fk-avatar-placeholder {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 20px;
}

.fk-site-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  letter-spacing: -.01em;
}

/* ── Sidenav ────────────────────────────────────────────────── */
.fk-sidenav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 8px;
  flex: 1;
}

.fk-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  transition: all .15s;
  white-space: nowrap;
  overflow: hidden;
}
.fk-nav-item i {
  font-size: 13px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}
.fk-nav-item span { overflow: hidden; text-overflow: ellipsis; }
.fk-nav-item:hover { background: var(--bg-hover); color: var(--text); }
.fk-nav-item.active {
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: 600;
}

.fk-nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 4px;
  flex-shrink: 0;
}

/* ── Sidebar theme btn ──────────────────────────────────────── */
.fk-sidebar-theme {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.fk-theme-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
}
.fk-theme-btn:hover { background: var(--bg-hover); color: var(--text); }
.fk-theme-btn i { font-size: 14px; width: 16px; text-align: center; flex-shrink: 0; }
.fk-theme-btn .theme-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Main Content ───────────────────────────────────────────── */
.fk-main {
  flex: 1;
  min-width: 0;
  padding: 24px 22px 60px;
  /* Beri ruang untuk sidebar yang sekarang fixed (tidak lagi ambil ruang
     lewat flex, jadi konten perlu margin-left manual selebar sidebar). */
  margin-left: 220px;
}

/* ── Marquee ─────────────────────────────────────────────────── */
.fk-marquee-wrap {
  background: linear-gradient(90deg, #2563eb 0%, #7c3aed 100%);
  border-radius: 10px;
  padding: 9px 16px;
  margin-bottom: 18px;
  overflow: hidden;
}
.fk-marquee-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
}
.fk-marquee-text {
  display: inline-block;
  animation: marquee 28s linear infinite;
}
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Promo Banner ───────────────────────────────────────────── */
.fk-promo-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
  transition: background .2s;
}
.fk-promo-img {
  width: 56px; height: 56px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
}
.fk-promo-img-placeholder {
  width: 56px; height: 56px;
  border-radius: 9px;
  background: var(--primary-bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-size: 20px;
  flex-shrink: 0;
}
.fk-promo-label { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.fk-promo-price { color: var(--primary); font-weight: 700; }
.fk-promo-sub {
  font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px;
}
.fk-promo-cut { color: #22c55e; font-weight: 600; }
.fk-badge-disc {
  background: #dc2626; color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
}

/* ── Search ─────────────────────────────────────────────────── */
.fk-search-wrap { margin-bottom: 14px; }
.fk-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 0 14px;
  transition: border-color .15s, background .2s;
}
.fk-search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}
.fk-search-icon { color: var(--text-muted); font-size: 13px; flex-shrink: 0; }
.fk-search-input {
  flex: 1; border: none; background: transparent;
  color: var(--text); font-size: 13.5px;
  padding: 11px 0; outline: none;
}
.fk-search-input::placeholder { color: var(--text-muted); }
.fk-filter-btn {
  background: transparent; border: none;
  color: var(--text-muted); padding: 4px;
  border-radius: 6px; font-size: 14px;
  transition: color .15s;
}
.fk-filter-btn:hover { color: var(--primary); }

/* ── Category Pills ─────────────────────────────────────────── */
.fk-pills-wrap {
  display: flex; flex-wrap: wrap; gap: 7px;
  margin-bottom: 18px;
}
.fk-pill {
  padding: 5px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-soft);
  transition: all .15s;
}
.fk-pill:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.fk-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* ── Product Grid ───────────────────────────────────────────── */
.fk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  align-items: start;
}

/* ── Product Card ───────────────────────────────────────────── */
.fk-product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, border-color .18s, background .2s;
}
.fk-product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(37,99,235,.3);
}

.fk-card-img {
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: var(--bg2);
}
.fk-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.fk-product-card:hover .fk-card-img img { transform: scale(1.04); }

.fk-card-body {
  padding: 13px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.fk-card-name {
  font-size: 13px; font-weight: 600;
  color: var(--text); line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fk-card-desc-box { margin-top: 2px; }
.fk-desc-toggle {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none;
}
.fk-card-desc-label {
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.fk-desc-chevron { font-size: 10px; color: var(--text-muted); transition: transform .2s; }
.fk-desc-chevron.open { transform: rotate(180deg); }
.fk-desc-short, .fk-desc-full {
  font-size: 12px; color: var(--text-soft); line-height: 1.55; margin-top: 4px;
}
.fk-desc-full {
  display: none; border-top: 1px solid var(--border); padding-top: 6px; margin-top: 5px;
}

.fk-card-price { font-size: 15px; font-weight: 800; color: var(--primary); margin-top: 4px; }
.fk-card-original {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
}
.fk-badge-blue {
  background: var(--primary-bg); color: var(--primary);
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
}

.fk-card-bottom {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border);
}
.fk-card-sold {
  font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; gap: 4px;
}
.fk-fire { color: #f59e0b; }

.fk-btn-beli {
  background: var(--primary); color: #fff;
  font-size: 12px; font-weight: 600;
  padding: 6px 13px; border-radius: 8px;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
.fk-btn-beli:hover { background: var(--primary-h); transform: scale(1.03); }
.fk-btn-beli:active { transform: scale(.98); }

/* ── Empty ──────────────────────────────────────────────────── */
.fk-empty {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.fk-empty i { font-size: 44px; margin-bottom: 14px; opacity: .35; }
.fk-empty h5 { font-size: 15px; color: var(--text-soft); margin-bottom: 5px; }
.fk-empty p { font-size: 13px; }

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  background: var(--bg-sidebar) !important;
  border-top: 1px solid var(--border) !important;
  color: var(--text-soft) !important;
  transition: background .2s, border-color .2s, color .2s;
}
footer h6 { color: var(--text) !important; }
footer hr { border-color: var(--border) !important; }
footer small { color: var(--text-muted); }

.footer-link { color: var(--text-soft) !important; transition: color .15s; }
.footer-link:hover { color: var(--text) !important; }

.footer-social {
  width: 34px; height: 34px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-soft);
  font-size: 14px;
  transition: all .15s;
}
.footer-social:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Bootstrap overrides ────────────────────────────────────── */
.btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  font-weight: 600; border-radius: 8px;
}
.btn-primary:hover {
  background: var(--primary-h) !important;
  border-color: var(--primary-h) !important;
}

.form-control, .form-select {
  background: var(--input-bg) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-bg) !important;
}

.table { color: var(--text) !important; }
.table > :not(caption) > * > * {
  background: transparent !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

.modal-content {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

/* ── Responsive ─────────────────────────────────────────────── */

/* Tablet: kurangi lebar sidebar */
@media (max-width: 1100px) {
  .fk-sidebar { width: 190px; min-width: 190px; }
  .fk-main { margin-left: 190px; }
  .fk-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

/* Mobile: sidebar jadi drawer (slide-in) dibuka lewat tombol hamburger */
@media (max-width: 768px) {
  .fk-layout { display: block; }
  .fk-main { padding: 14px 14px 50px; margin-left: 0; }

  .fk-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    min-width: 260px;
    height: 100vh;
    z-index: 1060;
    box-shadow: none;
  }
  .fk-sidebar.open { left: 0; box-shadow: 8px 0 24px rgba(0,0,0,.25); }

  /* Drawer mobile: konten mengisi penuh tinggi drawer (bukan lagi
     mengikuti sisa tinggi viewport setelah navbar 57px seperti di desktop) */
  .fk-sidebar-inner {
    min-height: 100%;
    padding-top: 16px;
  }

  .fk-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* Overlay backdrop untuk drawer mobile */
.fk-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1055;
  opacity: 0;
  transition: opacity .2s;
}
.fk-sidebar-overlay.visible { display: block; opacity: 1; }

/* Tombol close drawer di dalam sidebar (mobile saja) */
.fk-sidebar-close {
  display: none;
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  color: var(--text-soft);
  align-items: center; justify-content: center;
  font-size: 13px;
}
@media (max-width: 768px) {
  .fk-sidebar-close { display: flex; }
}

@media (max-width: 420px) {
  .fk-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .fk-card-price { font-size: 13.5px; }
  .fk-btn-beli { padding: 5px 10px; font-size: 11.5px; }
}

