.site-navbar {
    padding: 0.5rem 0.75rem;
}

.site-navbar .navbar-logo {
    max-height: 40px; /* smaller default logo height per user's request */
    width: auto;
    object-fit: contain;
    margin-right: 1rem;
}

/* Prevent inline-image baseline gap which can create a thin line under the logo. Make the image a block-level element. */
.site-navbar .navbar-logo,
.navbar-brand img.navbar-logo {
    display: block;
}

.brand-title {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1;
}
.brand-tagline {
    display: block;
    margin-top: 2px;
    color: rgba(0,0,0,0.6);
}

.navbar-search .form-control {
    height: 44px;
}
.navbar-search .btn-primary {
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.navbar-contact .text-muted {
    display: block;
    font-size: 0.9rem;
}
.navbar-contact a.btn-link {
    color: #fff; /* keep it visible on light navbar */
    opacity: 0.9;
}

.contact-btn {
    border-radius: 10px;
    padding: 6px 10px;
    color: #fff !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: transform .08s ease, box-shadow .08s ease;
}
.contact-btn i {
    font-size: 0.95rem;
}
.contact-btn.btn-primary {
    background: linear-gradient(180deg,#0069d9,#0053b3);
    border: none;
}
.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

/* Hamburger handled by Bootstrap; remove custom menu-toggle styles */

/* Large screens (desktops) */
@media screen and (min-width: 1200px) {
    .site-navbar {
        padding: 1rem 2rem;
    }
    .site-navbar .navbar-logo {
        max-height: 48px;
    }
}

/* Medium screens (tablets) */
@media screen and (max-width: 1199px) and (min-width: 768px) {
    .navbar {
        padding: 0.8rem 1.5rem;
    }
    .navbar-logo {
        max-height: 40px;
    }
}

/* Small screens (mobile) */
@media screen and (max-width: 767px) {
    .site-navbar {
        padding: 0.4rem 0.6rem;
    }
    .site-navbar .navbar-logo {
        max-height: 32px;
    }
    .site-navbar .navbar-search {
        width: 100%;
        margin-top: 0.5rem;
    }
    .site-navbar .navbar-info {
        font-size: 0.9rem;
    }
}

/* Mobile reorder and compact contact icons */
@media screen and (max-width: 767px) {
    .mobile-quick-contact .contact-btn {
        padding: 6px 8px;
        border-radius: 8px;
        min-width: 38px;
        min-height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* hide text labels on very small screens in the main navbar (desktop uses d-none d-xl-inline) */
    .navbar-contact .contact-btn span {
        display: none !important;
    }

    /* Ensure the search sits below the logo and icons on very narrow screens if space is tight */
    .site-navbar .navbar-search {
        order: 3;
        width: 100%;
        margin-top: 6px;
    }

    /* Keep the offcanvas toggle aligned to the right */
    .site-navbar .btn[data-bs-toggle="offcanvas"] {
        margin-left: auto;
    }

    /* Mobile header: compact search and action icons */
    .mobile-header {
        gap: 8px;
        padding: 8px 6px;
    }

    .mobile-top-row {
        padding: 4px 6px;
    }

    .mobile-search-row {
        padding: 6px 6px 10px 6px;
    }

    .mobile-search-form .form-control {
        border-radius: 22px;
        padding-left: 12px;
        height: 40px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        border: 1px solid #e6e6e6;
        background: #fff;
    }

    .mobile-search-form .btn {
        border-radius: 18px;
        padding: 6px 10px;
        margin-left: 6px;
    }

    .mobile-action-icons .action-icon {
        width: 40px;
        height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        border: 1px solid rgba(0,0,0,0.06);
        background: #fff;
        color: #0074d9;
        box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    }

    .mobile-top-row .navbar-logo {
        max-height: 36px;
    }

    .mobile-action-icons .menu-toggle {
        background: linear-gradient(180deg,#0069d9,#0053b3);
        color: #fff;
        border: none;
    }

    /* Offcanvas tweaks: slightly larger and padded list items */
    .offcanvas-body .list-group-item a {
        display: block;
        padding: 12px 8px;
        color: #333;
    }
}

/* Mobile search group tweaks */
@media screen and (max-width: 767px) {
    .mobile-search-group .form-control {
        height: 46px;
        padding-left: 14px;
    }
    .mobile-search-group .btn {
        height: 46px;
        padding: 0 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .mobile-hamburger {
        height: 46px;
        width: 46px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 10px;
        border-radius: 8px;
    }
    /* ensure the search input shrinks/grows to available space */
    .navbar-search .form-control {
        min-width: 0; /* allow flexbox to shrink */
    }
    /* Slightly reduce the category bar height and remove extra spacing */
    #categoryBar {
        min-height: 44px;
        padding-top: 6px;
        padding-bottom: 6px;
    }
}

/* Mobile-specific: show menu toggle, stack logo and search, style sidebar */
@media screen and (max-width: 767px) {
    /* small-screen tweaks preserved but offcanvas handles categories */
    .site-navbar .navbar-search {
        width: 100%;
        margin-top: 0.5rem;
    }
    /* On small screens we rely on Bootstrap offcanvas; make sure categoryBar hides */
    #categoryBar {
        display: none;
    }
}

/* Category bar specific styles */
#categoryBar {
    min-height: 48px;
    padding: 8px 0;
    display: none; /* default hidden on small screens */
}

/* Show category bar only on screens wider than 991px (desktop). Hide on tablets and smaller. */
@media (min-width: 992px) {
    #categoryBar {
        display: block;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    /* Simple CSS hover fallback: show dropdown menu on hover for desktop */
    #categoryBar .nav-item.dropdown:hover > .dropdown-menu {
        display: block;
        visibility: visible;
        opacity: 1;
        transform: none;
    }

    /* Keep category label and caret on the same line */
    #categoryBar .nav {
        align-items: center; /* vertically center items */
    }
    #categoryBar .nav-item {
        display: inline-flex;       /* keep label+caret together */
        align-items: center;        /* vertical centering */
        white-space: nowrap;        /* prevent wrapping onto two lines */
        gap: 0.35rem;               /* small gap between label and toggle */
    }
    /* position each nav-item as anchor for a centered dropdown menu */
    #categoryBar .nav-item {
        position: relative;
    }

    /* invisible pointer-bridge under the nav-item to prevent small pointer gaps
       between the label and the dropdown menu from firing a mouseleave */
    #categoryBar .nav-item::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        height: 8px; /* small bridge height */
        pointer-events: auto; /* keep hover state when mouse crosses this area */
        background: transparent;
    }
    /* Ensure links & toggle inside the category bar use inline-flex so they align */
    #categoryBar .nav-link {
        display: inline-flex;
        align-items: center;
    }

    /* Category icon sizing and spacing */
    #categoryBar .cat-icon {
        font-size: 0.98rem;
        margin-right: 0.5rem; /* slightly more breathing room */
        line-height: 1;
        display: inline-block;
        width: auto; /* allow icon to size naturally */
        text-align: center;
    }

    /* absolutely position the dropdown menu under the nav-item and center it */
    #categoryBar .dropdown-menu {
        position: absolute !important; /* ensure static display uses our positioning */
        top: 100%; /* sits directly beneath the nav-item (no gap) */
        left: 50%;
        transform: translateX(-50%);
        min-width: 10rem; /* default min width */
        box-shadow: 0 6px 18px rgba(0,0,0,0.12);
        z-index: 1050; /* ensure it stays above other elements */
        pointer-events: auto;
    }

    /* keep default Bootstrap toggle behavior; avoid forcing compact button styles here to prevent layout regressions */
    /* previous edits that added compact toggle styles were reverted to restore Bootstrap defaults */

    
}

/* Offcanvas is provided by Bootstrap; remove custom sidebar styles but keep helper classes if present */
.no-scroll {
    /* kept for compatibility but typically Bootstrap offcanvas handles scrolling */
    overflow: hidden;
}

/* Extra small screens */
@media screen and (max-width: 480px) {
    .navbar-logo {
        max-height: 28px;
    }
    .navbar-info {
        font-size: 0.8rem;
    }
}