/* ============================================================
   SB HEADER — Floating architectural navigation
   ============================================================ */

.sb-header {
    --sb-h-paper: #F4F0E8;
    --sb-h-white: #FCFBF8;
    --sb-h-ink: #11110F;
    --sb-h-bronze: #B58A43;
    --sb-h-mute: #6F6B64;
    --sb-h-border: rgba(17, 17, 15, 0.10);
    --sb-h-height: 76px;
    --sb-h-top: 18px;
    --sb-h-logo: 142px;
    --sb-h-radius: 18px;
    --sb-h-blur: 12px;
    --sb-h-shadow: 0 10px 28px rgba(17, 17, 15, 0.06);
    --sb-h-bg: rgba(252, 251, 248, 0.94);

    position: fixed;
    top: var(--sb-h-top);
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: 1280px;
    height: var(--sb-h-height);
    z-index: 1000;
    box-sizing: border-box;
    border: 1px solid var(--sb-h-border);
    border-radius: var(--sb-h-radius);
    background: var(--sb-h-bg);
    -webkit-backdrop-filter: blur(var(--sb-h-blur));
    backdrop-filter: blur(var(--sb-h-blur));
    box-shadow: var(--sb-h-shadow);
    transition:
        height 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        top 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        background 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.4s ease;
    overflow: visible;
}

.sb-header.sb-header--scrolled {
    --sb-h-height: 66px;
    --sb-h-top: 10px;
    --sb-h-bg: rgba(252, 251, 248, 0.98);
    --sb-h-shadow: 0 12px 32px rgba(17, 17, 15, 0.09);
}

.sb-header.sb-header--scrolled .sb-header__logo {
    transform: scale(0.9);
}

.sb-header__inner {
    display: grid;
    grid-template-columns: minmax(150px, auto) 1fr auto;
    align-items: center;
    gap: 16px;
    height: 100%;
    padding: 0 18px 0 22px;
    box-sizing: border-box;
    overflow: visible;
}

/* ---- Logo (never clip) ---- */
.sb-header__brand {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    flex-shrink: 0;
    min-width: var(--sb-h-logo);
    overflow: visible;
    line-height: 0;
}

.sb-header__logo {
    display: block;
    width: var(--sb-h-logo);
    height: auto;
    max-height: 48px;
    object-fit: contain;
    object-position: left center;
    transform: scale(1);
    transform-origin: left center;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
    overflow: visible;
}

.sb-header.sb-header--logo-pending .sb-header__logo {
    opacity: 0;
}

.sb-header__brand:focus-visible {
    outline: 2px solid var(--sb-h-bronze);
    outline-offset: 4px;
    border-radius: 6px;
}

/* ---- Desktop nav ---- */
.sb-header__nav {
    justify-self: center;
    min-width: 0;
}

.sb-header__list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(4px, 1.1vw, 18px);
    list-style: none;
    margin: 0;
    padding: 0;
}

.sb-header__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 6px;
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sb-h-ink);
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), color 0.3s ease;
}

.sb-header__link::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 8px;
    width: 20px;
    height: 1px;
    background: var(--sb-h-bronze);
    transform: translateX(-50%) scaleX(0);
    transform-origin: center;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.sb-header__link:hover,
.sb-header__link:focus-visible {
    transform: translateY(-2px);
    color: var(--sb-h-ink);
}

.sb-header__link:hover::after,
.sb-header__link:focus-visible::after,
.sb-header__link[aria-current="page"]::after {
    transform: translateX(-50%) scaleX(1);
}

.sb-header__link[aria-current="page"] {
    color: var(--sb-h-ink);
}

.sb-header__link:focus-visible {
    outline: 2px solid var(--sb-h-bronze);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---- Actions ---- */
.sb-header__actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-self: end;
    flex-shrink: 0;
}

.sb-header__cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    height: 48px;
    min-height: 44px;
    padding: 0 8px 0 20px;
    border-radius: 999px;
    background: var(--sb-h-ink);
    color: #fff;
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(17, 17, 15, 0.14);
    transition:
        background 0.3s ease,
        transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.3s ease;
}

.sb-header__cta-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--sb-h-bronze);
    color: #fff;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.sb-header__cta-icon svg {
    display: block;
    width: 14px;
    height: 14px;
}

.sb-header__cta:hover {
    background: var(--sb-h-bronze);
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(181, 138, 67, 0.28);
}

