/**
 * Website Layout Styles
 * Modern, clean CSS following best practices
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --primary-color: #008000;
    --primary-dark: #006400;
    --primary-light: rgba(0, 128, 0, 0.1);
    --white: #ffffff;
    --text-dark: #333;
    --border-color: rgba(0, 128, 0, 0.1);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.1);
    --transition-fast: 0.3s ease;
}

/* ========================================
   Top Bar with Social Media and Search
   ======================================== */
.top-bar {
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #e9ecef !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1040 !important;
    font-size: 0.9rem;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    height: auto !important;
    min-height: 42px;
    padding: 6px 0;
}

.top-bar.hidden {
    transform: translateY(-100%);
    opacity: 0;
}

/* Social Media Links - Adjusted for horizontal layout */
.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: transparent;
    border: 1px solid #dee2e6;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.social-link:hover {
    background-color: var(--primary-color);
    color: var(--white) !important;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 128, 0, 0.2);
}

.social-link i {
    font-size: 12px;
}

/* Search Form - Adjusted for horizontal layout */
.search-input-group {
    position: relative;
    max-width: 400px;
    width: 100%;
}

.search-input {
    background-color: var(--white);
    border: 1px solid #dee2e6;
    border-radius: 25px;
    padding: 6px 40px 6px 18px;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    box-shadow: none;
    min-width: 300px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 128, 0, 0.1);
    background-color: var(--white);
}

.search-btn {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-50%) scale(1.05);
}

.search-btn i {
    font-size: 11px;
}

/* ========================================
   Navbar Styles - ALWAYS VISIBLE, NEVER HIDDEN
   ======================================== */
.navbar,
.navbar.navbar-light,
.navbar.navbar-expand-lg,
.navbar-light,
.navbar-light.sticky-top,
.navbar.sticky-top,
nav.navbar {
    position: fixed !important;
    top: 48px !important;
    /* Height of top bar */
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1030 !important;
    background-color: var(--white) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    transition: top 0.3s ease-in-out !important;
    min-height: 60px !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    display: flex !important;
    pointer-events: auto !important;
}

/* DISABLED: Navbar should NEVER move when top-bar is hidden */
/* .navbar.top-bar-hidden,
.navbar.navbar-light.top-bar-hidden,
.navbar-light.sticky-top.top-bar-hidden,
.navbar.sticky-top.top-bar-hidden,
nav.navbar.top-bar-hidden {
    top: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
} */

