/*
  Smart Store – UI layer
  Goal: make Zonaid storefront feel like a modern eCommerce template
  WITHOUT changing backend features / flows.

  This file intentionally overrides style.css tokens + a few components.
*/

/* ------------------------------
   Theme tokens (Blue / White)
------------------------------ */

/* Dark mode defaults: elegant, not too black */
:root {
  --primary-color: #60a5fa;
  --primary-dark: #3b82f6;
  --primary-rgb: 96, 165, 250;

  --bg-dark: #0f172a;
  --bg-card: #111c32;
  --bg-surface: #0b1224;
  --text-primary: #e5e7eb;
  --text-secondary: #b6c2d1;
  --border-color: rgba(255, 255, 255, .10);

  --radius: 16px;
  --shadow: 0 10px 28px rgba(2, 6, 23, .22);
  --shadow-hover: 0 18px 48px rgba(2, 6, 23, .34);
  --nav-h: 92px;
}

html[data-theme="light"] {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-rgb: 37, 99, 235;

  --bg-dark: #f6f8ff;
  --bg-card: #ffffff;
  --bg-surface: #f3f6ff;
  --text-primary: #0f172a;
  --text-secondary: #4b5563;
  --border-color: #e6ebf5;
  --shadow: 0 10px 26px rgba(15, 23, 42, .06);
  --shadow-hover: 0 18px 42px rgba(15, 23, 42, .10);
}

/* Reduce grid background prominence in light mode */
html[data-theme="light"] .animated-bg {
  opacity: .55;
}

/* Body spacing: header is taller in Smart Store */
body {
  padding-top: var(--nav-h);
}

@media (max-width: 991.98px) {
  :root { --nav-h: 78px; }
}

/* Landing page previously used a desktop sidebar; Smart Store uses the main header instead */
@media (min-width: 992px) {
  body.lp-index {
    padding-left: 0 !important;
    padding-top: var(--nav-h) !important;
  }

  body.lp-index #mainNavbar {
    display: block !important;
  }

  body.lp-index .lp-aside {
    display: none !important;
  }

  body.lp-index section[id] {
    scroll-margin-top: calc(var(--nav-h) + 1rem);
  }
}

/* ------------------------------
   Header / Navbar
------------------------------ */

/* We replace <nav.navbar> with <header#mainNavbar.ss-header> */
.ss-header {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, .86);
  border-bottom: 1px solid rgba(2, 6, 23, .06);
  transition: transform .2s ease, box-shadow .25s ease, background-color .25s ease;
}

html[data-theme="dark"] .ss-header,
:root:not([data-theme]) .ss-header {
  background: rgba(11, 18, 36, .78);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.ss-header.scrolled {
  box-shadow: var(--shadow);
}

.ss-topbar {
  font-size: 13px;
  line-height: 1.2;
  padding: 8px 0;
  background: linear-gradient(90deg, rgba(var(--primary-rgb), .95), rgba(var(--primary-rgb), .82));
  color: rgba(255, 255, 255, .92);
}

html[data-theme="dark"] .ss-topbar {
  background: linear-gradient(90deg, rgba(15, 23, 42, .98), rgba(var(--primary-rgb), .32));
}

.ss-topbar a {
  color: rgba(255, 255, 255, .88);
  text-decoration: none;
}

.ss-topbar a:hover { color: #fff; }

.ss-mainbar {
  padding: 10px 0;
}

.ss-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.ss-brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.ss-brand span {
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--text-primary);
}

.ss-search {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  overflow: hidden;
  min-width: 340px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .04);
}

html[data-theme="dark"] .ss-search {
  background: rgba(255, 255, 255, .04);
  box-shadow: none;
}

.ss-search input {
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  color: var(--text-primary);
  padding: 10px 14px;
  min-width: 0;
}

.ss-search input::placeholder { color: var(--text-secondary); }

.ss-search button {
  border: 0;
  background: var(--primary-color);
  color: #fff;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ss-search button:hover { filter: brightness(.96); }

/* Search panel (toggle) */
.ss-search-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: max-height .25s ease, opacity .2s ease, transform .2s ease;
}