.sb-header__cta:hover .sb-header__cta-icon {
    transform: translateX(3px);
    background: var(--sb-h-ink);
}

.sb-header__cta:focus-visible {
    outline: 2px solid var(--sb-h-bronze);
    outline-offset: 3px;
}

/* ---- Menu button (mobile) ---- */
.sb-header__menu-btn {
    display: none;
    position: relative;
    width: 46px;
    height: 46px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid var(--sb-h-border);
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    color: var(--sb-h-ink);
    transition: border-color 0.3s ease, background 0.3s ease;
}

.sb-header__menu-line {
    display: block;
    width: 18px;
    height: 1.5px;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
    transform-origin: center;
}

.sb-header__menu-btn[aria-expanded="true"] .sb-header__menu-line:first-child {
    transform: translateY(4.25px) rotate(45deg);
}

.sb-header__menu-btn[aria-expanded="true"] .sb-header__menu-line:last-child {
    transform: translateY(-4.25px) rotate(-45deg);
}

.sb-header__menu-btn:hover {
    border-color: rgba(181, 138, 67, 0.45);
}

.sb-header__menu-btn:focus-visible {
    outline: 2px solid var(--sb-h-bronze);
    outline-offset: 3px;
}

/* ---- Mobile drawer ---- */
.sb-header-drawer {
    position: fixed;
    inset: 0;
    z-index: 1100;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: var(--sb-h-paper);
    color: var(--sb-h-ink);
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
    clip-path: inset(0 0 100% 0);
    transition: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding:
        max(18px, env(safe-area-inset-top, 0px))
        max(20px, env(safe-area-inset-right, 0px))
        max(28px, env(safe-area-inset-bottom, 0px))
        max(20px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
}

.sb-header-drawer.is-open {
    visibility: visible;
    pointer-events: auto;
}

body.sb-menu-open .sb-header {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.sb-header-drawer__inner {
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 40px);
    height: 100%;
}

.sb-header-drawer__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    padding-top: 4px;
}

.sb-header-drawer__brand-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.sb-header-drawer__eyebrow {
    margin: 0;
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--sb-h-mute);
}

.sb-header-drawer__logo-link {
    display: inline-flex;
    line-height: 0;
}

.sb-header-drawer__logo {
    display: block;
    width: min(168px, 48vw);
    height: auto;
    max-height: 52px;
    object-fit: contain;
    object-position: left center;
}

.sb-header-drawer__controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.sb-header-drawer__controls .sb-theme-toggle,
.sb-header-drawer__close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid var(--sb-h-border);
    border-radius: 12px;
    background: transparent;
    color: var(--sb-h-ink);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.sb-header-drawer__close svg {
    display: block;
    width: 18px;
    height: 18px;
}

.sb-header-drawer__controls .sb-theme-toggle:hover,
.sb-header-drawer__close:hover {
    border-color: rgba(181, 138, 67, 0.5);
    background: rgba(181, 138, 67, 0.06);
}

.sb-header-drawer__controls .sb-theme-toggle:focus-visible,
.sb-header-drawer__close:focus-visible {
    outline: 2px solid var(--sb-h-bronze);
    outline-offset: 2px;
}

.sb-header-drawer__nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
}

