/*
 * Shared site header (top nav + mobile fullscreen menu).
 * Used by landing and case study pages. Requires CSS variables
 * --wf-primary, --wf-primary-dark, --wf-navy, --wf-muted, --wf-border
 * to be defined on :root by the host page.
 */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: rgba(250, 250, 252, 0.85);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-bottom: 1px solid var(--wf-border);
}

.site-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.site-header .logo img {
    height: 44px;
    width: auto;
}

.site-header .logo-text {
    font-family: 'Funnel Display', 'Inter', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--wf-navy);
    letter-spacing: -0.03em;
}

.site-header nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.site-header nav a {
    color: var(--wf-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.site-header nav a:hover {
    color: var(--wf-primary);
}

/* Desktop dropdown under "Produkty" */
.site-header .nav-dropdown {
    position: relative;
}

.site-header .nav-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.site-header .nav-dropdown-trigger::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform 0.2s;
    opacity: 0.6;
}

.site-header .nav-dropdown:hover .nav-dropdown-trigger::after,
.site-header .nav-dropdown:focus-within .nav-dropdown-trigger::after {
    transform: rotate(225deg) translate(-1px, -1px);
}

.site-header .nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 18px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: 260px;
    background: var(--wf-bg);
    border: 1px solid var(--wf-border);
    border-radius: 14px;
    box-shadow: 0 24px 50px rgba(15, 15, 18, 0.1);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    z-index: 120;
}

/* Bridge so hover doesn't break when cursor crosses the gap */
.site-header .nav-dropdown::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 22px;
}

.site-header .nav-dropdown:hover .nav-dropdown-menu,
.site-header .nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.site-header .nav-dropdown-menu a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    color: var(--wf-navy);
    font-size: 0.92rem;
    line-height: 1.3;
    transition: background 0.15s;
}

.site-header .nav-dropdown-menu a:hover {
    background: var(--wf-primary-soft);
    color: var(--wf-navy);
}

.site-header .nav-dropdown-menu a strong {
    font-weight: 700;
    font-size: 0.98rem;
}

.site-header .nav-dropdown-menu a span {
    color: var(--wf-muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.site-header .nav-phone {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--wf-navy) !important;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid var(--wf-border);
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.site-header .nav-phone svg {
    flex-shrink: 0;
    color: var(--wf-primary);
}

.site-header .nav-phone:hover {
    color: var(--wf-primary) !important;
    border-color: var(--wf-primary);
    background: var(--wf-primary-soft);
}

/* "Přihlášení" secondary link — sits between the phone and the primary
   CTA. Outlined to read as utility action, not a section anchor. */
.site-header .nav-auth {
    color: var(--wf-navy) !important;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid var(--wf-border);
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.site-header .nav-auth:hover {
    color: var(--wf-primary) !important;
    border-color: var(--wf-primary);
    background: var(--wf-primary-soft);
}

.site-header .menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--wf-navy);
}

/* CTA button — used in both header and mobile nav */
.btn-nav-cta {
    padding: 10px 22px;
    background: var(--wf-primary);
    color: #ffffff !important;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-nav-cta:hover {
    background: var(--wf-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 12px 28px -10px rgba(91, 79, 199, 0.45);
    text-decoration: none;
}

/* Mobile fullscreen nav (sibling of .site-header) */
/* Dark "interstitial" mobile menu — matches the orb sections on the landing.
   Linear ink→violet→honey gradient with a violet/honey radial glow on top.
   z-index well above the embedded search widget (which sits in main flow). */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* iOS Safari: top:0 + bottom:0 only fills the *layout* viewport, leaving
       the menu cut off above the bottom toolbar. height: 100dvh tracks the
       dynamic viewport so the dark backdrop reaches the bottom of the screen
       even with the toolbar visible. 100vh is the fallback for very old
       browsers; bottom:0 covers the rest. */
    height: 100vh;
    height: 100dvh;
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    background: linear-gradient(135deg, #09090b 0%, #14102a 50%, #221608 100%);
    color: #F5F4F1;
    overflow: hidden;
    isolation: isolate;
}

/* Soft violet→honey orb behind the nav items */
.mobile-nav::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34rem;
    height: 34rem;
    margin-top: -17rem;
    margin-left: -17rem;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(91, 79, 199, 0.55) 0%,
        rgba(140, 132, 216, 0.35) 40%,
        rgba(240, 179, 34, 0.22) 72%,
        rgba(240, 179, 34, 0) 100%
    );
    filter: blur(80px);
    pointer-events: none;
    z-index: -1;
}

