/**
 * Meercato Header Styles (non-Tailwind)
 * Matches Figma design: node 1:800
 */

#header.meercato-header {
    font-family: 'Almarai', sans-serif;
    position: relative;
    z-index: 50;
    overflow: visible;
}

#header .meercato-header__top {
    align-items: center;
    gap: 18px;
    height: 88px;
    padding: 0 20px !important;
    max-width: 100%;
    overflow: visible;
    justify-content: flex-start !important;
}

#header .meercato-header__group {
    gap: 20px !important;
    min-width: 0 !important;
    flex: 1 1 0% !important;
    width: 0 !important;
}

#header .meercato-header__search-group {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px !important;
    height: 54px;
    min-width: 0 !important;
    flex: 1 1 0% !important;
    width: 0 !important;
}

/* Desktop language switcher – flag + text per Figma node 196:17982 */
#header .meercato-header__desktop-lang {
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    display: flex;
    align-items: center;
    align-self: center;
    height: 54px;
}

#header .meercato-header__lang-link {
    display: inline-flex;
    align-items: center;
    min-height: 54px;
    gap: 5px;
    text-decoration: none;
}

#header .meercato-header__lang-text {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #01265c;
    text-transform: capitalize;
    line-height: 1;
}

#header .meercato-header__lang-flag {
    width: 25px;
    height: 18px;
    display: block;
}

#header .meercato-header__search-group > .relative {
    display: block !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: 54px;
}

#header .meercato-header__search-group form,
#header #search_mini_form {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    width: 100% !important;
    height: 54px;
}

#header .meercato-header__actions {
    gap: 20px;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    margin-inline-start: auto;
}

#header .logo img {
    width: 120px;
    height: 78px;
    object-fit: contain;
}

#header .meercato-header__search-input,
#header input#search {
    flex: 1 1 0% !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 54px;
    padding: 0 16px;
    border: none;
    background-color: #f4f4f4;
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    color: #8d8d8d;
    box-sizing: border-box;
}

#header .meercato-header__search-input::placeholder {
    color: #8d8d8d;
    opacity: 0.7;
}

#header .meercato-header__search-button {
    width: 60px;
    height: 54px;
    margin: 0;
    padding: 0;
    border: none;
    background-color: #ee3a54;
}

#header .meercato-header__search-button:hover {
    background-color: #d6324a;
}

#header .meercato-header__search-button svg {
    width: 24px;
    height: 24px;
    color: #ffffff;
    stroke: #ffffff;
}

#header .meercato-header__login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 112px;
    height: 40px;
    padding: 0;
    border-radius: 2px;
    background-color: #878787;
    color: #ffffff;
    font-family: 'Almarai', sans-serif;
    font-size: 11.8px;
    font-weight: 700;
    letter-spacing: 0.295px;
    text-transform: capitalize;
    text-decoration: none;
    white-space: nowrap;
}

#header .meercato-header__login:hover {
    background-color: #6e6e6e;
}

#header .meercato-header__login svg {
    width: 27px;
    height: 27px;
    color: #ffffff;
    stroke: #ffffff;
}

#header .meercato-header__login-text {
    font-family: 'Almarai', sans-serif;
    font-size: 11.8px;
    font-weight: 700;
    letter-spacing: 0.295px;
    line-height: 26px;
    color: #ffffff;
    white-space: nowrap;
}

#header .meercato-header__action {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #ee3e54;
    text-decoration: none;
    white-space: nowrap;
}

#header .meercato-header__action svg {
    width: 27px;
    height: 27px;
    color: #ee3e54;
    stroke: #ee3e54;
}

#header .meercato-header__action-text {
    font-family: 'Almarai', sans-serif;
    font-size: 15.73px;
    font-weight: 700;
    letter-spacing: 0.393px;
    text-transform: none;
    line-height: 34.67px;
    color: #ee3e54;
    white-space: nowrap;
}

#header .meercato-header__action--partner,
#header .meercato-header__action--cart {
    gap: 5.33px;
}

#header .meercato-header__action-icon {
    display: block;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    color: #ee3e54;
    fill: currentColor;
    stroke: none;
}

#header .meercato-header__cart-icon-wrap {
    width: 42.67px;
    height: 42.67px;
    align-items: flex-end;
    justify-content: flex-start;
    flex-shrink: 0;
}

/* Partner and Cart text now inherits base action-text styles (unified font size) */

#header .meercato-header__cart-badge {
    position: absolute;
    top: 0;
    inset-inline-start: auto;
    inset-inline-end: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 21.33px;
    height: 21.33px;
    padding: 0 5px;
    border-radius: 10.67px;
    background-color: #ee3e54;
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-size: 13.33px;
    font-weight: 600;
    line-height: 21.33px;
    text-align: center;
}

#header .meercato-header__lang {
    display: inline-flex;
    align-items: flex-end;
    gap: 5px;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #01265c;
    text-transform: capitalize;
}

#header:dir(rtl) .meercato-header__lang {
    flex-direction: row-reverse;
}

#header:dir(rtl) .meercato-header__search-input {
    border-radius: 0 4px 4px 0;
}