/* Navbar ALWAYS stays at 48px, never moves */
.navbar.top-bar-hidden,
.navbar.navbar-light.top-bar-hidden,
.navbar-light.sticky-top.top-bar-hidden,
.navbar.sticky-top.top-bar-hidden,
nav.navbar.top-bar-hidden {
    top: 48px !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Navbar Brand Adjustments */
.navbar-brand h2 {
    font-size: 1.5rem;
}

/* Navbar Toggler - Always visible on mobile/tablet */
.navbar-toggler {
    display: block !important;
    border: 1px solid rgba(0, 128, 0, 0.2);
    padding: 0.5rem 0.75rem;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 128, 0, 0.25);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 128, 0, 0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar.top-bar-hidden {
    top: 0 !important;
    /* Move to top when top bar is hidden */
}

/* ========================================
   Dropdown Menus
   ======================================== */
.navbar-nav .dropdown-menu {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    z-index: 1060 !important;
    position: absolute !important;
    display: none;
}

.navbar-nav .dropdown-menu.show {
    display: block !important;
}

.navbar-nav .dropdown-item {
    color: var(--text-dark);
    padding: 0.5rem 1rem;
    transition: all var(--transition-fast);
    background-color: transparent;
}

.navbar-nav .dropdown-item:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.navbar-nav .dropdown-item.active {
    background-color: transparent !important;
    color: var(--primary-color);
    font-weight: 500;
}

.navbar-nav .dropdown-item:active,
.navbar-nav .dropdown-item:focus {
    background-color: var(--primary-light) !important;
    color: var(--primary-color);
}

/* ========================================
   Dropdown Container Fixes
   ======================================== */
.navbar-nav .dropdown {
    position: relative !important;
}

/* Ensure dropdown containers don't clip dropdowns */
.navbar-collapse,
.navbar-nav,
.nav-item.dropdown {
    overflow: visible !important;
}

/* Fix for containers that might hide dropdowns */
.container-fluid,
.navbar-expand-lg .navbar-collapse {
    overflow: visible !important;
}

/* Fix dropdown menus that extend beyond viewport on right side */
.navbar-nav .dropdown:last-child .dropdown-menu,
.navbar-nav .dropdown:nth-last-child(2) .dropdown-menu,
.navbar-nav .dropdown:nth-last-child(3) .dropdown-menu {
    left: auto !important;
    right: 0 !important;
}

/* Bootstrap dropdown-menu-end override for proper right alignment */
.navbar-nav .dropdown-menu.dropdown-menu-end {
    left: auto !important;
    right: -10px !important;
    transform: translateX(0) !important;
    min-width: 220px;
    max-width: 260px;
    white-space: normal;
    word-wrap: break-word;
}

/* Ensure dropdown items wrap text properly */
.navbar-nav .dropdown-menu.dropdown-menu-end .dropdown-item {
    white-space: normal;
    word-wrap: break-word;
    padding-right: 1rem;
}

/* Specific fix for More dropdown - ensure it stays within viewport */
.navbar-nav>.dropdown:last-of-type .dropdown-menu,
.navbar-nav .nav-item.dropdown:last-of-type .dropdown-menu {
    right: 10px !important;
    left: auto !important;
    transform: none !important;
    margin-right: 10px;
}

/* Force all right-side dropdowns to stay in viewport */
@media (min-width: 992px) {
    .navbar-nav .dropdown-menu.dropdown-menu-end {
        right: 0 !important;
        left: auto !important;
        margin-right: 15px;
        max-width: 250px;
    }

    .navbar-nav .dropdown-menu.dropdown-menu-end .dropdown-item {
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Ensure dropdown doesn't overflow viewport */
.navbar-nav .dropdown-menu {
    max-width: calc(100vw - 20px);
}

/* Prevent body/html from hiding dropdowns */
html,
body {
    overflow-x: clip;
}

/* Ensure navbar allows dropdown overflow */
.navbar {
    overflow: visible !important;
}

.navbar .container-fluid {
    overflow: visible !important;
}

/* ========================================
   Mega Dropdown - FIXED POSITIONING
   ======================================== */

.mega-dropdown {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    background: var(--white) !important;
    z-index: 1050 !important;
}

.mega-dropdown .container-fluid {
    max-width: 100% !important;
    padding: 2rem 1rem !important;
}

/* Mega Dropdown Header - Logo and Title on Left */
.mega-dropdown-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.mega-dropdown-header img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.mega-dropdown-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.5rem;
}

.mega-dropdown-header p {
    margin: 0;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.mega-dropdown-section {
    background: var(--white);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.mega-dropdown-section:hover {
    box-shadow: 0 4px 15px rgba(0, 128, 0, 0.1);
    transform: translateY(-2px);
}

.mega-dropdown-section h5 {
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.mega-dropdown-content .dropdown-item {
    padding: 0.5rem 0;
    border: none;
    background: none;
    transition: all var(--transition-fast);
}

.mega-dropdown-content .dropdown-item:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
    padding-left: 0.5rem;
    transform: translateX(5px);
}

/* ========================================
   Mobile User Menu
   ======================================== */
.mobile-user-menu {
    position: fixed;
    bottom: 70px;
    right: 10px;
    z-index: 1001;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 15px;
    min-width: 200px;
    border: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.user-avatar-large {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.user-icon-large {
    font-size: 40px;
    color: var(--primary-color);
    margin-right: 10px;
}

.user-name {
    font-weight: 500;
    color: var(--text-dark);
}

.logout-btn {
    background: none;
    border: none;
    color: #666;
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    transition: color var(--transition-fast);
    font-size: 14px;
    width: 100%;
}

.logout-btn:hover {
    color: var(--primary-color);
}

.logout-btn i {
    margin-right: 8px;
}

/* ========================================
   Mobile Bottom Navigation - Modern Design
   ======================================== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 128, 0, 0.1);
    z-index: 1050;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    display: none;
    /* Hidden by default, shown via media query */
}

/* Show bottom nav on tablet and mobile */
@media (max-width: 991.98px) {
    .mobile-bottom-nav {
        display: block !important;
    }
}

/* ========================================
   Fix Horizontal Scroll on Mobile
   ======================================== */
html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

@media (max-width: 991.98px) {

    .container-fluid,
    .container-xxl,
    .container {
        overflow-x: hidden;
        max-width: 100vw;
        padding-left: 12px;
        padding-right: 12px;
    }

    .row {
        margin-left: -6px;
        margin-right: -6px;
    }

    .row>* {
        padding-left: 6px;
        padding-right: 6px;
    }

    /* Fix owl carousel overflow */
    .owl-carousel,
    .header-carousel {
        max-width: 100vw;
        overflow: hidden;
    }

    /* Fix clients logo track */
    .clients-logo-container {
        max-width: 100vw;
        overflow: hidden;
    }

    .clients-logo-track {
        gap: 40px;
    }
}

.mobile-bottom-nav .nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
    max-width: 100%;
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #DC143C;
    transition: all 0.2s ease;
    padding: 6px 12px;
    border-radius: 12px;
    flex: 1;
    max-width: 80px;
    position: relative;
}

.mobile-bottom-nav .nav-item::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: transform 0.2s ease;
}

.mobile-bottom-nav .nav-item:hover,
.mobile-bottom-nav .nav-item.active {
    color: var(--primary-color);
}

.mobile-bottom-nav .nav-item.active::before {
    transform: translateX(-50%) scaleX(1);
}

.mobile-bottom-nav .nav-item.active i {
    transform: scale(1.1);
}

.mobile-bottom-nav .nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
    transition: transform 0.2s ease;
}

.mobile-bottom-nav .nav-item span {
    font-size: 9px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ========================================
   Mobile Sidebar for Mega Menus
   ======================================== */
.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1060;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: #fff;
    z-index: 1070;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

.mobile-sidebar.active {
    right: 0;
}

.mobile-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 128, 0, 0.1);
    background: linear-gradient(135deg, #008000 0%, #006400 100%);
    color: white;
}

.mobile-sidebar-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.mobile-sidebar-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.mobile-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mobile-sidebar-content {
    padding: 16px;
}

.mobile-sidebar-section {
    margin-bottom: 20px;
}

.mobile-sidebar-section h6 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 12px;
}

.mobile-sidebar-section a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.mobile-sidebar-section a:hover,
.mobile-sidebar-section a.active {
    background: rgba(0, 128, 0, 0.1);
    color: var(--primary-color);
}

.mobile-sidebar-section a i {
    width: 24px;
    margin-right: 10px;
    font-size: 1rem;
}

/* ========================================
   Mobile Header Actions
   ======================================== */
.mobile-header-actions {
    gap: 6px;
}

.mobile-signin-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 5px 10px !important;
    font-size: 0.7rem !important;
    border-radius: 6px !important;
    white-space: nowrap;
    font-weight: 500;
    gap: 4px;
    background-color: var(--primary-color) !important;
    color: #fff !important;
    text-decoration: none !important;
    border: none !important;
    box-shadow: none;
    transition: all 0.2s ease;
    height: auto !important;
    min-height: unset !important;
    line-height: 1.2;
}