.ss-search-panel.is-open {
  max-height: 140px;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  padding-bottom: 12px;
}

.ss-search-panel .ss-search {
  min-width: 0;
  width: 100%;
}

@media (min-width: 992px) {
  .ss-search-panel.is-open {
    padding-top: 4px;
    padding-bottom: 14px;
  }

  .ss-search-panel .ss-search {
    max-width: 820px;
    margin-inline: auto;
  }
}

/* Mobile drawer menu */
.ss-no-scroll { overflow: hidden; }

.ss-drawer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
}

.ss-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, .42);
  opacity: 0;
  transition: opacity .2s ease;
}

.ss-drawer-panel {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: min(88vw, 380px);
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  box-shadow: var(--shadow-hover);
  transform: translateX(-100%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
}

.ss-drawer.is-open {
  pointer-events: auto;
}

.ss-drawer.is-open .ss-drawer-backdrop {
  opacity: 1;
}

.ss-drawer.is-open .ss-drawer-panel {
  transform: none;
}

.ss-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px;
  border-bottom: 1px solid var(--border-color);
}

.ss-drawer-title {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -.02em;
}

.ss-drawer-close {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ss-drawer-close:hover {
  background: rgba(var(--primary-rgb), .08);
  color: var(--text-primary);
}

.ss-drawer-body {
  padding: 10px 10px 18px;
  overflow: auto;
}

.ss-drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px;
  margin: 2px 4px;
  border-radius: 16px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
}

.ss-drawer-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.ss-drawer-ico {
  width: 22px;
  text-align: center;
  color: var(--primary-color);
}

.ss-drawer-link:hover {
  background: rgba(var(--primary-rgb), .08);
}

.ss-drawer-link.active {
  background: rgba(var(--primary-rgb), .12);
  color: var(--primary-color);
}

.ss-drawer-toggle .ss-drawer-chev {
  color: var(--text-secondary);
  transition: transform .2s ease, color .2s ease;
}

.ss-drawer-toggle.is-open .ss-drawer-chev {
  transform: rotate(180deg);
  color: var(--primary-color);
}

.ss-drawer-sub {
  max-height: 0;
  overflow: hidden;
  margin: 4px 8px 8px 18px;
  padding-left: 10px;
  border-left: 1px dashed rgba(var(--primary-rgb), .28);
  transition: max-height .25s ease;
}

.ss-drawer-sub.is-open {
  max-height: 620px;
}

.ss-drawer-sublink {
  display: block;
  padding: 10px 10px;
  margin: 2px 0;
  border-radius: 14px;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 700;
}

.ss-drawer-sublink:hover {
  background: rgba(var(--primary-rgb), .07);
  color: var(--text-primary);
}

.ss-drawer-section {
  margin: 10px 10px 6px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}


.ss-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ss-navlink {
  font-weight: 700;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 999px;
  transition: background-color .15s ease, color .15s ease;
}

.ss-navlink:hover,
.ss-navlink.active {
  background: rgba(var(--primary-rgb), .10);
  color: var(--primary-color);
}

.ss-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ss-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.ss-icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: rgba(var(--primary-rgb), .35);
}

.ss-icon-btn .mini-badge {
  top: -6px;
  right: -6px;
}

/* Bottom nav: keep behavior, update look for light theme */
@media (max-width: 991.98px) {
  html[data-theme="light"] .mobile-bottom-nav {
    background: rgba(255, 255, 255, .92);
    border-top: 1px solid rgba(2, 6, 23, .08);
    box-shadow: 0 -10px 30px rgba(15, 23, 42, .10);
  }

  html[data-theme="light"] .mobile-bottom-nav a,
  html[data-theme="light"] .mobile-bottom-nav button {
    color: var(--text-secondary);
  }

  html[data-theme="light"] .mobile-bottom-nav a.active,
  html[data-theme="light"] .mobile-bottom-nav button.active {
    color: var(--primary-color);
    background: rgba(var(--primary-rgb), .08);
  }
}

