/* ==========================================================================
   Header + Mega Menu — exact match to customer screenshot
   ========================================================================== */

.gm-header--design.page-header {
    background: #ffffff;
    border-bottom: 1px solid #EEEEEE;
    box-shadow: none;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.gm-header--design .gm-header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 72px;
    padding: 0.5rem 0;
}

.gm-header--design .gm-header__right {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    min-width: 0;
}

.gm-header--design .gm-header__logo img {
    max-height: 44px;
    width: auto;
    display: block;
}

.gm-header--design .gm-header__nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.gm-header--design .gm-header__nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0;
    border: none;
    background: transparent;
    color: #2A2A2A !important;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none !important;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.4;
    transition: color 0.15s ease;
}

.gm-header--design .gm-header__nav-item:hover {
    color: var(--gm-green) !important;
}

.gm-header--design .gm-header__nav-item--cats {
    font-weight: 600;
}

.gm-header--design .gm-header__burger {
    color: #2A2A2A;
    flex-shrink: 0;
}

.gm-header--design.gm-mega-open .gm-header__nav-item--cats,
.gm-header--design.gm-mega-open .gm-header__nav-item--cats .gm-header__burger {
    color: var(--gm-green) !important;
}

/* Left tools: search, cart, auth — RTL: first in DOM is closest to center */
.gm-header--design .gm-header__left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-shrink: 0;
}

.gm-header--design .gm-header__tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    color: #333333;
    font-size: 1.15rem;
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.15s ease, background 0.15s ease;
}

.gm-header--design .gm-header__tool:hover,
.gm-header--design .gm-header__search-wrap.is-open .gm-header__tool {
    color: var(--gm-green);
    background: rgba(0, 166, 81, 0.06);
}

.gm-header--design .gm-header__search-wrap {
    position: relative;
}

.gm-header--design .gm-header__search-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: min(380px, calc(100vw - 2rem));
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 1300;
    pointer-events: none;
}

.gm-header--design .gm-header__search-wrap.is-open .gm-header__search-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.gm-header--design .gm-header__search form {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.gm-header--design .gm-header__search form input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    height: 44px !important;
    padding: 0 1rem !important;
    font-size: 0.875rem !important;
    box-shadow: none !important;
    outline: none !important;
}

.gm-header--design .gm-header__search-btn {
    border: none;
    background: transparent;
    width: 44px;
    height: 44px;
    color: #6B7280;
    cursor: pointer;
}

/* Cart — icon only, green badge */
.gm-header--design .gm-header__cart.user-item.cart {
    position: relative !important;
    border: none !important;
    margin: 0 !important;
}

.gm-header--design .gm-header__cart > a.dropdown--btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    color: #333 !important;
    font-size: 0 !important;
    text-decoration: none !important;
    position: relative;
    border-radius: 8px;
}

.gm-header--design .gm-header__cart > a.dropdown--btn:hover {
    color: var(--gm-green) !important;
    background: rgba(0, 166, 81, 0.06) !important;
}

.gm-header--design .gm-header__cart > a.dropdown--btn i {
    font-size: 1.2rem !important;
    margin: 0 !important;
    color: inherit;
}

.gm-header--design .gm-header__cart .cart-count {
    position: absolute !important;
    top: 2px !important;
    right: 2px !important;
    left: auto !important;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--gm-green) !important;
    color: #fff !important;
    font-size: 0.62rem !important;
    font-weight: 700;
    border-radius: 999px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Auth link with text */
.gm-header--design .gm-header__auth {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #2A2A2A !important;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none !important;
    padding: 0.45rem 0.75rem;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    white-space: nowrap;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.gm-header--design .gm-header__auth i {
    font-size: 1.05rem;
}

.gm-header--design .gm-header__auth:hover {
    color: var(--gm-green) !important;
    border-color: var(--gm-green);
}

.gm-header--design .gm-header__account {
    position: relative;
}

/* ---- Mega Menu ---- */
.gm-header--design .gm-mega {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 999;
    border: none;
    box-shadow: none;
    padding: 0.35rem 0 1.25rem;
    background: transparent;
}

.gm-header--design.gm-mega-open .gm-mega {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.gm-header--design .gm-mega__panel {
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
}

.gm-header--design .gm-mega__box {
    background: #ffffff;
    border: 1px solid #EEEEEE;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.08);
    padding: 1.75rem 1.5rem 1.75rem;
}

.gm-header--design .gm-mega__layout {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

.gm-header--design .gm-mega__grid {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem 1.75rem;
}

.gm-header--design .gm-mega__col {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0;
    border: none;
}

.gm-header--design .gm-mega__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.35rem;
    border-radius: 10px;
    text-decoration: none !important;
    color: #2A2A2A !important;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.45;
    transition: background 0.15s ease, color 0.15s ease;
}

.gm-header--design .gm-mega__item:hover {
    background: #F6FBF8;
    color: var(--gm-green-dark) !important;
}

/* Icon on the right of text in RTL (first in flex) */
.gm-header--design .gm-mega__item-icon-wrap {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid #E3E5E8;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.gm-header--design .gm-mega__item:hover .gm-mega__item-icon-wrap {
    border-color: #C8CDD3;
}

.gm-header--design .gm-mega__item-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
    opacity: 0.7;
    filter: grayscale(1);
}

.gm-header--design .gm-mega__item-icon--default {
    color: #A0A6AE;
    opacity: 1;
    filter: none;
    width: auto;
    height: auto;
}

.gm-header--design .gm-mega__item-label {
    flex: 1;
    min-width: 0;
}

.gm-header--design .gm-mega__products-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    align-self: flex-start;
    color: var(--gm-green) !important;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none !important;
    padding: 0.55rem 0.25rem;
    white-space: nowrap;
    margin-top: 0.15rem;
}

