/* ============================================================================
   Impercoat Header — Professional Sticky Header
   Cores: #0B2F41 (dark) | #FD9933 (accent) | #fff (white)
   ============================================================================ */

/* ── CSS Custom Properties ─────────────────────────────────────────────── */
:root {
    --ich-height:      80px;
    --ich-height-sm:   64px;
    --ich-primary:     #0B2F41;
    --ich-primary-dk:  #071D28;
    --ich-accent:      #FD9933;
    --ich-accent-dk:   #e07e1a;
    --ich-white:       #ffffff;
    --ich-text-muted:  rgba(255,255,255,0.7);
    --ich-border:      rgba(255,255,255,0.08);
    --ich-shadow:      0 4px 32px rgba(7,29,40,0.35);
    --ich-transition:  0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --ich-font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ich-radius:      6px;
    --ich-z:           9999;
}

/* ── Reset & Base ──────────────────────────────────────────────────────── */
#ich-header,
#ich-header * {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Header wrapper ────────────────────────────────────────────────────── */
#ich-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--ich-z);
    height: var(--ich-height);
    background: var(--ich-primary);
    border-bottom: 1px solid var(--ich-border);
    font-family: var(--ich-font);
    transition: height var(--ich-transition), background var(--ich-transition), box-shadow var(--ich-transition);
    will-change: height, box-shadow;
}

/* Scrolled state */
#ich-header.is-scrolled {
    height: var(--ich-height-sm);
    background: rgba(11, 47, 65, 0.97);
    box-shadow: var(--ich-shadow);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom-color: rgba(253, 153, 51, 0.15);
}

/* ── Inner flex container ──────────────────────────────────────────────── */
.ich-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 32px;
}

/* ── Logo ──────────────────────────────────────────────────────────────── */
.ich-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
    outline-offset: 4px;
}

.ich-logo__img {
    height: 52px;
    width: auto;
    display: block;
    transition: height var(--ich-transition), opacity var(--ich-transition);
    object-fit: contain;
}

#ich-header.is-scrolled .ich-logo__img {
    height: 40px;
}

.ich-logo:hover .ich-logo__img {
    opacity: 0.9;
}

/* ── Nav ───────────────────────────────────────────────────────────────── */
.ich-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.ich-nav__list {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* WordPress menu overrides */
.ich-nav__list > li {
    margin: 0;
    padding: 0;
    position: relative;
}

.ich-nav__list > li > a,
.ich-nav__link {
    display: inline-flex;
    align-items: center;
    padding: 8px 13px;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    border-radius: var(--ich-radius);
    transition:
        color var(--ich-transition),
        background var(--ich-transition);
    white-space: nowrap;
    position: relative;
}

/* Hover state */
.ich-nav__list > li > a:hover,
.ich-nav__link:hover {
    color: var(--ich-white);
    background: rgba(255, 255, 255, 0.08);
}

/* Active / current page */
.ich-nav__list > li.current-menu-item > a,
.ich-nav__list > li.current_page_item > a,
.ich-nav__list > li.current-menu-ancestor > a {
    color: var(--ich-accent);
    background: rgba(253, 153, 51, 0.1);
}

/* Active indicator dot */
.ich-nav__list > li.current-menu-item > a::after,
.ich-nav__list > li.current_page_item > a::after {
    content: '';
    display: block;
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--ich-accent);
}

/* ── Featured nav items ─────────────────────────────────────────────────── */
/* Orçamento */
.ich-nav__item--budget > a,
.ich-nav__list > li.menu-item-budget > a {
    color: var(--ich-accent) !important;
    font-weight: 700 !important;
    border: 1px solid rgba(253, 153, 51, 0.35);
    background: rgba(253, 153, 51, 0.08) !important;
}

.ich-nav__item--budget > a:hover,
.ich-nav__list > li.menu-item-budget > a:hover {
    background: rgba(253, 153, 51, 0.18) !important;
    border-color: rgba(253, 153, 51, 0.6) !important;
}

/* Contato */
.ich-nav__item--contact > a,
.ich-nav__list > li.menu-item-contact > a {
    color: rgba(255, 255, 255, 0.85);
}

