/* ============================================
   NOCTUNE AUDIO - Stylesheet
   Dikembangkan oleh TECHSTACUK
   ============================================ */

:root {
  --bg: #0f1115;
  --bg-alt: #15181f;
  --surface: #1b1e26;
  --border: #2a2e38;
  --text: #eef0f4;
  --text-muted: #9aa0ac;
  --accent: #7c5cff;
  --accent-soft: #7c5cff22;
  --success: #34d399;
  --danger: #f87171;
  --radius: 14px;
  --font: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ==== HEADER ==== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15, 17, 21, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #4f9dff);
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800;
}
.brand-text em { font-style: normal; color: var(--accent); }
.main-nav { display: flex; gap: 28px; }
.main-nav a { color: var(--text-muted); font-size: 0.95rem; transition: color .2s; }
.main-nav a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 16px; }
.cart-link { position: relative; display: flex; }
.cart-count {
  position: absolute; top: -8px; right: -10px; background: var(--accent);
  color: #fff; font-size: 0.7rem; font-weight: 700; min-width: 18px; height: 18px;
  border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.nav-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); }

/* ==== HERO ==== */
.hero { padding: 90px 0 70px; overflow: hidden; position: relative; }
.hero-inner { display: flex; align-items: center; gap: 40px; }
.hero-text { flex: 1; }
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; font-size: 0.8rem; }
.hero-text h1 { font-size: 2.6rem; line-height: 1.15; margin: 14px 0 18px; }
.hero-text p { color: var(--text-muted); max-width: 480px; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 14px; }
.hero-visual { flex: 1; position: relative; height: 320px; }
.hero-glow {
  position: absolute; inset: 0; margin: auto; width: 260px; height: 260px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  filter: blur(10px);
}
.hero-ring { position: absolute; border: 2px solid var(--border); border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.hero-ring-1 { width: 220px; height: 220px; border-color: var(--accent); opacity: .4; }
.hero-ring-2 { width: 320px; height: 320px; }

/* ==== BUTTONS ==== */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 26px; border-radius: 999px; font-weight: 600; font-size: 0.95rem; cursor: pointer; border: none; transition: all .2s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-full { width: 100%; }

/* ==== SECTIONS ==== */
.section { padding: 60px 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: 1.6rem; margin-bottom: 28px; }
.page-title { font-size: 2rem; margin-bottom: 20px; }
.empty-note { color: var(--text-muted); }

/* ==== CATEGORY GRID ==== */
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.category-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; text-align: center; font-weight: 600; transition: all .2s;
}
.category-card:hover { border-color: var(--accent); transform: translateY(-3px); }

/* ==== PRODUCT GRID / CARD ==== */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.product-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: all .2s;
}
.product-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.product-thumb { aspect-ratio: 1/1; background: var(--bg-alt); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb-placeholder { font-size: 2.5rem; font-weight: 800; color: var(--border); }
.product-thumb-placeholder.large { font-size: 5rem; }
.product-info { padding: 16px; }
.product-info h3 { font-size: 1rem; margin: 0 0 6px; }
.product-desc { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-price { display: flex; align-items: center; gap: 8px; }
.product-price.large { font-size: 1.4rem; margin: 14px 0; }
.price-old { text-decoration: line-through; color: var(--text-muted); font-size: 0.85rem; }
.price-now { color: var(--accent); font-weight: 700; }

/* ==== CS HIGHLIGHT ==== */
.cs-highlight-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 34px; flex-wrap: wrap; }
.cs-highlight-inner p { color: var(--text-muted); margin: 6px 0 0; }

/* ==== SEARCH BAR ==== */
.search-bar { display: flex; gap: 10px; margin-bottom: 28px; max-width: 420px; }
.search-bar input { flex: 1; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.search-bar button { padding: 12px 22px; border-radius: 999px; border: none; background: var(--accent); color: #fff; cursor: pointer; }

/* ==== PRODUCT DETAIL ==== */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.main-image { background: var(--surface); border-radius: var(--radius); overflow: hidden; aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; }
.main-image img { width: 100%; height: 100%; object-fit: cover; }
.thumb-list { display: flex; gap: 10px; margin-top: 10px; }
.thumb-list img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); }
.breadcrumb { color: var(--accent); font-size: 0.85rem; font-weight: 600; }
.brand-label { color: var(--text-muted); font-size: 0.9rem; }
.stock-info { color: var(--success); font-size: 0.9rem; margin-bottom: 18px; }
.product-full-desc { color: var(--text-muted); margin-bottom: 24px; white-space: pre-line; }
.add-to-cart-form { display: flex; gap: 14px; margin-bottom: 14px; }
.qty-control { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.qty-control input { width: 50px; text-align: center; border: none; background: transparent; color: var(--text); }
.qty-btn { width: 38px; height: 42px; background: var(--surface); border: none; color: var(--text); cursor: pointer; font-size: 1.1rem; }

/* ==== CART / CHECKOUT ==== */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.cart-table th, .cart-table td { padding: 14px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.cart-product-cell { display: flex; align-items: center; gap: 10px; }
.cart-product-cell img { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; }
.cart-qty-input { width: 60px; padding: 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.link-danger { color: var(--danger); background: none; border: none; cursor: pointer; text-decoration: underline; font-size: 0.85rem; }
.cart-summary { display: flex; justify-content: space-between; align-items: center; background: var(--surface); border-radius: var(--radius); padding: 20px; margin-top: 20px; }
.checkout-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; }
.checkout-form { display: flex; flex-direction: column; gap: 16px; }
.checkout-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--text-muted); }
.checkout-form input, .checkout-form textarea, .checkout-form select {
  padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-family: inherit;
}
.checkout-summary { background: var(--surface); border-radius: var(--radius); padding: 24px; height: fit-content; }
.summary-list { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.summary-list li { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--text-muted); }
.summary-total { font-size: 1.2rem; font-weight: 700; border-top: 1px solid var(--border); padding-top: 14px; }

/* ==== ALERTS ==== */
.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; }
.alert-success { background: #34d39922; border: 1px solid var(--success); color: var(--success); }
.alert-error { background: #f8717122; border: 1px solid var(--danger); color: var(--danger); }
.alert ul { margin: 0; padding-left: 18px; }

/* ==== FOOTER ==== */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); margin-top: 60px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; padding: 50px 20px; }
.footer-brand { margin-bottom: 12px; }
.footer-desc { color: var(--text-muted); font-size: 0.9rem; max-width: 320px; }
.footer-col h4 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 14px; }
.footer-col a, .footer-col p { display: block; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 10px; }
.footer-bottom { border-top: 1px solid var(--border); padding: 18px 20px; }
.footer-bottom .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 0.82rem; color: var(--text-muted); }
.dev-credit strong { color: var(--accent); }

