/* ========================================
   Header Alignment Fixes for Desktop & Mobile
   ======================================== */

/* Header white background */
.th-header {
    background-color: #ffffff;
}

.sticky-wrapper {
    background-color: #ffffff;
}

/* Desktop Header Alignment */
.th-header .menu-area {
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.th-header .menu-area .row {
    width: 100%;
    margin: 0;
}

/* Ensure proper vertical alignment */
.th-header .menu-area .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo alignment */
.th-header .header-logo {
    display: flex;
    align-items: center;
    padding-top: 15px;
    padding-bottom: 15px;
}

.th-header .header-logo img {
    max-height: 60px;
    width: auto;
    object-fit: contain;
}

/* Navigation menu alignment */
.th-header .main-menu {
    display: flex;
    align-items: center;
}

.th-header .main-menu>ul {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.th-header .main-menu>ul>li {
    display: flex;
    align-items: center;
}

/* Button area alignment */
.th-header .header-button {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
}

/* Ensure consistent spacing */
.th-header .col-auto {
    display: flex;
    align-items: center;
}

/* ========================================
   Mobile Responsive Alignment (max-width: 991px)
   ======================================== */

@media (max-width: 991px) {

    /* Mobile header container */
    .th-header .menu-area {
        padding: 10px 0;
    }

    .th-header .menu-area .row {
        align-items: center;
        justify-content: space-between;
    }

    /* Logo sizing for mobile */
    .th-header .header-logo {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .th-header .header-logo img {
        max-height: 45px;
    }

    /* Mobile menu toggle button alignment */
    .th-header .th-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 45px;
        height: 45px;
        border: 1px solid rgba(108, 109, 113, 0.15);
        border-radius: 4px;
        background: transparent;
        color: var(--title-color);
        font-size: 20px;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .th-header .th-menu-toggle:hover {
        background-color: var(--theme-color);
        border-color: var(--theme-color);
        color: var(--white-color);
    }

    /* Hide desktop elements on mobile */
    .th-header .header-button.d-none.d-lg-flex {
        display: none !important;
    }
}

/* ========================================
   Tablet Alignment (768px - 991px)
   ======================================== */

@media (min-width: 768px) and (max-width: 991px) {
    .th-header .header-logo img {
        max-height: 50px;
    }

    .th-header .menu-area {
        padding: 12px 0;
    }
}

/* ========================================
   Small Mobile Alignment (max-width: 575px)
   ======================================== */

@media (max-width: 575px) {

    /* Tighter spacing for small screens */
    .th-header .container,
    .th-header .th-container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .th-header .header-logo {
        max-width: 140px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .th-header .header-logo img {
        max-height: 40px;
    }

    .th-header .th-menu-toggle {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .th-header .menu-area {
        padding: 8px 0;
    }
}

/* ========================================
   Extra Small Mobile (max-width: 375px)
   ======================================== */

@media (max-width: 375px) {
    .th-header .header-logo {
        max-width: 120px;
    }

    .th-header .header-logo img {
        max-height: 35px;
    }

    .th-header .th-menu-toggle {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
}

/* ========================================
   Sticky Header Alignment
   ======================================== */

.sticky-wrapper.sticky .th-header .menu-area {
    padding: 8px 0;
    background-color: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.sticky-wrapper.sticky .th-header .header-logo {
    padding-top: 10px;
    padding-bottom: 10px;
}

.sticky-wrapper.sticky .th-header .header-logo img {
    max-height: 50px;
}

@media (max-width: 991px) {
    .sticky-wrapper.sticky .th-header .menu-area {
        padding: 8px 0;
    }

    .sticky-wrapper.sticky .th-header .header-logo img {
        max-height: 40px;
    }
}

/* ========================================
   Center alignment fix for specific layouts
   ======================================== */

/* Ensure the row doesn't overflow */
.th-header .menu-area .row {
    max-width: 100%;
    flex-wrap: nowrap;
}

/* Prevent logo from shrinking too much */
.th-header .header-logo {
    flex-shrink: 0;
}

/* Allow menu to take available space */
.th-header .col-auto.me-auto {
    flex-grow: 0;
    flex-shrink: 1;
}

/* Prevent buttons from wrapping */
.th-header .header-button {
    flex-wrap: nowrap;
    white-space: nowrap;
}

/* ========================================
   Vertical centering improvements
   ======================================== */

.th-header .menu-area .row>* {
    display: flex;
    align-items: center;
}

/* Ensure icons are vertically centered */
.th-header .icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   Additional spacing fixes
   ======================================== */

/* Consistent padding for header layout2 style2 */
.header-layout2.style2 .menu-area {
    padding-top: 0;
    padding-bottom: 0;
}

.header-layout2.style2 .header-logo {
    padding-top: 15px;
    padding-bottom: 15px;
}

@media (max-width: 991px) {
    .header-layout2.style2 .header-logo {
        padding-top: 10px;
        padding-bottom: 10px;
    }
}