/**
 * HairStyleMojo Header Styles
 *
 * Migrated from WPCode snippet 27873 (header v1.1).
 *
 * @package HelloBizChild
 * @since   1.2.0
 */

/* ========================================
   HEADER BAR - STICKY
======================================== */
.hsh-header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-200);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    transition: var(--transition);
}

.hsh-header.scrolled {
    box-shadow: 0 1px 0 var(--border);
    border-bottom-color: transparent;
}

.hsh-header-spacer {
    height: 64px;
}

.hsh-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    height: 64px;
}

/* Logo pushes left, nav centers, actions push right */
.hsh-header-inner .hsh-logo {
    flex-shrink: 0;
}

.hsh-header-inner .hsh-nav {
    flex: 1;
    justify-content: center;
}

.hsh-header-inner .hsh-header-actions {
    flex-shrink: 0;
}

/* Logo */
.hsh-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: var(--transition);
}

.hsh-logo:hover {
    transform: scale(1.02);
}

.hsh-logo-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hsh-logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hsh-logo-text {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 700;
    color: var(--charcoal);
    letter-spacing: -0.01em;
}

.hsh-logo-text span {
    color: var(--blue);
}

/* ========================================
   MAIN NAVIGATION
======================================== */
.hsh-nav {
    display: flex;
    align-items: center;
}

.hsh-nav-list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hsh-nav-item {
    position: relative;
}

.hsh-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 400;
    color: var(--charcoal-mid);
    text-decoration: none;
    border-radius: 0;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
}

.hsh-nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 10px;
    right: 10px;
    height: 1.5px;
    background: var(--charcoal);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s var(--ease-out);
}

.hsh-nav-link:hover::after,
.hsh-nav-item.active .hsh-nav-link::after {
    transform: scaleX(1);
}

.hsh-nav-link span {
    position: relative;
    z-index: 1;
}

.hsh-nav-link:hover,
.hsh-nav-item.active .hsh-nav-link {
    color: var(--charcoal);
}

/* ========================================
   DROPDOWN MENU
======================================== */
.hsh-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 220px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 100;
}

.hsh-nav-item:hover .hsh-dropdown,
.hsh-nav-item:focus-within .hsh-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* "More" chevron icon */
.hsh-more-chevron {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    margin-left: -2px;
    transition: transform 0.2s ease;
}
.hsh-nav-more:hover .hsh-more-chevron {
    transform: rotate(180deg);
}

.hsh-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hsh-dropdown-item {
    margin: 0;
}

.hsh-dropdown-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--charcoal);
    text-decoration: none;
    border-radius: 10px;
    transition: var(--transition);
}

.hsh-dropdown-link:hover {
    background: var(--blue-subtle);
    color: var(--blue);
    transform: translateX(4px);
}

.hsh-dropdown--mega {
    left: auto;
    right: 0;
    transform: translateY(10px);
    min-width: 460px;
    max-width: min(560px, 80vw);
    padding: 16px;
}

.hsh-nav-item:hover .hsh-dropdown--mega,
.hsh-nav-item:focus-within .hsh-dropdown--mega {
    transform: translateY(0);
}

.hsh-mega-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.hsh-mega-col {
    background: var(--gray-100);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
}

.hsh-mega-hub {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 8px;
}

.hsh-mega-hub:hover {
    color: var(--blue);
}

.hsh-mega-children {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hsh-mega-child {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--white);
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--charcoal-mid);
    line-height: 1.2;
    transition: var(--transition);
}

.hsh-mega-child:hover {
    color: var(--blue);
    border-color: var(--blue-light);
}

.hsh-dropdown-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

