/* ============================================
   Mobile Bottom Navigation Bar
   ============================================ */

/* Hide desktop nav on mobile, show bottom nav */
@media (max-width: 992px) {
    /* Hide side navigation */
    .main-nav,
    .mobile-menu-toggle,
    .mobile-menu-overlay {
        display: none !important;
    }

    /* Show bottom navigation */
    .mobile-bottom-nav {
        display: flex !important;
    }

    /* Center logo on mobile header */
    .website-header .header-wrapper {
        justify-content: center !important;
    }

    .website-header .logo-container {
        margin: 0 auto;
    }
}

/* Bottom Navigation Container */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--white);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.bottom-nav-container {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10px;
    gap: 8px;
}

/* Navigation Items */
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #6b7280;
    transition: all 0.3s ease;
    padding: 8px 4px;
    border-radius: 12px;
    position: relative;
    min-width: 0;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item:hover,
.bottom-nav-item:focus {
    color: var(--primary-blue);
    background: rgba(30, 64, 175, 0.05);
    text-decoration: none;
}

.bottom-nav-item.active {
    color: var(--primary-blue);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 3px;
    background: var(--primary-blue);
    border-radius: 0 0 3px 3px;
}

/* Icon Styling */
.bottom-nav-item .nav-icon {
    font-size: 1.4rem;
    margin-bottom: 4px;
    transition: all 0.3s ease;
    display: block;
}

.bottom-nav-item.active .nav-icon {
    transform: scale(1.1);
    color: var(--primary-blue);
}

/* Text Label */
.bottom-nav-item .nav-label {
    font-size: 0.7rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Language Dropdown in Bottom Nav */
.bottom-nav-dropdown {
    position: relative;
}

.bottom-nav-dropdown .dropdown-menu {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 10px;
    border-radius: 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    min-width: 120px;
}

.bottom-nav-dropdown .dropdown-item {
    padding: 10px 15px;
    font-size: 0.85rem;
}

/* ============================================
   WhatsApp Floating Button
   ============================================ */

.whatsapp-float {
    position: fixed;
    bottom: 80px;
    left: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 999;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    animation: pulse-whatsapp 2s ease-in-out infinite;
}

[dir="ltr"] .whatsapp-float {
    left: auto;
    right: 20px;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
    text-decoration: none;
}

.whatsapp-float i {
    font-size: 2rem;
    color: white;
}

/* Tooltip */
.whatsapp-float::before {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 15px;
    padding: 8px 12px;
    background: #128C7E;
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

[dir="ltr"] .whatsapp-float::before {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: 15px;
}

.whatsapp-float::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 6px 6px 0;
    border-color: transparent #128C7E transparent transparent;
    opacity: 0;
    transition: all 0.3s ease;
}

[dir="ltr"] .whatsapp-float::after {
    left: auto;
    right: 100%;
    border-width: 6px 0 6px 6px;
    border-color: transparent transparent transparent #128C7E;
}

.whatsapp-float:hover::before,
.whatsapp-float:hover::after {
    opacity: 1;
}

/* Pulse Animation */
@keyframes pulse-whatsapp {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(37, 211, 102, 0.7), 0 0 0 10px rgba(37, 211, 102, 0.1);
    }
}

/* Hide on Desktop */
@media (min-width: 993px) {
    .mobile-bottom-nav {
        display: none !important;
    }

    .whatsapp-float {
        bottom: 30px;
        width: 65px;
        height: 65px;
    }

    .whatsapp-float i {
        font-size: 2.2rem;
    }
}

/* Responsive Adjustments */
@media (max-width: 576px) {
    .bottom-nav-container {
        padding: 0 8px;
        gap: 6px;
    }

    .bottom-nav-item .nav-icon {
        font-size: 1.3rem;
        margin-bottom: 3px;
    }

    .bottom-nav-item .nav-label {
        font-size: 0.65rem;
    }

    .bottom-nav-item {
        padding: 6px 8px;
        min-width: 50px;
        max-width: 75px;
    }

    .whatsapp-float {
        width: 55px;
        height: 55px;
        bottom: 75px;
        left: 15px;
    }

    [dir="ltr"] .whatsapp-float {
        left: auto;
        right: 15px;
    }

    .whatsapp-float i {
        font-size: 1.8rem;
    }
}

@media (max-width: 400px) {
    .mobile-bottom-nav {
        padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    }

    .bottom-nav-container {
        padding: 0 5px;
        gap: 4px;
    }

    .bottom-nav-item .nav-icon {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }

    .bottom-nav-item .nav-label {
        font-size: 0.6rem;
    }

    .bottom-nav-item {
        padding: 5px 6px;
        min-width: 45px;
        max-width: 70px;
    }

    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 70px;
        left: 12px;
    }

    [dir="ltr"] .whatsapp-float {
        left: auto;
        right: 12px;
    }

    .whatsapp-float i {
        font-size: 1.6rem;
    }
}

/* Add bottom padding to body when bottom nav is visible */
@media (max-width: 992px) {
    body {
        padding-bottom: 70px;
    }

    /* Adjust main content */
    main {
        margin-bottom: 20px;
    }
}

/* Ensure content doesn't hide behind bottom nav */
.website-footer {
    margin-bottom: 0;
}

/* Accessibility */
.bottom-nav-item:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Active state animation */
.bottom-nav-item.active .nav-icon {
    animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {
    0%, 100% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* WhatsApp Button Accessibility */
.whatsapp-float:focus {
    outline: 3px solid #25D366;
    outline-offset: 3px;
}

/* Performance Optimization */
.mobile-bottom-nav,
.whatsapp-float {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Smooth transitions */
.bottom-nav-item * {
    transition: all 0.3s ease;
}
