/* =====================================================
   RB Modern Header — sticky, top bar, nav, mobile drawer
   ===================================================== */

.rb-header {
    width: 100%;
    position: relative;
    z-index: 90;
    font-family: var(--rb-font-body);
}

/* Sticky behavior: position: fixed when scrolled (activated by JS).
   Using fixed (not sticky) bypasses any parent `overflow: hidden`
   on Elementor containers that breaks position: sticky.
   Body padding-top is added by JS to prevent content jump. */
.rb-header[data-sticky="1"].is-stuck {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    animation: rb-header-slide-down 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes rb-header-slide-down {
    from { transform: translateY(-100%); }
    to   { transform: translateY(0); }
}

/* ---------- Top bar ---------- */
.rb-header__topbar {
    background: var(--rb-dark);
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: var(--rb-transition);
}

.rb-header__topbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px var(--rb-space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--rb-space-4);
}

.rb-header__topbar-left,
.rb-header__topbar-right {
    display: flex;
    align-items: center;
    gap: var(--rb-space-4);
}

.rb-header__contact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.85) !important;
    text-decoration: none !important;
    transition: var(--rb-transition-fast);
}

.rb-header__contact:hover {
    color: var(--rb-accent) !important;
}

.rb-header__contact svg {
    width: 14px;
    height: 14px;
    color: var(--rb-accent);
}

.rb-header__msg {
    color: var(--rb-accent);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Doubled-class selector beats inline widget-control CSS that hits .rb-header__topbar a */
.rb-header .rb-header__ada,
.rb-header__topbar .rb-header__ada,
.rb-header .rb-header__socials a,
.rb-header__topbar .rb-header__socials a {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.10) !important;
    color: #FFFFFF !important;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    padding: 0;
    text-decoration: none !important;
    line-height: 1;
    transition: var(--rb-transition-fast);
}

.rb-header .rb-header__ada:hover,
.rb-header .rb-header__ada:focus,
.rb-header .rb-header__ada:active,
.rb-header__topbar .rb-header__ada:hover,
.rb-header .rb-header__socials a:hover,
.rb-header .rb-header__socials a:focus,
.rb-header .rb-header__socials a:active,
.rb-header__topbar .rb-header__socials a:hover {
    background: var(--rb-accent) !important;
    color: var(--rb-dark) !important;
    transform: translateY(-1px) scale(1.05);
    outline: none;
}

/* Force inner SVGs and FA icons to follow hover color */
.rb-header .rb-header__socials a:hover svg,
.rb-header .rb-header__socials a:hover svg *,
.rb-header .rb-header__socials a:hover i,
.rb-header .rb-header__ada:hover svg,
.rb-header .rb-header__ada:hover svg * {
    color: var(--rb-dark) !important;
    fill: currentColor !important;
}

/* Force SVG fill to follow text color on every path/circle/shape */
.rb-header__ada svg,
.rb-header__ada svg *,
.rb-header__socials a svg,
.rb-header__socials a svg * {
    fill: currentColor !important;
    stroke: none;
}

.rb-header__ada svg {
    width: 18px !important;
    height: 18px !important;
    display: block;
}

.rb-header__socials {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    align-items: center;
}

.rb-header__socials a svg {
    width: 15px;
    height: 15px;
    display: block;
}

/* FontAwesome <i> uses color, not fill */
.rb-header__socials a i,
.rb-header__ada i {
    font-size: 15px;
    line-height: 1;
    color: inherit !important;
}

/* ---------- Main bar ---------- */
.rb-header__main {
    background: var(--rb-light);
    transition: var(--rb-transition);
    box-shadow: 0 1px 0 rgba(31, 27, 22, 0.06);
}

.rb-header[data-sticky="1"].is-stuck .rb-header__main {
    box-shadow: var(--rb-shadow-md);
}

.rb-header[data-shrink="1"].is-stuck .rb-header__main-inner {
    padding-top: 12px;
    padding-bottom: 12px;
}

/* Collapse top bar on scroll → only main bar (logo+nav+CTA) stays visible.
   Keeps user's "main bar sticky, top bar gone" experience without
   restructuring the markup. */
.rb-header[data-sticky="1"].is-stuck .rb-header__topbar {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden;
    border-color: transparent !important;
    transition: var(--rb-transition);
}

.rb-header__main-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px var(--rb-space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--rb-space-5);
    transition: var(--rb-transition);
}

/* ---------- Logo ---------- */
.rb-header__logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none !important;
    flex-shrink: 0;
}

.rb-header__logo-text {
    font-family: var(--rb-font-heading);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--rb-dark) !important;
    transition: var(--rb-transition-fast);
}

.rb-header__logo:hover .rb-header__logo-text {
    color: var(--rb-primary) !important;
}

.rb-header__logo-image {
    height: 40px;
    width: auto;
    display: block;
    transition: var(--rb-transition);
}

/* ---------- Nav ---------- */
.rb-header__nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.rb-header__nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: var(--rb-space-5);
}

