/* --- 1. CORE & STICKY HEADER --- */
.st-site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--header-bg, #ffffff);
    padding: clamp(8px, 1.5vw, 15px) 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: var(--st-trans, 0.3s);
}

/* --- 2. LAYOUT LOGIC (Desktop) --- */
/* Layout Standard (Logo Kiri - Nav Tengah - WA Kanan) */
.st-header-grid {
    display: grid;
    grid-template-columns: auto 1fr auto; 
    align-items: center;
    width: 100%;
    gap: clamp(1rem, 2vw, 2.5rem);
}

/* Layout Centered Stacked (Logo Atas, Menu Bawah) */
.st-header-stacked {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Layout Luxury (Top Row: Info - Logo - Sosmed | Bottom Row: Nav) */
.st-header-luxury {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 5px;
}

.st-luxury-top-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    padding: 0 4vw 0 4vw;
}

/* --- 3. LOGO & BRANDING --- */
.st-logo img, 
.st-logo-centered-top img,
.st-logo-luxury img,
.custom-logo-link img {
    max-height: clamp(45px, 5vw, 65px);
    width: auto;
    display: block;
    transition: opacity 0.3s ease;
}

.st-brand-text {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text-color, #333);
}

/* Ikon Mawar SVG Sidebar/Brand */
.st-rose-icon-sidebar {
    width: 22px;
    height: 22px;
    vertical-align: middle;
    margin-right: 8px;
    color: var(--accent-color);
    display: inline-block;
    transition: transform 0.3s ease;
}

/* --- 4. NAVIGASI GLOBAL --- */
.st-main-nav, 
.st-main-nav-centered {
    display: flex;
    justify-content: center;
    width: 100%;
}

.st-menu, 
.st-menu-bottom {
    display: flex;
    list-style: none !important;
    padding: 0;
    margin: 0 auto;
    gap: clamp(5px, 0.5vw, 10px); /* Jarak antar item menu */
}

.st-menu li, 
.st-menu-bottom li {
    position: relative;
    list-style: none !important;
}

