/* ======================================================
   JUAL BELI KOMPUTER BEKAS — STYLESHEET (CLEAN VERSION)
====================================================== */

/* Catatan: font Poppins di-load via <link> di index.html (bukan di sini),
   biar gak nge-block render CSS ini di koneksi lambat. */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
    font-family: 'Poppins', sans-serif;
}

html {
    scroll-padding-top: 110px;
    overflow-x: hidden;
    max-width: 100%;
}

:root {
    --primary: #2563EB;
    --secondary: #60A5FA;
    --dark: #0F172A;
    --text: #475569;
    --bg: #F8FAFC;
    --white: #fff;
    --shadow: 0 15px 40px rgba(37, 99, 235, .12);
}

body {
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }

/* ================= LOADER ================= */

.loader {
    position: fixed;
    inset: 0;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
}

.loader-circle {
    width: 70px;
    height: 70px;
    border: 7px solid #ddd;
    border-top: 7px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

/* ================= HEADER / NAVBAR ================= */

header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 9999;
}

nav {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 8%;
    background: #ffffff;
    transition: .35s;
}

nav.scrolled { box-shadow: var(--shadow); }

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
    flex-shrink: 1;
}

.logo img { width: 55px; height: 55px; border-radius: 50%; flex-shrink: 0; }

.logo h2 {
    color: var(--primary);
    font-size: 24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 35px;
    flex-shrink: 0;
    margin: 0 20px;
}

nav ul li a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: .3s;
}

nav ul li a:hover { color: var(--primary); }

.btn-nav {
    padding: 14px 30px;
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    transition: .3s;
}

.btn-nav:hover { transform: translateY(-4px); }

/* Hamburger (mobile only, hidden on desktop) — digambar pake CSS murni,
   bukan karakter font, biar dijamin selalu kelihatan di semua HP. */
.menu-toggle {
    display: none;
    width: 32px;
    height: 24px;
    cursor: pointer;
    position: relative;
}

.menu-toggle span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    border-radius: 3px;
    background: var(--primary);
}

.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 10px; }
.menu-toggle span:nth-child(3) { top: 20px; }

/* ================= HERO ================= */

.hero {
    position: relative;
    display: grid;
    grid-template-columns: 55% 45%;
    align-items: center;
    gap: 40px;
    padding: 140px 8% 90px;
    overflow-x: hidden;
    max-width: 100vw;
}

.hero::before {
    content: "";
    position: absolute;
    width: 550px;
    height: 550px;
    background: #60A5FA;
    border-radius: 50%;
    right: -180px;
    top: -180px;
    opacity: .15;
    filter: blur(40px);
}

.hero::after {
    content: "";
    position: absolute;
    width: 400px;
    height: 400px;
    background: #2563EB;
    border-radius: 50%;
    left: -150px;
    bottom: -150px;
    opacity: .08;
    filter: blur(40px);
}

.particles {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(#60A5FA 2px, transparent 2px);
    background-size: 45px 45px;
    opacity: .18;
    pointer-events: none;
}

.hero-text { position: relative; z-index: 2; width: 100%; max-width: 650px; }

.hero-badge {
    display: inline-block;
    padding: 10px 18px;
    background: #DBEAFE;
    color: #2563EB;
    border-radius: 50px;
    font-weight: 600;
    margin-bottom: 25px;
}

.hero h1 { font-size: 64px; line-height: 74px; font-weight: 800; color: var(--dark); }

.hero h1 span {
    color: #2563EB;
    background: linear-gradient(90deg, #2563EB, #60A5FA);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.hero p { margin: 28px 0; font-size: 18px; line-height: 34px; max-width: 600px; }

.hero-button { display: flex; gap: 18px; }

.btn-primary {
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    padding: 16px 34px;
    border-radius: 50px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    transition: .3s;
    box-shadow: 0 15px 35px rgba(37, 99, 235, .25);
}

.btn-primary:hover { transform: translateY(-5px); }

.btn-secondary {
    padding: 16px 34px;
    border: 2px solid #2563EB;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    color: #2563EB;
    transition: .3s;
}

.btn-secondary:hover { background: #2563EB; color: white; }

/* ================= ROBOT ================= */

.hero-image {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    min-height: 550px;
}

.robot-glow {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96, 165, 250, .6), transparent);
    filter: blur(25px);
    animation: glow 4s ease infinite;
}

@keyframes glow { 50% { transform: scale(1.2); opacity: .5; } }

.robot {
    width: 420px;
    max-width: 100%;
    height: auto;
    position: relative;
    z-index: 5;
    filter: drop-shadow(0 25px 55px rgba(37, 99, 235, .35));
    animation: float 4s ease-in-out infinite;
}

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }

.robot-chat {
    position: absolute;
    top: 110px;
    left: 20px;
    width: 280px;
    background: #fff;
    padding: 18px 22px;
    border-radius: 20px;
    color: #2563EB;
    font-weight: 600;
    line-height: 1.6;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .12);
    animation: chat 3s ease-in-out infinite;
    transition: .35s;
    z-index: 20;
}

