/* ============================================
   MEGA MENU STYLES
   ============================================ */

.megamenu-wrapper {
    position: relative;
    display: inline-block;
}

/* Trigger Button - Hiển thị trên cả desktop và mobile */
.megamenu-trigger {
    background: #0033cc;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.megamenu-trigger:hover {
    background: #0055ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.megamenu-trigger i {
    font-size: 14px;
}

/* ============================================
   DESKTOP - DROPDOWN 3 CỘT (Căn giữa)
   ============================================ */
.megamenu-desktop {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    min-width: 700px;
    max-width: 90vw;
}

.megamenu-wrapper:hover .megamenu-desktop,
.megamenu-wrapper.active .megamenu-desktop {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.megamenu-column {
    display: flex;
    flex-direction: column;
}

.megamenu-column-title {
    font-size: 16px;
    font-weight: 700;
    color: #FF8E23;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #FF8E23;
}

.megamenu-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.megamenu-item {
    margin-bottom: 10px;
}

.megamenu-item a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    padding: 6px 0;
}

.megamenu-item a i {
    font-size: 10px;
    color: #0033cc;
    transition: transform 0.3s ease;
}

.megamenu-item a:hover {
    color: #0033cc;
    padding-left: 5px;
}

.megamenu-item a:hover i {
    transform: translateX(3px);
}

/* ============================================
   MOBILE - OFF-CANVAS SLIDE FROM RIGHT
   ============================================ */
.megamenu-mobile {
    display: none;
}

/* Overlay backdrop */
.megamenu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.megamenu-mobile.active .megamenu-overlay {
    opacity: 1;
    visibility: visible;
}

/* Panel slide from right - Dưới header */
.megamenu-panel {
    position: fixed;
    top: 60px;
    right: -320px;
    width: 320px;
    height: calc(100% - 60px);
    background: white;
    box-shadow: -4px 0 20px rgba(0,0,0,0.2);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.megamenu-mobile.active .megamenu-panel {
    right: 0;
}

/* Close button */
.megamenu-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: #333;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.megamenu-close:hover {
    background: #f0f0f0;
    color: #FF6B00;
}

/* Panel header */
.megamenu-panel-header {
    padding: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.megamenu-panel-title {
    font-size: 20px;
    font-weight: 700;
    color: #0033cc;
    margin: 0;
}

.megamenu-dropdown {
    padding: 10px 0;
}

.megamenu-accordion-item {
    border-bottom: 1px solid #eee;
}

.megamenu-accordion-item:last-child {
    border-bottom: none;
}

.megamenu-accordion-header {
    width: 100%;
    background: white;
    border: none;
    padding: 15px 20px;
    text-align: left;
    font-size: 15px;
    font-weight: 700;
    color: #FF8E23;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.megamenu-accordion-header:hover {
    background: #f8f8f8;
}

.megamenu-accordion-header i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.megamenu-accordion-item.active .megamenu-accordion-header i {
    transform: rotate(180deg);
}

.megamenu-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f8f8f8;
}

.megamenu-accordion-item.active .megamenu-accordion-content {
    max-height: 400px;
}

.megamenu-accordion-content ul {
    list-style: none;
    margin: 0;
    padding: 10px 20px 15px;
}

.megamenu-accordion-content li {
    margin-bottom: 8px;
}

.megamenu-accordion-content a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    padding: 6px 0;
    transition: all 0.3s ease;
}

.megamenu-accordion-content a i {
    font-size: 10px;
    color: #0033cc;
}

.megamenu-accordion-content a:hover {
    color: #0033cc;
    padding-left: 5px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    /* Ẩn desktop dropdown trên mobile */
    .megamenu-desktop {
        display: none !important;
    }

    /* Hiển thị mobile panel */
    .megamenu-mobile {
        display: block;
    }

    /* Overlay cho mobile */
    .megamenu-overlay {
        top: 0;
    }
}

@media (min-width: 769px) {
    /* Ẩn mobile panel trên desktop */
    .megamenu-mobile {
        display: none !important;
    }
}
