/**
 * Mobile Header Styles
 * Hamburger menu with slide-in sidebar from left
 * Primary: #19868b | Secondary: #e1273d
 */

/* ========================================
   MOBILE HEADER BAR
   ======================================== */

/* Mobile header - only visible on tablet and mobile */
.mobile-header {
    display: none;
    position: fixed;
    top: 44px; /* Below topbar */
    left: 0;
    right: 0;
    z-index: 9999995;
    background: #ffffff;
    height: 60px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: top 0.3s ease;
}

/* When scrolled, topbar hides so mobile header goes to top */
body.scrolled .mobile-header {
    top: 0;
}

.mobile-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 15px;
}

/* Hamburger Button */
.mobile-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background: #333333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger animation when open */
.mobile-hamburger.active .hamburger-icon span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-hamburger.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-hamburger.active .hamburger-icon span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Logo */
.mobile-header-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.mobile-header-logo img {
    max-height: 45px;
    width: auto;
}

/* Mobile Header Icons (right side) */
.mobile-header-icons {
    display: flex;
    align-items: center;
    gap: 5px;
}

.mobile-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #333333;
    font-size: 18px;
    text-decoration: none;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.mobile-header-icon:hover {
    background: rgba(25, 134, 139, 0.1);
    color: #19868b;
}

/* ========================================
   MOBILE SIDEBAR MENU
   ======================================== */

/* Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 340px;
    max-width: 90vw;
    height: 100vh;
    background: #ffffff;
    z-index: 99999999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.2);
}

.mobile-sidebar.active {
    transform: translateX(0);
}

/* RTL Support - sidebar from right */
[dir="rtl"] .mobile-sidebar {
    left: auto;
    right: 0;
    transform: translateX(100%);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
}

[dir="rtl"] .mobile-sidebar.active {
    transform: translateX(0);
}

/* Sidebar Header */
.mobile-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.mobile-sidebar-logo img {
    max-height: 50px;
    width: auto;
}

.mobile-sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #666;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.mobile-sidebar-close:hover {
    background: rgba(225, 39, 61, 0.1);
    color: #e1273d;
}

/* Sidebar Navigation */
.mobile-sidebar-nav {
    padding: 15px 0;
}

.mobile-nav-item {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    color: #333333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover {
    background: rgba(25, 134, 139, 0.05);
    color: #19868b;
}

.mobile-nav-link i {
    font-size: 14px;
    color: #999;
    transition: transform 0.3s ease;
}

.mobile-nav-item.open > .mobile-nav-link i {
    transform: rotate(90deg);
}

[dir="rtl"] .mobile-nav-item.open > .mobile-nav-link i {
    transform: rotate(-90deg);
}

/* Submenu */
.mobile-submenu {
    display: none;
    background: #f8f9fa;
    padding: 0;
    list-style: none;
    margin: 0;
}

.mobile-nav-item.open > .mobile-submenu {
    display: block;
}

.mobile-submenu-item {
    border-bottom: 1px solid #eee;
}

.mobile-submenu-item:last-child {
    border-bottom: none;
}

.mobile-submenu-link {
    display: flex;
    align-items: center;
    padding: 12px 20px 12px 35px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

[dir="rtl"] .mobile-submenu-link {
    padding: 12px 35px 12px 20px;
}

.mobile-submenu-link:hover {
    background: rgba(25, 134, 139, 0.08);
    color: #19868b;
}

.mobile-submenu-link img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    margin-right: 10px;
}

[dir="rtl"] .mobile-submenu-link img {
    margin-right: 0;
    margin-left: 10px;
}

.mobile-submenu-link i {
    margin-right: 10px;
    font-size: 14px;
    color: #19868b;
}

[dir="rtl"] .mobile-submenu-link i {
    margin-right: 0;
    margin-left: 10px;
}

