/* ============================================================
   BARKLY — Header, Footer, Cart Drawer
   ============================================================ */

:root {
    --bk-ink:        #2A332B;
    --bk-green:      #3D5A3E;
    --bk-green-2:    #587A47;
    --bk-gold:       #C8922A;
    --bk-gold-soft:  #F0D28A;
    --bk-cream:      #F5F0E8;
    --bk-paper:      #FAF7F2;
    --bk-white:      #ffffff;
    --bk-text:       #2A332B;
    --bk-text-mid:   #4A5A4C;
    --bk-text-light: #8A9084;
    --bk-border:     rgba(61, 90, 62, 0.12);
    --bk-shadow:     0 4px 24px rgba(61, 90, 62, 0.08);
    --bk-shadow-lg:  0 12px 40px rgba(61, 90, 62, 0.18);
    --bk-radius:     14px;
    --bk-radius-lg:  20px;
    --bk-header-h:   72px;
}

/* ============================================================
   HEADER
   ============================================================ */

.bk-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bk-white);
    border-bottom: 1px solid var(--bk-border);
    transition: box-shadow 0.3s ease;
}

.bk-header.is-scrolled {
    box-shadow: 0 2px 12px rgba(61, 90, 62, 0.06);
}

.bk-header__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: var(--bk-header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* ── LOGO ─────────────────────────────────────────────────── */
.bk-header__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--bk-green);
    transition: opacity 0.2s ease;
}
.bk-header__logo:hover {
    opacity: 0.85;
}
.bk-header__logo-img {
    /* Owner 2026-05-18: bumped 48px → 52px. Header height stays at 72px
       via .bk-header__inner; only the logo grows. */
    height: 52px !important;
    width: auto !important;
    display: block;
}
/* Belt-and-suspenders selector for any nested-image variants. height-only
   to preserve the logo's intrinsic aspect ratio (the PNG is a wordmark, not
   a square mark — forcing both axes squishes the lettering). */
.bk-header__mark img,
.bk-header__logo img {
    height: 52px !important;
    width: auto !important;
}

/* fallback ako logo PNG ne postoji */
.bk-header__logo-img:not([src]),
.bk-header__logo-img[src=""],
.bk-header__logo-img[src*="barkly-logo.png"]:where(:not([data-loaded])) {
    /* Ako se slika ne učita, JS dodaje fallback klasu na <a> */
}

.bk-header__logo--text {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 26px;
    font-weight: 800;
    color: var(--bk-green);
    letter-spacing: -0.02em;
}

/* ── PRIMARY NAV (center) — owner spec 2026-05 ───────────────
   Sits between .bk-header__logo and .bk-header__actions.
   flex:1 + justify-content:center makes it center between logo and actions.
   Hidden on ≤900px (no hamburger for now — caveman). */
.bk-header__nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    justify-content: center;
}
.bk-header__nav-link {
    padding: 7px 13px;
    color: #2A332B;
    font-size: 13.5px;
    font-weight: 500;
    font-family: "DM Sans", sans-serif;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    letter-spacing: -0.01em;
}
.bk-header__nav-link:hover {
    background: rgba(61,90,62,0.07);
    color: #3D5A3E;
}
@media (max-width: 900px) {
    .bk-header__nav { display: none; }
}

/* ── ACTIONS (right) ──────────────────────────────────────── */
.bk-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bk-header__icon-btn {
    position: relative;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    color: var(--bk-green);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
}
.bk-header__icon-btn:hover,
.bk-header__icon-btn:focus-visible {
    background: var(--bk-cream);
    border-color: var(--bk-border);
    color: var(--bk-ink);
    outline: none;
}
.bk-header__icon-btn:active {
    transform: scale(0.94);
}
.bk-header__icon-btn svg {
    pointer-events: none;
}

/* ── CART BADGE — owner 2026-05-17, 4th pass ────────────────────────────────
   Sits ABOVE-RIGHT of the cart icon (peeks out, doesn't overlap glyph).
   Selector duplicated so this rule wins regardless of cascade ordering. */