/* ------------------------------
   Buttons
------------------------------ */

.btn-gradient {
  background: var(--primary-color) !important;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(var(--primary-rgb), .18);
}

.btn-gradient:hover {
  box-shadow: 0 14px 32px rgba(var(--primary-rgb), .24);
}

.btn-outline-gradient {
  border: 2px solid rgba(var(--primary-rgb), .55) !important;
  color: var(--primary-color) !important;
}

.btn-outline-gradient:hover {
  background: rgba(var(--primary-rgb), .06) !important;
}

.category-badge {
  background: rgba(var(--primary-rgb), .08) !important;
  border: 1px solid rgba(var(--primary-rgb), .18) !important;
}

/* ------------------------------
   Product cards
------------------------------ */

.product-grid {
  gap: 1.1rem;
}

@media (min-width: 769px) {
  .product-grid { gap: 1.35rem; }
}

.product-card {
  overflow: hidden;
  padding: 0;
}

.ss-product-media {
  position: relative;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), .10), rgba(2, 132, 199, .08));
  border-bottom: 1px solid var(--border-color);
  padding: 18px;
}

html[data-theme="dark"] .ss-product-media {
  background: linear-gradient(135deg, rgba(var(--primary-rgb), .12), rgba(56, 189, 248, .10));
}

.ss-product-media .product-icon {
  width: 86px;
  height: 86px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(2, 6, 23, .06);
}

html[data-theme="dark"] .ss-product-media .product-icon {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .10);
}

.ss-product-media .product-icon img {
  width: 44px;
  height: 44px;
}

.ss-product-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.ss-quickview {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(2, 6, 23, .08);
  background: rgba(255, 255, 255, .88);
  color: rgba(2, 6, 23, .78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease;
}

html[data-theme="dark"] .ss-quickview {
  background: rgba(2, 6, 23, .55);
  border: 1px solid rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .86);
}

.ss-quickview:hover { transform: translateY(-1px); }

.ss-product-body {
  padding: 14px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ss-product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ss-product-meta .category-badge {
  cursor: pointer;
}

.ss-stock {
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: rgba(2, 132, 199, .06);
  color: var(--text-primary);
  white-space: nowrap;
}

.ss-stock.is-out {
  background: rgba(239, 68, 68, .08);
}

.product-title {
  margin: 0;
  min-height: unset;
}

.ss-product-footer {
  padding: 0 14px 14px;
  display: grid;
  gap: 10px;
}

.ss-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ss-price-row .current-price {
  font-size: 1.15rem;
}

.ss-hint {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ------------------------------
   Footer + modal cosmetics
------------------------------ */

.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
}

.site-footer .footer-link {
  text-decoration: none;
}

.site-footer .footer-link:hover {
  color: var(--primary-color);
}

.ss-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.ss-modal .modal-header,
.ss-modal .modal-footer {
  border-color: rgba(2, 6, 23, .06);
}

html[data-theme="dark"] .ss-modal .modal-header,
html[data-theme="dark"] .ss-modal .modal-footer {
  border-color: rgba(255, 255, 255, .08);
}


@media (max-width: 420px) {
  .ss-search {
    min-width: 0;
  }
}


/* ------------------------------
   Mobile refinements (Smart Store)
------------------------------ */

/* Hilangkan ikon mata (quick view) di mobile — cukup pakai tombol "Lihat detail" */
@media (max-width: 576px) {
  .ss-quickview {
    display: none !important;
  }
}

/* Pengumuman: di mobile jadi bottom-sheet setengah layar */
@media (max-width: 576px) {
  #notifOffcanvas.ss-notif-half {
    --bs-offcanvas-height: 52vh;
    height: var(--bs-offcanvas-height);
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
  }

  #notifOffcanvas.ss-notif-half .offcanvas-header {
    border-bottom: 1px solid var(--border-color);
  }

  #notifOffcanvas.ss-notif-half .offcanvas-body {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
}
