/* Zaitoon updated search bar styling - remove category dropdown */
.tp-header-search-wrapper {
    position: relative;
    border: 2px solid var(--tp-theme-primary);
    display: flex;
    align-items: center;
    width: 100%;
    border-radius: 30px;
    overflow: hidden;
}

.tp-header-search-box {
    flex: 1;
    width: 100%;
}

.tp-header-search-box input {
    padding-left: 25px;
    padding-right: 75px;
    width: 100%;
    height: 46px;
    background-color: var(--tp-common-white);
    color: unset;
    font-family: var(--primary-font);
    border: 0;
    border-radius: 30px 0 0 30px;
}

.tp-header-search-btn {
    position: absolute;
    top: 0;
    right: 0;
}

.tp-header-search-btn button {
    width: 60px;
    height: 46px;
    line-height: 46px;
    background-color: var(--tp-theme-primary);
    color: var(--tp-common-white);
    border: 0;
    border-radius: 0 30px 30px 0;
    position: relative;
    z-index: 2;
}

.tp-header-search-btn button::before,
.tp-header-search-btn button::after {
    display: none !important;
}

.tp-header-search-btn button svg {
    position: relative;
    z-index: 3;
}

/* Fix header alignment */
.tp-header-main {
    padding-top: 20px;
    padding-bottom: 20px;
}

.tp-header-main-right {
    gap: 20px !important;
    align-items: center !important;
}

.tp-header-login {
    margin-right: 0;
    display: flex;
    align-items: center;
    min-width: 0;
    flex-shrink: 0;
}

.tp-header-login a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.tp-header-login-icon span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(1, 15, 28, 0.1);
    flex-shrink: 0;
}

.tp-header-login-content {
    margin-left: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    max-width: 180px;
}

.tp-header-login-content span {
    display: block;
    font-size: 11px;
    line-height: 1.3;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.tp-header-login-title {
    margin: 0;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--tp-common-black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tp-header-action-item {
    display: flex;
    align-items: center;
}

.tp-header-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(1, 15, 28, 0.1);
    background: transparent;
    color: var(--tp-common-black);
    transition: all 0.3s ease;
}

.tp-header-action-btn:hover {
    border-color: var(--tp-theme-primary);
    color: var(--tp-theme-primary);
}

.tp-header-action-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--tp-theme-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid #fff;
}

/* Fix header height and dropdown positioning */
.tp-header-area {
    position: relative;
    z-index: 1000;
}

.tp-header-bottom {
    position: relative;
    z-index: 999;
    overflow: visible;
}

.tp-header-bottom .main-menu {
    overflow: visible;
}

.tp-header-bottom .main-menu > nav {
    overflow: visible;
}

/* Ensure dropdowns don't affect header height */
.tp-header-bottom .main-menu > nav > ul {
    position: relative;
}

/* Prevent any mega-menu or submenu from pushing content */
.tp-header-bottom .main-menu > nav > ul > li {
    position: relative;
}

/* Sticky header specific styles */
.tp-header-sticky-area {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
    background-color: var(--header-sticky-background-color) !important;
    color: var(--header-sticky-text-color) !important;
}

.tp-header-sticky-area.header-sticky-2 {
    transform: translateY(0);
}

.tp-header-sticky-area .tp-header-main {
    padding-top: 15px;
    padding-bottom: 15px;
}

.tp-header-sticky-area .tp-header-main-right {
    gap: 15px !important;
}

.tp-header-sticky-area .tp-header-search-box input {
    height: 42px;
}

.tp-header-sticky-area .tp-header-search-btn button {
    height: 42px;
    line-height: 42px;
}

.tp-header-sticky-area .tp-header-login-icon span {
    width: 38px;
    height: 38px;
}

.tp-header-sticky-area .tp-header-action-btn {
    width: 38px;
    height: 38px;
}

.tp-header-sticky-area .tp-header-bottom {
    border-top: 1px solid rgba(1, 15, 28, 0.1);
}

.tp-header-sticky-area .za-menu__link,
.tp-header-sticky-area .za-menu__label {
    min-height: 44px;
    padding: 10px 12px;
}