.bk-header__cart-btn,
.bk-header .bk-header__cart-btn {
    position: relative !important;
    overflow: visible !important;
}
.bk-header__cart-btn .bk-header__cart-count,
.bk-header__cart-count {
    position: absolute !important;
    top: -8px !important;
    right: -8px !important;
    min-width: 18px !important;
    height: 18px !important;
    padding: 0 5px;
    background: var(--bk-gold);
    color: var(--bk-white);
    border-radius: 999px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    line-height: 1;
    text-align: center;
    border: 2px solid var(--bk-cream);
    box-sizing: content-box;
    transform: scale(0);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.bk-header__cart-count.is-visible {
    transform: scale(1);
}
.bk-header__cart-count.is-bumped {
    animation: bk-cart-bump 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bk-cart-bump {
    0%, 100% { transform: scale(1); }
    30%      { transform: scale(1.35); }
    60%      { transform: scale(0.92); }
}

/* ── PROFILE BADGE — owner 2026-05-18 ────────────────────────────────────────
   Small gold dot in the top-right corner of the profile icon when the user
   is logged in. PHP only renders the <span> element when `is_user_logged_in()`,
   so no toggle class is needed — presence in DOM = visible. */
.bk-header__profile-btn {
    position: relative !important;
    overflow: visible !important;
}
.bk-header__profile-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #C8922A;       /* --bk-gold */
    border: 2px solid #F5F0E8; /* --bk-cream — matches the header bg ring */
    display: block;
    pointer-events: none;
}

/* ============================================================
   CART DRAWER
   ============================================================ */

.bk-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(42, 51, 43, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    z-index: 1100;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
.bk-cart-overlay.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s linear 0s;
}

.bk-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 420px;
    background: var(--bk-white);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 1101;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.bk-cart-drawer.is-open {
    transform: translateX(0);
}

.bk-cart-drawer__head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--bk-border);
    background: var(--bk-paper);
}
.bk-cart-drawer__title {
    margin: 0;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--bk-ink);
}
.bk-cart-drawer__close {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--bk-text-mid);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    padding: 0;
}
.bk-cart-drawer__close:hover {
    background: var(--bk-cream);
    color: var(--bk-ink);
}

.bk-cart-drawer__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 20px 24px;
    -webkit-overflow-scrolling: touch;
}

.bk-cart-drawer__loading {
    text-align: center;
    color: var(--bk-text-light);
    font-size: 14px;
    padding: 40px 0;
}

/* ── CART ITEMS ───────────────────────────────────────────── */
.bk-cart-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--bk-border);
}
.bk-cart-item:last-child {
    border-bottom: none;
}
.bk-cart-item__img {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background: var(--bk-cream);
    object-fit: cover;
    flex-shrink: 0;
}
.bk-cart-item__info {
    flex: 1;
    min-width: 0;
}
.bk-cart-item__name {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: var(--bk-ink);
    line-height: 1.3;
}
.bk-cart-item__meta {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--bk-text-light);
}
.bk-cart-item__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.bk-cart-item__qty {
    display: inline-flex;
    align-items: center;
    background: var(--bk-cream);
    border-radius: 8px;
    overflow: hidden;
}
.bk-cart-item__qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--bk-text-mid);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}
.bk-cart-item__qty-btn:hover {
    background: var(--bk-border);
    color: var(--bk-ink);
}
.bk-cart-item__qty-val {
    min-width: 28px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--bk-ink);
}
.bk-cart-item__price {
    font-size: 14px;
    font-weight: 700;
    color: var(--bk-green);
}
.bk-cart-item__remove {
    background: transparent;
    border: none;
    color: var(--bk-text-light);
    font-size: 11px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 0;
    transition: color 0.2s ease;
}
.bk-cart-item__remove:hover {
    color: #B5342B;
}

/* ── FOOT (totals + checkout) ─────────────────────────────── */
.bk-cart-drawer__foot {
    flex: 0 0 auto;
    padding: 18px 24px 24px;
    border-top: 1px solid var(--bk-border);
    background: var(--bk-paper);
}
.bk-cart-drawer__total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
}
.bk-cart-drawer__total-label {
    font-size: 13px;
    color: var(--bk-text-mid);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}
