/* =========================================================
   OPG Header — sticky site header.
   :root tokeni duplicirani iz hero.css (Bee Jump pattern) jer
   header se može učitati prije ili bez homepage hero plugina.
   ========================================================= */
:root {
    --opg-brand: #f7bd00;
    --opg-brand-dark: #eb6d2f;
    --opg-ink: #5a3733;
    --opg-ink-soft: #8b6a63;
    --opg-cream: #f9f4f0;
    --opg-white: #ffffff;
    --opg-font-heading: 'Signika Negative', system-ui, sans-serif;
    --opg-font-body: 'Open Sans', system-ui, sans-serif;
    /* Approximated header height per breakpoint — koristi se za
       scroll-padding-top tako da sticky header ne reže anchor target. */
    --opg-header-h: 68px;
}

@media (min-width: 768px) {
    :root {
        --opg-header-h: 88px;
    }
}

/* ---------- Anchor scroll offset (sticky header compensation) ---------- */

html {
    scroll-padding-top: var(--opg-header-h, 80px);
}

.admin-bar html {
    scroll-padding-top: calc(var(--opg-header-h, 80px) + 32px);
}

@media screen and (max-width: 782px) {
    .admin-bar html {
        scroll-padding-top: calc(var(--opg-header-h, 80px) + 46px);
    }
}

/* ---------- Body scroll lock when mobile menu open ---------- */

body.opg-header-open {
    overflow: hidden;
}

/* ---------- Header shell ---------- */

.opg-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--opg-cream, #f9f4f0);
    color: var(--opg-ink, #5a3733);
    font-family: var(--opg-font-body, system-ui, sans-serif);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.opg-header.is-scrolled {
    background: var(--opg-white, #fff);
    box-shadow: 0 2px 12px rgba(90, 55, 51, 0.1);
}

.admin-bar .opg-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .opg-header {
        top: 46px;
    }
}

/* ---------- Inner row ---------- */

.opg-header__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

@media (min-width: 768px) {
    .opg-header__inner {
        padding: 18px 24px;
        gap: 24px;
    }
}

@media (min-width: 1024px) {
    .opg-header__inner {
        padding: 20px 32px;
        gap: 32px;
    }
}

/* ---------- Logo ---------- */

.opg-header__logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--opg-ink, #5a3733);
    flex-shrink: 0;
}

.opg-header__logo-img {
    width: auto;
    height: 40px;
    display: block;
}

@media (min-width: 768px) {
    .opg-header__logo-img {
        height: 52px;
    }
}