.st-menu li a, 
.st-menu-bottom li a {
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    color: var(--header-text, #333);
    font-size: clamp(0.85rem, calc(1vw + 0.1rem), 0.95rem);
    letter-spacing: 0.02em;
    padding: 10px clamp(8px, 1vw, 12px); /* Padding rapat & responsif */
    display: block;
    transition: 0.3s;
}

.st-menu li a:hover, 
.st-menu-bottom li a:hover {
    color: var(--accent-color);
}

/* --- 5. SUB MENU / DROPDOWN --- */
.st-menu .sub-menu,
.st-menu-bottom .sub-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(15px);
    background: var(--header-bg, #ffffff);
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
    z-index: 100;
}

.st-menu li:hover > .sub-menu,
.st-menu-bottom li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.st-menu .sub-menu li a,
.st-menu-bottom .sub-menu li a {
    padding: clamp(8px, 1vh, 12px) 20px;
    font-weight: 500;
    font-size: 0.9rem;
}

/* --- 6. LUXURY ELEMENTS (Desktop Only) --- */
.st-luxury-contact {
    display: flex;
    gap: clamp(1rem, 2vw, 2rem);
    /* Kembali ke awal: merapat ke kiri (sejajar dengan konten di bawahnya) */
    justify-content: flex-start; 
}

.st-luxury-social {
    display: flex;
    gap: clamp(0.75rem, 1.5vw, 1.5rem);
    /* Kembali ke awal: merapat ke kanan */
    justify-content: flex-end;
}

/* Pastikan tidak ada padding sisa dari percobaan sebelumnya */
.st-luxury-contact, 
.st-luxury-social {
    padding-left: 0;
    padding-right: 0;
}

.st-luxury-item {
    text-decoration: none;
    color: var(--header-text);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    padding: 5px 12px;
    border-radius: 20px;
}

.st-luxury-item i {
    color: var(--accent-color);
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.st-luxury-item:hover {
    background: rgba(var(--accent-color), 0.05);
    color: var(--accent-color);
}

/* --- 7. HEADER ACTIONS (Standard Layout) --- */
.st-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: flex-end;
}

/* --- HOVER EFFECT UNTUK WHATSAPP --- */
.st-header-wa-clean {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 600;
    color: var(--accent-color);
    transition: all 0.3s ease; /* Transisi halus untuk semua perubahan */
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(var(--accent-rgb), 0.03); /* Background sangat tipis */
}

.st-header-wa-clean:hover {
    color: var(--header-text, #333); /* Berubah warna teks saat hover */
    background: rgba(var(--accent-rgb), 0.1); /* Background sedikit lebih gelap */
    transform: translateY(-2px); /* Efek melayang sedikit */
}

.st-header-wa-clean i {
    color: #25d366; /* Tetap hijau khas WA */
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.st-header-wa-clean:hover i {
    transform: scale(1.2) rotate(10deg); /* Ikon WA sedikit membesar dan miring */
}

/* Efek Klik */
.st-header-wa-clean:active {
    transform: scale(0.95);
}

/* --- 8. STANDARISASI RESPONSIVE (Target: Smartphone < 768px) --- */

/* A. STATE: TABLET & DESKTOP (>= 768px) */
@media (min-width: 768px) {
    .desktop-only, 
    .st-site-header { 
        display: block !important; 
    }
    
    .mobile-only,
    .st-mobile-app-header,
    .st-mobile-trigger,
    #mobile-menu-trigger { 
        display: none !important; 
    }

    /* Memastikan layout header tetap grid/flex di tablet lebar */
    .st-header-grid { display: grid !important; }
    .st-header-stacked { display: flex !important; }
}

/* B. STATE: SMARTPHONE (< 768px) */
@media (max-width: 767px) {
    /* Teknik Off-Screen untuk SEO pada Header Desktop */
    .st-site-header.desktop-only {
        display: block !important; /* Tetap ada di DOM untuk Googlebot */
        position: absolute !important;
        left: -9999px !important;
        top: -9999px !important;
        width: 1px !important;
        height: 1px !important;
        overflow: hidden !important;
        visibility: hidden;
        pointer-events: none;
    }

    /* Header Mobile App tetap tampil normal */
    .mobile-only,
    .st-mobile-app-header {
        display: block !important;
    }

    body {
        padding-bottom: 75px; 
    }
}

/* --- 9. MEGA MENU FIX (Hanya Aktif di Desktop) --- */
@media (min-width: 1025px) {
    /* (Kode Mega Menu Anda yang sudah ada tetap di sini) */
    .st-header-grid .st-menu li.mega-menu:hover > .sub-menu {
        display: flex !important;
        /* ... rest of your mega menu code ... */
    }
}

/* --- SIMPLE MEGA MENU FIX --- */

/* 1. Membuat Sub Menu pada Mega Menu menjadi lebar */
.st-menu-bottom li.mega-menu:hover > .sub-menu {
    display: flex;
    flex-direction: row; /* Berjejer ke samping */
    gap: 30px;
    padding: 25px;
    min-width: 500px; /* Lebar minimum agar tidak sesak */
    left: auto;
    right: 0; /* Menempel ke kanan agar tidak keluar layar */
    transform: translateY(0);
}

/* 2. Menghilangkan efek 'absolute' pada sub-menu level 3 agar tidak menumpuk */
.st-menu-bottom li.mega-menu .sub-menu .sub-menu {
    position: static; /* Kembali ke aliran teks biasa */
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    padding: 0 0 0 15px; /* Geser sedikit ke kanan untuk hierarki */
    transform: none;
    display: block; /* Selalu terlihat */
    min-width: auto;
    background: transparent;
}

/* 3. Merapikan tampilan teks */
.st-menu-bottom li.mega-menu .sub-menu li {
    margin-bottom: 10px;
}

.st-menu-bottom li.mega-menu .sub-menu li a {
    padding: 5px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* Judul Kategori (Flower Decoration, Parcel) dibuat lebih tegas */
.st-menu-bottom li.mega-menu > .sub-menu > li > a {
    font-weight: 800;
    color: var(--accent-color);
    text-transform: uppercase;
    border-bottom: 2px solid var(--accent-color);
    margin-bottom: 10px;
}

/* --- MEGA MENU KHUSUS STANDARD LAYOUT --- */

/* 1. Pastikan Container Standard Layout bisa menampung dropdown lebar */
.st-header-grid {
    position: relative;
}

/* 2. Style Sub-Menu Utama (Level 2) pada Mega Menu */
.st-header-grid .st-menu li.mega-menu:hover > .sub-menu {
    display: flex !important;
    flex-direction: row;
    gap: 40px;
    padding: 30px;
    min-width: 600px; /* Lebar Mega Menu */
    left: auto;
    right: 0; /* Menempel ke kanan agar tidak menabrak logo di kiri */
    transform: translateY(0);
    border-top: 3px solid var(--accent-color);
    border-radius: 0 0 10px 10px;
}

/* 3. Style Sub-Menu di Dalamnya (Level 3 - Flower Decoration, Parcel, dll) */
/* Kita buat Static agar tidak menumpuk */
.st-header-grid .st-menu li.mega-menu .sub-menu .sub-menu {
    position: static !important; /* KUNCINYA: Menghilangkan absolute agar tidak menumpuk */
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: none !important;
    padding: 10px 0 0 0 !important;
    margin: 0 !important;
    transform: none !important;
    background: transparent !important;
    min-width: auto !important;
}

/* 4. Merapikan Teks Judul Kategori di dalam Mega Menu */
.st-header-grid .st-menu li.mega-menu > .sub-menu > li > a {
    font-weight: 800 !important;
    color: var(--header-text) !important;
    text-transform: uppercase;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--accent-color);
    margin-bottom: 10px;
    padding-bottom: 5px;
}

/* 5. Merapikan Teks Anak Menu (Level 3) */
.st-header-grid .st-menu li.mega-menu .sub-menu .sub-menu li a {
    font-weight: 500 !important;
    font-size: 0.9rem !important;
    color: var(--header-text) !important;
    padding: 5px 0 !important;
    border: none !important;
}

.st-header-grid .st-menu li.mega-menu .sub-menu .sub-menu li a:hover {
    color: var(--accent-color) !important;
    padding-left: 5px !important;
}

/* --- DROPDOWN ARROW INDICATOR --- */

/* Menambahkan arrow pada menu yang memiliki sub-menu */
.menu-item-has-children > a::after {
    content: '\f107'; /* Kode icon angle-down dari FontAwesome */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-left: 8px;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    display: inline-block;
    vertical-align: middle;
    opacity: 0.7;
}

/* Efek rotasi saat menu di-hover */
.menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
    color: var(--accent-color);
    opacity: 1;
}

/* Menghilangkan arrow pada sub-menu level 3 agar tidak terlalu ramai (Opsional) */
/* Jika Anda ingin arrow di sub-menu juga, hapus bagian bawah ini */
.sub-menu .menu-item-has-children > a::after {
    content: '\f105'; /* Icon angle-right untuk sub-menu ke samping */
    float: right;
    margin-top: 3px;
}

.sub-menu .menu-item-has-children:hover > a::after {
    transform: translateX(3px);
}

/* Update di navbar.css atau header.css */

/* Sembunyikan Header Desktop HANYA di layar smartphone */
@media (max-width: 767px) {
    .desktop-only, 
    .st-site-header { 
        display: none !important; 
    }
}

/* Tampilkan Header Desktop di Tablet & Desktop (> 768px) */
@media (min-width: 768px) {
    .desktop-only { 
        display: block !important; 
    }
    .st-site-header { 
        display: block !important; 
    }
    
    /* Pastikan hamburger menu yang mungkin ada di layout desktop tersembunyi */
    .st-mobile-trigger, 
    #mobile-menu-trigger { 
        display: none !important; 
    }
}