.bk-cart-drawer__total-value {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 24px;
    font-weight: 800;
    color: var(--bk-ink);
}
.bk-cart-drawer__checkout {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: var(--bk-gold);
    color: var(--bk-white);
    border: none;
    border-radius: 50px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(200, 146, 42, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.bk-cart-drawer__checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(200, 146, 42, 0.45);
    color: var(--bk-white);
}
.bk-cart-drawer__view-cart {
    display: block;
    margin-top: 10px;
    text-align: center;
    color: var(--bk-text-mid);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s ease;
}
.bk-cart-drawer__view-cart:hover {
    color: var(--bk-green);
    text-decoration: underline;
}

/* ── EMPTY STATE ──────────────────────────────────────────── */
.bk-cart-drawer__empty {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
}
.bk-cart-drawer__empty[hidden] {
    display: none;
}
.bk-cart-drawer__empty-icon {
    font-size: 56px;
    margin-bottom: 12px;
    opacity: 0.5;
}
.bk-cart-drawer__empty-text {
    margin: 0 0 6px;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--bk-ink);
}
.bk-cart-drawer__empty-sub {
    margin: 0 0 22px;
    font-size: 13px;
    color: var(--bk-text-light);
    line-height: 1.5;
    max-width: 280px;
}
.bk-cart-drawer__empty-cta {
    display: inline-block;
    padding: 12px 28px;
    background: var(--bk-green);
    color: var(--bk-white);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}
.bk-cart-drawer__empty-cta:hover {
    background: var(--bk-ink);
    transform: translateY(-2px);
    color: var(--bk-white);
}

/* lock body scroll dok je drawer otvoren */
body.bk-cart-open {
    overflow: hidden;
}

/* ============================================================
   FOOTER
   ============================================================ */

/* ════════════════════════════════════════════════════════════════════════
   FOOTER REDESIGN v3 (owner 2026-05-13)
   ────────────────────────────────────────────────────────────────────────
   Owner-prescribed cream/paper design — verbatim CSS block. Border-top
   3px solid gold replaces previous ::before gradient. Display:block!important
   rule removed (was never needed, didn't override bg anyway).
   ════════════════════════════════════════════════════════════════════════ */
.bk-footer {
    background: #F5F0E8 !important;
    color: #2A332B !important;
    padding: 72px 0 0 !important;
    font-family: 'DM Sans', sans-serif !important;
    border-top: 3px solid #C8922A !important;
    margin-top: 80px;
    position: relative;
    z-index: 100;
    clear: both;
}
.bk-footer__bottom {
    background: #EDE8E0 !important;
}
.bk-footer__logo-img {
    height: 44px !important;
    width: auto !important;
    display: inline-block !important;
    filter: none !important;
}

.bk-footer__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px 56px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.bk-footer__col {
    min-width: 0;
}

/* ── BRAND COL ────────────────────────────────────────────── */
.bk-footer__logo {
    display: inline-block;
    margin-bottom: 4px;
    text-decoration: none;
}
.bk-footer__logo-img {
    height: 44px;
    width: auto;
    /* NO filter — original colors on cream bg */
    filter: none;
}

.bk-footer__about {
    font-size: 14px;
    line-height: 1.7;
    color: rgba(42,51,43,0.7);
    margin: 16px 0 20px;
    max-width: 360px;
}

.bk-footer__heading {
    font-family: 'Fraunces', serif;
    font-size: 16px;
    font-weight: 600;
    color: #2A332B;
    margin: 0 0 20px;
}

.bk-footer__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bk-footer__link {
    color: rgba(42,51,43,0.65);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}
.bk-footer__link:hover {
    color: #C8922A;
}

.bk-footer__list--contact li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(42,51,43,0.65);
    font-size: 14px;
}
.bk-footer__list--contact svg {
    color: #C8922A;
    flex-shrink: 0;
}
.bk-footer__list--contact .bk-footer__link {
    color: rgba(42,51,43,0.65);
}

.bk-footer__hours {
    font-size: 15px;
    font-weight: 600;
    color: #2A332B;
    margin: 0 0 4px;
}

.bk-footer__hours-sub {
    font-size: 13px;
    color: rgba(42,51,43,0.55);
    margin: 0 0 20px;
}

/* WhatsApp CTA button */
.bk-footer__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25D366;
    color: #fff !important;
    border-radius: 999px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    margin-top: 16px;
}
.bk-footer__cta:hover {
    background: #1ebe5d;
    transform: translateY(-1px);
}
.bk-footer__cta svg {
    color: #fff;
}

/* Instagram CTA modifier — DEPRECATED 2026-05-18.
   Owner replaced the colourful WhatsApp/Instagram CTA pills with the
   subtle ink/cream `.bk-footer__social-link` pills (see below). Kept the
   class only so any cached templates / legacy markup keep rendering. */