#header:dir(rtl) .meercato-header__search-button {
    border-radius: 4px 0 0 4px;
}

#header:dir(rtl) .meercato-header__action,
#header:dir(rtl) .meercato-header__login {
    flex-direction: row-reverse;
}

#header:dir(ltr) .meercato-header__search-input {
    border-radius: 4px 0 0 4px;
}

#header:dir(ltr) .meercato-header__search-button {
    border-radius: 0 4px 4px 0;
}

/* Search input widths removed – input now uses flex: 1 to fill available space */

/* ==========================================================================
   MOBILE HEADER STYLES - Only visible on mobile (< 768px)
   Figma design: node 109:13399
   ========================================================================== */

/* Hide mobile header on desktop */
#header .meercato-header__mobile {
    display: none;
}

/* Mobile-only styles */
@media (max-width: 767px) {
    /* Show mobile header on mobile */
    #header .meercato-header__mobile {
        display: block;
        background: #ffffff;
        box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.25);
        padding: 12px 16px;
    }

    /* Hide desktop header on mobile */
    #header .meercato-header__desktop {
        display: none !important;
    }

    /* Mobile header inner container */
    #header .meercato-header__mobile-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 12px;
    }

    /* Mobile logo */
    #header .meercato-header__mobile-logo {
        flex-shrink: 0;
    }

    #header .meercato-header__mobile-logo .logo img {
        width: 77px;
        height: 46px;
        object-fit: contain;
    }

    /* Mobile search form */
    #header .meercato-header__mobile-search {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 40px;
        background: #ffffff;
        border: 0.8px solid rgba(211, 211, 211, 0.83);
        border-radius: 6px;
        padding: 0 16px;
        max-width: 100%;
        width: 100%;
    }

    /* Mobile search input */
    #header .meercato-header__mobile-search-input {
        flex: 1;
        height: 100%;
        border: none;
        background: transparent;
        font-family: 'Open Sans', sans-serif;
        font-size: 14px;
        font-weight: 400;
        color: #5b5b5b;
        outline: none;
        padding: 0;
        min-width: 0;
    }

    #header .meercato-header__mobile-search-input::placeholder {
        color: #5b5b5b;
        font-weight: 700;
    }

    #header .meercato-header__mobile-search-input::placeholder::first-letter {
        text-transform: capitalize;
    }

    /* Mobile search button */
    #header .meercato-header__mobile-search-btn {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        padding: 0;
        margin: 0;
        cursor: pointer;
    }

    #header .meercato-header__mobile-search-btn svg {
        width: 13px;
        height: 13px;
    }

    /* Mobile wishlist icon */
    #header .meercato-header__mobile-wishlist {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #header .meercato-header__mobile-wishlist svg {
        width: 32px;
        height: 30px;
    }
}

/* ==========================================================================
   TABLET HEADER STYLES - Only visible on tablet (768px - 1023px)
   Figma design: node 139:5528
   ========================================================================== */

@media (min-width: 768px) and (max-width: 1024px) {
    #header,
    #header .meercato-header__mobile,
    #header .meercato-header__mobile-inner {
        box-sizing: border-box;
        max-width: 100%;
    }

    /* Show mobile header on tablet */
    #header .meercato-header__mobile {
        display: block;
        background: #ffffff;
        box-shadow: 0px 6.764px 33.818px 0px rgba(0, 0, 0, 0.25);
        padding: 0 27px;
    }

    /* Hide desktop header on tablet */
    #header .meercato-header__desktop {
        display: none !important;
    }

    /* Tablet header inner container */
    #header .meercato-header__mobile-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        max-width: 690px;
        margin: 0 auto;
        gap: 27px;
        height: auto;
        padding: 0;
    }

    /* Tablet logo */
    #header .meercato-header__mobile-logo {
        flex-shrink: 0;
    }

    #header .meercato-header__mobile-logo .logo img {
        width: 130px;
        height: 78px;
        object-fit: contain;
    }

    /* Tablet search form */
    #header .meercato-header__mobile-search {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 68px;
        background: #ffffff;
        border: 1.353px solid rgba(211, 211, 211, 0.83);
        border-radius: 10px;
        padding: 0 27px;
        max-width: 100%;
        width: 100%;
    }

    /* Tablet search input */
    #header .meercato-header__mobile-search-input {
        flex: 1;
        height: 100%;
        border: none;
        background: transparent;
        font-family: 'Open Sans', sans-serif;
        font-size: 24px;
        font-weight: 400;
        color: #5b5b5b;
        outline: none;
        padding: 0;
        min-width: 0;
    }

    #header .meercato-header__mobile-search-input::placeholder {
        color: #5b5b5b;
        font-weight: 700;
        text-transform: capitalize;
    }

    /* Tablet search button */
    #header .meercato-header__mobile-search-btn {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        padding: 0;
        margin: 0;
        cursor: pointer;
    }

    #header .meercato-header__mobile-search-btn svg {
        width: 22px;
        height: 22px;
    }

    /* Tablet wishlist icon */
    #header .meercato-header__mobile-wishlist {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #header .meercato-header__mobile-wishlist svg {
        width: 54px;
        height: 51px;
    }
}