.mobile-signin-btn:hover {
    background-color: var(--primary-dark) !important;
    color: #fff !important;
    text-decoration: none !important;
}

.mobile-signin-btn i {
    font-size: 0.65rem !important;
}

.mobile-signin-btn span {
    font-size: 0.7rem !important;
}

.mobile-avatar {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.mobile-user-icon {
    font-size: 1.75rem;
    color: var(--primary-color);
}

/* Desktop Button Styles */
.desktop-signin-btn {
    font-size: 0.9rem;
}

.desktop-avatar {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.desktop-user-icon {
    font-size: 2rem;
    color: var(--primary-color);
}

/* Navbar Logo */
.navbar-logo {
    height: 50px;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 991.98px) {
    body {
        padding-bottom: 70px;
        padding-top: 68px;
        /* Reduced - Account for top bar (32px) + navbar (36px) */
    }

    /* Top Bar Mobile Adjustments - More Compact */
    .top-bar {
        padding: 2px 0;
        min-height: 32px;
    }

    .top-bar .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .social-link {
        width: 22px;
        height: 22px;
        margin-right: 2px;
    }

    .social-link i {
        font-size: 9px;
    }

    .search-input-group {
        max-width: 160px;
    }

    .search-input {
        padding: 4px 28px 4px 10px;
        font-size: 0.7rem;
        min-width: 120px;
    }

    .search-btn {
        width: 22px;
        height: 22px;
    }

    .search-btn i {
        font-size: 8px;
    }

    /* Navbar adjustments for mobile/tablet - COMPACT HEIGHT */
    .navbar {
        top: 32px !important;
        min-height: 36px;
        /* Reduced */
        visibility: visible !important;
        opacity: 1 !important;
        padding: 0 !important;
    }

    .navbar.top-bar-hidden {
        top: 0 !important;
    }

    .navbar-brand {
        padding: 0.15rem 0.5rem !important;
    }

    .navbar-brand h2 {
        font-size: 1rem;
    }

    .navbar-logo {
        height: 28px !important;
    }

    .navbar-toggler {
        padding: 0.2rem 0.4rem;
        border: 1px solid rgba(0, 128, 0, 0.3);
    }

    .navbar-toggler-icon {
        width: 0.9em;
        height: 0.9em;
    }

    /* Mobile collapsed menu styling */
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        border-top: 1px solid rgba(0, 128, 0, 0.1);
        max-height: calc(100vh - 150px);
        overflow-y: auto;
        overflow-x: visible !important;
        z-index: 1050 !important;
    }

    /* Mobile dropdown menu fixes */
    @media (max-width: 991.98px) {
        .navbar-nav .dropdown-menu {
            position: static !important;
            float: none;
            width: auto;
            margin-top: 0;
            background-color: transparent;
            border: 0;
            box-shadow: none;
            padding-left: 1rem;
        }

        .navbar-nav .dropdown-menu.show {
            display: block !important;
        }

        .navbar-nav .dropdown-item {
            padding: 0.5rem 1rem;
            color: var(--text-dark);
        }

        .navbar-nav .dropdown-item:hover,
        .navbar-nav .dropdown-item:focus {
            background-color: var(--primary-light);
            color: var(--primary-color);
        }
    }

    /* Ensure collapse is hidden by default */
    .navbar-collapse:not(.show) {
        display: none !important;
    }

    .navbar-collapse.show {
        display: block !important;
    }

    .navbar-collapse.collapsing {
        display: block !important;
        height: 0;
        overflow: hidden;
        transition: height 0.35s ease;
    }

    .navbar-nav {
        padding: 1rem !important;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        border-radius: 8px;
        margin-bottom: 4px;
    }

    .navbar-nav .nav-link:hover {
        background-color: var(--primary-light);
    }

    /* Hide desktop sign-in button on mobile */
    .navbar .d-none.d-lg-block {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .top-bar {
        padding: 2px 0;
        min-height: 28px;
    }

    .search-input-group {
        max-width: 120px;
    }

    .search-input::placeholder {
        font-size: 0.55rem;
    }

    .search-input {
        min-width: 80px;
        padding: 3px 24px 3px 8px;
        font-size: 0.65rem;
    }

    .social-link {
        width: 18px;
        height: 18px;
    }

    .social-link i {
        font-size: 8px;
    }

    .search-btn {
        width: 20px;
        height: 20px;
    }

    /* Hide "Follow Us:" text on very small screens */
    .top-bar .d-none.d-md-inline {
        display: none !important;
    }

    /* Navbar adjustments for small mobile - ULTRA COMPACT */
    .navbar {
        top: 28px !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-height: 32px;
    }

    .navbar.top-bar-hidden {
        top: 0 !important;
    }

    body {
        padding-top: 60px;
        /* Ultra compact: top bar (28px) + navbar (32px) */
        padding-bottom: 65px;
    }

    .navbar-brand h2 {
        font-size: 0.9rem;
    }

    .navbar-logo {
        height: 24px !important;
    }

    .mobile-signin-btn {
        padding: 3px 8px !important;
        font-size: 0.6rem !important;
        height: 22px;
        border-radius: 4px !important;
    }

    .mobile-signin-btn span {
        display: inline !important;
        font-size: 0.6rem;
    }

    .mobile-signin-btn i {
        font-size: 0.55rem !important;
    }

    .mobile-avatar {
        width: 24px;
        height: 24px;
    }

    /* Bottom nav adjustments */
    .mobile-bottom-nav .nav-item {
        padding: 4px 8px;
    }

    .mobile-bottom-nav .nav-item i {
        font-size: 18px;
    }

    .mobile-bottom-nav .nav-item span {
        font-size: 9px;
    }
}

/* Body padding for desktop */
body {
    padding-top: 108px;
    /* Account for top bar (48px) + navbar (60px) */
}

body.top-bar-hidden {
    padding-top: 60px;
    /* Only navbar height when top bar is hidden */
}

/* Desktop specific adjustments */
@media (min-width: 992px) {
    body {
        padding-top: 108px;
        /* Keep desktop padding the same */
        padding-bottom: 0;
    }

    .navbar-toggler {
        display: none !important;
    }

    .navbar-brand h2 {
        font-size: 1.75rem;
    }

    .navbar-brand img {
        height: 60px !important;
    }

    /* Desktop dropdown positioning fixes */
    .navbar-nav .dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        z-index: 1060 !important;
        min-width: 200px;
        background-color: var(--white);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: var(--shadow-md);
        padding: 0.5rem 0;
        margin-top: 0.5rem;
    }

    /* Ensure dropdown containers allow overflow */
    .navbar,
    .navbar-nav,
    .nav-item.dropdown {
        overflow: visible !important;
    }
}

/* Tablet and mobile body padding adjustments */
@media (max-width: 991.98px) {
    body {
        padding-top: 80px;
        /* Top bar (40px) + reduced navbar (40px) */
    }
}

@media (max-width: 576px) {
    body {
        padding-top: 72px;
        /* Top bar (36px) + reduced navbar (36px) */
    }
}

/* ========================================
   Heart Beat Animation for Donate Button
   ======================================== */
@keyframes heartBeat {
    0% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.3);
    }

    28% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.3);
    }

    70% {
        transform: scale(1);
    }
}

