/* Top bar responsive text sizing */
.bg-dark .col-md-4 span {
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .bg-dark .col-md-4 span {
        font-size: 0.75rem;
    }
}

/* Navbar toggler styling */
.navbar-toggler {
    border: 1px solid rgba(0,0,0,.1);
    padding: 0.5rem 0.75rem;
}

.navbar-toggler-icon {
    width: 1.5em;
    height: 1.5em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Simple styles for the mobile accordion menu */
.mobile-submenu-toggle {
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.2rem;
}
.mobile-submenu {
    padding-left: 1.5rem;
}

/* Hover mega menu styles */
.dropdown-hover {
    position: static;
}

/* Make the navbar position relative so dropdowns align with it */
.navbar-nav {
    position: relative;
}

/* Ensure top bar dropdowns DON'T open on hover - click only */
.top-bar-dropdown .dropdown-menu {
    display: none !important;
}

.top-bar-dropdown .dropdown-menu.show {
    display: block !important;
}

/* Prevent top bar dropdowns from being affected by any hover states */
.bg-primary .dropdown:hover .dropdown-menu:not(.show) {
    display: none !important;
}

.bg-primary .dropdown .dropdown-menu {
    display: none !important;
}

.bg-primary .dropdown .dropdown-menu.show {
    display: block !important;
}

/* Product mega menu dropdowns - hidden by default */
.navbar-expand-lg .dropdown-hover .dropdown-menu {
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
    visibility: hidden;
}

/* Only apply hover effect to product category mega menus in main navigation, not top bar dropdowns */
.navbar-expand-lg .dropdown-hover.product-mega-menu:hover .dropdown-menu {
    display: block !important;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease;
}

/* Keep dropdown open when hovering the dropdown itself */
.product-category-dropdown:hover {
    display: block !important;
    opacity: 1;
    visibility: visible;
}

.dropdown-menu.show {
    display: block;
    opacity: 1;
}

/* Enhanced mega menu styles */
.product-category-dropdown {
    position: absolute;
    width: 100%;
    min-width: 600px;
    left: 0;
    right: 0;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 0.5rem;
    margin-top: 0;
    padding: 2rem !important;
    background-color: white;
    top: 100%;
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    width: 100%;
    align-items: start;
}

.mega-menu-products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
    align-items: start;
}

.product-category-dropdown .dropdown-item {
    padding: 0.4rem 1rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1.3;
}

.product-category-dropdown .dropdown-item:hover {
    background-color: #449CCC;
    color: white;
    transform: translateX(5px);
}

.mega-menu-cta {
    background: linear-gradient(135deg, #449CCC 0%, #16425b 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.mega-menu-cta h4 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.mega-menu-cta p {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    opacity: 0.95;
}

.mega-menu-cta .btn {
    background-color: white;
    color: #449CCC;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    transition: all 0.2s ease;
    border: none;
}

.mega-menu-cta .btn:hover {
    background-color: #f8f9fa;
    color: #16425b;
    transform: scale(1.05);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.2);
}

.mega-menu-cta .btn-outline-light {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.mega-menu-cta .btn-outline-light:hover {
    background-color: white;
    color: #449CCC;
    border-color: white;
}

/* Services dropdown styling to match mega menu */
.service-items {
    min-width: 250px;
}

.service-item {
    padding: 0.25rem 0;
    border-bottom: 1px solid #eee;
}

.service-item:last-child {
    border-bottom: none;
}

.service-item .dropdown-item {
    padding: 0.375rem 0.75rem;
    margin-bottom: 0;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.service-item .dropdown-item:hover {
    background-color: #f8f9fa;
    color: #007bff;
    transform: translateX(2px);
}

/* Lottie Logo Styling */
#lottie-logo {
    width: 200px;
    height: 60px;
    min-height: 60px;
    transition: transform 0.3s ease;
    background-color: transparent;
}

.navbar-brand {
    display: inline-block;
    min-height: 60px;
}

.navbar-brand:hover #lottie-logo {
    transform: scale(1.05);
}

/* Logo fallback - show site name if Lottie doesn't load */
.logo-fallback {
    display: none;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

/* Search Modal Styling */
#searchModal .modal-header {
    background: linear-gradient(135deg, #449CCC 0%, #16425b 100%);
    color: white;
    border-bottom: none;
}

#searchModal .modal-title {
    color: white;
}