.sb-header-drawer__list {
    list-style: none;
    margin: 0;
    padding: 8px 0 12px;
    border: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sb-header-drawer__item,
.sb-header-drawer__fade {
    opacity: 0;
    transform: translateY(16px);
}

.sb-header-drawer__item {
    border: none;
}

.sb-header-drawer__link {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 48px;
    padding: 10px 0;
    box-sizing: border-box;
    font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    font-size: clamp(1.5rem, 6.2vw, 2.05rem);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sb-h-ink);
    text-decoration: none;
    border-radius: 0;
    background: none;
    transition: color 0.25s ease, opacity 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.sb-header-drawer__label {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 0.22em;
    overflow: hidden;
}

.sb-header-drawer__word {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    line-height: 1.15;
}

.sb-header-drawer__char {
    display: inline-block;
    will-change: transform, opacity;
}

.sb-header-drawer__num,
.sb-header-drawer__arrow {
    display: none !important;
}

@media (hover: hover) {
    .sb-header-drawer__link:hover,
    .sb-header-drawer__link:focus-visible {
        color: var(--sb-h-bronze);
        opacity: 1;
    }
}

.sb-header-drawer__link:active {
    color: var(--sb-h-bronze);
}

.sb-header-drawer__link:focus-visible {
    outline: none;
    color: var(--sb-h-bronze);
}

.sb-header-drawer__link[aria-current="page"] {
    color: var(--sb-h-bronze);
}

html.theme-dark .sb-header-drawer__logo {
    filter: brightness(0) invert(1);
}

html.theme-dark .sb-header-drawer__cta--ghost {
    color: #F5F2EA;
    border-color: rgba(212, 175, 55, 0.45);
}

html.theme-dark .sb-header-drawer__social-btn {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(245, 242, 234, 0.14);
    color: #F5F2EA;
}

html.theme-dark .sb-header-drawer__controls .sb-theme-toggle,
html.theme-dark .sb-header-drawer__close {
    border-color: rgba(245, 242, 234, 0.16);
    color: #F5F2EA;
}

.sb-header-drawer__foot {
    margin-top: auto;
    padding-top: 24px;
    display: grid;
    gap: 18px;
    flex-shrink: 0;
}

.sb-header-drawer__actions {
    display: grid;
    gap: 10px;
}

.sb-header-drawer__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 999px;
    background: var(--sb-h-ink);
    color: #fff;
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(17, 17, 15, 0.14);
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.sb-header-drawer__cta svg {
    display: block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.sb-header-drawer__cta:hover,
.sb-header-drawer__cta:focus-visible {
    background: var(--sb-h-bronze);
    transform: translateY(-1px);
}

.sb-header-drawer__cta:hover svg,
.sb-header-drawer__cta:focus-visible svg {
    transform: translateX(2px);
}

.sb-header-drawer__cta--ghost {
    background: transparent;
    color: var(--sb-h-ink);
    border: 1px solid rgba(181, 138, 67, 0.45);
    box-shadow: none;
}

.sb-header-drawer__cta--ghost:hover,
.sb-header-drawer__cta--ghost:focus-visible {
    background: rgba(181, 138, 67, 0.08);
    color: var(--sb-h-bronze);
    border-color: var(--sb-h-bronze);
}

.sb-header-drawer__social {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.sb-header-drawer__social-label {
    width: 100%;
    margin: 0 0 2px;
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--sb-h-mute);
}

.sb-header-drawer__social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(17, 17, 15, 0.12);
    background: rgba(252, 251, 248, 0.9);
    color: var(--sb-h-ink);
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    flex: 1 1 calc(33.333% - 7px);
    min-width: 0;
}

.sb-header-drawer__social-btn svg {
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: currentColor;
}

.sb-header-drawer__social-btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sb-header-drawer__social-btn--ig:hover,
.sb-header-drawer__social-btn--ig:focus-visible {
    color: #fff;
    background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
    border-color: transparent;
}

.sb-header-drawer__social-btn--fb:hover,
.sb-header-drawer__social-btn--fb:focus-visible {
    color: #fff;
    background: #1877f2;
    border-color: transparent;
}

.sb-header-drawer__social-btn--wa:hover,
.sb-header-drawer__social-btn--wa:focus-visible {
    color: #fff;
    background: #25d366;
    border-color: transparent;
}

.sb-header-drawer__meta {
    display: grid;
    gap: 6px;
    padding-top: 4px;
    border-top: 1px solid rgba(181, 138, 67, 0.2);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sb-h-mute);
}

.sb-header-drawer__meta a {
    color: var(--sb-h-ink);
    text-decoration: none;
}

.sb-header-drawer__meta a:hover {
    color: var(--sb-h-bronze);
}