/* Icon colors — all blue-toned, no pink */
.hsh-dropdown-item .hsh-dropdown-icon { background: #EBF4FF; }

/* Nav dropdown arrow */
.hsh-nav-link svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.hsh-nav-item:hover .hsh-nav-link svg {
    transform: rotate(180deg);
}

/* ========================================
   SEARCH & CTA
======================================== */
.hsh-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Language Selector Dropdown */
.hsh-lang-selector {
    position: relative;
}

.hsh-lang-current {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    background: transparent;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.hsh-lang-current:hover {
    background: var(--gray-100);
}

.hsh-lang-current .hsh-lang-flag {
    display: none;
}

.hsh-lang-flag {
    font-size: 17px;
    line-height: 1;
}

.hsh-lang-code {
    font-size: 13px;
    font-weight: 500;
    color: var(--charcoal-mid);
    letter-spacing: 0.05em;
}

.hsh-lang-chevron {
    width: 14px;
    height: 14px;
    stroke: var(--charcoal-light);
    stroke-width: 2;
    fill: none;
    transition: transform 0.2s ease;
}

.hsh-lang-selector:hover .hsh-lang-chevron,
.hsh-lang-selector.open .hsh-lang-chevron {
    transform: rotate(180deg);
}

.hsh-lang-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: var(--transition);
    z-index: 100;
}

.hsh-lang-selector:hover .hsh-lang-dropdown,
.hsh-lang-selector.open .hsh-lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hsh-lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--charcoal);
    transition: var(--transition);
}

.hsh-lang-option:hover {
    background: var(--blue-subtle);
    color: var(--blue);
}

.hsh-lang-option.active {
    color: var(--blue);
    font-weight: 600;
}

.hsh-lang-name {
    flex: 1;
}

.hsh-lang-check {
    width: 16px;
    height: 16px;
    stroke: var(--blue);
    stroke-width: 2.5;
    fill: none;
}

/* Try-On text link — hidden on desktop, moved to nav in Phase 2 */
.hsh-tryon-link {
    display: none;
}

/* Try-On nav link modifier */
.hsh-nav-link--tryon {
    font-weight: 500;
    color: var(--blue);
}

.hsh-nav-link--tryon::after {
    background: var(--blue);
}

.hsh-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: var(--charcoal);
    color: var(--white);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    border-radius: 50px;
    transition: var(--transition);
    box-shadow: none;
}

.hsh-cta-btn:hover {
    background: var(--blue-dark);
    transform: none;
    box-shadow: none;
    color: var(--white);
}

.hsh-cta-btn svg {
    display: none;
}

/* ========================================
   MOBILE MENU TOGGLE
======================================== */
.hsh-mobile-toggle {
    display: none;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 10001;
}

.hsh-hamburger {
    width: 24px;
    height: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hsh-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--charcoal);
    border-radius: 2px;
    transition: var(--transition);
}

.hsh-mobile-toggle.active .hsh-hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hsh-mobile-toggle.active .hsh-hamburger span:nth-child(2) {
    opacity: 0;
}

.hsh-mobile-toggle.active .hsh-hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ========================================
   MOBILE LANGUAGE SWITCHER
======================================== */
.hsh-mobile-lang {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.hsh-mobile-lang-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 500;
    color: var(--charcoal);
    text-decoration: none;
    background: var(--blue-subtle);
    border-radius: 12px;
    transition: var(--transition);
}

.hsh-mobile-lang-link:hover {
    background: var(--blue);
    color: var(--white);
}

/* ========================================
   MOBILE MENU
======================================== */
.hsh-mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 85%;
    height: 100vh;
    background: var(--white);
    z-index: 10000;
    padding: 100px 24px 40px;
    overflow-y: auto;
    transition: var(--transition);
    box-shadow: -10px 0 40px rgba(0,0,0,0.1);
}

.hsh-mobile-menu.active {
    right: 0;
}

.hsh-mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hsh-mobile-nav-item {
    border-bottom: 1px solid var(--border);
}

.hsh-mobile-nav-item--label {
    border-top: 1px solid var(--border);
    border-bottom: 0;
    margin-top: 8px;
    padding-top: 14px;
}

.hsh-mobile-nav-item--label span {
    display: inline-block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    color: var(--blue-dark);
}

.hsh-mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--charcoal);
    text-decoration: none;
    transition: var(--transition);
}

.hsh-mobile-nav-link:hover {
    color: var(--blue);
}

.hsh-mobile-nav-link svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.hsh-mobile-nav-link--topic {
    font-size: 15px;
}