@media (max-width: 991px) {
    .tp-header-search-box {
        width: 100%;
    }

    .tp-header-main {
        padding-top: 15px;
        padding-bottom: 15px;
    }

    .tp-header-login-content {
        display: none;
    }

    .tp-header-login-icon span {
        margin-right: 0;
    }

    .tp-header-main-right {
        gap: 12px !important;
    }

    .tp-header-login {
        max-width: 120px;
    }
}

@media (max-width: 767px) {
    .tp-header-search-wrapper {
        flex-direction: row;
    }

    .tp-header-search-box input {
        padding-left: 15px;
        padding-right: 60px;
        font-size: 14px;
    }

    .tp-header-search-btn button {
        width: 50px;
        height: 40px;
        line-height: 40px;
    }

    .tp-header-login {
        display: none;
    }

    .tp-header-action-btn {
        width: 36px;
        height: 36px;
    }
}

/* Reserve independent space for the logo, search, account, and actions. */
.zaitoon-header-layout {
    display: grid;
    grid-template-areas: "logo search controls";
    grid-template-columns: minmax(150px, 1fr) minmax(280px, 3.5fr) minmax(420px, 2.8fr);
    align-items: center;
    column-gap: 16px;
    row-gap: 0;
    margin: 0 !important;
    --bs-gutter-x: 0;
    --bs-gutter-y: 0;
}

.zaitoon-header-layout > .zaitoon-header-col-logo,
.zaitoon-header-layout > .zaitoon-header-col-search,
.zaitoon-header-layout > .zaitoon-header-col-controls {
    width: auto !important;
    max-width: none;
    min-width: 0;
    padding: 0 !important;
    margin: 0;
}

.zaitoon-header-col-logo {
    grid-area: logo;
}

.zaitoon-header-col-search {
    grid-area: search;
}

.zaitoon-header-col-controls {
    grid-area: controls;
}

.zaitoon-header-col-search > .tp-header-search,
.zaitoon-header-col-search .tp-header-search-wrapper {
    width: 100%;
    min-width: 0;
}

.tp-header-search-box {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}

.tp-header-main-right {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    width: 100%;
    min-width: 0;
    gap: 16px !important;
}

.tp-header-login {
    flex: 1 1 auto;
    min-width: 0;
}

.tp-header-login a {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.tp-header-login-content {
    flex: 1 1 auto;
    width: 100%;
    max-width: 240px;
    margin-left: 0;
    min-width: 0;
}

.tp-header-login-email,
.tp-header-login-title {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tp-header-action {
    flex: 0 0 auto;
    min-width: 0;
    gap: 12px;
}

.tp-header-action-item {
    flex: 0 0 auto;
    margin: 0 !important;
}

@media (max-width: 1199.98px) {
    .zaitoon-header-layout {
        grid-template-areas:
            "logo controls"
            "search search";
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 12px;
        row-gap: 12px;
    }

    .zaitoon-header-layout > .zaitoon-header-col-search {
        width: 100% !important;
        justify-self: stretch;
    }

    .tp-header-main-right {
        width: auto;
        gap: 8px !important;
    }

    .tp-header-login {
        display: flex !important;
        max-width: none;
        flex: 0 0 auto;
    }

    .tp-header-action {
        gap: 8px;
    }

    .tp-header-login-icon span,
    .tp-header-action-btn {
        width: 36px;
        height: 36px;
    }

    .tp-header-main {
        padding-top: 15px;
        padding-bottom: 15px;
    }
}

@media (max-width: 767px) {
    .zaitoon-header-layout {
        row-gap: 12px;
    }

    .zaitoon-header-layout > .zaitoon-header-col-search {
        width: 100% !important;
        justify-self: stretch;
    }

    .tp-header-main-right {
        gap: 8px !important;
    }

    .tp-header-action {
        gap: 6px;
    }

    .tp-header-login-icon span,
    .tp-header-action-btn {
        width: 32px;
        height: 32px;
    }

    .tp-header-search-wrapper {
        height: 42px;
    }

    .tp-header-search-box input,
    .tp-header-search-btn button {
        height: 42px;
    }

    .tp-header-search-btn button {
        line-height: 42px;
    }
}