/* Nested Submenu (Level 2) */
.mobile-nested-submenu {
    display: none;
    background: #f0f0f0;
    padding: 0;
    list-style: none;
    margin: 0;
}

.mobile-submenu-item.open > .mobile-nested-submenu {
    display: block;
}

.mobile-nested-link {
    display: flex;
    align-items: center;
    padding: 10px 20px 10px 50px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s ease;
}

[dir="rtl"] .mobile-nested-link {
    padding: 10px 50px 10px 20px;
}

.mobile-nested-link:hover {
    background: rgba(25, 134, 139, 0.1);
    color: #19868b;
}

.mobile-nested-link img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    margin-right: 8px;
}

[dir="rtl"] .mobile-nested-link img {
    margin-right: 0;
    margin-left: 8px;
}

/* Sidebar Footer */
.mobile-sidebar-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.mobile-sidebar-contact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-sidebar-contact a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.mobile-sidebar-contact a:hover {
    color: #19868b;
}

.mobile-sidebar-contact i {
    width: 20px;
    color: #19868b;
}

.mobile-sidebar-social {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.mobile-sidebar-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #19868b;
    color: #ffffff;
    border-radius: 50%;
    font-size: 18px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.mobile-sidebar-social a:hover {
    background: #0d6d71;
    transform: translateY(-2px);
}

/* Individual social icon colors on hover */
.mobile-sidebar-social a[href*="facebook"]:hover {
    background: #1877f2;
}

.mobile-sidebar-social a[href*="instagram"]:hover {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.mobile-sidebar-social a[href*="twitter"]:hover,
.mobile-sidebar-social a[href*="x.com"]:hover {
    background: #1da1f2;
}

.mobile-sidebar-social a[href*="linkedin"]:hover {
    background: #0077b5;
}

.mobile-sidebar-social a[href*="youtube"]:hover {
    background: #ff0000;
}

.mobile-sidebar-social a[href*="tiktok"]:hover {
    background: #000000;
}

.mobile-sidebar-social a[href*="whatsapp"]:hover {
    background: #25d366;
}

.mobile-sidebar-social a[href*="snapchat"]:hover {
    background: #fffc00;
    color: #000;
}

/* ========================================
   RESPONSIVE VISIBILITY
   ======================================== */

/* Show mobile header on tablet and mobile */
@media (max-width: 991px) {
    .mobile-header {
        display: block;
    }
    
    /* Hide desktop header on mobile */
    .main-header {
        display: none !important;
    }
    
    /* Adjust body padding for mobile header */
    body {
        padding-top: 104px !important; /* topbar (44px) + mobile header (60px) */
    }
    
    body.scrolled {
        padding-top: 60px !important; /* only mobile header when topbar hidden */
    }
}

@media (max-width: 768px) {
    .mobile-header {
        top: 40px; /* Smaller topbar on tablet */
        height: 56px;
    }
    
    body {
        padding-top: 96px !important; /* topbar (40px) + mobile header (56px) */
    }
    
    body.scrolled {
        padding-top: 56px !important;
    }
    
    .mobile-header-logo img {
        max-height: 40px;
    }
    
    .mobile-sidebar {
        width: 320px;
    }
}

@media (max-width: 576px) {
    .mobile-header {
        top: 36px; /* Even smaller topbar on mobile */
        height: 52px;
    }
    
    body {
        padding-top: 88px !important; /* topbar (36px) + mobile header (52px) */
    }
    
    body.scrolled {
        padding-top: 52px !important;
    }
    
    .mobile-header-logo img {
        max-height: 36px;
    }
    
    .mobile-hamburger {
        width: 40px;
        height: 40px;
    }
    
    .hamburger-icon {
        width: 22px;
        height: 16px;
    }
    
    .mobile-header-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .mobile-sidebar {
        width: 300px;
    }
    
    .mobile-sidebar-social a {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* ========================================
   BODY SCROLL LOCK
   ======================================== */

body.mobile-menu-open {
    overflow: hidden;
}
