/* =========================================================
 * Pop-up pilihan toko (Worldwide / Indonesia) — beranda
 * Isi dari page "store-picker" (functions.php bagian 31); perilaku di store-picker.js.
 * Layar penuh berlatar putih, tampil seketika, hanya tertutup lewat tombol.
 *
 * Susunan (HP & desktop sama):
 *   merek (Heading / Image)  →  label "SHOP"  →  2 tombol vertikal  →  footer di bawah layar
 *
 * Peran paragraf diberi class oleh store-picker.js (bisa juga diisi sendiri lewat
 * Block → Advanced → Additional CSS class):
 *   tf-gate-eyebrow  paragraf tepat setelah merek ("SHOP")
 *   tf-gate-text     paragraf lain di tengah (opsional)
 *   tf-gate-footer   paragraf terakhir
 *
 * SATU SUMBER PENGATURAN: semua ukuran & jarak ada di bagian 1 (variabel .tf-gate).
 * Bisa diubah langsung di DevTools; tidak ada blok lain yang menimpanya.
 * ========================================================= */


/* ---------- 1. Pengaturan — SATU-SATUNYA sumber angka ----------
   Tidak ada blok lain yang menimpa nilai ini (juga tidak ada @media untuk desktop).
   Nilai yang berbeda antara HP & desktop memakai clamp(minimal, ikut lebar layar, maksimal):
   angka pertama = ukuran di HP, angka terakhir = ukuran di desktop. */

.tf-gate {
    /* warna */
    --gate-bg: #fff;
    --gate-ink: var(--ink, #101014);
    --gate-muted: #6b6b70;

    /* tata letak */
    --gate-pad: 40px;                                       /* kiri-kanan isi */
    --gate-top: clamp(56px, 7vh, 64px);                     /* atas layar → merek */
    --gate-bottom: 64px;                                    /* footer → bawah layar */
    --gate-label-gap: clamp(72px, 16vh, 128px);             /* merek → label "SHOP" */

    /* merek */
    --gate-brand-size: clamp(44px, 5vw + 26px, 72px);

    /* label "SHOP" & teks pendukung */
    --gate-label-size: clamp(15px, 0.25vw + 14px, 16px);
    --gate-text-size: 16px;

    /* tombol */
    --gate-btn-width: 320px;                                /* maksimum; di HP menyesuaikan layar */
    --gate-btn-height: clamp(64px, 1vw + 60px, 68px);
    --gate-btn-font: 20px;                                  /* teks Worldwide & Indonesia */
    --gate-btn-gap: clamp(20px, 1vw + 16px, 24px);          /* antar tombol */
    --gate-btn-top: clamp(32px, 1vw + 28px, 36px);          /* label → tombol */

    /* footer */
    --gate-footer-size: clamp(12px, 0.25vw + 11px, 13px);
}


/* ---------- 2. Layar penuh ---------- */

.tf-gate {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: var(--gate-bg);
    transition: opacity 0.22s ease;                     /* hanya saat ditutup */
}
.tf-gate[hidden] {
    display: none;
}
.tf-gate.is-closing {
    opacity: 0;
}

.tf-gate__card {
    position: relative;                                 /* acuan footer */
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: var(--gate-top) var(--gate-pad) calc(var(--gate-bottom) + 48px);
    background: var(--gate-bg);
    color: var(--gate-ink);
    text-align: center;
    font-family: var(--utility, "Archivo", sans-serif);
    outline: 0;
}
.tf-gate__card > * {
    margin: 0;
}


/* ---------- 3. Merek ---------- */

.tf-gate__card > :is(h1, h2, h3, h4) {
    font-family: var(--display, "Inter", sans-serif);
    font-size: var(--gate-brand-size);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.035em;
    color: var(--gate-ink);
}
.tf-gate__card > .wp-block-image img {
    display: block;
    width: auto;
    max-height: var(--gate-brand-size);
    margin: 0 auto;
}


/* ---------- 4. Label "SHOP" & teks pendukung ---------- */

/* Selector posisi = cadangan sebelum store-picker.js memberi class (tampil seketika tanpa berkedip) */
.tf-gate-eyebrow,
.tf-gate__card > :is(h1, h2, h3, h4, .wp-block-image) + p {
    margin-top: var(--gate-label-gap);
    font-size: var(--gate-label-size);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gate-muted);
}
.tf-gate-text {
    margin-top: 16px;
    font-size: var(--gate-text-size);
    line-height: 1.45;
    color: var(--gate-ink);
}


/* ---------- 5. Tombol ----------
   Putih + garis tipis hitam, tanpa sudut membulat; hover / ditekan / sudah diklik = hitam, teks putih.
   !important HANYA di bagian ini, untuk mengalahkan layout bawaan block Buttons WordPress
   (flex, orientasi, lebar tombol dari editor). */

.tf-gate .wp-block-buttons {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: min(100%, var(--gate-btn-width)) !important;
    gap: var(--gate-btn-gap);
    margin: var(--gate-btn-top) 0 0;
}
.tf-gate .wp-block-button {
    width: 100% !important;
    max-width: none !important;
    flex: none !important;
    margin: 0 !important;
}
.tf-gate .wp-block-button__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: var(--gate-btn-height);
    padding: 14px 24px;
    border: 1px solid var(--gate-ink);
    border-radius: 0;
    background: var(--gate-bg);
    color: var(--gate-ink);
    font-family: var(--utility, "Archivo", sans-serif);
    font-size: var(--gate-btn-font);
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: none;
    transition: background-color 0.18s ease, color 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}
/* Hitam: saat hover (desktop), saat ditekan, dan TETAP hitam setelah diklik (is-selected dari store-picker.js) */
@media (hover: hover) {
    .tf-gate .wp-block-button__link:hover {
        background: var(--gate-ink);
        color: var(--gate-bg);
    }
}
.tf-gate .wp-block-button__link:active,
.tf-gate .wp-block-button__link.is-selected {
    background: var(--gate-ink);
    color: var(--gate-bg);
}
.tf-gate .wp-block-button__link:focus-visible {
    outline: 2px solid var(--gate-ink);
    outline-offset: 3px;
}


/* ---------- 6. Footer (menempel di bawah layar) ---------- */

.tf-gate-footer,
.tf-gate__card > p:last-child {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 0 24px calc(var(--gate-bottom) + env(safe-area-inset-bottom, 0px));
    font-size: var(--gate-footer-size);
    line-height: 1.5;
    letter-spacing: 0.06em;
    color: var(--gate-muted);
}


/* ---------- 7. Halaman di belakang tidak ikut tergulir ---------- */

html:has(#tf-gate.is-open),
html:has(#tf-gate.is-open) body,
html.tf-gate-lock,
html.tf-gate-lock body {
    overflow: hidden;
}


/* ---------- 8. Pengguna yang memilih "kurangi gerakan" ---------- */

@media (prefers-reduced-motion: reduce) {
    .tf-gate,
    .tf-gate .wp-block-button__link {
        transition: none;
    }
}