.heart-beat {
    animation: heartBeat 1s ease-in-out;
    color: #e74c3c !important;
}

.heart-beat i {
    color: #e74c3c !important;
}

/* Keep donate heart red after click - Higher specificity to override active state */
.mobile-bottom-nav .nav-items .nav-item[href*="donate"].clicked,
.mobile-bottom-nav .nav-items .nav-item[href*="donate"].clicked i,
.mobile-bottom-nav .nav-items .nav-item[href*="donate"].heart-beat,
.mobile-bottom-nav .nav-items .nav-item[href*="donate"].heart-beat i {
    color: #e74c3c !important;
}

/* Ensure donate heart is red when active and clicked */
.mobile-bottom-nav .nav-items .nav-item[href*="donate"].active.clicked,
.mobile-bottom-nav .nav-items .nav-item[href*="donate"].active.clicked i {
    color: #e74c3c !important;
}

/* ========================================
   CRITICAL: Force navbar to NEVER be hidden
   These rules have highest priority
   ======================================== */
html body .navbar,
html body nav.navbar,
html body .navbar.navbar-light,
html body .navbar.navbar-expand-lg,
html body .navbar-light.sticky-top,
html body .sticky-top.navbar-light,
body .navbar[class],
nav.navbar.navbar-expand-lg.bg-white.navbar-light {
    position: fixed !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
    transform: none !important;
    clip: auto !important;
    clip-path: none !important;
    height: auto !important;
    min-height: 60px !important;
    overflow: visible !important;
    pointer-events: auto !important;
}