.mobile-nav.active { display: flex; }

/* Embedded /widget.js search bar uses z-index 2147483647 (max int32) on its
   input, dropdown, and modal. No CSS specificity wins. When the menu is open
   we instead hide the widget at the source via a body-level class set by
   site-header.js. The widget also teleports its results dropdown and modal
   to body-level (wf-results-detached, wf-search-modal-overlay) so we cover
   those siblings too. visibility (not display:none) keeps any in-flight
   focus / fetch state intact when the menu closes. */
body.wf-mobile-nav-open #woodysfetch-widget,
body.wf-mobile-nav-open .wf-results-detached,
body.wf-mobile-nav-open .wf-search-modal-overlay,
body.wf-mobile-nav-open .wf-search-widget {
    visibility: hidden !important;
}

/* Mirror of the rule above: when the widget's fullscreen modal is open, hide
   the .site-header. iOS Safari occasionally renders backdrop-filter elements
   above sibling position:fixed overlays regardless of z-index — visible on the
   landing demo as the page header bleeding through the search modal when it
   opens from a scrolled-down position. Pure CSS (:has() is Safari 15.4+ — same
   baseline as the widget itself). */
body:has(.wf-fullscreen-overlay) .site-header {
    visibility: hidden !important;
}

.mobile-nav a {
    color: #F5F4F1;
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 600;
    transition: color 0.2s;
    position: relative;
}

.mobile-nav a:hover { color: #f0b322; }

.mobile-nav .btn-nav-cta {
    padding: 14px 32px;
    font-size: 1.1rem;
    background: #5b4fc7;
    color: #fff !important;
    box-shadow: 0 14px 30px -10px rgba(91, 79, 199, 0.55);
}
.mobile-nav .btn-nav-cta:hover {
    background: #4d40b8;
    box-shadow: 0 18px 38px -10px rgba(91, 79, 199, 0.7);
}

.mobile-nav .close-menu {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #F5F4F1;
    padding: 8px;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.mobile-nav .close-menu:hover { opacity: 1; }

.mobile-nav-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.mobile-nav-subs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

.mobile-nav-subs a {
    font-size: 1rem !important;
    color: rgba(245, 244, 241, 0.65) !important;
    font-weight: 500 !important;
}
.mobile-nav-subs a:hover { color: #f0b322 !important; }

.mobile-nav-subs a strong {
    color: #F5F4F1;
    font-weight: 700;
    margin-right: 0.4rem;
}

.mobile-nav-phone {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f0b322 !important;
    font-weight: 600;
    font-size: 1.2rem;
}
.mobile-nav-phone:hover { color: #f5c947 !important; }

.mobile-nav-phone svg {
    flex-shrink: 0;
}

@media (max-width: 1100px) {
    .site-header nav { gap: 1rem; }
    .site-header .nav-phone { padding: 6px 8px; font-size: 0; border: none; }
    .site-header .nav-phone svg { width: 20px; height: 20px; }
}

@media (max-width: 968px) {
    .site-header nav { display: none; }
    .site-header .menu-toggle { display: block; }
}

@media (max-width: 768px) {
    .site-header { padding: 0.75rem 1rem; }
    .site-header .logo img { height: 36px; }
    .site-header .logo-text { font-size: 1.15rem; }
}
