/* ═══════════════════════════════════════════════
   Header Styler Widget — v4.0
   ═══════════════════════════════════════════════ */

/* ─── Reset ─── */
.hsw-wrap *,
.hsw-sidebar * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ─── Header base ─── */
/* position set per-widget via inline <style> (sticky / not-sticky) */
.hsw-header {
    background-color: #ffffff;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.3s ease;
    width: 100%;
}

.hsw-spacer { height: 75px; }

.hsw-has-border { border-bottom: 1px solid #F0F2F5; }

/* ─── Inner ─── */
.hsw-inner {
    width: 100%;
    max-width: 1200px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    margin: 0 auto;
}

/* ─── Logo ─── */
.hsw-logo-area {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.hsw-profile-img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #eee;
    flex-shrink: 0;
    display: block;
}

.hsw-custom-logo {
    width: 140px;
    height: auto;
    display: block;
}

.hsw-branding {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hsw-name {
    font-weight: 800;
    font-size: 17px;
    color: #1D242B;
    line-height: 1.2;
    white-space: nowrap;
}

.hsw-tagline {
    font-size: 12px;
    color: #6B7C93;
    line-height: 1.4;
    white-space: nowrap;
}

/* ─── Desktop Nav ─── */
.hsw-desktop-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.hsw-desktop-nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    align-items: center;
}

.hsw-desktop-nav a {
    text-decoration: none;
    color: #1D242B;
    font-size: 14px;
    font-weight: 700;
    transition: color 0.2s;
    white-space: nowrap;
    display: inline-block;
}

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

/* helper visibility wrappers */
.hsw-desktop-only { display: inline-flex; align-items: center; gap: 12px; }
.hsw-mobile-only  { display: none; }

/* ─── CTA Button ─── */
.hsw-cta-btn {
    background: linear-gradient(135deg, #FF9D2E 0%, #FF6B4A 100%);
    color: #ffffff !important;
    padding: 10px 22px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 14px rgba(255,107,74,.3);
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.hsw-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,107,74,.4);
    color: #ffffff !important;
    text-decoration: none;
}

/* ─── Auth button (desktop) ─── */
.hsw-auth-btn {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #1D242B;
    font-weight: 700;
    font-size: 14px;
    transition: color 0.2s;
    white-space: nowrap;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
}

.hsw-auth-btn:hover {
    color: #FF6B4A;
}

/* ─── Cart ─── */
.hsw-cart-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: #1D242B;
    text-decoration: none;
    padding: 4px;
    transition: color 0.2s;
    line-height: 1;
}

.hsw-cart-btn:hover { color: #FF6B4A; }

.hsw-cart-count {
    position: absolute;
    top: -4px;
    right: -6px;
    background: #FF6B4A;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    pointer-events: none;
}

/* ─── Hamburger ─── */
.hsw-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: #1D242B;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hsw-hamburger:hover { color: #FF6B4A; }

/* ─── Overlay ─── */
.hsw-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.hsw-overlay.active { display: block; opacity: 1; }

/* ─── Sidebar ─── */
.hsw-sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    z-index: 99999;
    box-shadow: -5px 0 25px rgba(0,0,0,.12);
    transition: right 0.38s cubic-bezier(0.25,0.46,0.45,0.94);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hsw-sidebar.active { right: 0 !important; }

.hsw-sidebar-top {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    gap: 10px;
    border-bottom: 1px solid #F0F2F5;
    flex-shrink: 0;
}

/* Search */
.hsw-search-box { flex: 1; }

.hsw-search-box form {
    display: flex;
    align-items: center;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.2s;
}

.hsw-search-box form:focus-within { border-color: #FF9D2E; }

.hsw-search-box input[type="search"] {
    flex: 1;
    padding: 10px 12px;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
    color: #1D242B;
    min-width: 0;
}

.hsw-search-submit {
    background: none;
    border: none;
    cursor: pointer;
    color: #6B7C93;
    padding: 0 12px;
    display: flex;
    align-items: center;
    height: 100%;
    transition: color 0.2s;
}

.hsw-search-submit:hover { color: #FF6B4A; }

.hsw-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #1D242B;
    padding: 4px;
    flex-shrink: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.hsw-close-btn:hover { color: #FF6B4A; }

.hsw-sidebar-body {
    padding: 8px 20px 28px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Mobile nav */
.hsw-mobile-nav {
    list-style: none;
    margin-bottom: 4px;
}

.hsw-mobile-nav li { border-bottom: 1px solid #F0F2F5; }

.hsw-mobile-nav li a {
    display: block;
    padding: 16px 0;
    text-decoration: none;
    color: #1D242B;
    font-weight: 600;
    font-size: 16px;
    transition: color 0.2s;
}

.hsw-mobile-nav li a:hover { color: #FF6B4A; }

/* Auth link in sidebar */
.hsw-sidebar-auth {
    padding: 16px 0;
    border-bottom: 1px solid #F0F2F5;
}

.hsw-auth-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #1D242B;
    font-weight: 700;
    font-size: 15px;
    transition: color 0.2s;
}

.hsw-auth-link:hover { color: #FF6B4A; }

/* CTA at bottom of sidebar */
.hsw-sidebar-cta {
    margin-top: 20px;
}

.hsw-sidebar-cta .hsw-cta-btn {
    display: flex;
    width: 100%;
    text-align: center;
    justify-content: center;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE ≤ 991px
   ═══════════════════════════════════════════════ */
@media (max-width: 991px) {

    /* hide desktop nav always */
    .hsw-desktop-nav { display: none !important; }

    /* show hamburger for styles 2, 3, 4 */
    .hsw-style2 .hsw-hamburger,
    .hsw-style3 .hsw-hamburger,
    .hsw-style4 .hsw-hamburger { display: flex; }

    /* visibility helpers flip on mobile */
    .hsw-desktop-only { display: none !important; }
    .hsw-mobile-only  { display: inline-flex !important; align-items: center; gap: 8px; }

    /* height fallback */
    .hsw-header { height: 60px; }
    .hsw-spacer { height: 60px; }
    .hsw-inner  { height: 60px; padding: 0 14px; }

    .hsw-profile-img { width: 38px; height: 38px; }
    .hsw-name        { font-size: 15px; }
    .hsw-tagline     { font-size: 11px; }

    /* Prevent logo overflowing into actions area */
    .hsw-style2 .hsw-logo-area,
    .hsw-style3 .hsw-logo-area,
    .hsw-style4 .hsw-logo-area {
        flex: 1;
        min-width: 0;
        max-width: calc(100% - 80px);
    }

    .hsw-style2 .hsw-branding,
    .hsw-style3 .hsw-branding,
    .hsw-style4 .hsw-branding { min-width: 0; overflow: hidden; }

    .hsw-style2 .hsw-name, .hsw-style2 .hsw-tagline,
    .hsw-style3 .hsw-name, .hsw-style3 .hsw-tagline,
    .hsw-style4 .hsw-name, .hsw-style4 .hsw-tagline {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }
}

/* ═══════════════════════════════════════════════
   ELEMENTOR EDITOR
   ═══════════════════════════════════════════════ */
.elementor-editor-active .hsw-header {
    position: relative !important;
    width: 100% !important;
    left: auto !important;
    top: auto !important;
}

.elementor-editor-active .hsw-spacer { display: none !important; }

.elementor-editor-active .hsw-overlay { display: none !important; }

.elementor-editor-active .hsw-sidebar {
    position: relative !important;
    right: auto !important;
    width: 100% !important;
    height: auto !important;
    box-shadow: 0 0 0 1px #ddd;
    margin-top: 8px;
    border-radius: 8px;
}
