/* ============================================
   HEADER STYLES - REUSABLE COMPONENT
   ============================================ */

/* Debug: Add a visible indicator that header styles are loaded */
.header::after {
    content: "Header Styles Loaded";
    position: fixed;
    top: 0;
    right: 0;
    background: #28a745;
    color: white;
    padding: 4px 8px;
    font-size: 10px;
    z-index: 9999;
    display: none;
    /* Hide by default, can be enabled for debugging */
}

/* Header Prettification */
.header-container {
    max-width: 1320px;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

.header-logo img {
    width: auto;
    transition: transform 0.3s ease;
}

.header-logo:hover img {
    transform: scale(1.05);
}

.menu__nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu__nav li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.menu__nav li a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.menu__nav li a::after {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background: white;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.menu__nav li a:hover::after {
    width: 80%;
}

.header-nav-desktop {
    margin-right: 30px;
    display: none;
}

@media screen and (min-width: 1200px) {

    .header .header-nav-desktop,
    .header .d-flex.items-center .header-nav-desktop {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
    }
}

@media screen and (max-width: 1199px) {

    .header .header-nav-desktop,
    .header .d-flex.items-center .header-nav-desktop {
        display: none !important;
        visibility: hidden !important;
    }
}

.header-nav-list {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-nav-list li {
    margin: 0;
    padding: 0;
}

.header-nav-list li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.header.bg-white .header-nav-list li a {
    color: #13357b;
}

.header-nav-list li a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.header.bg-white .header-nav-list li a:hover {
    background: rgba(19, 53, 123, 0.08);
}

.header-nav-list li a::after {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background: white;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.header.bg-white .header-nav-list li a::after {
    background: #13357b;
}

.header-nav-list li a:hover::after {
    width: 80%;
}

.nav-item-dropdown {
    position: relative;
    overflow: visible;
}

.header .header-container,
.header-nav-desktop,
.header-nav-desktop .header-nav-list {
    overflow: visible;
}

.nav-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.header.bg-white .header-nav-list .nav-dropdown-trigger,
.header.bg-white .header-nav-list .nav-dropdown-arrow {
    color: #13357b;
}

.nav-dropdown-arrow {
    font-size: 10px;
    transition: transform 0.25s ease;
}

.nav-item-dropdown:hover .nav-dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    display: flex;
    min-width: 220px;
    background: rgba(19, 53, 123, 0.98);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 10001;
    pointer-events: none;
    overflow: visible;
}

.nav-item-dropdown:hover .nav-dropdown-menu,
.nav-item-dropdown.nav-dropdown-open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-dropdown-menu-left {
    max-height: 70vh;
    overflow-y: auto;
    padding: 8px 0;
}

.nav-dropdown-menu-left ul {
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: 220px;
}

.nav-dropdown-item {
    position: relative;
}

.nav-dropdown-item>a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
}

.header.bg-white .nav-dropdown-menu .nav-dropdown-item>a,
.header.bg-white .nav-dropdown-menu .nav-dropdown-jadwal-list li a,
.header.bg-white .nav-dropdown-menu .nav-dropdown-jadwal-title,
.header.bg-white .nav-dropdown-menu .nav-dropdown-jadwal-empty {
    color: #ffffff;
}

.header.bg-white .nav-dropdown-menu .nav-dropdown-jadwal-title {
    color: rgba(255, 255, 255, 0.95);
}

.header.bg-white .nav-dropdown-menu .nav-dropdown-jadwal-empty {
    color: rgba(255, 255, 255, 0.85);
}

.header.bg-white .nav-dropdown-menu .nav-dropdown-sub-arrow {
    color: rgba(255, 255, 255, 0.9);
}

.nav-dropdown-item>a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-dropdown-sub-arrow {
    font-size: 10px;
    opacity: 0.8;
    margin-left: 8px;
}

.nav-dropdown-jadwal-panel {
    position: relative;
    min-width: 0;
    width: 0;
    max-height: 70vh;
    overflow: hidden;
    padding: 0;
    border-left: none;
    margin-left: 0;
    margin-right: 0;
    transition: min-width 0.2s ease, width 0.2s ease, padding 0.2s ease, border 0.2s ease, margin 0.2s ease;
}

.nav-dropdown-jadwal-panel:has(.nav-dropdown-jadwal-list.is-visible) {
    min-width: 260px;
    width: auto;
    max-width: 320px;
    overflow-y: auto;
    padding: 12px 0;
    margin-right: 24px;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.nav-dropdown-jadwal-list {
    display: none;
    padding: 0 12px;
}

.nav-dropdown-jadwal-list.is-visible {
    display: block;
}

.nav-dropdown-jadwal-title {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 8px;
    padding: 0 4px;
}

.nav-dropdown-jadwal-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-dropdown-jadwal-list li a {
    display: block;
    padding: 8px 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    border-radius: 6px;
    white-space: nowrap;
}

.nav-dropdown-jadwal-list li a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-dropdown-jadwal-empty {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 4px;
}

.mobile-menu-item-has-children .mobile-menu-sub {
    list-style: none;
    margin: 0;
    padding: 8px 0 8px 16px;
    border-left: 2px solid rgba(255, 255, 255, 0.25);
}

.mobile-menu-item-has-children .mobile-menu-sub li {
    margin-bottom: 4px;
}

.mobile-menu-item-has-children .mobile-menu-sub li a {
    font-size: 15px;
    padding: 10px 16px;
}

.mobile-menu-sub-item a {
    font-size: 14px !important;
    opacity: 0.95;
}


.header-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn.login {
    background: white;
    color: #13357b;
    border: 2px solid white;
}

.header-btn.login:hover {
    background: transparent;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.header-btn.register {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.header-btn.register:hover {
    background: white;
    color: #13357b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.header-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    color: #13357b;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid white;
    position: relative;
}

.header-icon-btn:hover {
    background: transparent;
    color: white;
    transform: unset;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* Ensure icons turn white on hover */
.header-icon-btn:hover i.fas.fa-cart-shopping,
.header-icon-btn:hover i.fas.fa-user-circle {
    color: white !important;
}

.header-icons-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 20px;
}

.header-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 32px;
    color: white !important;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    font-size: 18px;
}

.header.bg-white .header-icon-link,
.header.bg-white .header-icon-link i {
    color: #13357b !important;
}

.header-icon-link:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

.header-icon-link i {
    color: white !important;
    font-size: 18px;
}

.header-icon-link .cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10;
}

@media (min-width: 1200px) {
    .header-icon-link {
        width: 30px;
        height: 32px;
    }
}

.menu-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 18px;
    padding: 10px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.menu-toggle:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}


/* Mobile Menu Modal - Clean Design */
.mobile-menu-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-modal.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 400px;
    height: 100%;
    background: #13357b;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mobile-menu-modal.is-active .mobile-menu-content {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(19, 53, 123, 0.95);
}

.mobile-menu-logo {
    flex: 1;
    display: flex;
    align-items: center;
}

.mobile-menu-logo img {
    height: 45px;
    width: auto;
    object-fit: contain;
}

.mobile-menu-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.mobile-menu-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu-list li {
    margin-bottom: 8px;
}

.mobile-menu-list li a {
    display: block;
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    padding: 16px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: transparent;
}

.mobile-menu-list li a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

@media (min-width: 1200px) {
    .mobile-menu-modal {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding-right: 10px;
        padding-left: 10px;
    }

    .header-logo img {
        height: 45px !important;
    }

    .header-icons-wrapper {
        gap: 8px;
        margin-left: 10px !important;
    }

    .header-icon-link {
        font-size: 16px;
        width: 28px;
        height: 28px;
    }
}

/* Only add position relative to header cart icon containers */
header a[href*="productcart"] {
    position: relative;
}

/* Ensure header cart icon maintains its color - Desktop only */
@media (min-width: 1200px) {
    header a[href*="productcart"] i.fas.fa-cart-shopping {
        color: #13357b !important;
    }
}

/* Ensure cart icons in header maintain proper styling */
header .header-icon-btn i.fas.fa-cart-shopping,
header .d-flex.items-center.text-inherit i.fas.fa-cart-shopping {
    color: #13357b !important;
    opacity: 1 !important;
    filter: none !important;
}

/* Ensure cart icon containers maintain proper color inheritance */
header a[href*="productcart"] {
    color: #13357b !important;
}

/* Ensure user icon maintains proper color */
header .header-icon-btn i.fas.fa-user-circle,
header .d-flex.items-center.text-inherit i.fas.fa-user-circle {
    color: #13357b !important;
    opacity: 1 !important;
    filter: none !important;
}


/* Ensure cart badge only appears on header cart icons */
header .cart-badge {
    position: absolute;
    top: -19% !important;
    right: -15% !important;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: bold;
    display: flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-width: 18px;
    z-index: 10;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Header consistency styles for all pages - Higher specificity */
header .header-icon-btn i.fas.fa-cart-shopping,
header .d-flex.items-center.text-inherit i.fas.fa-cart-shopping,
.header .header-icon-btn i.fas.fa-cart-shopping,
.header .d-flex.items-center.text-inherit i.fas.fa-cart-shopping {
    color: #13357b !important;
    opacity: 1 !important;
    filter: none !important;
}

header .header-icon-btn i.fas.fa-user-circle,
header .d-flex.items-center.text-inherit i.fas.fa-user-circle,
.header .header-icon-btn i.fas.fa-user-circle,
.header .d-flex.items-center.text-inherit i.fas.fa-user-circle {
    color: #13357b !important;
    opacity: 1 !important;
    filter: none !important;
}


.header-icon-btn:hover i.fas.fa-cart-shopping,
.header-icon-btn:hover i.fas.fa-user-circle,
.header .header-icon-btn:hover i.fas.fa-cart-shopping,
.header .header-icon-btn:hover i.fas.fa-user-circle {
    color: white !important;
}

/* Additional specificity for header elements */
.header[data-add-bg] .header-icon-btn i.fas.fa-cart-shopping,
.header[data-add-bg] .header-icon-btn i.fas.fa-user-circle,
.header[data-add-bg] .d-flex.items-center.text-inherit i.fas.fa-cart-shopping,
.header[data-add-bg] .d-flex.items-center.text-inherit i.fas.fa-user-circle {
    color: #13357b !important;
    opacity: 1 !important;
    filter: none !important;
}


.header[data-add-bg] .header-icon-btn:hover i.fas.fa-cart-shopping,
.header[data-add-bg] .header-icon-btn:hover i.fas.fa-user-circle {
    color: white !important;
}

/* Ensure header icons wrapper is always visible */
.header-icons-wrapper {
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
    display: flex !important;
}

/* Keep mobile menu button white on all states */
.header .menu-toggle {
    color: white !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.header.bg-white .menu-toggle,
.header.bg-white .menu-toggle i {
    color: #13357b !important;
    background: rgba(19, 53, 123, 0.08) !important;
    border: 1px solid rgba(19, 53, 123, 0.2) !important;
}

.header .menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

.header.bg-white .menu-toggle:hover {
    background: rgba(19, 53, 123, 0.15) !important;
}

/* Ensure menu button icon is always white */
.header .menu-toggle i {
    color: white !important;
}

@media screen and (min-width: 768px) {

    .header .menu-toggle,
    .header .header-icons-wrapper .menu-toggle,
    .menu-toggle {
        display: none !important;
        visibility: hidden !important;
    }
}

@media screen and (max-width: 767px) {

    .header .menu-toggle,
    .header .header-icons-wrapper .menu-toggle,
    .menu-toggle {
        display: flex !important;
        visibility: visible !important;
    }
}

/* Override main.css - prevent header background change when menu is opened */
.header.is-menu-opened {
    background-color: transparent !important;
    border-bottom: none !important;
}

/* Ensure header maintains original styling when menu is opened */
.header.is-menu-opened[data-add-bg] {
    background-color: var(--color-dark-3) !important;
}

/* Ensure cart badge stays red */
.cart-badge {
    background: #ff4757 !important;
    opacity: 1 !important;
}