/* Mobile expandable subcategories */
.hsh-mobile-chevron {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    margin-left: auto;
    padding: 3px;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.hsh-mobile-nav-item.expanded .hsh-mobile-chevron {
    transform: rotate(180deg);
}

.hsh-mobile-sub-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.hsh-mobile-nav-item.expanded .hsh-mobile-sub-list {
    max-height: 300px;
}

.hsh-mobile-sub-link {
    display: block;
    padding: 10px 16px 10px 32px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.hsh-mobile-sub-link:hover {
    color: var(--blue);
    padding-left: 36px;
}

.hsh-mobile-cta {
    margin-top: 30px;
}

.hsh-mobile-cta .hsh-cta-btn {
    width: 100%;
    justify-content: center;
    padding: 16px 24px;
}

.hsh-mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(45,55,72,0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.hsh-mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 1024px) {
    .hsh-nav {
        display: none;
    }

    .hsh-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hsh-header-actions .hsh-cta-btn,
    .hsh-header-actions .hsh-tryon-link {
        display: none;
    }
}

@media (max-width: 1200px) {
    .hsh-dropdown--mega {
        min-width: 380px;
    }
    .hsh-mega-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .hsh-header-inner {
        padding: 0 20px;
        height: 56px;
    }

    .hsh-header-spacer {
        height: 56px;
    }

    .hsh-logo-text {
        font-size: 16px;
    }

    .hsh-logo-icon {
        width: 32px;
        height: 32px;
    }

    .hsh-lang-current {
        padding: 5px 6px;
    }

    .hsh-lang-code {
        font-size: 12px;
    }

    .hsh-mobile-menu {
        width: 280px;
    }
}

/* ========================================
   SEARCH OVERLAY
======================================== */
.hsh-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--charcoal);
    border-radius: 50%;
    transition: var(--transition);
}

.hsh-search-toggle:hover {
    background: var(--blue-subtle);
    color: var(--blue);
}

.hsh-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10002;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.hsh-search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.hsh-search-container {
    width: 100%;
    max-width: 680px;
    padding: 0 32px;
}

.hsh-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    transition: border-color 0.2s ease;
}

.hsh-search-input-wrap:focus-within {
    border-color: var(--blue);
}

.hsh-search-icon {
    color: var(--charcoal-light);
    flex-shrink: 0;
}

.hsh-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 500;
    color: var(--charcoal);
    background: transparent;
}

.hsh-search-input::placeholder {
    color: var(--charcoal-light);
    font-weight: 400;
}

.hsh-search-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--gray-100);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: var(--charcoal-light);
    flex-shrink: 0;
    transition: var(--transition);
}

.hsh-search-close:hover {
    background: var(--charcoal);
    color: var(--white);
}

.hsh-search-results {
    margin-top: 16px;
    max-height: 50vh;
    overflow-y: auto;
}

.hsh-search-result {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    text-decoration: none;
    transition: var(--transition);
}

.hsh-search-result:hover {
    background: var(--blue-subtle);
}

.hsh-search-result-thumb {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--gray-100);
}

.hsh-search-result-info {
    flex: 1;
    min-width: 0;
}

.hsh-search-result-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--charcoal);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hsh-search-result-cat {
    font-size: 12px;
    font-weight: 500;
    color: var(--blue);
    margin-top: 4px;
}

.hsh-search-no-results {
    text-align: center;
    padding: 32px 16px;
    color: var(--charcoal-light);
    font-size: 15px;
}

.hsh-search-loading {
    text-align: center;
    padding: 24px;
    color: var(--charcoal-light);
}

@media (max-width: 600px) {
    .hsh-search-overlay {
        padding-top: 90px;
    }
    .hsh-search-container {
        padding: 0 20px;
    }
    .hsh-search-input {
        font-size: 16px;
    }
    .hsh-search-result-thumb {
        width: 48px;
        height: 48px;
    }
}

/* Admin bar offset */
.admin-bar .hsh-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .hsh-header {
        top: 46px;
    }
}

html[dir="rtl"] .hsh-dropdown--mega {
    right: auto;
    left: 0;
}