body.sb-menu-open .float-stack {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

body.sb-menu-open #chat-widget {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ---- Breakpoints ---- */
@media (max-width: 1280px) and (min-width: 900px) {
    .sb-header__list { gap: 2px; }
    .sb-header__link {
        font-size: 11.5px;
        letter-spacing: 0.08em;
        padding-inline: 5px;
    }
    .sb-header__inner { padding-inline: 14px 12px; gap: 10px; }
    .sb-header { --sb-h-logo: 132px; }
}

@media (max-width: 1100px) and (min-width: 900px) {
    .sb-header__list { gap: 0; }
    .sb-header__link { font-size: 11px; padding-inline: 4px; }
    .sb-header__cta { padding-left: 14px; }
    .sb-header__cta > span:first-child { letter-spacing: 0.08em; }
}

@media (max-width: 899px) {
    .sb-header {
        --sb-h-height: 66px;
        --sb-h-top: 10px;
        --sb-h-logo: 120px;
        --sb-h-radius: 16px;
        width: calc(100% - 24px);
    }

    .sb-header.sb-header--scrolled {
        --sb-h-height: 62px;
        --sb-h-top: 8px;
    }

    .sb-header.sb-header--scrolled .sb-header__logo {
        transform: scale(0.92);
    }

    .sb-header__inner {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 0 10px 0 14px;
        gap: 8px;
    }

    .sb-header__brand {
        min-width: 0;
    }

    .sb-header__nav { display: none; }
    .sb-header__cta { display: none; }
    .sb-header__menu-btn { display: inline-flex; }
    .sb-header__logo { max-height: 40px; }

    .sb-header__actions {
        gap: 6px;
        flex-shrink: 0;
    }

    .sb-header__actions .sb-theme-toggle {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        border-radius: 11px;
    }

    .sb-header__menu-btn {
        width: 44px;
        height: 44px;
    }

    .sb-header-drawer {
        padding-top: max(16px, env(safe-area-inset-top, 0px));
        padding-inline: max(18px, env(safe-area-inset-left, 0px)) max(18px, env(safe-area-inset-right, 0px));
    }

    .sb-header-drawer__inner {
        max-width: none;
        min-height: calc(100dvh - 24px);
    }

    .sb-header-drawer__top {
        margin-bottom: 22px;
    }

    .sb-header-drawer__link {
        min-height: 46px;
        padding: 9px 0;
        font-size: clamp(1.4rem, 5.8vw, 1.85rem);
    }

    .sb-header-drawer__foot {
        padding-top: 22px;
        gap: 16px;
    }

    .sb-header-drawer__cta {
        height: 50px;
        font-size: 11px;
    }

    .sb-header-drawer__social-btn {
        flex: 1 1 calc(50% - 5px);
        padding: 10px 12px;
        font-size: 10px;
    }

    .sb-header-drawer__social-btn--wa {
        flex: 1 1 100%;
    }

    .sb-header-drawer__meta {
        font-size: 10px;
        letter-spacing: 0.08em;
        gap: 8px;
    }
}

@media (max-width: 599px) {
    .sb-header {
        width: calc(100% - 20px);
    }

    .sb-header__inner {
        padding: 0 8px 0 12px;
    }

    .sb-header { --sb-h-logo: 112px; }

    .sb-header-drawer__logo {
        width: min(148px, 52vw);
        max-height: 46px;
    }

    .sb-header-drawer__link {
        min-height: 44px;
        padding: 8px 0;
        font-size: clamp(1.32rem, 5.4vw, 1.65rem);
        letter-spacing: 0.03em;
    }
}

@media (max-width: 380px) {
    .sb-header { --sb-h-logo: 100px; }

    .sb-header__logo { max-height: 36px; }

    .sb-header-drawer {
        padding-inline: max(14px, env(safe-area-inset-left, 0px)) max(14px, env(safe-area-inset-right, 0px));
    }

    .sb-header-drawer__link {
        min-height: 42px;
        padding: 7px 0;
        font-size: 1.28rem;
    }

    .sb-header-drawer__social-btn span {
        display: none;
    }

    .sb-header-drawer__social-btn {
        flex: 1 1 calc(33.333% - 7px);
        justify-content: center;
        padding: 10px;
    }

    .sb-header-drawer__social-btn--wa {
        flex: 1 1 100%;
    }

    .sb-header-drawer__social-btn--wa span {
        display: inline;
    }
}

@media (max-width: 899px) and (max-height: 500px) and (orientation: landscape) {
    .sb-header-drawer {
        padding-top: max(10px, env(safe-area-inset-top, 0px));
        padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
    }

    .sb-header-drawer__top {
        margin-bottom: 12px;
    }

    .sb-header-drawer__logo {
        max-height: 36px;
        width: 120px;
    }

    .sb-header-drawer__link {
        min-height: 40px;
        padding: 6px 0;
        font-size: 1.15rem;
    }

    .sb-header-drawer__foot {
        padding-top: 14px;
        gap: 12px;
    }

    .sb-header-drawer__cta {
        height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sb-header,
    .sb-header__logo,
    .sb-header__link,
    .sb-header__link::after,
    .sb-header__cta,
    .sb-header__cta-icon,
    .sb-header__menu-line,
    .sb-header-drawer__item {
        transition: none !important;
    }

    .sb-header-drawer__arrow {
        transition: none !important;
    }
}
