/* css/responsive.css */

/* Sembunyikan elemen mobile di desktop secara default */
.mobile-menu-btn,
.mobile-section {
    display: none;
}

/* ==========================================================================
   Aturan untuk layar kecil (Tablet ke bawah)
   ========================================================================== */
@media (max-width: 768px) {

    /* --- Layout & Tipografi Global --- */
    body {
        font-size: 14px; /* Ukuran font dasar untuk mobile */
    }
    h1, .page-header h1 { font-size: 1.8rem !important; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.2rem; }

    /* --- Sembunyikan Elemen Desktop --- */
    .header-slogan,
    #language-switcher,
    #floatingMenu,
    #friendMenu,
    #side-quick-links,
    .brixie-model-container,
    .landing-section:not(.mobile-section):not(#move-forward-section),
    #hero-video-container,
    #hero-secondary-image-container,
    .lego-models-container,
    .hero-friend-ui-container,
    #hero-background-image-container,
    #next-step-section,
    #move-gallery-section,
    #about-section {
        display: none !important;
    }

    /* --- Header & Navigasi Mobile --- */
    .header-container {
        justify-content: space-between;
        padding: 10px 20px;
    }
    .header-container .logo {
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        max-width: 140px;
        order: 2;
    }
    .mobile-menu-btn {
        display: block;
        font-size: 1.8rem;
        background: none;
        border: none;
        color: white; /* Warna ikon hamburger jadi putih */
        cursor: pointer;
        order: 1;
        margin: 0; /* Reset margin */
    }

    /* --- Utility Bar Responsif --- */
    .utility-bar-container {
        padding: 0; /* Reset padding desktop */
    }
    .utility-bar-wrapper {
        overflow-x: auto; /* Izinkan scroll horizontal */
        padding: 10px 15px;
        justify-content: flex-start; /* Mulai dari kiri */
        -webkit-overflow-scrolling: touch; /* Scrolling lebih mulus di iOS */
    }
    /* Sembunyikan scrollbar untuk tampilan lebih bersih */
    .utility-bar-wrapper::-webkit-scrollbar { display: none; }
    .utility-bar-wrapper { -ms-overflow-style: none;  scrollbar-width: none; }
    .utility-bar-item {
        flex-shrink: 0; /* Mencegah item menyusut */
    }

    /* --- Layout Halaman Konten (Sub-pages) --- */
    body.sub-page .page-content {
        padding-top: 70px; /* Sesuaikan dengan tinggi header baru */
    }
    .page-container {
        padding: 1.5rem 1rem;
    }
    .page-container.with-sidebar {
        display: flex;
        flex-direction: column;
    }
    .main-content { order: 1; }
    .page-sidebar {
        order: 2;
        width: 100%;
        margin-top: 30px;
        position: static; /* Hapus sticky di mobile */
    }
    .content-section { padding: 1.5rem; }
    .about-page-mascot { display: none; }

    /* --- Tata Letak Landing Page (Desktop) yang Perlu Disesuaikan --- */
    .landing-section { padding: 3rem 0; }
    .section-header h3 { font-size: 1.5rem; }
    .about-preview-content { flex-direction: column; gap: 2rem; }
    .about-text h2 { font-size: 1.8rem; }
    .about-image { order: -1; }
    .capabilities-grid { grid-template-columns: 1fr; }
    .gallery-preview-grid { grid-template-columns: repeat(2, 1fr); }
    .cta-grid { grid-template-columns: 1fr; }

    /* --- Perbaikan Section Khusus Mobile --- */
    .mobile-section {
        display: block !important;
        padding: 2.5rem 20px;
    }
    .mobile-posts-scroller {
        display: flex;
        overflow-x: auto;
        gap: 15px;
        padding: 10px 0;
        -webkit-overflow-scrolling: touch; /* Scrolling lebih mulus di iOS */
    }
    .mobile-posts-scroller .landing-post-card {
        flex: 0 0 280px;
        width: 280px;
    }
    #mobile-services .mobile-services-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .mobile-service-item {
        background: #f4f6f9;
        padding: 20px 15px;
        border-radius: 10px;
        text-align: center;
        font-size: 0.9rem;
        font-weight: 500;
        color: var(--dark);
        text-decoration: none;
    }
    .mobile-service-item i {
        font-size: 1.8rem;
        color: var(--primary);
        margin-bottom: 10px;
        display: block;
    }
    #mobile-quiz .mobile-quiz-card {
        display: flex;
        align-items: center;
        gap: 15px;
        background: linear-gradient(135deg, #e3f2fd, #bbdefb);
        padding: 20px;
        border-radius: 12px;
    }
    #mobile-quiz .mobile-quiz-content { flex: 1; text-align: left; }
    #mobile-quiz .mobile-quiz-content h3 { font-size: 1.2rem; margin: 0 0 5px; color: #0d47a1; }
    #mobile-quiz .mobile-quiz-content p { font-size: 0.9rem; margin: 0 0 15px; color: #1976d2; }
    #mobile-quiz .mobile-quiz-img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }
    #mobile-instagram .mobile-ig-grid a {
        aspect-ratio: 1 / 1;
    }
    #mobile-instagram .mobile-ig-grid img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* --- Perbaikan Gambar di Dalam Konten --- */
    #page-content-placeholder img,
    #insight-detail-container .post-content img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
    }

    /* --- Perbaikan Footer --- */
    .footer-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    .footer-bottom-content {
        flex-direction: column;
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .map-container {
        width: 100%;
        margin-bottom: 30px;
    }
    .footer-legal {
        width: 100%;
        align-items: flex-start;
        text-align: left;
    }

    /* --- Lightbox Responsif --- */
    .gallery-lightbox-content {
        max-width: 95%;
        width: 95%; /* Ensure it takes up space */
    }

    /* Reposition lightbox controls for mobile */
    .lightbox-close-btn,
    .lightbox-nav-btn {
        background-color: rgba(0, 0, 0, 0.4);
        transform: none; /* Reset desktop transforms */
    }
    .lightbox-close-btn:hover,
    .lightbox-nav-btn:hover {
        background-color: rgba(0, 0, 0, 0.7);
        transform: none; /* Reset desktop transforms */
        color: #fff;
    }

    .lightbox-close-btn {
        top: 5px;
        right: 5px;
        font-size: 1.8rem;
        width: 40px;
        height: 40px;
        line-height: 40px;
        text-align: center;
        border-radius: 50%;
    }

    .lightbox-nav-btn {
        top: 50%;
        transform: translateY(-50%);
        padding: 15px 10px;
        border-radius: 5px;
    }
    #lightboxPrev {
        left: 5px;
    }
    #lightboxNext {
        right: 5px;
    }

    /* --- Perbaikan Tombol WhatsApp Mobile --- */
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        z-index: 1010; /* Naikkan lapisan agar di atas konten lain, tapi di bawah menu/lightbox */
    }
}

