/* ==========================================================================
   Dasar: reset, tipografi, layout, header, footer
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--primary-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
}

.skip-link:focus {
  left: 16px;
  top: 8px;
}

/* Layout ------------------------------------------------------------------ */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.page {
  padding-top: var(--s-5);
  padding-bottom: var(--s-7);
}

.page-head {
  margin-bottom: var(--s-5);
}

.page-head h1 {
  font-size: var(--fs-h1);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.page-head p {
  margin-top: var(--s-1);
  color: var(--body);
}

.section {
  margin-top: var(--s-7);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-3);
}

.section-head h2 {
  font-size: var(--fs-h2);
  line-height: 1.3;
}

.section-head a {
  font-size: var(--fs-label);
  font-weight: 600;
  white-space: nowrap;
}

.stack > * + * {
  margin-top: var(--s-3);
}

.muted {
  color: var(--muted);
}

.body-text {
  color: var(--body);
}

.nums {
  font-variant-numeric: tabular-nums;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.brand-sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--body);
  letter-spacing: 0;
}

.header-nav {
  display: none;
  gap: var(--s-5);
  font-size: var(--fs-label);
  font-weight: 600;
}

.header-nav a {
  color: var(--body);
}

.header-nav a:hover,
.header-nav a[aria-current='page'] {
  color: var(--ink);
  text-decoration: none;
}

.cart-btn {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
}

.cart-btn:hover {
  background: var(--surface-warm);
  text-decoration: none;
}

.nav-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: var(--r-sm);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle:hover {
  background: var(--surface-warm);
}

.mobile-nav {
  border-top: 1px solid var(--hairline);
  background: var(--surface);
}

.mobile-nav-inner {
  display: grid;
  padding-top: 4px;
  padding-bottom: 4px;
}

.mobile-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid var(--hairline);
  font-size: var(--fs-label);
  font-weight: 600;
  color: var(--body);
}

.mobile-nav a:last-child {
  border-bottom: 0;
}

.mobile-nav a:hover {
  color: var(--ink);
  text-decoration: none;
}

@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }

  .mobile-nav {
    display: none !important;
  }
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: var(--r-full);
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 900px) {
  .header-nav {
    display: flex;
  }
}

/* Footer ------------------------------------------------------------------ */

.site-footer {
  margin-top: var(--s-7);
  background: var(--surface);
  border-top: 1px solid var(--hairline);
}

.footer-grid {
  display: grid;
  gap: var(--s-5);
  padding-top: var(--s-6);
  padding-bottom: var(--s-6);
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: var(--s-6);
  }
}

.footer-brand {
  font-size: 16px;
  font-weight: 700;
}

.footer-heading {
  font-size: var(--fs-label);
  font-weight: 600;
  margin-bottom: var(--s-2);
}

.footer-text {
  font-size: var(--fs-caption);
  color: var(--body);
  margin-top: var(--s-1);
}

.footer-links a {
  display: inline-block;
  padding: 4px 0;
  font-size: var(--fs-caption);
  color: var(--body);
}

.footer-links a:hover {
  color: var(--ink);
}

.footer-bottom {
  border-top: 1px solid var(--hairline);
  padding-top: var(--s-4);
  padding-bottom: var(--s-5);
  font-size: 12px;
  color: var(--muted);
}

/* Utilitas ---------------------------------------------------------------- */

[hidden] {
  display: none !important;
}

.hidden {
  display: none !important;
}

.nowrap {
  white-space: nowrap;
}

.spacer {
  flex: 1;
}

/* Jarak aman untuk bilah lengket di mobile */
.has-orderbar {
  padding-bottom: 96px;
}

@media (min-width: 1024px) {
  .has-orderbar {
    padding-bottom: var(--s-7);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