/* ── WordPress dropdown sub-menu ────────────────────────────────────────── */
.ich-nav__list .sub-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 200px;
    background: var(--ich-primary-dk);
    border: 1px solid var(--ich-border);
    border-radius: var(--ich-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition:
        opacity var(--ich-transition),
        transform var(--ich-transition),
        visibility var(--ich-transition);
    z-index: 1;
}

.ich-nav__list li:hover > .sub-menu,
.ich-nav__list li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ich-nav__list .sub-menu li a {
    display: block;
    padding: 9px 16px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color var(--ich-transition), background var(--ich-transition);
}

.ich-nav__list .sub-menu li a:hover {
    color: var(--ich-accent);
    background: rgba(255, 255, 255, 0.05);
}

/* ── Right side ────────────────────────────────────────────────────────── */
.ich-header__right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

/* ── GE Seal ───────────────────────────────────────────────────────────── */
.ich-ge-seal {
    display: flex;
    align-items: center;
    text-decoration: none;
    outline-offset: 4px;
    padding: 6px 10px;
    border-radius: var(--ich-radius);
    border: 1px solid var(--ich-border);
    background: rgba(255, 255, 255, 0.04);
    transition: background var(--ich-transition), border-color var(--ich-transition);
}

.ich-ge-seal:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.18);
}

.ich-ge-seal__inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ich-ge-seal__text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.1;
}

.ich-ge-seal__label {
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    font-family: var(--ich-font);
    white-space: nowrap;
}

.ich-ge-seal__label--bold {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.1em;
}

.ich-ge-seal__divider {
    width: 1px;
    height: 28px;
    background: var(--ich-border);
}

.ich-ge-seal__logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    display: block;
    transition: opacity var(--ich-transition);
}

.ich-ge-seal:hover .ich-ge-seal__logo {
    opacity: 1;
}

/* ── Desktop CTA Button ─────────────────────────────────────────────────── */
.ich-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--ich-accent);
    color: var(--ich-white);
    font-family: var(--ich-font);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 10px 18px;
    border-radius: var(--ich-radius);
    text-decoration: none;
    white-space: nowrap;
    transition:
        background var(--ich-transition),
        transform var(--ich-transition),
        box-shadow var(--ich-transition);
    box-shadow: 0 2px 10px rgba(253, 153, 51, 0.3);
}

.ich-cta-btn:hover {
    background: var(--ich-accent-dk);
    color: var(--ich-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(253, 153, 51, 0.45);
    text-decoration: none;
}

.ich-cta-btn:active {
    transform: translateY(0);
}

.ich-cta-btn svg {
    flex-shrink: 0;
}

/* ── Burger button ─────────────────────────────────────────────────────── */
.ich-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--ich-border);
    border-radius: var(--ich-radius);
    cursor: pointer;
    padding: 8px;
    transition: background var(--ich-transition);
    flex-shrink: 0;
}

.ich-burger:hover {
    background: rgba(255, 255, 255, 0.14);
}

.ich-burger__bar {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--ich-white);
    border-radius: 2px;
    transition:
        transform var(--ich-transition),
        opacity var(--ich-transition),
        width var(--ich-transition);
    transform-origin: center;
}

/* Burger → X animation */
#ich-header.nav-open .ich-burger__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
#ich-header.nav-open .ich-burger__bar:nth-child(2) {
    opacity: 0;
    width: 0;
}
#ich-header.nav-open .ich-burger__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile overlay ─────────────────────────────────────────────────────── */
.ich-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 29, 40, 0.7);
    z-index: calc(var(--ich-z) - 1);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity var(--ich-transition);
}

/* ── Scroll progress bar ─────────────────────────────────────────────────── */
#ich-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--ich-accent);
    width: var(--ich-scroll-pct, 0%);
    transition: width 0.1s linear;
}

