.gheader {
    --gheader-accent: #4D6D37;
    --gheader-bg: #FFFFFF;
    --gheader-underline: 2px;
    --gheader-slogan-angle: -6deg;
    --gheader-slogan-right-offset: 0px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    z-index: 30;
    container-type: inline-size;
}

.gheader *,
.gheader *::before,
.gheader *::after {
    box-sizing: border-box;
}

.gheader__inner {
    width: 100%;
    margin: 0 auto;
    display: flex;
    box-sizing: border-box;
    overflow: visible;
    align-items: center;
    justify-content: space-between;
    gap: clamp(18px, 2.2vw, 48px);
}

.gheader__logo-wrap,
.gheader__logo-link,
.gheader__logo-img {
    border: 0 !important;
    border-bottom: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.gheader__logo-wrap {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.gheader__logo-link {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.gheader__logo-link::before,
.gheader__logo-link::after,
.gheader__logo-img::before,
.gheader__logo-img::after {
    display: none !important;
    content: none !important;
}

.gheader__logo-img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100% - 8px);
    object-fit: contain;
}

.gheader__nav {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.gheader__nav-link,
.gheader__mobile-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1F241F;
    text-decoration: none !important;
    white-space: nowrap;
    line-height: 1.2;
    font-size: 15px;
}

.gheader__nav-link {
    padding: 11px 0 13px;
}

.gheader__nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    height: var(--gheader-underline);
    background: var(--gheader-accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .18s ease;
}

.gheader--underline-hover-active .gheader__nav-link:hover::after,
.gheader--underline-hover-active .gheader__nav-link.is-active::after,
.gheader--underline-hover .gheader__nav-link:hover::after,
.gheader--underline-active .gheader__nav-link.is-active::after,
.gheader--underline-always .gheader__nav-link::after {
    transform: scaleX(1);
}

.gheader--underline-none .gheader__nav-link::after {
    display: none;
}

.gheader__right {
    --gheader-right-gap: clamp(16px, 1.6vw, 32px);
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    gap: var(--gheader-right-gap);
}

.gheader__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 11px;
    white-space: nowrap;
}

.gheader__action,
.gheader__burger {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    padding: 4px;
    margin: 0;
    color: #1F241F;
    text-decoration: none !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    line-height: 1;
}

.gheader__action svg,
.gheader__action i {
    display: block;
    fill: currentColor;
}

.gheader__separator {
    width: 1px;
    height: 24px;
    display: inline-block;
    flex: 0 0 1px;
}

