/* =========================================================
   ARRIZ STORE — Design tokens & komponen dasar (dipakai semua halaman)
   ========================================================= */
:root {
  --white: #ffffff;
  --blue: #1677ff;
  --blue-dark: #075bd3;
  --blue-light: #eaf2ff;
  --gray-light: #f3f4f6;
  --text: #334155;
  --text-strong: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --success: #16a34a;
  --success-bg: #ecfdf3;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --violet: #7c3aed;
  --violet-bg: #f3e8ff;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-blue: 0 10px 30px rgba(22, 119, 255, 0.22);
  --container: 1160px;
  --nav-h: 68px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img,
svg {
  display: block;
  max-width: 100%;
}
h1,
h2,
h3,
h4 {
  color: var(--text-strong);
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
}
p {
  margin: 0 0 1em;
}
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  color: var(--blue-dark);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 3px solid rgba(22, 119, 255, 0.45);
  outline-offset: 2px;
  border-radius: 6px;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--blue);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
}
.skip-link:focus {
  top: 12px;
  color: #fff;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 14px;
}
.tiny {
  font-size: 12.5px;
}
.mono {
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  letter-spacing: 0.02em;
}
.icon {
  width: 20px;
  height: 20px;
  flex: none;
}
.icon-sm {
  width: 16px;
  height: 16px;
}
.icon-lg {
  width: 24px;
  height: 24px;
}

/* ---------- Tombol ---------- */
.btn {
  --btn-bg: var(--blue);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.15s var(--ease), border-color 0.2s;
  white-space: nowrap;
}
.btn:hover {
  background: var(--blue-dark);
  color: #fff;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  box-shadow: var(--shadow-blue);
}
.btn-lg {
  min-height: 52px;
  padding: 14px 26px;
  font-size: 16px;
}
.btn-sm {
  min-height: 36px;
  padding: 7px 14px;
  font-size: 14px;
  border-radius: 10px;
}
.btn-block {
  width: 100%;
}
.btn-secondary {
  --btn-bg: var(--blue-light);
  --btn-fg: var(--blue-dark);
}
.btn-secondary:hover {
  background: #dbe9ff;
  color: var(--blue-dark);
}
.btn-outline {
  --btn-bg: #fff;
  --btn-fg: var(--text-strong);
  border-color: var(--border-strong);
}
.btn-outline:hover {
  background: var(--gray-light);
  color: var(--text-strong);
}
.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text);
}
.btn-ghost:hover {
  background: var(--gray-light);
  color: var(--text-strong);
}
.btn-success {
  --btn-bg: var(--success);
}
.btn-success:hover {
  background: #15803d;
}
.btn-danger {
  --btn-bg: #fff;
  --btn-fg: var(--danger);
  border-color: #fecaca;
}
.btn-danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
}
.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.btn:disabled:hover {
  background: var(--btn-bg);
  color: var(--btn-fg);
}
.btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2.5px solid currentColor;
  border-color: var(--btn-fg) var(--btn-fg) var(--btn-fg) transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-strong);
  cursor: pointer;
  transition: background 0.2s;
}
.icon-btn:hover {
  background: var(--gray-light);
}
.icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- Form ---------- */
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}
.label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-strong);
}
.input,
.select,
.textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.textarea {
  min-height: 96px;
  resize: vertical;
}
.input::placeholder,
.textarea::placeholder {
  color: #94a3b8;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(22, 119, 255, 0.14);
}
.input[aria-invalid='true'] {
  border-color: var(--danger);
}
.help {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.error-text {
  font-size: 13.5px;
  color: var(--danger);
  margin: 0;
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  font-size: 14.5px;
}
.check input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--blue);
  flex: none;
}

/* ---------- Kartu, badge, alert ---------- */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad {
  padding: 24px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--gray-light);
  color: var(--text);
}
.badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.badge.no-dot::before {
  display: none;
}
.status-pending_payment {
  background: var(--warning-bg);
  color: var(--warning);
}
.status-waiting_process {
  background: var(--blue-light);
  color: var(--blue-dark);
}
.status-processing {
  background: var(--violet-bg);
  color: var(--violet);
}
.status-completed {
  background: var(--success-bg);
  color: var(--success);
}
.status-cancelled {
  background: var(--danger-bg);
  color: var(--danger);
}
.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--gray-light);
  font-size: 14.5px;
}
.alert p:last-child {
  margin: 0;
}
.alert .icon {
  margin-top: 2px;
}
.alert-info {
  background: var(--blue-light);
  border-color: #cfe1ff;
  color: #0b3f8f;
}
.alert-warning {
  background: var(--warning-bg);
  border-color: #fde68a;
  color: #78350f;
}
.alert-danger {
  background: var(--danger-bg);
  border-color: #fecaca;
  color: #991b1b;
}
.alert-success {
  background: var(--success-bg);
  border-color: #bbf7d0;
  color: #14532d;
}

/* ---------- Toast ---------- */
#toast-root {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 200;
  display: grid;
  gap: 8px;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--text-strong);
  color: #fff;
  font-size: 14.5px;
  box-shadow: var(--shadow);
  animation: toast-in 0.25s var(--ease);
}
.toast.success {
  background: #166534;
}
.toast.error {
  background: #b91c1c;
}
.toast.hide {
  opacity: 0;
  transition: opacity 0.3s;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.navbar.scrolled {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.navbar .container {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  color: var(--text-strong);
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex: none;
}
.brand:hover {
  color: var(--text-strong);
}
.brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}
.brand span b {
  color: var(--blue);
  font-weight: 800;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
}
.nav-links a {
  display: block;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text);
  font-weight: 500;
  font-size: 15px;
}
.nav-links a:hover,
.nav-links a[aria-current='page'] {
  color: var(--blue);
  background: var(--blue-light);
}
.nav-cta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-toggle {
  display: none;
}
.admin-link {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #94a3b8;
}
.admin-link:hover {
  color: var(--text);
  background: var(--gray-light);
}

@media (max-width: 1080px) {
  .nav-toggle {
    display: inline-grid;
    margin-left: auto;
  }
  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 16px 16px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s var(--ease);
  }
  .nav-links a {
    padding: 12px 14px;
  }
  .navbar.open .nav-links {
    transform: none;
    opacity: 1;
    visibility: visible;
  }
  .nav-cta .btn {
    display: none;
  }
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 0;
  background: #0b1630;
  color: #cbd5e1;
  padding: 56px 0 28px;
  font-size: 14.5px;
}
.footer a {
  color: #cbd5e1;
}
.footer a:hover {
  color: #fff;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
}
.footer .brand {
  color: #fff;
}
.footer .brand img {
  background: #fff;
}
.footer h3 {
  color: #fff;
  font-size: 15px;
  margin-bottom: 14px;
}
.footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.footer-about {
  margin-top: 14px;
  max-width: 340px;
}
.footer-wa a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: #94a3b8;
  font-size: 13px;
}
@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

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