.gm-header--design .gm-mega__products-link:hover {
    color: var(--gm-green-dark) !important;
}

.gm-header--design .gm-mega__products-link svg {
    flex-shrink: 0;
}

@media (max-width: 1199.98px) {
    .gm-header--design .gm-header__nav {
        gap: 1.1rem;
    }

    .gm-header--design .gm-mega__grid {
        gap: 0.25rem 1rem;
    }
}

@media (max-width: 991.98px) {
    .gm-header--design.page-header {
        display: none !important;
    }
}

@media (min-width: 992px) {
    .gm-header-mobile {
        display: none !important;
    }
}

@media (max-width: 575.98px) {
    .gm-header--design .gm-mega__layout {
        flex-direction: column;
    }

    .gm-header--design .gm-mega__grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ---- Desktop search modal ---- */
.gm-header--design .gm-header__search-trigger.is-active {
    color: var(--gm-green);
    background: rgba(0, 166, 81, 0.08);
}

.gm-search-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 8vh 1rem 2rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
}

.gm-search-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.gm-search-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 28, 24, 0.48);
    backdrop-filter: blur(4px);
}

.gm-search-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: min(82vh, 760px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(18, 28, 24, 0.22);
    overflow: hidden;
    transform: translateY(12px) scale(0.98);
    transition: transform .22s ease;
}

.gm-search-modal.is-open .gm-search-modal__dialog {
    transform: translateY(0) scale(1);
}

.gm-search-modal .gm-header__search-wrap.is-modal {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: min(82vh, 760px);
    position: static;
}

.gm-search-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 8px;
}

.gm-search-modal__head strong {
    font-size: 1rem;
    font-weight: 800;
    color: #1a1a2e;
}

.gm-search-modal__close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: #f3f5f4;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.gm-search-modal__close:hover {
    background: #e8f6f0;
    color: var(--gm-green);
}

.gm-search-modal__form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 18px 14px;
    padding: 6px 8px 6px 6px;
    border-radius: 14px;
    background: #f5f7f6;
    border: 1px solid #e5e7eb;
}

.gm-search-modal__form:focus-within {
    border-color: rgba(0, 166, 81, 0.45);
    box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.12);
    background: #fff;
}

.gm-search-modal__submit {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 11px;
    background: var(--gm-green);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
}

.gm-search-modal__submit:hover {
    background: var(--gm-green-dark, #008F45);
}

.gm-search-modal__input {
    flex: 1;
    min-width: 0;
    height: 42px;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    font-size: 0.95rem !important;
    color: #1a1a2e;
    padding: 0 4px !important;
}

.gm-search-modal__clear {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.gm-search-modal__clear:hover {
    color: #6b7280;
    background: #eef1ef;
}

.gm-search-modal__body.search-result,
.gm-search-modal .search-result,
.gm-search-modal .gm-search-panel {
    position: static !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: none !important;
    border: 0 !important;
    border-top: 1px solid #eef2f0 !important;
    border-radius: 0 !important;
    width: 100% !important;
    max-height: none !important;
    overflow: auto;
    padding: 12px 18px 18px !important;
    background: #fff !important;
    flex: 1 1 auto;
    min-height: 0;
}

.gm-search-modal .gm-search-block {
    margin-bottom: 1.1rem;
}

.gm-search-modal .gm-search-block:last-child {
    margin-bottom: 0;
}

.gm-search-modal .gm-search-block__head {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #6b7280;
}

.gm-search-modal .gm-search-block__head i {
    color: var(--gm-green);
}

body.gm-search-modal-open {
    overflow: hidden;
}

@media (max-width: 575.98px) {
    .gm-search-modal {
        padding: 0;
        align-items: stretch;
    }

    .gm-search-modal__dialog,
    .gm-search-modal .gm-header__search-wrap.is-modal {
        width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
    }
}
