/* ==========================================================================
   Flaz Shoe Care - shared stylesheet (storefront, tracking and admin)
   Rules: no box-shadow anywhere, hairline borders for depth, no emoji.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Zero shadow reset and design tokens
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-shadow: none !important;
  text-shadow: none !important;
}

:root {
  --brand: #BF5524;
  --brand-glow: #E8956C;
  --brand-hover: #A9461A;
  --brand-pressed: #9A4318;
  --brand-50: #FAF1EA;
  --brand-200: #EBCDB9;
  --brand-800: #A9461A;
  --canvas: #FFFFFF;
  --paper: #F7F4F0;
  --ink: #1F1C1A;
  --ink-700: #2E2A27;
  --onyx: #24201D;
  --line: #E6E0D9;
  --ivory: #F3EEE8;
  --muted: #6B635C;
  --line-dark: rgba(255, 255, 255, 0.08);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
.font-display { font-family: "Fraunces", Georgia, serif; letter-spacing: -0.03em; }
.font-mono, .mono { font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace; font-variant-numeric: tabular-nums; }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.btn:focus-visible, .pill:focus-visible, .qty button:focus-visible, .ba-thumb:focus-visible, .check-row:focus-within { outline: 3px solid var(--brand); outline-offset: 3px; }
.skip-link {
  min-height: 48px; display: inline-flex; align-items: center;
  position: absolute; left: 16px; top: -64px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 9999px;
}
.skip-link:focus { top: 16px; }

/* --------------------------------------------------------------------------
   2. Surfaces
   -------------------------------------------------------------------------- */
.surface { background: var(--canvas); border: 1px solid var(--line); }
.surface-paper { background: var(--paper); border: 1px solid var(--line); }
.surface-dark { background: var(--ink-700); border: 1px solid var(--line-dark); }
.glass {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.glass-strong { background: rgba(255, 255, 255, 0.9); }
.glass-dark {
  background: rgba(31, 28, 26, 0.64);
  border: 1px solid var(--line-dark);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.hairline { border: 1px solid var(--line); }
.hairline-dark { border: 1px solid var(--line-dark); }

/* --------------------------------------------------------------------------
   3. Buttons, inputs and chips
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 9999px;
  font-weight: 600; font-size: 14.5px; line-height: 1; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 150ms var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn[disabled], .btn.is-disabled { opacity: 0.5; pointer-events: none; }
/* Terracotta fill with white text: 4.63:1 (AA); the 18.67px bold hero label is large text, so it also meets AAA */
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:active { background: var(--brand-pressed); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-700); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--ink); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.28); }
.btn-outline-light:hover { border-color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--paper); }
.btn-danger { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }
.btn-danger:hover { background: #FEE2E2; }
.btn-sm { min-height: 48px; padding: 0 18px; font-size: 13.5px; }
/* Hero call to action: 18.67px bold text is WCAG large text (AAA threshold 4.5:1); white on #BF5524 is 4.63:1 */
.btn-hero { min-height: 56px; padding: 0 28px; font-size: 1.1667rem; font-weight: 700; }
.btn-icon { width: 48px; min-height: 48px; padding: 0; }

.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  background: var(--canvas); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 15px;
  transition: border-color 150ms var(--ease);
}
.textarea { min-height: 96px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: #C9C9C9; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: #FCA5A5; }
.field-error { margin-top: 6px; font-size: 13px; color: #B91C1C; }
.label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: #404040; }
.hint { font-size: 12.5px; color: #737373; margin-top: 6px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 48px; padding: 0 18px; border-radius: 9999px;
  border: 1px solid var(--line); background: var(--canvas); color: #404040;
  font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease);
}
.pill:hover { border-color: var(--ink); }
.pill.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600;
  background: var(--paper); border: 1px solid var(--line); color: #404040;
}
.chip-brand { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-800); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

.check-row {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); cursor: pointer; font-size: 14px;
}
.check-row:has(input:checked) { background: var(--brand-50); border-color: var(--brand-200); }
.check-row input { accent-color: var(--brand); width: 18px; height: 18px; flex: none; }

