/* ===============================================
   LOGO SIZE FIXES - RESPONSIVE & CONSISTENT
   =============================================== */

/* Base logo styling */
.logo-site {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-site img {
    transition: none !important; /* Remove any transitions */
    object-fit: contain;
    height: auto;
    max-width: 100%;
}

/* Main header logo sizes */
.tf-header.style-3 .logo-site img {
    width: 120px !important;
    height: auto !important;
    /* max-height: 60px; */
}

/* Fixed header (sticky) logo sizes */
.tf-header.header-fixed .logo-site img {
    width: 100px !important;
    height: auto !important;
    max-height: 50px;
}

/* Responsive breakpoints for mobile devices */

/* Extra Large Desktop (1600px+) */
@media (min-width: 1600px) {
    .tf-header.style-3 .logo-site img {
        width: 140px !important;
        /* max-height: 70px; */
    }

    .tf-header.header-fixed .logo-site img {
        width: 120px !important;
        /* max-height: 60px; */
    }
}

/* Large Desktop (1400-1599px) */
@media (min-width: 1400px) and (max-width: 1599px) {
    .tf-header.style-3 .logo-site img {
        width: 130px !important;
        max-height: 65px;
    }

    .tf-header.header-fixed .logo-site img {
        width: 110px !important;
        max-height: 55px;
    }
}

/* Desktop (1200-1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .tf-header.style-3 .logo-site img {
        width: 120px !important;
        /* max-height: 60px; */
    }

    .tf-header.header-fixed .logo-site img {
        width: 100px !important;
        /* max-height: 50px; */
    }
}

/* Large Tablet (992-1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .tf-header.style-3 .logo-site img {
        width: 110px !important;
        /* max-height: 55px; */
    }

    .tf-header.header-fixed .logo-site img {
        width: 90px !important;
        /* max-height: 45px; */
    }
}

/* Tablet (768-991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .tf-header.style-3 .logo-site img {
        width: 140px !important;
        /* max-height: 70px; */
    }

    .tf-header.header-fixed .logo-site img {
        width: 125px !important;
        /* max-height: 62px; */
    }
}

/* Large Mobile (576-767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .tf-header.style-3 .logo-site img {
        width: 130px !important;
        /* max-height: 65px; */
    }

    .tf-header.header-fixed .logo-site img {
        width: 120px !important;
        /* max-height: 60px; */
    }
}

/* Mobile (320-575px) */
@media (max-width: 575px) {
    .tf-header.style-3 .logo-site img {
        width: 120px !important;
        /* max-height: 60px; */
    }

    .tf-header.header-fixed .logo-site img {
        width: 110px !important;
        /* max-height: 55px; */
    }
}

/* Extra Small Mobile (320px and below) */
@media (max-width: 320px) {
    .tf-header.style-3 .logo-site img {
        width: 100px !important;
        /* max-height: 50px; */
    }

    .tf-header.header-fixed .logo-site img {
        width: 95px !important;
        /* max-height: 47px; */
    }
}

/* Special cases for header layouts */

/* Header absolute positioning fixes */
.header-abs-3 .logo-site img {
    height: 64px !important;
    width: auto !important;
    max-width: 120px;
}

/* Mobile menu logo adjustments */
@media (max-width: 1199px) {
    .header-abs-3 .logo-site img {
        height: 50px !important;
        max-width: 100px;
    }
}

/* Offcanvas/Mobile menu logo */
.offcanvas .logo-site img,
.mobile-menu .logo-site img {
    width: 140px !important;
    height: auto !important;
    max-height: 70px;
}

/* Mobile sidebar/offcanvas header logo - OPTIMAL SIZE */
.offcanvas-header .offcanvas-title img,
.offcanvas-header img,
#mobileMenu .offcanvas-header img,
#mobileMenu .offcanvas-title img,
.offcanvas.offcanvas-start .offcanvas-header img,
.offcanvas.offcanvas-start .offcanvas-title img {
    width: 110px !important;
    min-width: 110px !important;
    height: auto !important;
    max-height: 55px !important;
    min-height: 35px !important;
    object-fit: contain !important;
    display: block !important;
}

/* Mobile menu logo responsive sizes - BALANCED DIMENSIONS */
@media (max-width: 575px) {
    .offcanvas .logo-site img,
    .mobile-menu .logo-site img,
    .offcanvas-header .offcanvas-title img,
    .offcanvas-header img,
    #mobileMenu .offcanvas-header img,
    #mobileMenu .offcanvas-title img,
    .offcanvas.offcanvas-start .offcanvas-header img,
    .offcanvas.offcanvas-start .offcanvas-title img {
        width: 100px !important;
        min-width: 100px !important;
        max-height: 50px !important;
        min-height: 32px !important;
        object-fit: contain !important;
        display: block !important;
    }
}

@media (max-width: 480px) {
    .offcanvas-header .offcanvas-title img,
    .offcanvas-header img,
    #mobileMenu .offcanvas-header img,
    #mobileMenu .offcanvas-title img,
    .offcanvas.offcanvas-start .offcanvas-header img,
    .offcanvas.offcanvas-start .offcanvas-title img {
        width: 90px !important;
        min-width: 90px !important;
        max-height: 45px !important;
        min-height: 30px !important;
        object-fit: contain !important;
        display: block !important;
    }
}

