/* ============================================================
   SITE HEADER  –  header.css
   Selectors: tối đa 3 level từ class cha → class con
   Không dùng biến :root
   ============================================================ */

/* ── Base ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
    transition: box-shadow .25s;
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 15px;
}

/* ── Logo ── */
.site-header__logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.site-header__logo img {
    height: 62px;
    width: auto;
    object-fit: contain;
}

/* ── Nav ── */
.site-header__nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-header__nav-head {
    display: none;
}

/* Menu list */
.site-header__menu {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Menu item */
.site-header__item {
    position: relative;
}

.site-header__link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 0px;
    font-size: 15px;
    font-weight: 500;
    color: #222;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color .2s, border-color .2s;
    white-space: nowrap;
}

.site-header__link:hover,
.site-header__link.active {
    color: var(--color-hover);
    border-bottom-color: var(--color-hover);
}

/* Chevron icon */
.site-header__chevron {
    width: 18px;
    height: 18px;
    transition: transform .2s;
    flex-shrink: 0;
}

/* Dropdown */
.site-header__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    /* min-width: 220px; */
    width: max-content;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .12);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .2s, transform .2s, visibility .2s;
    z-index: 100;
}

.site-header__item:hover .site-header__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.site-header__dropdown-link {
    display: block;
    padding: 9px 18px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.site-header__dropdown-link:hover {
    background: #fff5ec;
    color: var(--color-hover);
}

.site-header__dropdown-item.active .site-header__dropdown-link {
    color: var(--color-hover);
    font-weight: 600;
}

/* ── Actions ── */
.site-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Hotline */
.site-header__hotline {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #222;
}

.site-header__hotline-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--color-secondary);
    border-radius: 50%;
    color: #fff;
    flex-shrink: 0;
}

.site-header__hotline-icon svg {
    width: 18px;
    height: 18px;
}

.site-header__hotline-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.site-header__hotline-text small {
    font-size: 12px;
}

.site-header__hotline-text strong {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-hover);
    letter-spacing: .3px;
}

/* Đăng ký thợ button */
.site-header__register-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    background: var(--color-secondary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s, transform .15s;
}

.site-header__register-btn:hover {
    background: var(--color-hover);
    transform: translateY(-1px);
}

/* Search button */
.site-header__search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: 1.5px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    color: #444;
    transition: border-color .2s, color .2s;
}

.site-header__search-btn:hover {
    border-color: var(--color-hover);
    color: var(--color-hover);
}

.site-header__search-btn svg {
    width: 18px;
    height: 18px;
}

/* Hamburger – hidden on desktop */
.site-header__hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.site-header__hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #222;
    border-radius: 2px;
    transition: transform .25s;
}

/* Overlay mobile */
.overlay-m {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 998;
    backdrop-filter: blur(2px);
}

.overlay-m.active {
    display: block;
}

/* ── Search Overlay ── */
.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s;
}

.search-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.search-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    backdrop-filter: blur(4px);
}

.search-overlay__box {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 16px;
    z-index: 1;
    transform: translateY(-16px);
    transition: transform .25s;
}

.search-overlay.active .search-overlay__box {
    transform: translateY(0);
}

.search-overlay__form {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .18);
}

.search-overlay__icon {
    width: 20px;
    height: 20px;
    color: #999;
    flex-shrink: 0;
}

.search-overlay__input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: #222;
    background: transparent;
}

.search-overlay__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #f3f3f3;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #555;
    transition: background .2s;
}

.search-overlay__close:hover {
    background: var(--color-hover);
    color: #fff;
}

.search-overlay__close svg {
    width: 16px;
    height: 16px;
}

/* ── Modal Đăng ký thợ ── */
.modal-worker {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s;
}

.modal-worker.active {
    opacity: 1;
    pointer-events: all;
}

.modal-worker__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(4px);
}

.modal-worker__box {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    padding: 32px 28px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .22);
    z-index: 1;
    transform: translateY(20px) scale(.97);
    transition: transform .28s cubic-bezier(.22, 1, .36, 1);
}

.modal-worker.active .modal-worker__box {
    transform: translateY(0) scale(1);
}

.modal-worker__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.modal-worker__title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.modal-worker__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #555;
    transition: background .2s, color .2s;
}

.modal-worker__close:hover {
    background: var(--color-hover);
    color: #fff;
}

.modal-worker__close svg {
    width: 16px;
    height: 16px;
}

