@font-face {
    font-family: 'Roboto';
    src: url('../fonts/roboto/Roboto-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'Roboto';
    src: url('../fonts/roboto/Roboto-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

.joyin-site-header {
    width: 100%;
    background: #fff;
    color: #252d38;
    font-family: 'Roboto', Arial, sans-serif;
    position: relative;
    z-index: 100;
}

.joyin-header-top {
    min-height: clamp(76px, 5.85vw, 112px);
    display: grid;
    place-items: center;
    border-bottom: 1px solid #d9dde1;
}

.joyin-header-logo {
    display: inline-flex;
    width: clamp(174px, 12.4vw, 238px);
    line-height: 0;
}

.joyin-header-logo img {
    width: 100%;
    height: auto;
    display: block;
}

.joyin-header-bottom {
    min-height: clamp(82px, 7vw, 130px);
    display: flex;
    align-items: center;
}

.joyin-header-inner {
    width: min(1800px, calc(100% - 120px));
    display: grid;
    grid-template-columns: minmax(260px, 360px) 1fr auto;
    align-items: center;
    gap: clamp(28px, 3vw, 58px);
    margin: 0 auto;
    position: relative;
}

.joyin-header-search {
    grid-column: 1;
    width: min(100%, 360px);
    height: clamp(52px, 3.95vw, 70px);
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    padding: clamp(5px, 0.41vw, 8px) clamp(7px, 0.53vw, 10px) clamp(5px, 0.41vw, 8px) clamp(18px, 1.35vw, 26px);
    border: 1px solid #d0d4d8;
    border-radius: 999px;
    background: #fff;
    transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.joyin-header-search:focus-within {
    border-color: #f37022;
    box-shadow: 0 8px 24px rgba(243, 112, 34, 0.12);
}

.joyin-header-search input {
    min-width: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #27313c;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: clamp(15px, 1.04vw, 20px);
    font-weight: 400;
}

.joyin-header-search input::placeholder {
    color: #c7cbd0;
    opacity: 1;
}

.joyin-header-search button {
    height: clamp(42px, 3vw, 56px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 clamp(20px, 1.55vw, 30px);
    border: 0;
    border-radius: 999px;
    background: #f37022;
    color: #fff;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: clamp(14px, 0.94vw, 18px);
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    transition: background 0.22s ease, transform 0.22s ease;
}

.joyin-header-search button:hover,
.joyin-header-search button:focus-visible {
    background: #db5f13;
    transform: translateY(-1px);
}

.joyin-header-search-icon {
    width: 28px;
    height: 28px;
    display: inline-block;
    position: relative;
    flex: 0 0 auto;
}

.joyin-header-search-icon::before,
.joyin-header-search-icon::after {
    content: '';
    position: absolute;
    display: block;
}

.joyin-header-search-icon::before {
    width: 19px;
    height: 19px;
    left: 1px;
    top: 1px;
    border: 3px solid currentColor;
    border-radius: 50%;
}

.joyin-header-search-icon::after {
    width: 12px;
    height: 3px;
    right: 1px;
    bottom: 4px;
    border-radius: 99px;
    background: currentColor;
    transform: rotate(45deg);
    transform-origin: center;
}

.joyin-header-primary-nav,
.joyin-header-primary-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(18px, 1.85vw, 36px);
}

.joyin-header-primary-nav {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    white-space: nowrap;
}

.joyin-header-primary-menu {
    padding: 0;
    margin: 0;
    list-style: none;
}

.joyin-header-primary-menu li {
    padding: 0;
    margin: 0;
}

.joyin-header-primary-nav a,
.joyin-header-primary-menu a,
.joyin-header-life-link {
    color: #252d38;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: clamp(14px, 1.04vw, 20px);
    font-weight: 400;
    line-height: 1;
    text-decoration: none;
    transition: color 0.2s ease;
}

.joyin-header-primary-nav a:hover,
.joyin-header-primary-nav a:focus-visible,
.joyin-header-primary-menu a:hover,
.joyin-header-primary-menu a:focus-visible {
    color: #FF7421;
}

.joyin-header-life-link:hover,
.joyin-header-life-link:focus-visible {
    color: #f37022;
}

.joyin-header-actions {
    grid-column: 3;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    justify-self: end;
    gap: clamp(22px, 1.9vw, 36px);
    position: relative;
    z-index: 2;
    pointer-events: none;
    white-space: nowrap;
}

.joyin-header-life-link,
.joyin-header-menu-toggle,
.joyin-header-menu-panel {
    pointer-events: auto;
}

.joyin-header-divider {
    width: 1px;
    height: 42px;
    background: #d5d9dd;
}

.joyin-header-menu-toggle {
    width: 42px;
    height: 42px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #27313c;
    cursor: pointer;
}

.joyin-header-menu-toggle span {
    width: 27px;
    height: 2px;
    display: block;
    border-radius: 99px;
    background: currentColor;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.joyin-header-menu-toggle[aria-expanded='true'] span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.joyin-header-menu-toggle[aria-expanded='true'] span:nth-child(2) {
    opacity: 0;
}

.joyin-header-menu-toggle[aria-expanded='true'] span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.joyin-header-menu-panel {
    min-width: 230px;
    height: auto;
    position: absolute;
    top: calc(100% + 22px);
    right: 0;
    z-index: 20;
    padding: 18px;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(39, 49, 60, 0.14);
}

.joyin-header-menu-panel[hidden] {
    display: none;
}

.joyin-header-menu-list {
    display: grid;
    gap: 2px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.joyin-header-menu-list a {
    display: block;
    padding: 11px 12px;
    border-radius: 6px;
    color: #27313c;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.2;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.joyin-header-menu-list a:hover,
.joyin-header-menu-list a:focus-visible {
    color: #f37022;
}

@media (max-width: 1180px) {
    .joyin-header-inner {
        width: min(1400px, calc(100% - 48px));
        grid-template-columns: minmax(240px, 320px) 1fr auto;
        gap: 28px;
    }

    .joyin-header-primary-nav {
        gap: 18px;
    }
}

@media (max-width: 920px) {
    .joyin-header-bottom {
        min-height: 0;
        padding: 18px 0;
    }

    .joyin-header-inner {
        grid-template-columns: 1fr auto;
        gap: 18px;
    }

    .joyin-header-search {
        grid-column: 1 / -1;
        order: 2;
    }

    .joyin-header-primary-nav {
        display: none;
        position: static;
        transform: none;
    }

    .joyin-header-actions {
        grid-column: 2;
        order: 1;
    }
}

@media (max-width: 560px) {
    .joyin-site-header {
        padding: 0 20px 12px;
    }

    .joyin-header-top {
        min-height: 88px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        border-bottom: 0;
    }

    .joyin-header-inner {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
        position: static;
    }

    .joyin-header-logo {
        width: clamp(128px, 35vw, 168px);
    }

    .joyin-header-bottom {
        padding: 0;
    }

    .joyin-header-life-link {
        display: none;
    }

    .joyin-header-actions {
        position: absolute;
        top: 28px;
        right: 20px;
        z-index: 6;
        width: 36px;
        height: 36px;
        gap: 0;
        grid-column: auto;
        order: initial;
        justify-self: auto;
    }

    .joyin-header-divider {
        display: none;
    }

    .joyin-header-menu-toggle {
        width: 36px;
        height: 36px;
        gap: 6px;
    }

    .joyin-header-menu-toggle span {
        width: 26px;
        height: 2px;
    }

    .joyin-header-search {
        grid-column: 1;
        width: 100%;
        height: clamp(58px, 14.48vw, 68px);
        gap: 8px;
        padding: clamp(6px, 1.58vw, 8px) clamp(8px, 1.8vw, 10px) clamp(6px, 1.58vw, 8px) clamp(26px, 6.8vw, 34px);
    }

    .joyin-header-search input {
        font-size: clamp(12px, 3.17vw, 16px);
    }

    .joyin-header-search button {
        height: clamp(46px, 11.31vw, 54px);
        gap: clamp(8px, 2.26vw, 12px);
        padding: 0 clamp(22px, 6.1vw, 30px);
        font-size: clamp(12px, 3.17vw, 16px);
    }

    .joyin-header-search-icon {
        width: clamp(20px, 5.43vw, 28px);
        height: clamp(20px, 5.43vw, 28px);
    }

    .joyin-header-search-icon::before {
        width: clamp(14px, 4.3vw, 20px);
        height: clamp(14px, 4.3vw, 20px);
        border-width: 2px;
    }

    .joyin-header-search-icon::after {
        width: clamp(8px, 2.49vw, 12px);
        height: 2px;
        bottom: 4px;
    }

    .joyin-header-menu-panel {
        top: calc(100% + 12px);
        right: 0;
        min-width: min(260px, calc(100vw - 40px));
    }
}