/* Mobile navbar height overrides */
@media (max-width: 991.98px) {

    html body .navbar,
    html body nav.navbar,
    html body .navbar.navbar-light,
    html body .navbar.navbar-expand-lg,
    html body .navbar-light.sticky-top,
    html body .sticky-top.navbar-light,
    body .navbar[class],
    nav.navbar.navbar-expand-lg.bg-white.navbar-light {
        min-height: 36px !important;
        /* Compact mobile height */
    }
}

@media (max-width: 576px) {

    html body .navbar,
    html body nav.navbar,
    html body .navbar.navbar-light,
    html body .navbar.navbar-expand-lg,
    html body .navbar-light.sticky-top,
    html body .sticky-top.navbar-light,
    body .navbar[class],
    nav.navbar.navbar-expand-lg.bg-white.navbar-light {
        min-height: 32px !important;
        /* Ultra compact for small mobile */
    }
}

/* Ensure navbar content is visible - but NOT collapse on mobile */
html body .navbar .navbar-nav,
html body .navbar .navbar-brand {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Only force navbar-collapse to flex on desktop */
@media (min-width: 992px) {
    html body .navbar .navbar-collapse {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Override any jQuery or JS style changes */
.navbar[style*="top: -"],
.navbar[style*="visibility: hidden"],
.navbar[style*="display: none"],
.navbar[style*="opacity: 0"] {
    top: 48px !important;
    visibility: visible !important;
    display: flex !important;
    opacity: 1 !important;
}

.navbar.top-bar-hidden[style*="top: -"],
.navbar.top-bar-hidden[style*="visibility: hidden"],
.navbar.top-bar-hidden[style*="display: none"] {
    top: 0 !important;
    visibility: visible !important;
    display: flex !important;
    opacity: 1 !important;
}

/* ========================================
   Service Items Mobile Responsive Styles
   ======================================== */
@media (max-width: 767px) {
    .service-item {
        padding: 0 !important;
        border-radius: 12px !important;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .service-item:hover {
        transform: translateY(-2px);
    }

    .service-item .p-4 {
        padding: 16px 12px !important;
    }

    .service-item .fa-3x {
        font-size: 1.75rem !important;
        margin-bottom: 10px !important;
    }

    .service-item h5 {
        font-size: 0.95rem !important;
        margin-bottom: 8px !important;
        font-weight: 600 !important;
    }

    .service-item p {
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0 !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Force 2 columns on mobile */
    .container-xxl .row.g-4>[class*="col-lg-3"] {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        padding: 6px !important;
    }

    .container-xxl .row.g-4 {
        margin: 0 -6px !important;
    }
}

@media (max-width: 576px) {
    .service-item .p-4 {
        padding: 14px 10px !important;
    }

    .service-item .fa-3x {
        font-size: 1.5rem !important;
        margin-bottom: 8px !important;
    }

    .service-item h5 {
        font-size: 0.85rem !important;
        margin-bottom: 6px !important;
    }

    .service-item p {
        font-size: 0.75rem !important;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
}

/* ========================================
   Carousel Mobile Responsive Styles
   ======================================== */

/* Hide dots on desktop */
.header-carousel .owl-dots {
    display: none;
}

@media (max-width: 991.98px) {

    /* Remove any gap between header and carousel on mobile */
    .header-carousel,
    .container-fluid.p-0:first-child,
    .container-fluid.p-0 {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Ensure owl carousel wrapper has no extra margin */
    .owl-carousel.header-carousel {
        margin-top: 0 !important;
    }
}

@media (max-width: 768px) {
    .header-carousel .owl-carousel-item {
        height: 50vh !important;
        min-height: 300px;
    }

    .header-carousel .owl-carousel-item img {
        object-fit: contain !important;
        object-position: center !important;
        background-color: #f8f9fa;
    }

    /* Hide navigation arrows on mobile */
    .header-carousel .owl-nav {
        display: none !important;
    }

    /* Show and style dots on mobile */
    .header-carousel .owl-dots {
        display: flex !important;
        justify-content: center;
        position: absolute;
        bottom: 15px;
        left: 0;
        right: 0;
        z-index: 10;
    }

    .header-carousel .owl-dots .owl-dot {
        width: 10px;
        height: 10px;
        margin: 0 5px;
        background: rgba(255, 255, 255, 0.5) !important;
        border-radius: 50%;
        border: none;
        transition: all 0.3s ease;
    }

    .header-carousel .owl-dots .owl-dot.active {
        background: #fff !important;
        transform: scale(1.2);
    }

    .header-carousel .owl-dots .owl-dot span {
        display: none;
    }

    /* Adjust content overlay for shorter carousel */
    .header-carousel .owl-carousel-item .position-absolute.bottom-0 {
        padding: 20px 0 15px !important;
    }

    .header-carousel .owl-carousel-item h1,
    .header-carousel .owl-carousel-item h2 {
        font-size: clamp(1.2rem, 4vw, 1.8rem) !important;
        margin-bottom: 0.5rem !important;
    }

    .header-carousel .owl-carousel-item h5 {
        font-size: 0.7rem !important;
        margin-bottom: 0.5rem !important;
    }

    .header-carousel .owl-carousel-item p {
        font-size: 0.85rem !important;
        margin-bottom: 0.5rem !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .header-carousel .owl-carousel-item .btn {
        padding: 0.4rem 1rem !important;
        font-size: 0.85rem !important;
    }
}

@media (max-width: 576px) {
    .header-carousel .owl-carousel-item {
        height: 45vh !important;
        min-height: 280px;
    }

    .header-carousel .owl-carousel-item .position-absolute.bottom-0 {
        padding: 15px 0 10px !important;
    }

    .header-carousel .owl-carousel-item h1,
    .header-carousel .owl-carousel-item h2 {
        font-size: clamp(1rem, 5vw, 1.4rem) !important;
    }

    .header-carousel .owl-carousel-item p {
        font-size: 0.8rem !important;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .header-carousel .owl-carousel-item .d-flex.flex-wrap {
        flex-direction: column;
        gap: 0.5rem !important;
    }

    .header-carousel .owl-carousel-item .text-white.animated.slideInRight {
        font-size: 0.75rem !important;
    }
}
/* ========================================
   Mobile Bottom Sheet Styles
   ======================================== */
.mobile-bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 1054;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.mobile-bottom-sheet-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-bottom-sheet {
    position: fixed;
    bottom: 70px;
    left: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fdf8 100%);
    border-radius: 20px;
    z-index: 1055;
    transform: translateY(calc(100% + 80px));
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 50vh;
    overflow-y: auto;
    box-shadow: 0 -8px 30px rgba(0, 128, 0, 0.15), 0 4px 20px rgba(0, 0, 0, 0.1);
    padding-bottom: 16px;
    border: 1px solid rgba(0, 128, 0, 0.1);
}

.mobile-bottom-sheet.active {
    transform: translateY(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.bottom-sheet-handle {
    width: 50px;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), #00a000);
    border-radius: 3px;
    margin: 14px auto 12px;
    opacity: 0.7;
}

.bottom-sheet-content {
    padding: 8px 16px 16px;
}

.bottom-sheet-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.bottom-sheet-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    padding: 14px 8px;
    border-radius: 16px;
    transition: all 0.25s ease;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 128, 0, 0.08);
}

.bottom-sheet-item:hover,
.bottom-sheet-item:active {
    background: linear-gradient(135deg, rgba(0, 128, 0, 0.1) 0%, rgba(0, 128, 0, 0.05) 100%);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 128, 0, 0.15);
    border-color: rgba(0, 128, 0, 0.2);
}

.bottom-sheet-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f9f0 0%, #e8f5e8 100%);
    border-radius: 14px;
    margin-bottom: 10px;
    transition: all 0.25s ease;
    border: 1px solid rgba(0, 128, 0, 0.1);
}

.bottom-sheet-item:hover .bottom-sheet-icon,
.bottom-sheet-item:active .bottom-sheet-icon {
    background: linear-gradient(135deg, var(--primary-color) 0%, #00a000 100%);
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 128, 0, 0.3);
}

.bottom-sheet-icon i {
    font-size: 22px;
    color: var(--primary-color);
    transition: all 0.25s ease;
}

.bottom-sheet-item:hover .bottom-sheet-icon i,
.bottom-sheet-item:active .bottom-sheet-icon i {
    color: #fff;
    transform: scale(1.1);
}

.bottom-sheet-item span {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    color: #444;
}

.bottom-sheet-item:hover span,
.bottom-sheet-item:active span {
    color: var(--primary-color);
}

@media (max-width: 400px) {
    .mobile-bottom-sheet {
        left: 4px;
        right: 4px;
        bottom: 65px;
    }
    
    .bottom-sheet-grid {
        gap: 8px;
    }

    .bottom-sheet-icon {
        width: 46px;
        height: 46px;
    }

    .bottom-sheet-icon i {
        font-size: 20px;
    }

    .bottom-sheet-item span {
        font-size: 10px;
    }

    .bottom-sheet-item {
        padding: 10px 4px;
    }
}

/* Fix: Ensure bottom sheets are hidden by default */
.mobile-bottom-sheet:not(.active) {
    transform: translateY(calc(100% + 80px)) !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