#robotText { display: block; transition: .35s; }

.robot-chat::after {
    content: "";
    position: absolute;
    right: -9px;
    top: 50%;
    width: 18px;
    height: 18px;
    background: #fff;
    transform: translateY(-50%) rotate(45deg);
}

@keyframes chat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ======================================================
   SECTION HEADER (dipakai berulang)
====================================================== */

section { padding: 90px 8%; }

.section-header { text-align: center; margin-bottom: 60px; }

.section-header span { color: #2563EB; font-weight: 700; letter-spacing: 2px; }

.section-header h2 { font-size: 42px; color: var(--dark); margin: 15px 0; }

.section-header p { max-width: 700px; margin: auto; line-height: 30px; color: #64748B; }

/* ================= TENTANG ================= */

.about-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.about-card {
    background: white;
    border-radius: 22px;
    padding: 35px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .07);
    transition: .35s;
}

.about-card:hover { transform: translateY(-10px); box-shadow: 0 20px 45px rgba(37, 99, 235, .15); }

.about-card h3 { color: #2563EB; margin-bottom: 15px; }

.about-card p { line-height: 30px; }

/* ================= KATEGORI ================= */

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
}

.category-card {
    background: white;
    border-radius: 22px;
    padding: 35px;
    text-align: center;
    transition: .35s;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .06);
    text-decoration: none;
    color: inherit;
}

.category-card:hover { transform: translateY(-10px) scale(1.05); box-shadow: 0 20px 45px rgba(37, 99, 235, .18); }

.category-card:hover .icon { transform: scale(1.2) rotate(-8deg); }

.category-card .icon { transition: .35s; font-size: 55px; margin-bottom: 18px; }

.category-card h3 { color: var(--dark); }

/* ================= KEUNGGULAN ================= */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background: white;
    border-radius: 22px;
    padding: 35px;
    text-align: center;
    transition: .35s;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .06);
}

.feature-card:hover { transform: translateY(-10px); }

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #DBEAFE;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    font-size: 34px;
}

.feature-card h3 { margin-bottom: 12px; color: var(--dark); }

/* ================= PRODUK ================= */

.product-search { display: flex; justify-content: center; margin-bottom: 45px; }

.product-search input {
    width: 100%;
    max-width: 650px;
    padding: 18px 25px;
    border-radius: 50px;
    border: 2px solid #E2E8F0;
    outline: none;
    font-size: 17px;
    transition: .3s;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .05);
}

.product-search input:focus { border-color: #2563EB; box-shadow: 0 0 18px rgba(37, 99, 235, .18); }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 30px;
}

.product-card {
    width: 100%;
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .08);
    transition: .35s;
    position: relative;
}

.product-card:hover { transform: translateY(-10px); box-shadow: 0 18px 35px rgba(0, 0, 0, .12); }

.product-card img { width: 100%; height: 240px; aspect-ratio: 1 / 1; object-fit: cover; }

.product-card:target { animation: targetGlow .8s; }

@keyframes targetGlow { 0% { transform: scale(.95); } 50% { transform: scale(1.03); } 100% { transform: scale(1); } }

.badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #2563EB;
    color: white;
    padding: 8px 16px;
    border-radius: 40px;
    font-size: 13px;
}

.product-card h3 { padding: 25px 25px 10px; color: var(--dark); }

.product-card p { padding: 0 25px; line-height: 28px; }

.product-card a {
    display: block;
    margin: 25px;
    text-align: center;
    padding: 14px;
    text-decoration: none;
    background: #2563EB;
    color: white;
    border-radius: 12px;
    transition: .3s;
}

.product-card a:hover { background: #1D4ED8; }

/* ================= STATS (opsional/cadangan) ================= */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 25px; }

.stat-card { background: white; border-radius: 20px; text-align: center; padding: 40px; box-shadow: 0 10px 30px rgba(0, 0, 0, .06); }

.stat-card h2 { font-size: 52px; color: #2563EB; }

.stat-card p { margin-top: 12px; }

/* ================= GALERI ================= */

.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; }

.gallery-item {
    width: 100%;
    height: 230px;
    object-fit: cover;
    border-radius: 20px;
    cursor: pointer;
    transition: .35s;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .08);
}

.gallery-item:hover { transform: translateY(-10px) scale(1.03); box-shadow: 0 20px 45px rgba(37, 99, 235, .20); }

/* ================= LIGHTBOX ================= */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .88);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999999;
}

.lightbox.active { display: flex; }

.lightbox img { max-width: 90%; max-height: 90%; border-radius: 20px; }

.close-lightbox { position: absolute; top: 25px; right: 40px; font-size: 45px; color: white; cursor: pointer; }

/* ================= TESTIMONIAL (opsional/cadangan) ================= */

.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }

.testimonial-card { background: white; border-radius: 22px; padding: 35px; box-shadow: 0 12px 35px rgba(0, 0, 0, .08); transition: .35s; }

.testimonial-card:hover { transform: translateY(-10px); }