/* ── Body offset (applied by JS) ─────────────────────────────────────────── */
body.ich-loaded {
    padding-top: var(--ich-height) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet ≤ 1024px
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .ich-header__inner {
        padding: 0 20px;
        gap: 12px;
    }

    .ich-nav__list > li > a,
    .ich-nav__link {
        padding: 7px 9px;
        font-size: 0.82rem;
    }

    .ich-cta-btn {
        padding: 9px 14px;
        font-size: 0.8rem;
    }

    .ich-ge-seal__text {
        display: none;
    }

    .ich-ge-seal__divider {
        display: none;
    }

    .ich-ge-seal {
        padding: 5px 7px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile ≤ 768px
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    :root {
        --ich-height: 68px;
        --ich-height-sm: 60px;
    }

    .ich-burger {
        display: flex;
    }

    .ich-cta-btn {
        display: none;
    }

    /* Mobile nav: slide down from header */
    .ich-nav {
        position: fixed;
        top: var(--ich-height);
        left: 0;
        right: 0;
        bottom: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: var(--ich-primary-dk);
        display: flex;
        flex-direction: column;
        padding: 0;
        transform: translateX(-100%);
        transition: transform var(--ich-transition);
        z-index: calc(var(--ich-z) + 1);
        border-right: 1px solid var(--ich-border);
        max-width: 320px;
        width: 85vw;
    }

    #ich-header.nav-open .ich-nav {
        transform: translateX(0);
    }

    #ich-header.nav-open .ich-mobile-overlay {
        display: block;
        opacity: 1;
    }

    .ich-nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 16px 0;
        width: 100%;
    }

    .ich-nav__list > li {
        border-bottom: 1px solid var(--ich-border);
    }

    .ich-nav__list > li:last-child {
        border-bottom: none;
    }

    .ich-nav__list > li > a,
    .ich-nav__link {
        padding: 15px 24px;
        font-size: 1rem;
        border-radius: 0;
        justify-content: space-between;
    }

    .ich-nav__list > li > a:hover,
    .ich-nav__link:hover {
        background: rgba(255, 255, 255, 0.06);
        padding-left: 28px;
    }

    .ich-nav__list > li.current-menu-item > a::after,
    .ich-nav__list > li.current_page_item > a::after {
        display: none;
    }

    .ich-nav__list > li.current-menu-item > a {
        border-left: 3px solid var(--ich-accent);
        padding-left: 21px;
    }

    /* Mobile CTA at bottom of nav */
    .ich-nav__list::after {
        content: '';
        display: block;
        height: 20px;
    }

    /* Featured items in mobile */
    .ich-nav__item--budget > a {
        color: var(--ich-accent) !important;
        font-weight: 700 !important;
    }

    /* GE seal in mobile header */
    .ich-ge-seal__text {
        display: none;
    }

    .ich-ge-seal__divider {
        display: none;
    }

    /* Sub-menus on mobile: stack below parent */
    .ich-nav__list .sub-menu {
        position: static;
        visibility: visible;
        opacity: 1;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: rgba(0, 0, 0, 0.15);
        padding: 0;
        margin: 0;
        display: none;
    }

    .ich-nav__list li.is-open > .sub-menu {
        display: block;
    }

    .ich-nav__list .sub-menu li a {
        padding: 12px 24px 12px 40px;
        font-size: 0.875rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    }

    /* Mobile overlay visible */
    .ich-mobile-overlay {
        display: none;
        pointer-events: none;
    }

    #ich-header.nav-open .ich-mobile-overlay {
        display: block;
        pointer-events: auto;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Small Mobile ≤ 400px
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 400px) {
    .ich-header__inner {
        padding: 0 16px;
        gap: 8px;
    }

    .ich-logo__img {
        height: 40px;
    }

    .ich-ge-seal {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════════════════ */
#ich-header :focus-visible {
    outline: 2px solid var(--ich-accent);
    outline-offset: 3px;
    border-radius: 3px;
}

/* Skip to content */
.ich-skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: var(--ich-accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: 0 0 6px 6px;
    font-size: 0.875rem;
    font-weight: 700;
    z-index: calc(var(--ich-z) + 10);
    text-decoration: none;
    transition: top 0.1s;
}

.ich-skip-link:focus {
    top: 0;
}

/* ── Ensure WP Admin Bar compatibility ────────────────────────────────────── */
body.admin-bar #ich-header {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar #ich-header {
        top: 46px;
    }
}