/* --------------------------------------------------------------------------
   4. Status badges (semantic colors)
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 6px; border: 1px solid;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 9999px; background: currentColor; flex: none; }
.badge-pending   { color: #B45309; background: #FFFBEB; border-color: #FDE68A; }
.badge-washing   { color: #0369A1; background: #F0F9FF; border-color: #BAE6FD; }
.badge-drying, .badge-treatment { color: #6D28D9; background: #F5F3FF; border-color: #DDD6FE; }
.badge-qc        { color: #0F766E; background: #F0FDFA; border-color: #99F6E4; }
.badge-ready     { color: #047857; background: #F0FDF4; border-color: #BBF7D0; }
.badge-completed { color: #15803D; background: #DCFCE7; border-color: #86EFAC; }
.badge-cancelled { color: #B91C1C; background: #FEF2F2; border-color: #FECACA; }

/* --------------------------------------------------------------------------
   5. Navbar, announcement strip and mobile bar
   -------------------------------------------------------------------------- */
.nav-indicator {
  position: absolute; top: 0; bottom: 0; left: 0; width: 0; border-radius: 9999px;
  background: var(--brand-50); border: 1px solid var(--brand-200);
  opacity: 0; pointer-events: none;
  transition: left 250ms var(--ease), width 250ms var(--ease), opacity 150ms var(--ease);
}
.nav-link { position: relative; z-index: 1; padding: 8px 14px; font-size: 14px; font-weight: 600; color: #404040; border-radius: 9999px; }
.nav-link.is-active { color: var(--brand-800); }
.cart-count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 9999px;
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.cart-count.pulse { animation: count-pulse 250ms var(--ease); }
@keyframes count-pulse { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }

.marquee-track { display: inline-flex; white-space: nowrap; animation: marquee 18s linear infinite; }
@keyframes marquee { from { transform: translateX(100%); } to { transform: translateX(-100%); } }

.mobile-bar { transition: transform 250ms var(--ease), opacity 250ms var(--ease); }
.mobile-bar.is-hidden { transform: translateY(140%); opacity: 0; pointer-events: none; }

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */
.announce-bar { background: #ECE5DD; color: #4A433E; border-bottom: 1px solid #E0D8CF; }
.hero {
  background: linear-gradient(180deg, var(--ivory) 0%, #F7F3EE 62%, var(--canvas) 100%);
  color: var(--ink);
}
.hero-photo { position: relative; border-radius: 20px; overflow: hidden; background: #E9E3DC; border: 1px solid var(--line); }
.hero-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
.hero-photo-caption {
  position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.86); border: 1px solid rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-size: 13px; color: var(--ink);
}
.hero-badge { display: inline-flex; align-items: center; gap: 8px; border-radius: 9999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.7); color: #4A433E; }
.hero-glow-a {
  position: absolute; width: 720px; height: 720px; right: -180px; top: -120px; border-radius: 9999px;
  background: radial-gradient(closest-side, rgba(191, 85, 36, 0.10), rgba(191, 85, 36, 0) 100%);
  pointer-events: none;
}
.hero-glow-b {
  position: absolute; width: 520px; height: 520px; left: -200px; bottom: -220px; border-radius: 9999px;
  background: radial-gradient(closest-side, rgba(232, 149, 108, 0.14), rgba(232, 149, 108, 0) 100%);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   7. Before-after slider
   -------------------------------------------------------------------------- */
.ba-stage {
  --pos: 50%;
  overscroll-behavior-x: contain;
  position: relative; overflow: hidden; user-select: none; -webkit-user-select: none;
  touch-action: pan-y; cursor: ew-resize; border-radius: 16px; border: 1px solid var(--line);
  background: var(--paper);
}
.ba-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.ba-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba-divider { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; pointer-events: none; }
.ba-handle {
  position: absolute; top: 50%; left: var(--pos); width: 48px; height: 48px; margin: -24px 0 0 -24px;
  border-radius: 9999px; background: #fff; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--ink); cursor: ew-resize;
}
.ba-handle:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.ba-label {
  position: absolute; top: 14px; padding: 6px 12px; border-radius: 9999px; font-size: 12px; font-weight: 700;
  transition: opacity 150ms var(--ease);
}
.ba-label-before { left: 14px; background: rgba(31, 28, 26, 0.7); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.ba-label-after { right: 14px; background: var(--brand); color: #fff; }
.ba-stage.is-broken::after {
  content: "Foto tidak dapat dimuat"; position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  padding: 6px 12px; border-radius: 9999px; background: rgba(31, 28, 26, 0.75); color: #fff; font-size: 12px; font-weight: 600; pointer-events: none;
}
.ba-thumb { border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); padding: 12px 14px; min-height: 48px; text-align: left; cursor: pointer; }
.ba-thumb.is-active { border-color: var(--brand); background: var(--brand-50); }

/* --------------------------------------------------------------------------
   8. Treatment cards
   -------------------------------------------------------------------------- */
.t-card { border: 1px solid var(--line); border-radius: 16px; background: var(--canvas); overflow: hidden; display: flex; flex-direction: column; transition: border-color 150ms var(--ease), background-color 150ms var(--ease); }
.t-card:hover { border-color: #BDBDBD; }
.t-card.is-selected { background: var(--brand-50); border-color: var(--brand-200); }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9999px; background: var(--canvas); }
.qty button { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9999px; cursor: pointer; background: transparent; border: 0; }
.qty button:hover { background: var(--paper); }
.qty span { min-width: 26px; text-align: center; font-weight: 600; font-size: 14px; }

/* --------------------------------------------------------------------------
   9. Drawer, modal and scrim
   -------------------------------------------------------------------------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(31, 28, 26, 0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity 250ms var(--ease); }
.scrim.is-open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; width: 100%; max-width: 440px; min-width: 0; overflow: hidden; visibility: hidden; transition: transform 250ms var(--ease), visibility 0s linear 250ms; background: var(--canvas); border-left: 1px solid var(--line); transform: translateX(104%); display: flex; flex-direction: column; }
.drawer.is-open { transform: translateX(0); visibility: visible; transition: transform 250ms var(--ease), visibility 0s; }
@media (min-width: 640px) { .drawer { border-radius: 16px 0 0 16px; } }
.modal { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.is-open { display: flex; }
.modal-panel { width: 100%; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--canvas); border: 1px solid var(--line); border-radius: 16px; }
body.scroll-locked { overflow: hidden; }

.grid-collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 250ms var(--ease); }
.grid-collapse.is-open { grid-template-rows: 1fr; }
.grid-collapse > div { overflow: hidden; min-height: 0; }

/* --------------------------------------------------------------------------
   10. Receipt ticket
   -------------------------------------------------------------------------- */
.ticket { position: relative; background: var(--canvas); border: 1px solid var(--line); border-radius: 16px; }
.ticket-rule { border-top: 1px dashed #CFCFCF; margin: 16px -20px; position: relative; }
.ticket-rule::before, .ticket-rule::after {
  content: ""; position: absolute; top: -9px; width: 16px; height: 16px; border-radius: 9999px;
  background: var(--paper); border: 1px solid var(--line);
}
.ticket-rule::before { left: -9px; }
.ticket-rule::after { right: -9px; }
.qr-canvas { image-rendering: pixelated; width: 132px; height: 132px; }

/* --------------------------------------------------------------------------
   11. Tracking timeline
   -------------------------------------------------------------------------- */
.tl { display: grid; gap: 0; }
.tl-step { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 14px; padding-bottom: 22px; }
.tl-step:last-child { padding-bottom: 0; }
.tl-step::before {
  content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line);
  transform-origin: top; transform: scaleY(1);
}
.tl-step:last-child::before { display: none; }
.tl-step.is-done::before { background: var(--tl-color, var(--brand)); animation: tl-grow 400ms var(--ease) both; }
.tl-node {
  width: 28px; height: 28px; border-radius: 9999px; border: 2px solid var(--line); background: var(--canvas);
  display: flex; align-items: center; justify-content: center; color: #A3A3A3; position: relative;
}
.tl-step.is-done .tl-node { background: var(--tl-color, var(--brand)); border-color: var(--tl-color, var(--brand)); color: #fff; }
.tl-step.is-current .tl-node { border-color: var(--tl-color, var(--brand)); color: var(--tl-color, var(--brand)); }
.tl-step.is-current .tl-node::after {
  content: ""; position: absolute; inset: -6px; border-radius: 9999px; border: 2px solid var(--tl-color, var(--brand));
  animation: tl-ring 1.6s ease-out infinite;
}
.tl-step.is-upcoming { opacity: 0.55; }
@keyframes tl-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes tl-ring { 0% { opacity: 0.7; transform: scale(0.8); } 100% { opacity: 0; transform: scale(1.4); } }
.tl.is-cancelled .tl-step { opacity: 0.4; }

@media (min-width: 768px) {
  .tl.tl-horizontal { grid-template-columns: repeat(6, 1fr); }
  .tl.tl-horizontal .tl-step { grid-template-columns: 1fr; grid-template-rows: 28px auto; padding-bottom: 0; padding-right: 8px; gap: 12px; }
  .tl.tl-horizontal .tl-step::before { left: 28px; right: -4px; top: 13px; bottom: auto; width: auto; height: 2px; transform-origin: left; }
  .tl.tl-horizontal .tl-step.is-done::before { animation-name: tl-grow-x; }
}
@keyframes tl-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* --------------------------------------------------------------------------
   12. Toasts and spinner
   -------------------------------------------------------------------------- */
.toast-stack { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; width: min(92vw, 380px); pointer-events: none; }
.toast { background: var(--canvas); border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: 10px; padding: 12px 14px; font-size: 14px; pointer-events: auto; animation: toast-in 250ms var(--ease); }
.toast-success { border-left-color: #16A34A; }
.toast-error { border-left-color: #EF4444; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.spinner { width: 16px; height: 16px; border-radius: 9999px; border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   13. Admin shell
   -------------------------------------------------------------------------- */
.admin-sidebar { width: 264px; background: var(--onyx); border-right: 1px solid var(--line-dark); }
.admin-link { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 10px; color: rgba(255, 255, 255, 0.72); font-size: 14px; font-weight: 600; border-left: 2px solid transparent; }
.admin-link:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.admin-link.is-active { color: #fff; background: rgba(255, 255, 255, 0.06); border-left-color: var(--brand); }
.admin-badge { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 9999px; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700; text-align: center; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--canvas); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #737373; background: var(--paper); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FCFCFC; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: -11px -4px; width: calc(100% + 8px); height: 48px; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 9999px; background: #D4D4D4; border: 1px solid #C4C4C4; transition: background-color 150ms var(--ease); }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 9999px; background: #fff; transition: transform 150ms var(--ease); }
.switch input:checked + span { background: var(--brand); border-color: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.flash { border: 1px solid; border-radius: 10px; padding: 12px 16px; font-size: 14px; }
.flash-success { background: #F0FDF4; border-color: #BBF7D0; color: #15803D; }
.flash-error { background: #FEF2F2; border-color: #FECACA; color: #B91C1C; }
.stat-card { border: 1px solid var(--line); border-radius: 14px; background: var(--canvas); padding: 20px; }
.dropzone { border: 1px dashed #CFCFCF; border-radius: 12px; background: var(--paper); }
.sortable-item.is-dragging { opacity: 0.4; }

/* --------------------------------------------------------------------------
   14. Reduced motion and print
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

@media print {
  @page { size: 80mm auto; margin: 4mm; }
  body { background: #fff !important; }
  .no-print { display: none !important; }
  .print-receipt { width: 72mm; margin: 0 auto; border: 0 !important; }
}

/* --------------------------------------------------------------------------
   Overflow guards: fieldsets and grid children may shrink below their
   content width, so date inputs and long labels never create sideways scroll
   -------------------------------------------------------------------------- */
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.drawer form { overflow-x: hidden; }
.drawer .grid > *, .modal .grid > * { min-width: 0; }
.drawer input, .drawer select, .drawer textarea, .modal input, .modal select, .modal textarea { max-width: 100%; min-width: 0; }
input[type="date"], input[type="time"], input[type="datetime-local"] { min-width: 0; -webkit-appearance: none; appearance: none; }