/* ==========================================================================
   Aturan untuk layar sangat kecil (Ponsel)
   ========================================================================== */
@media (max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-legal {
        align-items: center;
        text-align: center;
    }
}

/* ==========================================================================
   Gaya untuk Overlay Menu Mobile (di luar media query)
   ========================================================================== */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #131354; /* Warna biru tua solid, sama seperti header */
    z-index: 3000;
    display: flex;
    justify-content: flex-start; /* Mulai dari kiri */
    align-items: flex-start;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-100%); /* Sembunyikan di luar layar kiri */
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); /* Animasi geser yang halus */
    pointer-events: none;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0); /* Tampilkan dengan menggeser ke posisi semula */
    pointer-events: auto;
}

.close-mobile-menu-btn {
    position: absolute;
    top: 20px;
    right: 20px; /* Tetap di kanan untuk akses mudah */
    font-size: 2.5rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 3001;
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Mulai dari atas */
    align-items: flex-start; /* Rata kiri */
    text-align: left;
    position: relative;
    height: 100%;
    width: 100%;
    max-width: 350px; /* Lebar menu */
    padding: 100px 40px 40px; /* Padding atas untuk memberi ruang dari status bar */
    box-sizing: border-box;
    overflow-y: auto;
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left; /* Teks rata kiri */
    width: 100%;
}

.mobile-nav ul li {
    margin: 10px 0;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active .mobile-nav li {
    opacity: 1;
    transform: translateY(0);
}
.mobile-menu-overlay.active .mobile-nav li:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu-overlay.active .mobile-nav li:nth-child(2) { transition-delay: 0.15s; }
/* ... (existing staggered delays) ... */

.mobile-nav ul li a {
    color: #ccc; /* Warna teks lebih lembut */
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 500;
    display: block; /* Agar padding bisa diterapkan */
    padding: 12px 15px;
    border-radius: 8px;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.mobile-nav ul li a:hover,
.mobile-nav a.active-link {
    color: var(--dark); /* Teks gelap untuk kontras di latar kuning */
    background-color: #FFD700; /* Latar kuning solid saat aktif */
    transform: translateX(10px); /* Efek geser kecil saat aktif */
    font-weight: 600;
}
.mobile-sub-menu {
    list-style: none;
    padding-left: 20px;
    margin-top: 8px;
    margin-bottom: 8px;
}
.mobile-sub-menu li {
    margin: 2px 0 !important;
}
.mobile-sub-menu a {
    font-size: 1.1rem !important;
    font-weight: 400 !important;
    color: #aaa !important;
    padding: 6px 15px !important;
}
.mobile-sub-menu a:hover {
    color: #FFD700 !important;
    background-color: transparent !important;
    transform: translateX(5px) !important;
}
.mobile-friend-call {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(255,255,255,0.2);
    width: 100%;
    text-align: left;
}

.mobile-friend-call h4 {
    text-align: left !important;
    font-size: 1rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}
.mobile-friend-icons {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
}
.mobile-friend-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: white;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.mobile-friend-btn img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-bottom: 5px;
    border: 2px solid transparent;
}
.mobile-menu-footer {
    margin-top: auto;
    padding-top: 20px;
    width: 100%;
    border-top: 1px solid rgba(255,255,255,0.2);
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.mobile-menu-contact a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ccc;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 10px;
    transition: color 0.2s ease;
}
.mobile-menu-contact a:hover {
    color: var(--primary);
}
.mobile-menu-socials {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
}
.mobile-menu-socials a {
    color: #ccc;
    font-size: 1.5rem;
    transition: color 0.2s ease, transform 0.2s ease;
    text-decoration: none;
}
.mobile-menu-socials a:hover {
    color: var(--primary);
    transform: translateY(-3px);
}