.opg-header__brand {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.opg-header__brand-line-1 {
    font-family: var(--opg-font-heading, sans-serif);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
    color: var(--opg-ink, #5a3733);
    text-transform: uppercase;
}

.opg-header__brand-line-2 {
    font-family: var(--opg-font-body, sans-serif);
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    color: var(--opg-ink-soft, #8b6a63);
    text-transform: uppercase;
    margin-top: 4px;
}

@media (min-width: 768px) {
    .opg-header__brand-line-1 {
        font-size: 1.4rem;
    }

    .opg-header__brand-line-2 {
        font-size: 0.78rem;
    }
}

/* ---------- Desktop nav ---------- */

.opg-header__nav--desktop {
    display: none;
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
}

@media (min-width: 1024px) {
    .opg-header__nav--desktop {
        display: flex;
    }
}

.opg-header__menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 32px;
}

.opg-header__menu li {
    position: relative;
}

.opg-header__menu a {
    text-decoration: none;
    color: var(--opg-ink, #5a3733);
    font-family: var(--opg-font-heading, sans-serif);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 8px 0;
    transition: color 0.2s ease;
    display: block;
}

.opg-header__menu a:hover,
.opg-header__menu a:focus-visible,
.opg-header__menu .current-menu-item > a,
.opg-header__menu .current-menu-ancestor > a,
.opg-header__menu .current_page_item > a {
    color: var(--opg-brand-dark, #eb6d2f);
}

/* Desktop dropdown (one level deep) */
.opg-header__menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 12px 0;
    position: absolute;
    top: 100%;
    left: -16px;
    background: var(--opg-white, #fff);
    box-shadow: 0 8px 24px rgba(90, 55, 51, 0.12);
    border-radius: 8px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 1;
}

.opg-header__menu li:hover > .sub-menu,
.opg-header__menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.opg-header__menu .sub-menu a {
    padding: 8px 20px;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
}

/* ---------- Right actions ---------- */

.opg-header__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .opg-header__actions {
        gap: 16px;
    }
}

/* ---------- Cart ---------- */

.opg-header__cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--opg-ink, #5a3733);
    text-decoration: none;
    transition: color 0.2s ease;
}

.opg-header__cart:hover,
.opg-header__cart:focus-visible {
    color: var(--opg-brand-dark, #eb6d2f);
}

.opg-header__cart-icon {
    display: block;
}

.opg-header__cart-count {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--opg-brand-dark, #eb6d2f);
    color: var(--opg-white, #fff);
    font-family: var(--opg-font-body, sans-serif);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border-radius: 999px;
    box-sizing: border-box;
}

/* ---------- Contact button ---------- */

.opg-header__contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-family: var(--opg-font-heading, sans-serif);
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--opg-white, #fff);
    background: var(--opg-brand, #f7bd00);
    padding: 12px 24px;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.opg-header__contact:hover,
.opg-header__contact:focus-visible {
    background: var(--opg-ink, #5a3733);
    color: var(--opg-white, #fff);
}

.opg-header__contact--desktop {
    display: none;
}

@media (min-width: 1024px) {
    .opg-header__contact--desktop {
        display: inline-flex;
    }
}

/* ---------- Mobile toggle ---------- */

.opg-header__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 0;
    color: var(--opg-ink, #5a3733);
    cursor: pointer;
    transition: color 0.2s ease;
}

.opg-header__toggle:hover,
.opg-header__toggle:focus-visible {
    color: var(--opg-brand-dark, #eb6d2f);
}

.opg-header__toggle-icon--close {
    display: none;
}

[data-opg-menu-toggle][aria-expanded="true"] .opg-header__toggle-icon--open {
    display: none;
}

[data-opg-menu-toggle][aria-expanded="true"] .opg-header__toggle-icon--close {
    display: block;
}

@media (min-width: 1024px) {
    .opg-header__toggle {
        display: none;
    }
}

/* ---------- Mobile menu panel ---------- */

.opg-header__mobile {
    display: block;
    background: var(--opg-cream, #f9f4f0);
    border-top: 1px solid rgba(90, 55, 51, 0.08);
    padding: 8px 0 16px;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
}

.opg-header.is-scrolled .opg-header__mobile {
    background: var(--opg-white, #fff);
}

.opg-header__mobile[hidden] {
    display: none !important;
}

@media (min-width: 1024px) {
    .opg-header__mobile {
        display: none !important;
    }
}

.opg-header__menu--mobile {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.opg-header__menu--mobile li {
    border-bottom: 1px solid rgba(90, 55, 51, 0.08);
}

.opg-header__menu--mobile li:last-child {
    border-bottom: none;
}

.opg-header__menu--mobile a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    padding: 16px 24px;
    color: var(--opg-ink, #5a3733);
    font-family: var(--opg-font-heading, sans-serif);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    position: relative;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.opg-header__menu--mobile a::after {
    content: "";
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a3733' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='9 6 15 12 9 18'/></svg>");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    flex-shrink: 0;
    margin-left: 12px;
    transition: transform 0.2s ease;
}

.opg-header__menu--mobile a:hover,
.opg-header__menu--mobile a:focus-visible {
    color: var(--opg-brand-dark, #eb6d2f);
}

.opg-header__menu--mobile .current-menu-item > a,
.opg-header__menu--mobile .current-menu-ancestor > a,
.opg-header__menu--mobile .current_page_item > a {
    color: var(--opg-brand-dark, #eb6d2f);
}

.opg-header__menu--mobile .current-menu-item > a::after,
.opg-header__menu--mobile .current-menu-ancestor > a::after,
.opg-header__menu--mobile .current_page_item > a::after {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eb6d2f' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><polyline points='9 6 15 12 9 18'/></svg>");
    transform: scale(1.15);
}

/* Mobile sub-menu (1 level deep) */
.opg-header__menu--mobile .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    background: rgba(90, 55, 51, 0.04);
}

.opg-header__menu--mobile .sub-menu a {
    padding-left: 44px;
    font-size: 0.9rem;
    letter-spacing: 0.12em;
}

/* Mobile contact button */
.opg-header__contact--mobile {
    display: flex;
    margin: 16px 24px 0;
    padding: 16px 24px;
    width: auto;
    justify-content: center;
}

@media (min-width: 1024px) {
    .opg-header__contact--mobile {
        display: none;
    }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .opg-header,
    .opg-header__menu a,
    .opg-header__menu .sub-menu,
    .opg-header__cart,
    .opg-header__contact,
    .opg-header__toggle,
    .opg-header__menu--mobile a,
    .opg-header__menu--mobile a::after {
        transition: none;
    }
}

/* =========================================================
   Admin form preview (image picker tile) — bere isti vizual
   kao homepage plugin, lokalno.
   ========================================================= */
.opg-header-image {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.opg-header-image__preview {
    width: 200px;
    height: 120px;
    background: #f0f0f1;
    border: 1px dashed #c3c4c7;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.opg-header-image__preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.opg-header-empty {
    color: #8c8f94;
    font-size: 12px;
}

.opg-header-image__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
