@font-face { font-family: 'Aiva'; src: url('/assets/font/aiva_light.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Aiva'; src: url('/assets/font/aiva_regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Aiva'; src: url('/assets/font/aiva_medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Aiva'; src: url('/assets/font/aiva_bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

/* ============================================================
   Katalog HPL Taco — MOBILE PORTRAIT  ( <= 768px )
   ============================================================ */
@media (max-width: 768px) {

  :root {
    --brand: #24a2fb;
    --bg: #1a1a1a;
    --surface: #FFFFFF;
    --surface-2: #F5F1EA;
    --border: #E7E2D9;
    --ink: #0C0A09;
    --ink-2: #44403C;
    --ink-muted: #78716C;
    --r-md: 12px;
    --r-xl: 22px;
    --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.08);
    --font: "Aiva", system-ui, sans-serif;
  }

  *, *::before, *::after { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
  body {
    font-family: var(--font); font-size: 16px; line-height: 1.5; color: #fff;
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    display: flex; flex-direction: column;
  }
  button, input { font-family: inherit; font-size: inherit; color: inherit; }
  button { cursor: pointer; border: 0; background: none; }

  .desktop-header { display: none !important; }

  /* --- MOBILE BOTTOM BAR --- */
  .mobile-bottom-bar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    height: 56px; background: linear-gradient(120deg, #9d00ff, #1c75ff, #6197ff, #22b8ff);
    z-index: 1000; box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
  }
.panel-toggle-btn {
    flex: 1; display: flex; align-items: center; justify-content: center;
    background: #a9b5c7; border: none; padding: 0; overflow: hidden;
  }
  .mobile-menu-btn {
    display: flex; align-items: center; justify-content: center; width: 56px;
    background: #24a2fb; border: none; border-left: 1px solid rgba(255,255,255,0.2); color: #fff;
  }

  /* --- MOBILE SIDE PANEL --- */
  .mobile-side-panel-overlay { display: none; position: fixed; inset: 0; background: rgb(255 255 255 / 14%); z-index: 5999; backdrop-filter: blur(4px); }
  .mobile-side-panel-overlay.open { display: block; }
  .mobile-side-panel { position: fixed; top: 0; left: 0; width: 90%; height: auto; background: #fff; z-index: 6000; transform: translateX(-110%); transition: transform 0.3s cubic-bezier(0.25,0.8,0.25,1); display: flex; flex-direction: column; max-height: 100%; }
  .mobile-side-panel.open { transform: translateX(0); }
  .mobile-side-header { display: flex; align-items: center; padding: 10px 20px; background: #5eb3f9; font-size: 1.2rem; color: #fff; }
  .panel-close-menu-btn { position: absolute; top: 50%; left: 100%; transform: translateY(-50%); width: 20px; height: 80px; background: #5eb3f9; border: none; border-radius: 0 8px 8px 0; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; line-height: 1.1; }
  .mobile-side-content { flex: 1; overflow-y: auto; }
  .mobile-menu-group-title { display: flex; align-items: center; padding: 15px 20px; font-size: 15px; color: #333; border-bottom: 1px solid #dbdada; gap: 12px; }
  .mobile-submenu { display: none; background: #f9f9f9; }
  .mobile-submenu.open { display: block; }
  .mobile-submenu a { display: block; padding: 12px 16px 12px 30px; color: #054087; text-decoration: none; background: #b6d2ff; border-bottom: 1px solid #fff; }

  /* --- MAIN --- */
  .katalog-main {
    flex: 1; display: flex; flex-direction: column;
    overflow: hidden; padding-bottom: 56px;background: #fff;
  }

  /* --- KATEGORI TABS --- */
  .kategori-tabs-wrap { padding: 0px; flex-shrink: 0; }
  .kategori-tabs { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;gap: 2px;}
  .kategori-tabs::-webkit-scrollbar { display: none; }
  .kategori-tab {
    border: 1px solid #929ca3;flex-shrink: 0; padding: 10px 24px; background: #a9b5c7;
    font-size: 1rem; font-weight: 400; color: #ffffff;
    cursor: pointer; transition: all 0.2s; white-space: nowrap;display: flex;gap: 8px;align-items: center;
  }
  .kategori-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

  /* --- PAGE VIEWER --- */
  .viewer-wrap {
    flex: 1; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; min-height: 0;
  }
  .nav-arrow { display: none; } /* sembunyikan arrow di mobile */
  .page-container {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    padding: 6px; touch-action: pan-y;
  }
  .page-img {
    max-width: 100%; max-height: 100%; object-fit: contain;
    border-radius: 4px; box-shadow: 0 0 11px 5px rgb(0 0 0 / 14%);
    user-select: none; -webkit-user-drag: none;
    transform-origin: center center;
  }
  .page-img-right { display: none !important; }

  /* --- PAGE FLIP ANIMATIONS --- */
  .flip-out-left  { animation: flipOutL 0.3s ease-in forwards; }
  .flip-in-right  { animation: flipInR  0.3s ease-out forwards; }
  .flip-out-right { animation: flipOutR 0.3s ease-in forwards; }
  .flip-in-left   { animation: flipInL  0.3s ease-out forwards; }

  @keyframes flipOutL {
    0%   { transform: perspective(1200px) rotateY(0); opacity: 1; }
    100% { transform: perspective(1200px) rotateY(-90deg); opacity: 0; }
  }
  @keyframes flipInR {
    0%   { transform: perspective(1200px) rotateY(90deg); opacity: 0; }
    100% { transform: perspective(1200px) rotateY(0); opacity: 1; }
  }
  @keyframes flipOutR {
    0%   { transform: perspective(1200px) rotateY(0); opacity: 1; }
    100% { transform: perspective(1200px) rotateY(90deg); opacity: 0; }
  }
  @keyframes flipInL {
    0%   { transform: perspective(1200px) rotateY(-90deg); opacity: 0; }
    100% { transform: perspective(1200px) rotateY(0); opacity: 1; }
  }

  /* --- PAGE INFO --- */
  .page-info {
    flex-shrink: 0; text-align: center; padding: 6px 0;
    font-size: 0.78rem; color: #0c0a09; letter-spacing: 0.5px;
  }

  /* --- SWIPE HINT --- */
  .swipe-hint {
    position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 6px;
    background: rgba(0,0,0,0.7); color: #ccc; padding: 8px 16px;
    border-radius: 50px; font-size: 0.72rem; z-index: 100;
    animation: hintPulse 2s ease-in-out infinite;
    pointer-events: none;
  }
  .swipe-hint.hidden { display: none; }
  @keyframes hintPulse { 0%, 100% { opacity: 0.9; } 50% { opacity: 0.4; } }

  /* --- FULLSCREEN ZOOM --- */
  .fullscreen-overlay {
    position: fixed; inset: 0; background: rgb(255 255 255); z-index: 9000;
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.2s ease;
  }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  .fullscreen-close {
    position: absolute; top: 12px; right: 12px; width: 44px; height: 44px;
    background: rgba(255,255,255,0.15); border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; z-index: 10;
  }
.fullscreen-img {
    max-width: 100%; max-height: 100%; object-fit: contain;
    touch-action: none;
    transform-origin: center center;
    will-change: transform;
  }

  /* --- TOAST --- */
  .toast-katalog {
    position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: #333; color: #fff; padding: 10px 24px; border-radius: 50px;
    font-size: 0.85rem; z-index: 99999; opacity: 0; pointer-events: none;
    transition: opacity 0.3s, transform 0.3s; white-space: nowrap;
  }
  .toast-katalog.show { opacity: 1; transform: translateX(-50%) translateY(0); }

}