.testimonial-card h3 { color: #FBBF24; margin-bottom: 15px; }

.testimonial-card p { line-height: 30px; }

.testimonial-card h4 { margin-top: 18px; color: #2563EB; }

/* ================= KONTAK ================= */

.contact-container { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }

.contact-info { background: white; border-radius: 22px; padding: 40px; box-shadow: 0 12px 35px rgba(0, 0, 0, .08); }

.contact-info h3 { color: #2563EB; margin-top: 18px; }

.contact-info p { margin-top: 8px; line-height: 28px; }

.maps iframe { width: 100%; border: 0; border-radius: 20px; box-shadow: 0 12px 35px rgba(0, 0, 0, .08); }

.wa-btn {
    display: inline-block;
    margin-top: 30px;
    padding: 15px 35px;
    background: #25D366;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    transition: .3s;
}

.wa-btn:hover { transform: translateY(-5px); }

/* ================= FOOTER ================= */

footer { background: #0F172A; color: white; padding: 70px 8% 100px; }

.footer-content { display: grid; grid-template-columns: 2fr 1fr; gap: 60px; }

.footer-content h2 { margin-bottom: 15px; }

.footer-content h3 { margin-bottom: 18px; }

.footer-content ul { list-style: none; }

.footer-content li { margin: 12px 0; }

.footer-content a { color: #CBD5E1; text-decoration: none; }

.footer-content a:hover { color: white; }

footer hr { margin: 35px 0 20px; border: none; height: 1px; background: #334155; }

.copyright { text-align: center; color: #94A3B8; }

/* ======================================================
   TOMBOL MENGAMBANG (Back to Top & WhatsApp)
====================================================== */

#topBtn {
    position: fixed;
    right: max(25px, env(safe-area-inset-right));
    bottom: 100px;
    width: 55px;
    height: 55px;
    border: none;
    border-radius: 50%;
    background: #2563EB;
    color: white;
    cursor: pointer;
    display: none;
    font-size: 22px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .2);
    z-index: 9998;
}

.wa-floating {
    position: fixed;
    right: 18px;
    bottom: 20px;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: #25D366;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
    z-index: 999999;
    transition: transform .25s;
}

.wa-floating img { width: 34px; height: 34px; }

.wa-floating:hover { transform: scale(1.08); }

/* ======================================================
   SCROLL ANIMATION
====================================================== */

.hidden { opacity: 0; transform: translateY(60px); transition: .8s; }

.show { opacity: 1; transform: translateY(0); }

/* ======================================================
   BLOG — halaman daftar artikel
====================================================== */

.blog-hero {
    padding: 150px 8% 60px;
    text-align: center;
    background: linear-gradient(180deg, #EFF6FF, var(--bg));
}

.blog-hero span { color: #2563EB; font-weight: 700; letter-spacing: 2px; }

.blog-hero h1 { font-size: 46px; color: var(--dark); margin: 15px 0; }

.blog-hero p { max-width: 650px; margin: auto; line-height: 30px; color: #64748B; }

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.blog-card {
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .08);
    transition: .35s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.blog-card:hover { transform: translateY(-10px); box-shadow: 0 18px 35px rgba(0, 0, 0, .12); }

.blog-card img { width: 100%; height: 200px; object-fit: cover; }

.blog-card-body { padding: 25px; }

.blog-date {
    display: inline-block;
    background: #DBEAFE;
    color: #2563EB;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
    padding: 6px 14px;
    border-radius: 40px;
    margin-bottom: 14px;
}

.blog-card h3 { font-size: 20px; color: var(--dark); margin-bottom: 10px; line-height: 1.4; }

.blog-card p { line-height: 26px; font-size: 15px; }

.blog-read-more { margin-top: 14px; color: #2563EB; font-weight: 600; font-size: 14px; }

/* ======================================================
   ARTIKEL — halaman isi 1 artikel blog
====================================================== */

.article-hero { padding: 150px 8% 40px; max-width: 800px; margin: 0 auto; }

.article-hero .blog-date { margin-bottom: 18px; }

.article-hero h1 { font-size: 38px; line-height: 1.3; color: var(--dark); margin-bottom: 15px; }

.article-hero .article-meta { color: #64748B; font-size: 15px; }

.article-cover {
    max-width: 900px;
    margin: 0 auto 50px;
    padding: 0 8%;
}

.article-cover img { width: 100%; border-radius: 22px; box-shadow: 0 15px 40px rgba(0, 0, 0, .1); }

.article-body {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 8% 90px;
    line-height: 32px;
    font-size: 17px;
    color: #334155;
}

.article-body h2 { font-size: 26px; color: var(--dark); margin: 40px 0 18px; }

.article-body h3 { font-size: 21px; color: var(--dark); margin: 30px 0 14px; }

.article-body p { margin-bottom: 20px; }

.article-body ul, .article-body ol { margin: 0 0 20px 22px; }

.article-body li { margin-bottom: 10px; }

.article-body a { color: #2563EB; font-weight: 600; }

.article-cta {
    max-width: 800px;
    margin: 20px auto 0;
    padding: 30px;
    background: #EFF6FF;
    border-radius: 20px;
    text-align: center;
}

.article-cta p { margin-bottom: 16px; font-weight: 600; color: var(--dark); }

.article-back {
    display: inline-block;
    margin: 40px 8% 0;
    color: #2563EB;
    font-weight: 600;
    text-decoration: none;
}


/* ======================================================
   FALLBACK MOBILE (dari JS) — jaring pengaman kedua.
   Selector ini spesifisitasnya lebih tinggi dari rule di
   dalam @media biasa, jadi dijamin menang & tetap benar
   walau @media telat/gagal ke-apply di browser tertentu.
====================================================== */

html.force-mobile .btn-nav { display: none; }
html.force-mobile .menu-toggle { display: block; }
html.force-mobile nav ul { display: none; }
html.force-mobile nav ul.active { display: flex; }

html.force-mobile .wa-floating {
    right: 15px;
    bottom: 18px;
    width: 56px;
    height: 56px;
}

html.force-mobile .wa-floating img { width: 32px; height: 32px; }



/* ======================================================
   RESPONSIVE — LAYAR SEDANG (<=1200px)
   Buat window browser ukuran "tanggung" (bukan HP, tapi
   juga belum selebar desktop penuh) — kecilin gap & logo
   biar gak numpuk sama menu navbar.
====================================================== */

@media (max-width: 1200px) {

    .logo h2 { font-size: 19px; max-width: 220px; }
    nav ul { gap: 20px; margin: 0 15px; }
    .btn-nav { padding: 12px 22px; }

}

@media (max-width: 992px) {

    .hero { grid-template-columns: 1fr; text-align: center; padding-top: 150px; }
    .hero-text { order: 2; }
    .hero-image { order: 1; margin-bottom: 40px; }
    .hero-button { justify-content: center; }
    .contact-container { grid-template-columns: 1fr; }
    .footer-content { grid-template-columns: 1fr; }
    nav ul { display: none; }

}

/* ======================================================
   RESPONSIVE — MOBILE (<=768px)
   Semua aturan mobile digabung di SATU tempat (tidak ada
   lagi blok @media 768px yang saling menimpa).
====================================================== */

@media (max-width: 768px) {

    /* --- Navbar --- */
    nav { padding: 15px 20px; position: relative; }

    .logo img { width: 44px; height: 44px; }
    .logo h2 { font-size: 15px; }

    .btn-nav { display: none; }

    .menu-toggle { display: block; }

    nav ul {
        position: absolute;
        top: 75px;
        left: 20px;
        right: 20px;
        background: white;
        border-radius: 18px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, .12);
        flex-direction: column;
        gap: 0;
        overflow: hidden;
        display: none;
        z-index: 9999;
    }

    nav ul.active { display: flex; }

    nav ul li { width: 100%; }

    nav ul li a { display: block; padding: 18px 20px; border-bottom: 1px solid #eee; }

    /* --- Hero --- */
    .hero { padding: 100px 20px 60px; gap: 20px; }

    .hero h1 { font-size: 36px; line-height: 44px; }

    .hero p { font-size: 15px; line-height: 28px; margin: 20px auto; }

    .hero-button { flex-direction: column; align-items: center; }

    .btn-primary, .btn-secondary { width: 100%; max-width: 280px; text-align: center; }

    /* --- Robot --- */
    .hero-image { min-height: auto; }

    .robot { width: min(220px, 65vw); }

    .robot-chat {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        max-width: 300px;
        margin: 15px auto 0;
        font-size: 14px;
    }

    .robot-chat::after { display: none; }

    /* --- Section headers --- */
    .section-header h2 { font-size: 28px; }
    .section-header p { font-size: 15px; }

    /* --- Grids jadi 1 kolom --- */
    .product-grid, .feature-grid, .about-container, .category-grid {
        grid-template-columns: 1fr;
    }

    /* --- Galeri 2 kolom --- */
    .gallery { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    .gallery-item { height: auto; aspect-ratio: 1 / 1; }

    /* --- Kontak --- */
    .contact-container { grid-template-columns: 1fr; }

    .maps iframe { height: 260px; }

    /* --- Footer --- */
    footer { text-align: center; }

    .footer-content { grid-template-columns: 1fr; gap: 30px; }

    /* --- Tombol mengambang: dipastikan tetap besar & mudah dijangkau jempol --- */
    #topBtn {
        right: max(15px, env(safe-area-inset-right));
        bottom: 90px;
        width: 50px;
        height: 50px;
    }

    .wa-floating {
        right: 15px;
        bottom: 18px;
        width: 56px;
        height: 56px;
    }

    .wa-floating img { width: 32px; height: 32px; }

    /* --- Blog & Artikel --- */
    .blog-hero { padding: 100px 20px 40px; }
    .blog-hero h1 { font-size: 30px; }
    .article-hero { padding: 100px 20px 30px; }
    .article-hero h1 { font-size: 26px; }
    .article-cover { padding: 0 20px; }
    .article-body { padding: 0 20px 60px; font-size: 16px; line-height: 28px; }
    .article-back { margin: 30px 20px 0; }

}