/* AuraPay UI refinements: header controls, locale modal, mobile order bar */

/* ---------- HEADER ---------- */
.ap-menu-left { display: none !important; }

.desktop-only { display: none; }
@media (min-width: 1024px) { .desktop-only { display: block; } }

.ap-head-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto !important;
}

/* Force the tools cluster to be the last item, hard-pinned to the right on mobile */
@media (max-width: 1023px) {
    .navbar .container > div { position: relative; }
    .navbar .container > div > .ml-auto:not(.ap-head-tools) { margin-left: 0 !important; }
    .ap-head-tools {
        order: 99;
        margin-left: auto !important;
        margin-right: 0 !important;
        justify-content: flex-end;
    }
}
@media (min-width: 1024px) { .ap-head-tools { display: none; } }

.ap-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #3a3a3a;
    border-radius: 9999px;
    background: transparent;
    color: #fff;
    line-height: 0;
    flex: 0 0 auto;
}
.ap-icon-btn svg { width: 17px; height: 17px; display: block; }

.ap-locale-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #3a3a3a;
    border-radius: 9999px;
    background: transparent;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    flex: 0 0 auto;
}
.ap-flag { width: 17px; height: 17px; border-radius: 9999px; display: block; object-fit: cover; flex: 0 0 auto; }
.ap-flag-lg { width: 26px; height: 26px; border-radius: 9999px; display: block; object-fit: cover; flex: 0 0 auto; }