.rb-header__nav-link {
    position: relative;
    display: inline-block;
    padding: 8px 0;
    font-family: var(--rb-font-heading);
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--rb-dark) !important;
    text-decoration: none !important;
    transition: var(--rb-transition-fast);
}

.rb-header__nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--rb-accent);
    transition: var(--rb-transition);
}

.rb-header__nav-link:hover,
.rb-header__nav-link.is-active {
    color: var(--rb-primary) !important;
}

.rb-header__nav-link:hover::after,
.rb-header__nav-link.is-active::after {
    width: 100%;
}

/* ---------- Actions / CTA ---------- */
.rb-header__actions {
    display: flex;
    align-items: center;
    gap: var(--rb-space-3);
    flex-shrink: 0;
}

.rb-header__cta {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background: var(--rb-accent);
    color: var(--rb-dark) !important;
    font-family: var(--rb-font-heading);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: var(--rb-radius-sm);
    text-decoration: none !important;
    transition: var(--rb-transition);
    box-shadow: 0 6px 16px rgba(242, 177, 55, 0.25);
}

.rb-header__cta:hover {
    background: var(--rb-dark) !important;
    color: var(--rb-light) !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(31, 27, 22, 0.25);
}

/* ---------- Burger ---------- */
.rb-header__burger {
    display: none;
    width: 44px;
    height: 44px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    cursor: pointer;
    padding: 0;
    color: inherit;
    border-radius: var(--rb-radius-sm);
    transition: var(--rb-transition-fast);
}

.rb-header__burger:hover,
.rb-header__burger:focus,
.rb-header__burger:active,
.rb-header__burger:focus-visible {
    background: rgba(31, 27, 22, 0.06) !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: inherit !important;
}

.rb-header__burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--rb-dark) !important;
    border-radius: 2px;
    transition: var(--rb-transition-fast);
    pointer-events: none;
}

.rb-header__burger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.rb-header__burger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.rb-header__burger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Mobile drawer ---------- */
.rb-header__drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(360px, 88vw);
    height: 100vh;
    background: var(--rb-light);
    box-shadow: var(--rb-shadow-lg);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    overflow-y: auto;
    padding: var(--rb-space-7) var(--rb-space-4) var(--rb-space-4);
}

.rb-header__drawer.is-open {
    transform: translateX(0);
}

.rb-header__drawer-close {
    position: absolute;
    top: var(--rb-space-3);
    right: var(--rb-space-3);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rb-cream);
    color: var(--rb-dark);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--rb-transition-fast);
}

.rb-header__drawer-close svg { width: 18px; height: 18px; }

.rb-header__drawer-close:hover {
    background: var(--rb-accent);
}

.rb-header__drawer-list {
    list-style: none;
    margin: 0 0 var(--rb-space-4);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rb-header__drawer-link {
    display: block;
    padding: 14px 16px;
    font-family: var(--rb-font-heading);
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--rb-dark) !important;
    border-radius: var(--rb-radius-sm);
    text-decoration: none !important;
    transition: var(--rb-transition-fast);
}

.rb-header__drawer-link:hover {
    background: var(--rb-cream);
    color: var(--rb-primary) !important;
    transform: translateX(4px);
}

.rb-header__cta--mobile {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: var(--rb-space-3);
}

.rb-header__drawer-contact {
    margin-top: var(--rb-space-5);
    padding-top: var(--rb-space-4);
    border-top: 1px solid var(--rb-border);
    display: flex;
    flex-direction: column;
    gap: var(--rb-space-2);
}

.rb-header__drawer-contact a {
    color: var(--rb-muted) !important;
    font-size: 14px;
    text-decoration: none !important;
    transition: var(--rb-transition-fast);
}

.rb-header__drawer-contact a:hover {
    color: var(--rb-primary) !important;
}

/* Backdrop */
.rb-header__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(31, 27, 22, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: var(--rb-transition);
}

.rb-header__backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .rb-header__topbar-inner { font-size: 12px; gap: var(--rb-space-3); }
    .rb-header__msg { display: none; }
    .rb-header__nav-list { gap: var(--rb-space-4); }
}

@media (max-width: 900px) {
    .rb-header__nav { display: none; }
    .rb-header__burger { display: flex; }
}

@media (max-width: 768px) {
    .rb-header__topbar-inner { padding: 8px var(--rb-space-3); flex-wrap: wrap; gap: var(--rb-space-2); }
    .rb-header__topbar-left { flex-wrap: wrap; gap: var(--rb-space-3); }
    .rb-header__contact span { display: none; }
    .rb-header__main-inner { padding: 16px var(--rb-space-3); gap: var(--rb-space-3); }
    .rb-header__cta { padding: 10px 18px; font-size: 13px; }
}

@media (max-width: 480px) {
    .rb-header__cta { display: none; }
    .rb-header__logo-text { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .rb-header *,
    .rb-header__drawer { transition: none !important; }
}