@media (max-width: 320px) {
    .offcanvas .logo-site img,
    .mobile-menu .logo-site img,
    .offcanvas-header .offcanvas-title img,
    .offcanvas-header img,
    #mobileMenu .offcanvas-header img,
    #mobileMenu .offcanvas-title img,
    .offcanvas.offcanvas-start .offcanvas-header img,
    .offcanvas.offcanvas-start .offcanvas-title img {
        width: 85px !important;
        min-width: 85px !important;
        max-height: 42px !important;
        min-height: 28px !important;
        object-fit: contain !important;
        display: block !important;
    }
}

/* Footer logo (if any) */
.footer .logo-site img {
    width: 120px !important;
    height: auto !important;
    max-height: 60px;
}

/* Retina display optimization */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    .logo-site img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print media */
@media print {
    .logo-site img {
        width: 120px !important;
        height: auto !important;
    }
}

/* Ensure logo container doesn't break layout */
.logo-site {
    overflow: hidden;
    flex-shrink: 0;
}

/* Center logo properly on mobile */
@media (max-width: 1199px) {
    .logo-site {
        justify-content: center !important;
    }
}

/* FORCE OVERRIDE ALL CONFLICTING STYLES - SIDEBAR LOGO */
.offcanvas-header img[style],
.offcanvas-header .offcanvas-title img[style],
#mobileMenu img[style],
#mobileMenu .offcanvas-header img[style],
#mobileMenu .offcanvas-title img[style],
.offcanvas.offcanvas-start img[style],
.offcanvas.offcanvas-start .offcanvas-header img[style],
.offcanvas.offcanvas-start .offcanvas-title img[style] {
    width: 110px !important;
    height: auto !important;
    min-width: 110px !important;
    max-height: 55px !important;
    min-height: 35px !important;
}

/* Mobile responsive overrides */
@media (max-width: 575px) {
    .offcanvas-header img[style],
    .offcanvas-header .offcanvas-title img[style],
    #mobileMenu img[style],
    #mobileMenu .offcanvas-header img[style],
    #mobileMenu .offcanvas-title img[style] {
        width: 100px !important;
        min-width: 100px !important;
    }
}

@media (max-width: 320px) {
    .offcanvas-header img[style],
    .offcanvas-header .offcanvas-title img[style],
    #mobileMenu img[style],
    #mobileMenu .offcanvas-header img[style],
    #mobileMenu .offcanvas-title img[style] {
        width: 85px !important;
        min-width: 85px !important;
    }
}

/* Remove any conflicting inline styles */
.logo-site img[style*="width"] {
    width: inherit !important;
}

/* Mobile-specific logo container improvements */
@media (max-width: 991px) {
    .logo-site {
        padding: 0.25rem 0;
        min-height: 50px;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Ensure logo doesn't get cut off in mobile header */
    .tf-header .header-top {
        min-height: 70px;
    }

    .tf-header.header-fixed {
        min-height: 60px;
    }
}

/* Extra mobile spacing for very small screens */
@media (max-width: 575px) {
    .logo-site {
        padding: 0.5rem 0;
        min-height: 60px;
    }

    .tf-header .header-top {
        min-height: 80px;
    }

    .tf-header.header-fixed {
        min-height: 70px;
    }
}

/* Mobile sidebar/offcanvas header improvements - OPTIMIZED LAYOUT */
.offcanvas-header,
#mobileMenu .offcanvas-header,
.offcanvas.offcanvas-start .offcanvas-header {
    padding: 1rem 1.25rem !important;
    min-height: 70px !important;
    border-bottom: 1px solid #e9ecef;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.offcanvas-header .offcanvas-title,
#mobileMenu .offcanvas-header .offcanvas-title,
.offcanvas.offcanvas-start .offcanvas-header .offcanvas-title {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 1 !important;
    text-align: center !important;
}

/* NUCLEAR OPTION - ABSOLUTE OVERRIDE FOR MOBILE SIDEBAR LOGO */
.offcanvas#mobileMenu .offcanvas-header .offcanvas-title img {
    width: 110px !important;
    min-width: 110px !important;
    height: auto !important;
    max-height: 55px !important;
    min-height: 35px !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

/* Responsive nuclear options */
@media (max-width: 575px) {
    .offcanvas#mobileMenu .offcanvas-header .offcanvas-title img {
        width: 100px !important;
        min-width: 100px !important;
        max-height: 50px !important;
        min-height: 32px !important;
    }
}

@media (max-width: 480px) {
    .offcanvas#mobileMenu .offcanvas-header .offcanvas-title img {
        width: 90px !important;
        min-width: 90px !important;
        max-height: 45px !important;
        min-height: 30px !important;
    }
}

@media (max-width: 320px) {
    .offcanvas#mobileMenu .offcanvas-header .offcanvas-title img {
        width: 85px !important;
        min-width: 85px !important;
        max-height: 42px !important;
        min-height: 28px !important;
    }
}

/* Mobile responsive adjustments for sidebar header */
@media (max-width: 575px) {
    .offcanvas-header {
        padding: 0.875rem 1rem !important;
        min-height: 65px !important;
    }
}

@media (max-width: 320px) {
    .offcanvas-header {
        padding: 0.75rem 0.75rem !important;
        min-height: 60px !important;
    }
}

/* Ensure close button alignment */
.offcanvas-header .btn-close {
    margin-left: auto;
    padding: 0.5rem;
    font-size: 1.2rem;
}

/* Ensure logo quality on mobile */
@media (max-width: 767px) {
    .logo-site img,
    .offcanvas-header img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
        image-rendering: pixelated;
        -ms-interpolation-mode: nearest-neighbor;
    }
}
