/* Heavypack flipbook — penampil katalog dengan efek balik halaman.
   Dimuat hanya di halaman yang punya katalog (Insight dan Katalog). */

.hp-flip {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    height: 100%;
    height: 100dvh;
    display: none;
    flex-direction: column;
    background: #121213;
    opacity: 0;
    transition: opacity .32s var(--hp-ease, ease);
}
.hp-flip.is-open { display: flex; }
.hp-flip.is-visible { opacity: 1; }
html.hp-flip-locked, html.hp-flip-locked body.hp-flip-locked { overflow: hidden !important; overscroll-behavior: none; }
body.hp-flip-locked .hp-whatsapp,
body.hp-flip-locked iframe[title*="chat widget" i] { visibility: hidden !important; pointer-events: none !important; }

/* ---------- kepala ---------- */

.hp-flip__head {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 22px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: #1a1a1c;
    flex-shrink: 0;
}
.hp-flip__title { min-width: 0; flex: 1; }
.hp-flip__title small {
    display: block;
    color: #ff7c29;
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .11em;
}
.hp-flip__title h2 {
    margin: 5px 0 0;
    overflow: hidden;
    color: #fff;
    font-size: 17px;
    line-height: 1.1;
    letter-spacing: -.03em;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.hp-flip__meta { color: #8b8c92; font-size: 9px; white-space: nowrap; }

/* ---------- tombol umum ---------- */

.hp-flip__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 36px;
    height: 36px;
    padding: 0 11px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 11px;
    background: rgba(255,255,255,.05);
    color: #e8e8ea;
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, color .2s ease, opacity .2s ease;
}
.hp-flip__btn:hover:not(:disabled) { border-color: rgba(255,102,0,.55); background: rgba(255,102,0,.14); color: #fff; }
.hp-flip__btn:disabled { opacity: .3; cursor: default; }
.hp-flip__btn.is-active { border-color: rgba(255,102,0,.6); background: rgba(255,102,0,.18); color: #fff; }
.hp-flip__btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- panggung ---------- */

.hp-flip__stage {
    position: relative;
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 26px;
    perspective: 2000px;
    perspective-origin: 50% 46%;
    cursor: grab;
    /* Tarikan mendatar harus sampai ke skrip, bukan ditafsirkan browser
       sebagai gulir atau navigasi mundur. */
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}
.hp-flip__stage.is-dragging { cursor: grabbing; }
.hp-flip__stage.is-zoomed {
    cursor: grab;
}
.hp-flip__book {
    position: relative;
    display: flex;
    transform-style: preserve-3d;
    transition: none;
}
.hp-flip__stage.is-interacting .hp-flip__book { will-change: transform; }
.hp-flip__stage img { pointer-events: none; -webkit-user-drag: none; }

/* ---------- lembar statis ---------- */

.hp-flip__page {
    position: relative;
    overflow: hidden;
    background: #26262a;
    box-shadow: 0 26px 64px rgba(0,0,0,.58);
}
.hp-flip__page img { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.hp-flip__page--left { border-radius: 4px 0 0 4px; }
.hp-flip__page--right { border-radius: 0 4px 4px 0; }
.hp-flip__page--solo { border-radius: 4px; }
.hp-flip__page.is-blank { background: transparent; box-shadow: none; }

/* Jilidan: kertas menukik ke dalam di dekat punggung buku. */
.hp-flip__page--left::after,
.hp-flip__page--right::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 46px;
    pointer-events: none;
}
.hp-flip__page--left::after { right: 0; background: linear-gradient(to right, transparent, rgba(0,0,0,.34)); }
.hp-flip__page--right::after { left: 0; background: linear-gradient(to left, transparent, rgba(0,0,0,.34)); }

/* ---------- lembar yang berputar ---------- */

.hp-flip__sheet {
    position: absolute;
    top: 0;
    transform: rotateY(0deg);
    transform-style: preserve-3d;
    will-change: transform;
    z-index: 5;
}
.hp-flip__sheet--forward { transform-origin: left center; }
.hp-flip__sheet--back { transform-origin: right center; }
.hp-flip__sheet--mobile { overflow: hidden; background: #fff; transform-style: flat; will-change: transform; }
.hp-flip__sheet--mobile img { display: block; width: 100%; height: 100%; object-fit: contain; }

.hp-flip__face {
    position: absolute;
    inset: 0;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: #fff;
    box-shadow: 0 30px 70px rgba(0,0,0,.55);
}
.hp-flip__face img { display: block; width: 100%; height: 100%; object-fit: contain; }
.hp-flip__face--back { transform: rotateY(180deg); }

/* Kepekatan kedua lapis ini diatur dari JavaScript mengikuti sudut putar,
   bukan sekadar muncul-hilang. Keduanya elemen nyata, bukan pseudo-element,
   justru karena pseudo-element tidak bisa disentuh dari skrip. */
.hp-flip__shade,
.hp-flip__gloss {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

/* Muka belakang tercermin oleh rotateY(180deg), jadi arah gradiennya
   dibalik agar sisi gelapnya tetap jatuh di punggung buku. */
.hp-flip__sheet--forward .hp-flip__face--front .hp-flip__shade { background: linear-gradient(to right, rgba(0,0,0,.95), rgba(0,0,0,.28)); }
.hp-flip__sheet--forward .hp-flip__face--back  .hp-flip__shade { background: linear-gradient(to left,  rgba(0,0,0,.95), rgba(0,0,0,.28)); }
.hp-flip__sheet--back    .hp-flip__face--front .hp-flip__shade { background: linear-gradient(to left,  rgba(0,0,0,.95), rgba(0,0,0,.28)); }
.hp-flip__sheet--back    .hp-flip__face--back  .hp-flip__shade { background: linear-gradient(to right, rgba(0,0,0,.95), rgba(0,0,0,.28)); }

.hp-flip__sheet--forward .hp-flip__face--front .hp-flip__gloss { background: linear-gradient(to right, rgba(255,255,255,.85), transparent 34%); }
.hp-flip__sheet--forward .hp-flip__face--back  .hp-flip__gloss { background: linear-gradient(to left,  rgba(255,255,255,.85), transparent 34%); }
.hp-flip__sheet--back    .hp-flip__face--front .hp-flip__gloss { background: linear-gradient(to left,  rgba(255,255,255,.85), transparent 34%); }
.hp-flip__sheet--back    .hp-flip__face--back  .hp-flip__gloss { background: linear-gradient(to right, rgba(255,255,255,.85), transparent 34%); }

/* ---------- memuat, kosong, petunjuk ---------- */

.hp-flip__note {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 13px;
    padding: 26px;
    color: #8b8c92;
    font-size: 11px;
    text-align: center;
}
.hp-flip__note strong { color: #fff; font-size: 15px; font-weight: 750; letter-spacing: -.02em; }
.hp-flip__note a { color: #ff7c29; font-weight: 750; }
.hp-flip__spinner {
    width: 30px;
    height: 30px;
    border: 2px solid rgba(255,255,255,.16);
    border-top-color: var(--hp-orange, #ff6600);
    border-radius: 50%;
    animation: hp-flip-spin .72s linear infinite;
}
@keyframes hp-flip-spin { to { transform: rotate(360deg); } }

.hp-flip__hint {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translate(-50%, 10px);
    padding: 8px 15px;
    border-radius: 999px;
    background: rgba(0,0,0,.62);
    color: #e8e8ea;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .4s ease, transform .4s var(--hp-ease, ease);
}
.hp-flip__hint.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- kaki / toolbar ---------- */

.hp-flip__foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 13px 22px;
    border-top: 1px solid rgba(255,255,255,.08);
    background: #1a1a1c;
    flex-shrink: 0;
    padding-bottom: calc(13px + env(safe-area-inset-bottom, 0px));
}
.hp-flip__counter {
    min-width: 92px;
    color: #c8c9ce;
    font-size: 10px;
    font-weight: 750;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.hp-flip__sep { width: 1px; height: 22px; background: rgba(255,255,255,.1); }

/* ---------- thumbnail ---------- */

.hp-flip__thumbs {
    display: none;
    gap: 9px;
    overflow-x: auto;
    padding: 13px 22px;
    border-top: 1px solid rgba(255,255,255,.08);
    background: #19191b;
    scrollbar-width: thin;
    touch-action: pan-x;
}
.hp-flip__thumbs.is-open { display: flex; }
.hp-flip__thumb {
    flex: 0 0 auto;
    width: 56px;
    border: 2px solid transparent;
    border-radius: 5px;
    padding: 0;
    background: #2b2b2d;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .2s ease;
}
.hp-flip__thumb img { display: block; width: 100%; aspect-ratio: .707; object-fit: cover; background: #fff; pointer-events: none; }
.hp-flip__thumb span { display: block; padding: 3px 0; color: #8b8c92; font-size: 8px; font-weight: 700; }
.hp-flip__thumb.is-current { border-color: var(--hp-orange, #ff6600); }
.hp-flip__thumb.is-current span { color: #ff7c29; }

/* ---------- layar kecil ---------- */

@media (max-width: 860px) {
    .hp-flip__head { gap: 8px; padding: 12px 12px; padding-top: max(12px, env(safe-area-inset-top, 0px)); }
    .hp-flip__title h2 { font-size: 14px; }
    .hp-flip__meta { display: none; }
    /* Titik hilang lebih dekat supaya lengkung halaman tetap terbaca di
       layar sempit; pada jarak desktop efeknya nyaris rata. */
    .hp-flip__stage { padding: 13px; }
    .hp-flip__foot { gap: 4px; padding: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
    .hp-flip__btn { min-width: 44px; height: 44px; padding: 0 8px; }
    .hp-flip__btn-label { display: none; }
    .hp-flip__counter { min-width: 60px; font-size: 9px; }
    .hp-flip__btn-label[data-role="zoomlabel"] { display: inline; font-size: 9px; }
    .hp-flip__thumbs { padding: 10px 13px; }
    .hp-flip__hint { bottom: 12px; font-size: 9px; }
}

.hp-flip.is-mobile .hp-flip__stage { padding: 13px; perspective: none; }
.hp-flip.is-mobile .hp-flip__book { transform-style: flat; }
.hp-flip.is-mobile .hp-flip__page { box-shadow: 0 8px 24px rgba(0,0,0,.35); }

@media (max-width: 420px) {
    .hp-flip__foot [data-role="first"],
    .hp-flip__foot [data-role="last"],
    .hp-flip__foot .hp-flip__sep { display: none; }
    .hp-flip__foot { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    .hp-flip, .hp-flip__book, .hp-flip__hint { transition-duration: .01ms; }
    .hp-flip__spinner { animation-duration: 3s; }
}
