/* ===== Top Bar ===== */
.header-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-wrap.is-scrolled .header {
    box-shadow: 0 2px 12px rgba(40, 32, 22, 0.06);
}

.top-bar {
    background: #FAFAF8;
    border-bottom: 1px solid #EFEAE3;
    height: var(--topbar-height);
}

.top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-bar-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #6A645C;
    line-height: 1;
}

.top-bar-item svg {
    width: 12px;
    height: 12px;
    color: #9A6B3C;
    flex-shrink: 0;
}

.top-bar-sep {
    color: #C8C0B6;
    font-size: 11px;
    margin: 0 2px;
}

.top-bar-social {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-bar-social a {
    display: flex;
    color: #6B6560;
}

.top-bar-social svg {
    width: 13px;
    height: 13px;
}

/* ===== Header (main nav row) ===== */
.header-wrap .header {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    height: var(--header-main-height);
    background: #FFFFFF;
    border-bottom: 1px solid #EFEAE3;
    overflow: visible;
}

.header-wrap .header-inner,
.header-wrap .nav,
.header-wrap .nav-list,
.header-wrap .nav-item.has-services-dropdown {
    overflow: visible;
}

.header-wrap .logo-img {
    height: 60px;
}

.header-wrap .nav-list {
    gap: 28px;
}

.header-wrap .search-btn {
    width: 34px;
    height: 34px;
    border: 1px solid #E8E2D8;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-wrap .search-btn svg {
    width: 15px;
    height: 15px;
}

/* ===== Services nav dropdown ===== */
.nav-item.has-services-dropdown {
    position: relative;
    padding-bottom: 10px;
    margin-bottom: -10px;
}

.nav-services-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 13px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 400;
    color: #4A453F;
    background: transparent;
    border-radius: 5px;
    line-height: 1;
    transition: background 0.18s ease, color 0.18s ease;
}

.nav-services-trigger:hover,
.nav-item.has-services-dropdown:hover .nav-services-trigger,
.nav-item.has-services-dropdown:has(.services-dropdown:hover) .nav-services-trigger {
    color: #9A6B3C;
}

.nav-services-trigger.is-open,
.nav-services-trigger[aria-expanded="true"],
.nav-services-trigger:hover,
.nav-item.has-services-dropdown:hover .nav-services-trigger,
.nav-item.has-services-dropdown:has(.services-dropdown:hover) .nav-services-trigger,
.nav-services-trigger.active {
    color: #9A6B3C;
    background: #FAF8F5;
    position: relative;
}

.header-wrap .nav-list a.active {
    color: #9A6B3C;
    position: relative;
}

.header-wrap .nav-list a.active::after,
.header-wrap .nav-services-trigger.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #9A6B3C;
    border-radius: 1px;
}

.header-wrap .nav-list a.active::after {
    bottom: -4px;
}

.header-wrap .nav-services-trigger.active::after {
    bottom: -1px;
}

.nav-services-trigger.is-open .nav-chevron,
.nav-services-trigger[aria-expanded="true"] .nav-chevron,
.nav-services-trigger:hover .nav-chevron,
.nav-item.has-services-dropdown:hover .nav-services-trigger .nav-chevron,
.nav-item.has-services-dropdown:has(.services-dropdown:hover) .nav-services-trigger .nav-chevron {
    transform: rotate(180deg);
}

.nav-chevron {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    transition: transform 0.18s ease;
}

.nav-item.has-dropdown > a {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.nav-item.has-dropdown .nav-chevron {
    width: 10px;
    height: 10px;
}

/* ===== Services Dropdown Panel ===== */
.services-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    padding-top: 8px;
    background: transparent;
    border: none;
    box-shadow: none;
    display: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease;
    z-index: 1100;
}

.services-dropdown.has-sub-panels {
    min-width: 480px;
}