/* ==== AI CHAT WIDGET ==== */
.chat-toggle {
  position: fixed; bottom: 24px; right: 24px; width: 58px; height: 58px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none; cursor: pointer; z-index: 200;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(124, 92, 255, .4);
}
.chat-window {
  position: fixed; bottom: 96px; right: 24px; width: 340px; max-width: calc(100vw - 40px);
  height: 460px; max-height: 70vh; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); z-index: 200; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.4);
}
.chat-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.chat-status { display: block; font-size: 0.72rem; color: var(--success); margin-top: 2px; }
.chat-header button { background: none; border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; }
.chat-messages { flex: 1; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { padding: 10px 14px; border-radius: 14px; font-size: 0.88rem; max-width: 85%; }
.chat-msg-bot { background: var(--bg-alt); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-msg-user { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-msg-typing { opacity: .6; font-style: italic; }
.chat-input-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-input-form input { flex: 1; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-alt); color: var(--text); }
.chat-input-form button { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); border: none; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* ==== PWA INSTALL POPUP (clean & simple) ==== */
.pwa-popup {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 300;
  display: flex; justify-content: center; animation: pwaSlideUp .35s ease;
}
@keyframes pwaSlideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.pwa-popup-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 14px 16px; display: flex; align-items: center; gap: 12px; max-width: 420px; width: 100%;
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
}
.pwa-popup-icon img { width: 40px; height: 40px; border-radius: 10px; }
.pwa-popup-text { flex: 1; display: flex; flex-direction: column; font-size: 0.85rem; }
.pwa-popup-text strong { font-size: 0.92rem; }
.pwa-popup-text span { color: var(--text-muted); }
.pwa-popup-btn { background: var(--accent); color: #fff; border: none; padding: 9px 18px; border-radius: 999px; font-weight: 600; cursor: pointer; font-size: 0.85rem; white-space: nowrap; }
.pwa-popup-close { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; font-size: 0.9rem; line-height: 1; }

/* ==== ADMIN ==== */
.admin-body { background: var(--bg-alt); }
.admin-login-card {
  max-width: 380px; margin: 100px auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 34px;
}
.admin-login-card h1 { font-size: 1.3rem; text-align: center; margin-bottom: 24px; }
.admin-login-card h1 em { color: var(--accent); font-style: normal; }
.admin-login-card form { display: flex; flex-direction: column; gap: 16px; }
.admin-login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--text-muted); }
.admin-login-card input { padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-alt); color: var(--text); }
.admin-footer-note { text-align: center; color: var(--text-muted); font-size: 0.78rem; margin-top: 20px; }

.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 230px; background: var(--surface); border-right: 1px solid var(--border); padding: 24px 18px; }
.admin-brand { margin-bottom: 30px; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.admin-sidebar nav a { padding: 10px 14px; border-radius: 8px; color: var(--text-muted); font-size: 0.9rem; }
.admin-sidebar nav a.active, .admin-sidebar nav a:hover { background: var(--accent-soft); color: var(--accent); }
.admin-main { flex: 1; padding: 30px 36px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.admin-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-label { display: block; color: var(--text-muted); font-size: 0.82rem; margin-bottom: 6px; }
.stat-value { font-size: 1.5rem; font-weight: 700; }
.admin-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.admin-panel h3 { margin-top: 0; }
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--text-muted); }
.admin-form-grid label.full { grid-column: 1 / -1; }
.admin-form-grid input, .admin-form-grid textarea { padding: 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-alt); color: var(--text); font-family: inherit; }
.admin-form-grid button { grid-column: 1 / -1; width: fit-content; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.admin-note { color: var(--text-muted); font-size: 0.85rem; }

/* ==== RESPONSIVE ==== */
@media (max-width: 900px) {
  .main-nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: var(--bg); flex-direction: column; padding: 16px 20px; border-bottom: 1px solid var(--border); }
  .main-nav.open { display: flex; }
  .nav-toggle { display: flex; }
  .hero-inner { flex-direction: column; text-align: center; }
  .hero-text p { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .product-detail, .checkout-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; align-items: center; justify-content: space-between; }
  .admin-sidebar nav { flex-direction: row; }
}