.ap-burger { display: flex; flex-direction: column; gap: 3px; }
.ap-burger span { display: block; width: 15px; height: 1.5px; background: #fff; border-radius: 2px; }

/* ---------- LOCALE MODAL ---------- */
.ap-modal { position: fixed; inset: 0; z-index: 100; display: none; }
.ap-modal.is-open { display: block; }
.ap-modal__overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, .72); }
.ap-modal__panel {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: #262626;
    border-radius: 22px;
    padding: 22px 18px;
    max-width: 460px;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.ap-modal__title { font-size: 17px; font-weight: 700; color: #fff; margin: 0 0 12px; }
.ap-modal__title + .ap-opt { margin-bottom: 0; }
.ap-modal__group + .ap-modal__group { margin-top: 22px; }

.ap-opt {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1px solid #3a3a3a;
    border-radius: 14px;
    background: transparent;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
}
.ap-opt.is-active { border-color: var(--warna_2, #1a41ff); }
.ap-opt__check { margin-left: auto; color: var(--warna_2, #1a41ff); display: none; }
.ap-opt.is-active .ap-opt__check { display: block; }
.ap-opt__check svg { width: 18px; height: 18px; display: block; }

.ap-lang-row { display: flex; gap: 12px; }
.ap-lang-row .ap-opt { flex: 1 1 0; min-width: 0; }

/* ---------- MOBILE ORDER BAR ---------- */
.ap-orderbar { padding: 10px 12px 12px !important; border-radius: 14px 14px 0 0 !important; }
.ap-orderbar > .ap-order-btn {
    height: 40px !important;
    min-height: 40px !important;
    border-radius: 10px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    letter-spacing: .1px;
    gap: 8px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
}
.ap-orderbar > .ap-order-btn svg { width: 17px !important; height: 17px !important; flex: 0 0 auto; }

/* CSS flags (no external requests) */
.ap-flag--id { background: linear-gradient(#e30613 0 50%, #ffffff 50% 100%); }
.ap-flag--gb {
    background:
        linear-gradient(#00247d, #00247d);
    position: relative;
    overflow: hidden;
}
.ap-flag--gb::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom, transparent calc(50% - 2px), #fff calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)),
        linear-gradient(to right, transparent calc(50% - 2px), #fff calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px));
}
.ap-flag--gb::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom, transparent calc(50% - 1px), #cf142b calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
        linear-gradient(to right, transparent calc(50% - 1px), #cf142b calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px));
}

/* ==========================================================================
   ORDER BUTTON SIZING + PAYMENT METHOD CSS FIX + LIGHT FLOW
   CSS-only, scoped selectors. Tidak mengubah struktur/fungsi.
   ========================================================================== */

/* ---------- 1. Tombol "Pesan Sekarang" (mobile bar) ---------- */
.ap-orderbar { padding: 8px 12px 10px !important; }
.ap-orderbar > .ap-order-btn {
    height: 34px !important;
    min-height: 34px !important;
    max-width: 100%;
    border-radius: 9999px !important;
    font-size: 12.5px !important;
    line-height: 1 !important;
    gap: 6px !important;
    padding: 0 16px !important;
    overflow: hidden;
}
.ap-orderbar > .ap-order-btn svg { width: 15px !important; height: 15px !important; }

/* ---------- 1b. Tombol "Pesan Sekarang" (desktop) ---------- */
#order-check-dest {
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 18px !important;
    font-size: 13px !important;
    line-height: 1 !important;
    border-radius: 9999px !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ---------- 2. Metode pembayaran: tampilan asli dipertahankan ----------
   Hanya properti minimum agar efek cahaya bisa menempel (tanpa mengubah
   ukuran, padding, border, radius, atau layout bawaan).
   Catatan: TIDAK memakai overflow:hidden agar ribbon "Best Price"/QRIS
   tampil utuh seperti semula. */
#paymentList .method-list {
    position: relative;
}

/* Perbaikan ribbon "Best Price" pada kartu Saldo Akun (kelas w-[4rem]
   tidak terdefinisi sehingga ribbon berantakan) — samakan dengan QRIS. */
#paymentList .method-list .w-\[4rem\] {
    width: 4.5rem;
}



/* ==========================================================================
   4. LOADING LIGHT FLOW / GLOW (referensi screen 1)
   CSS-only, hanya menambah efek cahaya pada area loading yang sudah ada.
   Tidak mengubah ukuran, posisi, warna dasar, atau layout.
   ========================================================================== */

/* --- 4a. Top loading bar --- */
.bar-of-progress {
    overflow: hidden;
}
.bar-of-progress > .glow {
    box-shadow: 3px 0 10px currentColor, 0 0 6px currentColor !important;
    opacity: .45 !important;
}
.bar-of-progress::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, .12) 40%,
        rgba(255, 255, 255, .55) 50%,
        rgba(255, 255, 255, .12) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 45% 100%;
    background-repeat: no-repeat;
    animation: ap-load-flow 1.6s linear infinite;
}
.bar-of-progress.finished::after {
    animation-play-state: paused;
    opacity: 0;
}

@keyframes ap-load-flow {
    from { background-position: -50% 0; }
    to   { background-position: 150% 0; }
}

/* --- 4b. Overlay loading (proses order) --- */
.load.show::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 108px;
    height: 108px;
    margin: -54px 0 0 -54px;
    border-radius: 9999px;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 255, 255, .10) 0%, rgba(255, 255, 255, 0) 70%);
    animation: ap-load-pulse 2.4s ease-in-out infinite;
}

@keyframes ap-load-pulse {
    0%, 100% { transform: scale(.92); opacity: .55; }
    50%      { transform: scale(1.06); opacity: .9; }
}

/* --- 4c. Skeleton loader: aliran cahaya halus --- */
.skeleton-loader .ph-item,
.skeleton-loader .ph-picture,
.skeleton-loader .ph-col-12,
.melpaaaaa,
.melpaaaaaa,
.melpaaaaaa3 {
    position: relative;
    overflow: hidden;
}
.skeleton-loader .ph-item::after,
.skeleton-loader .ph-picture::after,
.skeleton-loader .ph-col-12::after,
.melpaaaaa::after,
.melpaaaaaa::after,
.melpaaaaaa3::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(
        100deg,
        rgba(255, 255, 255, 0) 30%,
        rgba(255, 255, 255, .07) 47%,
        rgba(255, 255, 255, .14) 50%,
        rgba(255, 255, 255, .07) 53%,
        rgba(255, 255, 255, 0) 70%
    );
    background-size: 220% 100%;
    background-position: 150% 0;
    animation: ap-skeleton-flow 1.8s linear infinite;
}

@keyframes ap-skeleton-flow {
    from { background-position: 150% 0; }
    to   { background-position: -50% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .bar-of-progress::after,
    .load.show::before,
    .skeleton-loader .ph-item::after,
    .skeleton-loader .ph-picture::after,
    .skeleton-loader .ph-col-12::after,
    .melpaaaaa::after,
    .melpaaaaaa::after,
    .melpaaaaaa3::after { animation: none !important; }
}

/* ==========================================================================
   5. MODAL INFORMASI PRODUK — DARK GLASS (referensi screen 2)
   Hanya tampilan visual; struktur, isi, tombol, dan behavior tidak diubah.
   ========================================================================== */
.ap-info-modal .ap-info-panel {
    width: 100%;
    max-width: 480px;
    border-radius: 22px !important;
    background: linear-gradient(180deg, rgba(46, 46, 46, .88), rgba(32, 32, 32, .92)) !important;
    backdrop-filter: blur(18px) saturate(130%);
    border: 1px solid rgba(255, 255, 255, .07) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.ap-info-modal .ap-info-panel > h2 {
    padding: 22px 22px 6px !important;
    letter-spacing: .2px;
}
.ap-info-modal .ap-info-body {
    padding: 12px 20px 4px !important;
    gap: 14px !important;
}
.ap-info-modal .ap-info-body > #image_modal img,
.ap-info-modal .ap-info-body > #image_modal svg {
    max-height: 118px;
    width: auto;
}
.ap-info-modal .ap-info-note {
    border-color: rgba(255, 255, 255, .14) !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, .02);
    padding: 14px 16px !important;
    line-height: 1.6;
    text-align: left;
}
.ap-info-modal .ap-info-actions {
    background: transparent !important;
    padding: 16px 20px 20px !important;
    gap: 10px !important;
}
.ap-info-modal .ap-info-actions > button {
    height: 38px !important;
    border-radius: 9999px !important;
    padding: 0 22px !important;
}

/* ==========================================================================
   6. POPUP PROMOSI HOMEPAGE (referensi screen 1)
   Scoped ke .ap-popup — tidak memengaruhi elemen lain di website.
   Warna mengikuti tema existing (tidak ada perubahan warna global).
   ========================================================================== */
.ap-popup { display: none; }
.ap-popup .ap-popup__overlay { background: rgba(0, 0, 0, .8); }
.ap-popup .ap-popup__scroll { -webkit-overflow-scrolling: touch; }
.ap-popup .ap-popup__wrap {
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
.ap-popup .ap-popup__panel {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 16px !important;
    background: #2b2b2b !important;
    border: 1px solid rgba(255, 255, 255, .07) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
.ap-popup .ap-popup__media { position: relative; line-height: 0; }
.ap-popup .ap-popup__image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    color: transparent;
}
.ap-popup .ap-popup__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    background: rgba(20, 20, 20, .85);
    border: 2px solid var(--warna_3, #f97316);
    color: #fff;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.ap-popup .ap-popup__close svg { width: 20px; height: 20px; }
.ap-popup .ap-popup__close:hover { background: rgba(20, 20, 20, .95); }
.ap-popup .ap-popup__close:active { transform: scale(.94); }
.ap-popup .ap-popup__content { padding: 12px 16px 14px; }
.ap-popup .ap-popup__pager {
    display: block;
    width: 100%;
    text-align: center;
    font-size: .75rem;
    opacity: .8;
    margin-bottom: 6px;
}
.ap-popup .ap-popup__title {
    width: 100%;
    margin: 0 0 8px;
    text-align: center;
    font-size: 1rem;
    line-height: 1.35;
    font-weight: 700;
    text-transform: uppercase;
}
.ap-popup .ap-popup__description {
    width: 100%;
    text-align: left;
    font-size: .8125rem;
    line-height: 1.6;
    word-break: break-word;
}
.ap-popup .ap-popup__description p { margin: 0 0 6px; }
.ap-popup .ap-popup__description p:last-child { margin-bottom: 0; }
.ap-popup .ap-popup__description img { max-width: 100%; height: auto; }
.ap-popup .ap-popup__footer {
    width: 100%;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, .06);
}
.ap-popup .ap-popup__check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: .8125rem;
    user-select: none;
    padding: 4px 0;
}
.ap-popup .ap-popup__checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--warna_3, #f97316);
    flex: 0 0 auto;
}
@media (min-width: 640px) {
    .ap-popup .ap-popup__wrap { padding: 24px; }
    .ap-popup .ap-popup__panel { max-height: calc(100vh - 96px); }
}

/* ==========================================================================
   7. PENYELARASAN MODAL INFORMASI PRODUK PADA LAYAR KECIL (referensi screen 2)
   ========================================================================== */
.ap-info-modal .ap-info-panel {
    margin: 0 auto;
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.ap-info-modal .ap-info-panel > h2 { word-break: break-word; }
.ap-info-modal .ap-info-actions { flex-wrap: wrap; }
.ap-info-modal .ap-info-actions > button {
    min-width: 120px;
    max-width: 100%;
    -webkit-tap-highlight-color: transparent;
}
@media (max-width: 480px) {
    .ap-info-modal .ap-info-panel { border-radius: 18px !important; }
    .ap-info-modal .ap-info-panel > h2 { padding: 18px 18px 4px !important; font-size: 1rem !important; }
    .ap-info-modal .ap-info-body { padding: 10px 16px 2px !important; }
    .ap-info-modal .ap-info-body > #image_modal img,
    .ap-info-modal .ap-info-body > #image_modal svg { max-height: 96px; }
    .ap-info-modal .ap-info-actions { padding: 14px 16px 18px !important; }
    .ap-info-modal .ap-info-actions > button { height: 40px !important; min-width: 110px; }
}