/* Desktop: open ONLY while hovering the Services nav item */
@media (min-width: 1025px) {
    .services-dropdown.is-open {
        display: none;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .nav-item.has-services-dropdown:hover .services-dropdown {
        display: block;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

/* Mobile / programmatic open */
.services-dropdown.is-open {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.services-dropdown-inner {
    display: flex;
    align-items: stretch;
    background: #FFFFFF;
    border: 1px solid #E8E2D8;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(40, 32, 22, 0.1);
    overflow: hidden;
}

.services-dropdown:not(.has-sub-panels) .services-dropdown-inner {
    padding: 6px 0;
}

.services-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    flex: 0 0 210px;
    background: #FFFFFF;
}

.services-dropdown-list li {
    margin: 0;
    cursor: pointer;
}

.services-dropdown-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 14px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 400;
    color: #4A453F;
    line-height: 1.2;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, font-weight 0.15s ease;
}

.services-dropdown-list li.is-hovered > a,
.services-dropdown-list li.is-active > a,
.services-dropdown-list li:hover > a {
    background: #FAF8F5;
    color: #9A6B3C;
    border-left-color: #9A6B3C;
    font-weight: 500;
}

.services-dropdown-list .mega-cat-arrow {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    color: #B8B0A6;
    transition: color 0.15s ease;
}

.services-dropdown-list li:hover a .mega-cat-arrow,
.services-dropdown-list li.is-active a .mega-cat-arrow,
.services-dropdown-list li.is-hovered a .mega-cat-arrow {
    color: #9A6B3C;
}

/* Switch sub-panel when hovering a category tab */
@media (hover: hover) and (min-width: 1025px) {
    .services-dropdown-inner:has(.services-dropdown-list > li:hover) .services-sub-panel {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .services-dropdown-inner:has(.services-dropdown-list > li[data-cat="interior"]:hover) .services-sub-panel[data-sub="interior"],
    .services-dropdown-inner:has(.services-dropdown-list > li[data-cat="civil"]:hover) .services-sub-panel[data-sub="civil"],
    .services-dropdown-inner:has(.services-dropdown-list > li[data-cat="msgrill"]:hover) .services-sub-panel[data-sub="msgrill"],
    .services-dropdown-inner:has(.services-dropdown-list > li[data-cat="aluminum"]:hover) .services-sub-panel[data-sub="aluminum"],
    .services-dropdown-inner:has(.services-dropdown-list > li[data-cat="plumbing"]:hover) .services-sub-panel[data-sub="plumbing"],
    .services-dropdown-inner:has(.services-dropdown-list > li[data-cat="gypsum"]:hover) .services-sub-panel[data-sub="gypsum"],
    .services-dropdown-inner:has(.services-dropdown-list > li[data-cat="painting"]:hover) .services-sub-panel[data-sub="painting"],
    .services-dropdown-inner:has(.services-dropdown-list > li[data-cat="electrical"]:hover) .services-sub-panel[data-sub="electrical"],
    .services-dropdown-inner:has(.services-dropdown-list > li[data-cat="furniture"]:hover) .services-sub-panel[data-sub="furniture"],
    .services-dropdown-inner:has(.services-dropdown-list > li[data-cat="pvc"]:hover) .services-sub-panel[data-sub="pvc"] {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

/* ===== Services sub-panel (flyout) ===== */
.services-sub-panels {
    position: relative;
    flex: 1;
    min-width: 260px;
    background: #FAF8F5;
    border-left: 1px solid #EFEAE3;
    display: grid;
}

.services-sub-panel {
    grid-area: 1 / 1;
    display: flex;
    flex-direction: column;
    padding: 18px 18px 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.16s ease, visibility 0.16s ease;
}

.services-sub-panel.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.services-sub-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #E8E2D8;
}

.services-sub-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: #FFFFFF;
    border: 1px solid #E8E2D8;
    border-radius: 8px;
    color: #9A6B3C;
}

.services-sub-icon svg {
    width: 18px;
    height: 18px;
}

.services-sub-meta {
    min-width: 0;
    padding-top: 2px;
}

.services-sub-heading {
    margin: 0 0 4px;
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: 15px;
    font-weight: 600;
    color: #2E2A26;
    line-height: 1.2;
}

.services-sub-desc {
    display: block;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 400;
    color: #8A8278;
    line-height: 1.4;
}

.services-sub-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.services-sub-list li {
    margin: 0;
}

.services-sub-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 400;
    color: #4A453F;
    line-height: 1.2;
    background: #FFFFFF;
    border: 1px solid #E8E2D8;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.services-sub-dot {
    width: 6px;
    height: 6px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #D4C9BC;
    transition: background 0.15s ease, transform 0.15s ease;
}

.services-sub-label {
    flex: 1;
    min-width: 0;
}

.services-sub-list a .mega-cat-arrow {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    color: #C8C0B6;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.services-sub-list a:hover,
.services-sub-list li.is-active a {
    background: #FFFFFF;
    color: #9A6B3C;
    border-color: #9A6B3C;
    box-shadow: 0 2px 10px rgba(154, 107, 60, 0.12);
    transform: translateX(2px);
}

.services-sub-list a:hover .services-sub-dot,
.services-sub-list li.is-active a .services-sub-dot {
    background: #9A6B3C;
    transform: scale(1.15);
}

.services-sub-list a:hover .mega-cat-arrow,
.services-sub-list li.is-active a .mega-cat-arrow {
    opacity: 1;
    transform: translateX(0);
    color: #9A6B3C;
}

.services-sub-all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
    padding-top: 14px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    color: #9A6B3C;
    line-height: 1;
    transition: gap 0.15s ease;
}

.services-sub-all .mega-cat-arrow {
    width: 10px;
    height: 10px;
    transition: transform 0.15s ease;
}

.services-sub-all:hover {
    gap: 7px;
}

.services-sub-all:hover .mega-cat-arrow {
    transform: translateX(2px);
}

.services-sub-single {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.services-sub-single p {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 12px;
    line-height: 1.55;
    color: #6A645C;
}

.services-sub-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    margin-top: auto;
    padding: 9px 14px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    color: #FFFFFF;
    background: #9A6B3C;
    border-radius: 5px;
    line-height: 1;
    transition: background 0.15s ease, gap 0.15s ease;
}

.services-sub-cta .btn-icon {
    width: 14px;
    height: 14px;
}

.services-sub-cta:hover {
    background: #866032;
    gap: 11px;
}

/* ===== Mobile services accordion ===== */
.mobile-services-wrap {
    display: none;
}

.mobile-services-panel {
    display: none;
    width: 100%;
    padding: 2px 0 8px;
}

.mobile-services-panel.is-open {
    display: block;
}

.mobile-services-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0;
    background: none;
    border: none;
    font-family: var(--font-sans);
    font-size: 13px;
    color: #4A453F;
    cursor: pointer;
}

.mobile-services-toggle .nav-chevron {
    transition: transform 0.18s ease;
}

.mobile-services-toggle.is-open .nav-chevron {
    transform: rotate(180deg);
}

.mobile-cat-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 9px 10px;
    font-size: 12px;
    line-height: 1.25;
    color: #4A453F;
    background: #FAF8F5;
    border: 1px solid #E8E2D8;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.mobile-cat-btn.is-open {
    background: #FFFFFF;
    border-color: #D8CBB9;
    color: #9A6B3C;
}

.mobile-cat-btn svg,
.mobile-services-toggle svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.mobile-cat-btn svg {
    transition: transform 0.18s ease;
}

.mobile-cat-btn.is-open svg {
    transform: rotate(90deg);
}

.mobile-sub-panel {
    display: none;
    padding: 5px 0 5px 8px;
}

.mobile-sub-panel.is-open {
    display: block;
}

.mobile-sub-panel a {
    display: block;
    padding: 7px 9px;
    font-size: 12px;
    line-height: 1.25;
    color: #6A645C;
    border-radius: 5px;
}

.mobile-sub-panel a:hover {
    background: #FAF8F5;
    color: #9A6B3C;
}

.mobile-cat-group {
    margin-bottom: 5px;
}

/* ===== Responsive (desktop unchanged above 1024px) ===== */
@media (max-width: 1024px) {
    .nav-item.has-services-dropdown {
        display: none;
    }

    .services-dropdown {
        display: none !important;
    }

    .mobile-services-wrap {
        display: list-item;
        width: 100%;
    }
}

@media (max-width: 860px) {
    .top-bar {
        display: none;
    }

    :root {
        --header-height: var(--header-main-height);
    }
}
