/* --- LAYOUT HEADER & MENU MOBILE --- */

.header-mobile-wrapper {
    display: none;
    width: auto;
    margin: 0 auto;
    padding: 15px;
}

@media (max-width: 768px) {
    .header-mobile-wrapper {
        display: block;
    }
}

.header-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
}

.header-mobile-left {
    flex: 0 0 50%;
    max-width: 50%;
    margin-right: 0;
    min-width: 0; 
}

.header-mobile-right {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 50%;
    max-width: 50%;
}

.header-mobile-right .material-icons-outlined {
    vertical-align: middle;
}

.header-mobile-left img {
    max-width: 160px;
}

.mobile-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* --- LAYOUT SEARCH MOBILE --- */
.mobile-search-bar { /* Ini berfungsi sebagai overlay seperti menu */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1001; /* Z-index lebih tinggi sedikit dari menu */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.6s ease, visibility 0s 0.6s;
}

.mobile-search-panel {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0; /* Patokan di kanan */
    width: 100%;
    max-width: 100%;
    height: 100%;
    background-color: #fff;
    z-index: 1001;
    overflow-y: auto;
    transform: translateX(100%); /* Sembunyi di kanan */
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.mobile-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 15px;
}

.search-area-top {
    flex: 1;
}

.search-input-group {
    display: flex;
    align-items: center;
    background-color: whitesmoke;
    border-radius: 4px;
}

.search-input-field {
    width: 100%;
    height: 40px;
    background: none;
    padding: 0 10px;
    border: none;
    outline: none;
}

.search-submit-btn {
    border: none;
    background: none;
}

.mobile-search-content {
    padding: 20px;
}

.history-list {
    list-style: none;
    padding: 0;
}

.history-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px;
}

.history-list li a {
    display: flex;
    align-items: center;
    gap: 5px;
}

.history-list li a .material-icons-outlined {
    font-size: initial;
    color: #999;
    vertical-align: middle;
}

.remove-single-history {
    background: none;
    border: none;
}

.remove-single-history .material-icons-outlined {
    font-size: initial;
    color: #999;
    vertical-align: middle;
}

/* ----- SUGESTI TAG PENCARIAN ----- */

.search-trending-tags h4 {
    margin-bottom: 15px;
}

.tag-cloud-wrapper {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* --- LAYOUT MENU MOBILE --- */

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.6s ease, visibility 0s 0.6s;
}

.mobile-menu-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    background-color: #fff;
    z-index: 1000;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none; 
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.mobile-menu-panel::-webkit-scrollbar,
.mobile-search-panel::-webkit-scrollbar {
    display: none;
}

body.menu-open,
body.search-open {
    overflow: hidden; 
}

body.menu-open .mobile-menu-overlay {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.05s ease;
}

body.menu-open .mobile-menu-panel {
    transform: translateX(0);
    pointer-events: auto;
}

/* Aktifkan Search (Slide dari Kanan) */
body.search-open .mobile-search-bar {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.05s ease;
}
body.search-open .mobile-search-panel {
    transform: translateX(0);
    pointer-events: auto;
}


.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row-reverse;
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 20px;
    background-color: whitesmoke;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-header img {
    max-width: 160px;
}

.site-branding {
    flex: 1;
    display: flex;
    justify-content: center;
}

.mobile-menu-header .site-branding h1 {
    font-size: 1.5em;
    margin: 0;
}

.close-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.close-icon .material-icons-outlined {
    vertical-align: middle;
}

.mobile-user-nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.mobile-login-link,
.mobile-user-link {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
}

.mobile-avatar {
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
    border: 4px solid #fff;
}

.mobile-avatar img {
    width: 32px;
    border-radius: 50%;
}

.mobile-login-text,
.mobile-name {
    text-transform: capitalize;
    font-size: small;
}

.divider {
    padding: 3px;
    background-color: whitesmoke;
}

.mobile-menu-section {
    padding: 0 20px;
}

.mobile-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-primary > ul > li.menu-item-has-children {
    position: relative;
}

.mobile-menu-primary li a {
    text-transform: capitalize;
    display: block;
    padding: 8px 0;
    text-decoration: none;
}

.mobile-menu-primary .dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    padding: 8px 0;
    transition: transform 0.3s ease;
}

.mobile-menu-primary .dropdown-toggle i {
    vertical-align: middle;
}

.mobile-menu-primary li.active > .dropdown-toggle {
    transform: rotate(90deg);
}

.mobile-menu-primary .sub-menu {
    list-style: none;
    padding-left: 20px;
    margin: 0;
    display: none;
}

.mobile-menu-primary .sub-menu li a {
    font-size: 15px;
    font-weight: normal;
    padding: 5px 0;
    color: #666;
}

.mobile-menu-panel .menu-dropdown-icon {
    display: none !important; 
}

/* --- LAYOUT MENU MOBILE PAGES --- */

.mobile-menu-pages ul {
    display: flex;
    flex-direction: column;
}

.mobile-menu-pages ul li a {
    text-transform: capitalize;
    display: block;
    padding: 8px 0;
}

/* --- LAYOUT SOCIAL MOBILE --- */

.mobile-menu-socials .social-icons-list {
    justify-content: center;
    gap: 30px;
}

.mobile-menu-socials .social-icons-list a:hover {
    color: #333;
}

/* --- LAYOUT CREDIT MOBILE --- */

.mobile-menu-footer-credit {
    padding: 0 20px 20px;
    text-align: center;
    font-size: x-small;
    color: #999;
}

.mobile-menu-footer-credit p {
    margin: 0;
    font-size: x-small;
    color: #999;
    text-align: center;
}

.mobile-menu-footer-credit a {
    color: #999;
}