.bk-footer__cta--ig {
    background: linear-gradient(135deg, #F58529 0%, #DD2A7B 50%, #8134AF 100%);
    margin-top: 10px;
    display: inline-flex;
}
.bk-footer__cta--ig:hover {
    background: linear-gradient(135deg, #ff8f3c 0%, #ec3486 50%, #9540c1 100%);
    transform: translateY(-1px);
}

/* On-theme subtle social pill — owner 2026-05-18.
   Cream/ink palette (matches site theme). Used for WhatsApp + Instagram in
   the Kontaktirajte nas footer column. Replaces the green/gradient .bk-footer__cta
   variants in that location. Stacks vertically with small top-margin. */
.bk-footer__social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(42,51,43,0.2);
    color: #2A332B;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    background: transparent;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
    margin-top: 8px;
}
.bk-footer__social-link + .bk-footer__social-link {
    margin-left: 6px;
}
.bk-footer__social-link:hover {
    background: rgba(42,51,43,0.06);
    border-color: rgba(42,51,43,0.35);
    color: #2A332B;
    transform: translateY(-1px);
}
.bk-footer__social-link svg {
    flex: 0 0 auto;
}

/* Social link */
.bk-footer__social {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(42,51,43,0.15);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    color: rgba(42,51,43,0.65);
    text-decoration: none;
    transition: all 0.2s;
}
.bk-footer__social:hover {
    border-color: #C8922A;
    color: #C8922A;
}

/* Bottom copyright bar */
.bk-footer__bottom {
    background: #EDE8E0;
    border-top: 1px solid rgba(42,51,43,0.08);
}
.bk-footer__bottom-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.bk-footer__copy {
    font-size: 13px;
    color: rgba(42,51,43,0.5);
    margin: 0;
}
.bk-footer__legal {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 24px;
}
.bk-footer__legal .bk-footer__link {
    font-size: 13px;
}
.bk-footer__legal a {
    color: rgba(42,51,43,0.5);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}
.bk-footer__legal a:hover {
    color: #C8922A;
}

/* Sakrij sve što FSE/shortcode renderuje kao alternativni footer */
.wp-block-template-part[class*="footer"],
.wp-site-blocks > footer:not(.bk-footer),
body > footer:not(.bk-footer) {
    display: none !important;
}

/* Mobile */
@media (max-width: 900px) {
    .bk-footer__inner {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
        padding: 0 24px 48px;
    }
    .bk-footer__col--brand {
        grid-column: 1 / -1;
    }
    .bk-footer__about {
        max-width: 540px;
    }
}
@media (max-width: 600px) {
    .bk-footer__inner {
        grid-template-columns: 1fr;
    }
    .bk-footer__bottom-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 16px 24px;
    }
}

/* ============================================================
   RESPONSIVE — header only (footer responsive handled above)
   ============================================================ */
@media (max-width: 640px) {
    :root {
        --bk-header-h: 64px;
    }
    .bk-header__inner {
        padding: 0 16px;
    }
    .bk-header__logo-img {
        /* Mobile bump to keep proportion with the 48px desktop logo (owner 2026-05-17). */
        height: 40px !important;
        width: auto !important;
    }
    .bk-header__icon-btn {
        width: 40px;
        height: 40px;
    }
    .bk-cart-drawer {
        max-width: 100%;
    }
}

/* iOS — input zoom prevent + tap target */
@supports (-webkit-touch-callout: none) {
    .bk-header__icon-btn,
    .bk-cart-drawer__close,
    .bk-cart-drawer__checkout {
        -webkit-tap-highlight-color: transparent;
    }
}

/* hide WordPress admin bar offset for our sticky header */
.admin-bar .bk-header {
    top: 32px;
}
@media (max-width: 782px) {
    .admin-bar .bk-header {
        top: 46px;
    }
}

/* high contrast a11y */
@media (forced-colors: active) {
    .bk-header,
    .bk-footer,
    .bk-cart-drawer {
        border: 1px solid CanvasText;
    }
}

/* ════════════════════════════════════════════════════════════════════════
   NAV LINK COLOR FIX (owner 2026-05-14 — 6th pass)
   ────────────────────────────────────────────────────────────────────────
   Force ink color on header nav links + gold hover. Wins over any
   inherited color from body / parent rules (e.g. when an account-page
   gradient bg made the default dark ink look yellow).
   ════════════════════════════════════════════════════════════════════════ */
.bk-header__nav-link {
    color: #2A332B !important;
}
.bk-header__nav-link:hover {
    color: #3D5A3E !important;
    background: rgba(42,51,43,0.07) !important;
}