.gheader__badge {
    position: absolute;
    top: -5px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

/* Keep the fitted slot in the row, then position Search + slogan relative
   to the header edge. The slider remains live through Elementor CSS edits;
   measured limits prevent overlap with navigation or the next action. */
.gheader__slogan-cluster {
    flex: 0 1 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    transform: translateX(clamp(var(--gheader-slogan-min-shift, 0px), calc(var(--gheader-slogan-max-shift, 0px) - max(0px, var(--gheader-slogan-right-offset, 0px))), var(--gheader-slogan-max-shift, 0px)));
}

.gheader__slogan-cluster--no-slogan {
    transform: none;
}

.gheader__slogan-cluster > .gheader__search-toggle {
    flex: 0 0 auto;
}

.gheader__slogan {
    flex: 0 1 auto;
    min-width: 0;
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    place-items: center;
    text-align: center;
    text-decoration: none !important;
    margin-right: 0 !important;
    line-height: 1.2;
    font-size: 15px;
}

.gheader__slogan-text {
    display: block;
    width: max-content;
    white-space: nowrap;
    overflow-wrap: anywhere;
    transform-origin: center;
    transform: rotate(var(--gheader-slogan-angle, -6deg)) scale(var(--gheader-slogan-scale, 1));
}

.gheader__burger {
    width: 34px;
    height: 34px;
    flex-direction: column;
    gap: 5px;
    display: none;
}

.gheader__burger span {
    width: 21px;
    height: 2px;
    background: currentColor;
    border-radius: 3px;
    transition: transform .18s ease, opacity .18s ease;
}

.gheader.is-menu-open .gheader__burger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.gheader.is-menu-open .gheader__burger span:nth-child(2) {
    opacity: 0;
}
.gheader.is-menu-open .gheader__burger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.gheader__mobile-menu,
.gheader__search-panel {
    width: 100%;
    background-color: var(--gheader-bg, #FFFFFF);
    border-top: 1px solid #E7ECE4;
}

.gheader__mobile-menu {
    margin: 0 auto;
    padding: 12px 20px 18px;
}

.gheader__mobile-link {
    width: 100%;
    justify-content: flex-start;
    padding: 13px 4px;
    border-bottom: 1px solid #EEF1EC;
}

.gheader__mobile-link:last-child {
    border-bottom: 0;
}

.gheader__search-panel-inner {
    width: 100%;
    margin: 0 auto;
    padding: 14px 24px;
}

.gheader__search-form {
    display: flex;
    gap: 10px;
    width: 100%;
}

.gheader__search-form input {
    flex: 1 1 auto;
    min-width: 0;
    height: 42px;
    border: 1px solid #D8DED3;
    border-radius: 4px;
    padding: 0 14px;
    font: inherit;
}

.gheader__search-form button {
    flex: 0 0 auto;
    height: 42px;
    border: 0;
    border-radius: 4px;
    padding: 0 18px;
    background: var(--gheader-accent);
    color: #fff;
    cursor: pointer;
}

/* Pametni meni (v1.6): stavke ostaju vidljive po prioritetu dok god staju.
   JS skriva stavke od kraja liste; hamburger uvek sadrži kompletan meni. */
.gheader[data-overflow-mode="priority"] .gheader__nav {
    min-width: 0;
    flex: 0 1 auto;
}

.gheader.has-overflow .gheader__burger {
    display: inline-flex;
}

/* Only the navigation collapses. The slogan keeps its own flexible slot. */
.gheader.is-compact .gheader__nav {
    display: none;
}

.gheader.is-compact .gheader__burger {
    display: inline-flex;
}

.gheader.is-compact .gheader__right {
    --gheader-right-gap: 12px;
    margin-left: auto;
}

.gheader.is-compact .gheader__inner {
    gap: 18px;
}

.gheader.is-phone .gheader__separator {
    height: 24px;
}

.gheader.is-phone .gheader__actions {
    gap: 8px;
}

.gheader.is-phone .gheader__search-panel-inner,
.gheader.is-phone .gheader__mobile-menu {
    padding-left: 16px;
    padding-right: 16px;
}

.gheader.is-phone .gheader__search-form {
    flex-direction: column;
}

.gheader.is-phone .gheader__search-form button {
    width: 100%;
}

.gheader [hidden] {
    display: none !important;
}

/* ============================================================
   v1.2.0 — robust responsive fallback
   Container queries make the header react to the REAL width of
   the Elementor canvas/widget even if JS is late in the editor.
   ============================================================ */

/* Neutralise theme/global button styles (important in Elementor previews). */
.gheader button.gheader__action,
.gheader button.gheader__burger {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: 0;
    min-width: 0 !important;
    min-height: 0 !important;
    width: auto;
    max-width: none !important;
    padding: 4px !important;
    margin: 0 !important;
    line-height: 1 !important;
}

.gheader button.gheader__burger {
    width: 38px !important;
    height: 38px !important;
    padding: 7px !important;
}

.gheader__action:hover,
.gheader__action:focus,
.gheader__burger:hover,
.gheader__burger:focus {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

/* The desktop row must never force the widget wider than its container. */
.gheader__inner {
    min-width: 0;
    overflow: visible;
}

.gheader__right,
.gheader__actions,
.gheader__logo-wrap {
    min-width: 0;
}

/* Tablet / compact mode — based on the actual widget width. */
@container (max-width: 1240px) {
    .gheader[data-overflow-mode="compact"] .gheader__nav {
        display: none !important;
    }

    .gheader[data-overflow-mode="compact"] .gheader__burger {
        display: inline-flex !important;
    }

    .gheader[data-overflow-mode="compact"] .gheader__right {
        margin-left: auto !important;
        --gheader-right-gap: 8px;
        gap: var(--gheader-right-gap) !important;
    }

    .gheader[data-overflow-mode="compact"] .gheader__slogan-cluster {
        gap: 6px !important;
    }

    .gheader[data-overflow-mode="compact"] .gheader__inner {
        justify-content: space-between !important;
        gap: 14px !important;
    }

    .gheader[data-overflow-mode="compact"] .gheader__actions {
        gap: 10px !important;
    }
}

/* Phone mode. Keep logo + search + cart + hamburger in one stable row. */
@container (max-width: 650px) {
    .gheader__nav {
        display: none !important;
    }

    .gheader__burger {
        display: inline-flex !important;
    }

    .gheader[data-overflow-mode] .gheader__right {
        margin-left: auto !important;
        --gheader-right-gap: 6px;
        gap: var(--gheader-right-gap) !important;
    }

    .gheader[data-overflow-mode] .gheader__slogan-cluster {
        gap: 4px !important;
    }

    .gheader[data-overflow-mode] .gheader__inner {
        gap: 8px !important;
        padding-left: 14px !important;
        padding-right: 14px !important;
    }


    .gheader[data-overflow-mode] .gheader__actions {
        gap: 5px !important;
    }

    .gheader__separator {
        display: none !important;
    }

    .gheader__action,
    .gheader__burger {
        flex: 0 0 auto !important;
    }

    .gheader button.gheader__action,
    .gheader button.gheader__burger,
    .gheader a.gheader__action {
        width: 34px !important;
        height: 34px !important;
        padding: 6px !important;
    }

    .gheader button.gheader__burger {
        display: inline-flex !important;
        flex-direction: column !important;
    }

    .gheader__badge {
        top: -3px;
        right: -3px;
        min-width: 16px;
        height: 16px;
        font-size: 9px;
    }

    .gheader__mobile-menu,
    .gheader__search-panel-inner {
        max-width: 100% !important;
    }
}

/* Extra-narrow safety. */
@container (max-width: 390px) {
    .gheader[data-overflow-mode] .gheader__inner {
        padding-left: 10px !important;
        padding-right: 10px !important;
        gap: 5px !important;
    }


    .gheader[data-overflow-mode] .gheader__actions {
        gap: 2px !important;
    }

    .gheader button.gheader__action,
    .gheader button.gheader__burger,
    .gheader a.gheader__action {
        width: 32px !important;
        height: 32px !important;
        padding: 5px !important;
    }
}


/* ============================================================
   v1.4.0 — exact header height
   The main row obeys Elementor's exact height control. Content
   may scale/fit inside it, but cannot make the row taller.
   ============================================================ */
.gheader__inner {
    box-sizing: border-box !important;
}

.gheader__logo-wrap,
.gheader__logo-link {
    height: 100%;
    max-height: 100%;
}

.gheader__logo-link {
    max-width: 100%;
}

.gheader__logo-img {
    max-height: calc(100% - 8px) !important;
    object-fit: contain !important;
}

.gheader__nav,
.gheader__right,
.gheader__actions {
    max-height: 100%;
}

/* Keep controls centred inside very thin custom headers. */
.gheader__action,
.gheader__burger {
    align-self: center;
}

/* v1.6.0 — compact factory preset + optional priority overflow navigation. */

/* ============================================================
   v1.6.3 — true smart-fit + visually centred navigation
   No fixed nth-child hiding. JS keeps the maximum number of
   complete priority items that fit between logo and actions.
   ============================================================ */
@container (min-width: 651px) {
    .gheader[data-overflow-mode="priority"] .gheader__inner {
        position: relative !important;
        justify-content: space-between !important;
    }

    .gheader[data-overflow-mode="priority"] .gheader__logo-wrap {
        position: relative;
        z-index: 2;
    }

    .gheader[data-overflow-mode="priority"] .gheader__nav {
        display: flex !important;
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: max-content !important;
        max-width: none !important;
        min-width: 0 !important;
        flex: none !important;
        overflow: visible !important;
        justify-content: center !important;
        z-index: 1;
    }

    /* Older safety queries hid fixed item numbers. In v1.6.3 only the
       JS-calculated [hidden] state may remove a desktop menu item. */
    .gheader[data-overflow-mode="priority"] .gheader__nav-link:not([hidden]) {
        display: inline-flex !important;
    }

    .gheader[data-overflow-mode="priority"] .gheader__right {
        position: relative;
        z-index: 2;
        margin-left: auto !important;
    }

    .gheader[data-overflow-mode="priority"]:not(.has-overflow) .gheader__burger {
        display: none !important;
    }

    .gheader[data-overflow-mode="priority"].has-overflow .gheader__burger {
        display: inline-flex !important;
        flex-direction: column !important;
    }
}

/* Phone remains a clean compact row; the full navigation is in hamburger. */
@container (max-width: 650px) {
    .gheader[data-overflow-mode="priority"] .gheader__nav {
        display: none !important;
        position: static !important;
        transform: none !important;
    }

    .gheader[data-overflow-mode="priority"] .gheader__burger {
        display: inline-flex !important;
        flex-direction: column !important;
    }
}


/* ============================================================
   v1.6.7 — overlay hamburger/search panels
   Dropdowns are absolutely positioned over the page content. They
   do not increase header height and always inherit the exact header
   background color selected in Elementor. The value is also written
   inline on .gheader, so it does not depend on Elementor CSS cache.
   ============================================================ */

/* Let the dropdown escape the Elementor widget box. */
.elementor-widget-garden_header_builder,
.elementor-widget-garden_header_builder > .elementor-widget-container,
.gheader {
    overflow: visible !important;
}

.elementor-widget-garden_header_builder {
    position: relative;
    z-index: 99990 !important;
}

.gheader {
    z-index: 99991;
}

.gheader__mobile-menu,
.gheader__search-panel {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    z-index: 99999 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    background: var(--gheader-bg, #FFFFFF) !important;
    background-color: var(--gheader-bg, #FFFFFF) !important;
    box-shadow: 0 12px 28px rgba(31, 36, 31, .12);
    pointer-events: auto;
}

.gheader__mobile-menu[hidden],
.gheader__search-panel[hidden] {
    display: none !important;
}

.gheader.is-menu-open .gheader__mobile-menu:not([hidden]),
.gheader.is-search-open .gheader__search-panel:not([hidden]) {
    display: block !important;
}

.gheader__mobile-menu {
    max-height: min(70vh, 520px);
    overflow-x: hidden;
    overflow-y: auto;
}

.gheader__mobile-link {
    cursor: pointer;
    background-color: transparent;
}

/* v1.6.8: alpha-aware header background. The PHP renderer now preserves
   4/8-digit hex colors (for example #FFFFFFDE), so this variable is exactly
   the same translucent color for the header and its overlay panels. */


/* ============================================================
   v1.6.9 — real translucent compact header
   The same alpha-aware background is forced on the header and the
   dropdown. On tablet/phone the widget can overlap the following
   page content, so #FFFFFFDE is composited over the hero instead of
   over an empty white strip.
   ============================================================ */
.gheader {
    background: var(--gheader-bg, #FFFFFF) !important;
    background-color: var(--gheader-bg, #FFFFFF) !important;
}

.elementor-widget-garden_header_builder.gheader-overlay-active {
    margin-bottom: calc(-1 * var(--gheader-overlay-height, 66px)) !important;
    position: relative !important;
    z-index: 99990 !important;
}

.elementor-widget-garden_header_builder.gheader-overlay-active,
.elementor-widget-garden_header_builder.gheader-overlay-active > .elementor-widget-container {
    background: transparent !important;
    background-color: transparent !important;
    overflow: visible !important;
}


/* ============================================================
   v1.7.3 — Elementor editor-only canvas stabilisation
   This block is activated only when Elementor is actually editing
   the page. It does not change the published/front-end header.
   The editor gets a stable, full-width widget box and the compact
   overlay no longer pulls the following section upward while editing.
   ============================================================ */
.elementor-widget-garden_header_builder.gheader-editor-preview {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    align-self: stretch !important;
    margin-bottom: 0 !important;
    z-index: 20 !important;
}

.elementor-widget-garden_header_builder.gheader-editor-preview > .elementor-widget-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
}

.elementor-widget-garden_header_builder.gheader-editor-preview .gheader {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

/* On the live site compact mode intentionally overlays the first section.
   In the editor that negative margin makes the header look broken and can
   place the next section over the widget selection area. Keep the exact
   header visuals, but reserve its row height while editing. */
.elementor-widget-garden_header_builder.gheader-editor-preview.gheader-overlay-active {
    margin-bottom: 0 !important;
}

/* Elementor's editing chrome must stay above the header. The published
   version keeps its original high stacking order. */
.elementor-widget-garden_header_builder.gheader-editor-preview .gheader {
    z-index: 21 !important;
}