.modal-worker__desc {
    font-size: 14px;
    color: #666;
    margin: 0 0 20px;
    line-height: 1.6;
}

.modal-worker__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-worker__field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.modal-worker__field label {
    font-size: 13.5px;
    font-weight: 600;
    color: #333;
}

.modal-worker__field label span {
    color: var(--color-hover);
}

.site-header__chevron-trigger {
    display: flex;
}

.modal-worker__field input,
.modal-worker__field textarea,
.modal-worker__field select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #222;
    background: #fafafa;
    outline: none;
    transition: border-color .2s, background .2s;
    box-sizing: border-box;
    resize: vertical;
    height: 39px;
}

.modal-worker__field input:focus,
.modal-worker__field textarea:focus {
    border-color: var(--color-hover);
    background: #fff;
}

.modal-worker__submit {
    width: 100%;
    padding: 12px;
    background: var(--color-secondary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    transition: background .2s, transform .15s;
}

.modal-worker__submit:hover {
    background: var(--color-hover);
}

.modal-worker__submit:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
}

/* Alert thông báo trong modal */
.modal-worker__alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    line-height: 1.55;
    margin-bottom: 12px;
}

.modal-worker__alert--success {
    background: #edf9f0;
    border: 1.5px solid #52c67e;
    color: #1a7a3e;
}

.modal-worker__alert--error {
    background: #fff2f2;
    border: 1.5px solid #f08080;
    color: #c0392b;
}

/* ── Sticky scroll ── */
.site-header.affix {
    box-shadow: 0 4px 20px rgba(0, 0, 0, .12);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1350px) {
    .site-header__logo img {
        height: 50px;
    }

    .site-header__menu {
        gap: 15px;
    }

    .site-header__link {
        font-size: 14px;
    }
}

/* Tablet ≤ 1100px */
/* @media (max-width: 1100px) {
    .site-header__link {
        padding: 6px 9px;
        font-size: 13.5px;
    }

    .site-header__hotline-text strong {
        font-size: 15px;
    }
} */

/* Mobile ≤ 900px  – hamburger + drawer */
@media (max-width: 1200px) {

    .site-header__inner {
        height: 60px;
        gap: 12px;
        justify-content: space-between;
    }

    /* Nav drawer */
    .site-header__nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: min(320px, 85vw);
        height: 100vh;
        background: #fff;
        box-shadow: 4px 0 24px rgba(0, 0, 0, .15);
        flex-direction: column;
        align-items: stretch;
        overflow-y: auto;
        transition: left .3s cubic-bezier(.22, 1, .36, 1);
        z-index: 999;
        justify-content: start;
    }

    .site-header__nav.active {
        left: 0;
    }

    /* Mobile nav header */
    .site-header__nav-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid #f0f0f0;
    }

    .site-header__nav-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: #f5f5f5;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        color: #555;
    }

    .site-header__nav-close svg {
        width: 18px;
        height: 18px;
    }

    /* Menu on mobile */
    .site-header__menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px 0;
    }

    .site-header__link {
        padding: 12px 20px;
        border-bottom: none;
        border-left: 3px solid transparent;
        font-size: 15px;
        justify-content: space-between;
    }

    .site-header__chevron {
        width: 25px;
        height: 25px;
    }

    .site-header__link.active {
        border-left-color: var(--color-hover);
        border-bottom-color: transparent;
        background: #fff7f0;
    }

    .site-header__link:hover {
        border-left-color: transparent;
        border-bottom-color: transparent;
        background: transparent;
    }

    /* Dropdown on mobile – collapsed, toggle by JS */
    .site-header__dropdown {
        position: static;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        background: #f9f9f9;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        padding-left: 40px;
        width: 100%;
    }

    .site-header__dropdown li {
        list-style: disc;
    }

    .site-header__item.open .site-header__dropdown {
        display: block;
    }

    .site-header__item.open .site-header__chevron {
        transform: rotate(180deg);
    }

    .site-header__dropdown-link {
        padding: 10px 0px;
        font-size: 14px;
    }

    /* Hotline – hidden on mobile (too much space) */
    .site-header__hotline {
        display: none;
    }

    /* Show hamburger */
    .site-header__hamburger {
        display: flex;
    }
}

/* Small mobile ≤ 480px */
@media (max-width: 480px) {
    .site-header__register-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .modal-worker__box {
        padding: 24px 18px;
    }
}


@media (max-width: 380px) {
    .site-header__logo img {
        height: 40px;
    }
}