#searchModal .btn-close {
    filter: brightness(0) invert(1);
    opacity: 1;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    width: 1em;
    height: 1em;
}

#searchModal .btn-primary {
    background: linear-gradient(135deg, #449CCC 0%, #16425b 100%);
    border: none;
    font-weight: 600;
}

#searchModal .btn-primary:hover {
    background: linear-gradient(135deg, #3a8ab8 0%, #12364a 100%);
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.2);
}

/* Mini Cart Styling */
#bcMiniCartToggle,
#bcMiniCartToggleMobile {
    position: relative;
}

#bcMiniCartToggleMobile {
    color: #333;
}

#bcMiniCartToggleMobile:hover {
    color: #449CCC;
}

.mini-cart-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    background: white;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    z-index: 1050;
}

.mini-cart-header {
    background: linear-gradient(135deg, #449CCC 0%, #16425b 100%);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem 0.5rem 0 0;
    font-weight: 600;
}

/* Mini Cart Offcanvas Header */
.mini-cart-gradient-header {
    background: linear-gradient(135deg, #449CCC 0%, #16425b 100%) !important;
}

.mini-cart-gradient-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 1;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    width: 1em;
    height: 1em;
}

.mini-cart .offcanvas-title {
    font-weight: 700;
    font-size: 1.25rem;
    background: transparent !important;
}

.mini-cart .btn-primary {
    background: linear-gradient(135deg, #449CCC 0%, #16425b 100%);
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mini-cart .btn-primary:hover {
    background: linear-gradient(135deg, #3a8ab8 0%, #12364a 100%);
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(68, 156, 204, 0.3);
}

/* Mini Cart Remove Button Styling */
.mini-cart .bc-remove-cart-item {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    background-color: transparent;
    border-color: transparent;
    color: #449CCC;
}

.mini-cart .bc-remove-cart-item:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
    transform: scale(1.05);
}

.mini-cart .bc-remove-cart-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mini-cart .list-group-item {
    transition: background-color 0.2s ease;
}

.mini-cart .list-group-item:hover {
    background-color: #f8f9fa;
}

/* Footer Styling with Brand Gradient */
.footer {
    background: linear-gradient(135deg, #449CCC 0%, #16425b 100%);
    color: white;
    padding: 3rem 0;
}

.footer h5 {
    color: white;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.footer a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.2s ease;
}

.footer a:hover {
    color: white;
    transform: translateX(3px);
    display: inline-block;
}

.footer .brand-logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
}

.footer .social-icons a {
    font-size: 1.5rem;
    color: white;
    transition: all 0.2s ease;
}

.footer .social-icons a:hover {
    transform: scale(1.2);
}

/* Contact Section Enhancements */
.contact-section {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.contact-section .text-brand-primary {
    background: linear-gradient(135deg, #449CCC 0%, #16425b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-section .icon {
    color: #449CCC;
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

.contact-section .btn-primary {
    background: linear-gradient(135deg, #449CCC 0%, #16425b 100%);
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.contact-section .btn-primary:hover {
    background: linear-gradient(135deg, #3a8ab8 0%, #12364a 100%);
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(68, 156, 204, 0.3);
}

@media (max-width: 768px) {
    #lottie-logo {
        width: 120px;
        max-height: 40px;
        min-height: 40px;
    }
    .logo-fallback {
        font-size: 1rem;
    }
}

/* Mobile menu enhancements */
@media (max-width: 991px) {
    /* Show search and cart in header on mobile since top bar is hidden */
    .mobile-actions {
        display: flex !important;
        align-items: center;
        gap: 1rem;
    }
    
    .mobile-actions .btn-link {
        padding: 0.5rem;
    }
    
    /* Mobile menu styling */
    .navbar-collapse {
        margin-top: 1rem;
        border-top: 1px solid #dee2e6;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .mobile-submenu-toggle {
        padding: 0.75rem 1rem !important;
        user-select: none;
    }
}

/* Extra small mobile devices - tighter spacing */
@media (max-width: 576px) {
    .mobile-icons-wrapper {
        gap: 0.25rem !important;
    }
    
    .mobile-icons-wrapper .btn-link {
        padding: 0.25rem !important;
    }
    
    .navbar-toggler {
        padding: 0.25rem 0.5rem !important;
    }
    
    /* Override the global .d-flex.gap-2 column rule for mobile header icons */
    .mobile-icons-wrapper.d-flex.gap-2 {
        flex-direction: row !important;
    }
}
