/**
 * Galorina Header - Professional Marketplace Header Styles
 * Version: 2.0.0
 */

/* ================================
   CSS VARIABLES
   ================================ */
:root {
    --gh-primary: #252074;
    --gh-secondary: #006B28;
    --gh-accent: #FF6B00;
    --gh-bg: #ffffff;
    --gh-text: #333333;
    --gh-text-light: #666666;
    --gh-text-muted: #999999;
    --gh-border: #e5e5e5;
    --gh-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --gh-shadow-lg: 0 5px 25px rgba(0, 0, 0, 0.15);
    --gh-radius: 8px;
    --gh-radius-sm: 4px;
    --gh-transition: all 0.3s ease;
    --gh-z-header: 1000;
    --gh-z-dropdown: 1100;
    --gh-z-mobile: 1200;
    --gh-topbar-height: 40px;
    --gh-main-height: 70px;
    --gh-categories-height: 46px;
}

/* ================================
   RESET & BASE
   ================================ */
.gh-header * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.gh-header {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gh-text);
}

/* Ensure no gap between header and content */
body.gh-header-active {
    margin-top: 0 !important;
}

body.gh-header-active #page,
body.gh-header-active .site,
body.gh-header-active main,
body.gh-header-active .content,
body.gh-header-active .site-content,
body.gh-header-active .entry-content,
body.gh-header-active .woocommerce {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.gh-header a {
    text-decoration: none;
    color: inherit;
    transition: var(--gh-transition);
}

.gh-header button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: var(--gh-transition);
}

.gh-header input {
    font-family: inherit;
    border: none;
    outline: none;
}

.gh-header img {
    max-width: 100%;
    height: auto;
}

.gh-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ================================
   HEADER WRAPPER
   ================================ */
.gh-header-wrapper {
    position: relative;
    width: 100%;
    z-index: var(--gh-z-header);
}

.gh-header-wrapper.gh-sticky-header {
    position: sticky;
    top: 0;
}

.gh-header-wrapper.gh-sticky-header.gh-scrolled {
    box-shadow: var(--gh-shadow);
}

/* Spacer only for sticky header - calculated dynamically */
.gh-header-spacer {
    display: none;
}

.gh-sticky-header + .gh-header-spacer {
    display: block;
}

/* No extra spacing - header sits naturally at top */

/* ================================
   TOPBAR
   ================================ */
.gh-topbar {
    background: var(--gh-primary);
    color: #ffffff;
    height: var(--gh-topbar-height);
    font-size: 13px;
}

.gh-topbar .gh-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.gh-topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.gh-topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.gh-contact-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.9);
}

.gh-contact-item:hover {
    color: #ffffff;
}

.gh-contact-item svg {
    opacity: 0.8;
}

.gh-social-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gh-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    transition: var(--gh-transition);
}

.gh-social-link:hover {
    color: #ffffff;
    transform: translateY(-2px);
}

/* ================================
   MAIN HEADER
   ================================ */
.gh-main-header {
    background: var(--gh-bg);
    height: var(--gh-main-height);
    border-bottom: 1px solid var(--gh-border);
}

.gh-header-wrapper.gh-scrolled .gh-main-header {
    box-shadow: var(--gh-shadow);
}

.gh-main-header .gh-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 30px;
}

/* ================================
   LOGO
   ================================ */
.gh-logo {
    flex-shrink: 0;
}

.gh-logo a {
    display: flex;
    align-items: center;
}

.gh-logo img {
    max-height: 45px;
    width: auto;
}

.gh-logo-text {
    font-size: 28px;
    font-weight: 700;
    color: var(--gh-primary);
    letter-spacing: -1px;
}

/* ================================
   SEARCH
   ================================ */
.gh-search {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.gh-search-wrapper {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: var(--gh-radius);
    padding: 0 15px;
    border: 2px solid transparent;
    transition: var(--gh-transition);
}

.gh-search-wrapper:focus-within {
    background: #ffffff;
    border-color: var(--gh-primary);
}

.gh-search-wrapper svg {
    color: var(--gh-text-muted);
    flex-shrink: 0;
}

.gh-search-input {
    flex: 1;
    background: transparent;
    padding: 12px 15px;
    font-size: 14px;
    color: var(--gh-text);
}

.gh-search-input::placeholder {
    color: var(--gh-text-muted);
}

.gh-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--gh-bg);
    border-radius: var(--gh-radius);
    box-shadow: var(--gh-shadow-lg);
    margin-top: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--gh-transition);
    z-index: var(--gh-z-dropdown);
    max-height: 400px;
    overflow-y: auto;
}

.gh-search-results.gh-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.gh-search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--gh-border);
    transition: var(--gh-transition);
}

.gh-search-result-item:last-child {
    border-bottom: none;
}

.gh-search-result-item:hover {
    background: #f9f9f9;
}

.gh-search-result-img {
    width: 50px;
    height: 50px;
    border-radius: var(--gh-radius-sm);
    object-fit: cover;
    background: #f5f5f5;
}

.gh-search-result-info {
    flex: 1;
}

.gh-search-result-title {
    font-weight: 500;
    color: var(--gh-text);
    margin-bottom: 4px;
    line-height: 1.3;
}

.gh-search-result-price {
    font-size: 13px;
    color: var(--gh-secondary);
    font-weight: 600;
}

.gh-search-no-results {
    padding: 20px;
    text-align: center;
    color: var(--gh-text-muted);
}

.gh-loading {
    padding: 20px;
    text-align: center;
    color: var(--gh-text-muted);
}

/* ================================
   ACTIONS
   ================================ */
.gh-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gh-action-item {
    position: relative;
}

.gh-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--gh-text);
    position: relative;
}

.gh-action-btn:hover {
    background: #f5f5f5;
    color: var(--gh-primary);
}

.gh-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    background: var(--gh-accent);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* ================================
   USER MENU
   ================================ */
.gh-user {
    margin-left: 10px;
}

.gh-user-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border-radius: 25px;
    background: #f5f5f5;
}

.gh-user-toggle:hover {
    background: #eeeeee;
}

.gh-user-toggle img {
    border-radius: 50%;
}

.gh-user-name {
    font-weight: 500;
    color: var(--gh-text);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gh-user-toggle svg {
    color: var(--gh-text-muted);
}

.gh-login-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--gh-primary);
    color: #ffffff;
    border-radius: var(--gh-radius);
    font-weight: 500;
}

.gh-login-btn:hover {
    background: var(--gh-secondary);
}

/* ================================
   DROPDOWNS
   ================================ */
.gh-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 280px;
    background: var(--gh-bg);
    border-radius: var(--gh-radius);
    box-shadow: var(--gh-shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--gh-transition);
    z-index: var(--gh-z-dropdown);
}

.gh-dropdown.gh-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.gh-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--gh-border);
    font-weight: 600;
}

.gh-mark-read {
    font-size: 12px;
    color: var(--gh-primary);
    font-weight: 400;
}

.gh-mark-read:hover {
    text-decoration: underline;
}

.gh-dropdown-content {
    max-height: 300px;
    overflow-y: auto;
}

.gh-dropdown-footer {
    padding: 12px 15px;
    border-top: 1px solid var(--gh-border);
    text-align: center;
}

.gh-dropdown-footer a {
    color: var(--gh-primary);
    font-weight: 500;
}

.gh-dropdown-footer a:hover {
    color: var(--gh-secondary);
}

/* User Dropdown Specific */
.gh-user-dropdown {
    min-width: 320px;
    padding: 15px 0;
}

.gh-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 15px 15px;
}

.gh-user-info img {
    border-radius: 50%;
}

.gh-user-details {
    display: flex;
    flex-direction: column;
}

.gh-user-display-name {
    font-weight: 600;
    color: var(--gh-text);
}

.gh-user-email {
    font-size: 12px;
    color: var(--gh-text-muted);
}

.gh-dropdown-divider {
    height: 1px;
    background: var(--gh-border);
    margin: 10px 0;
}

.gh-menu-section {
    padding: 10px 15px;
}

.gh-menu-section-title {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--gh-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.gh-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    margin: 0 -15px;
    color: var(--gh-text);
    border-radius: var(--gh-radius-sm);
}

.gh-menu-item:hover {
    background: #f5f5f5;
    color: var(--gh-primary);
}

.gh-menu-item svg {
    color: var(--gh-text-muted);
}

.gh-menu-item:hover svg {
    color: var(--gh-primary);
}

.gh-menu-item-highlight {
    background: linear-gradient(135deg, var(--gh-primary), var(--gh-secondary));
    color: #ffffff;
    margin-top: 5px;
}

.gh-menu-item-highlight:hover {
    background: linear-gradient(135deg, var(--gh-secondary), var(--gh-primary));
    color: #ffffff;
}

.gh-menu-item-highlight svg {
    color: #ffffff;
}

.gh-menu-item-logout {
    color: #dc3545;
}

.gh-menu-item-logout:hover {
    background: #fff5f5;
}

.gh-menu-item-logout svg {
    color: #dc3545;
}

.gh-text-warning {
    color: #dc3545 !important;
}

/* Notification Items */
.gh-notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--gh-border);
    transition: var(--gh-transition);
}

.gh-notification-item:last-child {
    border-bottom: none;
}

.gh-notification-item:hover {
    background: #f9f9f9;
}

.gh-notification-item.gh-unread {
    background: #f0f7ff;
}

.gh-notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gh-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gh-notification-content {
    flex: 1;
}

.gh-notification-text {
    font-size: 13px;
    color: var(--gh-text);
    margin-bottom: 4px;
    line-height: 1.4;
}

.gh-notification-time {
    font-size: 11px;
    color: var(--gh-text-muted);
}

/* ================================
   CATEGORIES BAR
   ================================ */
.gh-categories-bar {
    background: #fafafa;
    border-bottom: 1px solid var(--gh-border);
    height: var(--gh-categories-height);
}

.gh-categories-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.gh-categories-nav::-webkit-scrollbar {
    display: none;
}

.gh-cat-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px;
    white-space: nowrap;
    border-radius: var(--gh-radius);
    color: var(--gh-text);
    font-size: 13px;
    font-weight: 500;
    transition: var(--gh-transition);
}

.gh-cat-link:hover {
    background: var(--gh-primary);
    color: #ffffff;
}

.gh-cat-link.gh-cat-all {
    background: var(--gh-primary);
    color: #ffffff;
}

.gh-cat-link.gh-cat-all:hover {
    background: var(--gh-secondary);
}

.gh-cat-icon {
    width: 20px;
    height: 20px;
    border-radius: var(--gh-radius-sm);
    object-fit: cover;
}

/* ================================
   MOBILE MENU
   ================================ */
.gh-mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    gap: 5px;
}

.gh-mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gh-text);
    border-radius: 1px;
    transition: var(--gh-transition);
}

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

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

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

.gh-mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--gh-z-mobile);
    pointer-events: none;
}

.gh-mobile-menu.gh-active {
    pointer-events: auto;
}

.gh-mobile-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: var(--gh-transition);
}

.gh-mobile-menu.gh-active .gh-mobile-menu-overlay {
    opacity: 1;
}

.gh-mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 85%;
    height: 100%;
    background: var(--gh-bg);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: var(--gh-shadow-lg);
}

.gh-mobile-menu.gh-active .gh-mobile-menu-content {
    transform: translateX(0);
}

.gh-mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--gh-border);
}

.gh-mobile-menu-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gh-text);
}

.gh-mobile-menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--gh-text);
}

.gh-mobile-menu-close:hover {
    background: #f5f5f5;
}

.gh-mobile-search {
    padding: 15px 20px;
    border-bottom: 1px solid var(--gh-border);
}

.gh-mobile-search input {
    width: 100%;
    padding: 12px 15px;
    background: #f5f5f5;
    border-radius: var(--gh-radius);
    font-size: 14px;
}

.gh-mobile-nav {
    padding: 10px 0;
}

.gh-mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--gh-text);
    border-left: 3px solid transparent;
}

.gh-mobile-nav-item:hover {
    background: #f5f5f5;
    border-left-color: var(--gh-primary);
}

.gh-mobile-nav-item svg {
    color: var(--gh-text-muted);
}

.gh-mobile-nav-divider {
    padding: 10px 20px 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gh-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: 1px solid var(--gh-border);
    margin-top: 5px;
}

.gh-mobile-nav-divider:first-child {
    border-top: none;
    margin-top: 0;
}

.gh-nav-highlight {
    background: linear-gradient(135deg, var(--gh-primary), var(--gh-secondary));
    color: #ffffff;
    margin: 5px 10px;
    border-radius: var(--gh-radius);
    border-left: none !important;
}

.gh-nav-highlight:hover {
    background: linear-gradient(135deg, var(--gh-secondary), var(--gh-primary));
    color: #ffffff;
}

.gh-nav-highlight svg {
    color: #ffffff;
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 1024px) {
    .gh-search {
        max-width: 350px;
    }
    
    .gh-categories-nav {
        gap: 3px;
    }
    
    .gh-cat-link {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    :root {
        --gh-header-height: 60px;
    }
    
    .gh-topbar {
        display: none;
    }
    
    .gh-categories-bar {
        display: none;
    }
    
    .gh-main-header {
        height: 60px;
    }
    
    .gh-main-header .gh-container {
        gap: 15px;
    }
    
    .gh-logo img {
        max-height: 35px;
    }
    
    .gh-logo-text {
        font-size: 22px;
    }
    
    .gh-search {
        display: none;
    }
    
    .gh-user-name {
        display: none;
    }
    
    .gh-user-toggle {
        padding: 4px;
        border-radius: 50%;
    }
    
    .gh-mobile-toggle {
        display: flex;
    }
    
    .gh-sticky + .gh-header-spacer {
        height: 60px;
    }
    
    .gh-dropdown {
        position: fixed;
        top: 60px;
        left: 10px;
        right: 10px;
        min-width: auto;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    .gh-user-dropdown {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .gh-container {
        padding: 0 15px;
    }
    
    .gh-login-btn span {
        display: none;
    }
    
    .gh-login-btn {
        padding: 10px;
        border-radius: 50%;
    }
    
    .gh-action-btn {
        width: 36px;
        height: 36px;
    }
    
    .gh-mobile-menu-content {
        width: 280px;
    }
}

/* ================================
   ANIMATIONS
   ================================ */
@keyframes gh-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.gh-badge.gh-pulse {
    animation: gh-pulse 2s infinite;
}

@keyframes gh-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.gh-loading::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--gh-border);
    border-top-color: var(--gh-primary);
    border-radius: 50%;
    animation: gh-spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* ================================
   DARK MODE SUPPORT (optional)
   ================================ */
@media (prefers-color-scheme: dark) {
    .gh-header-wrapper.gh-dark-mode-auto {
        --gh-bg: #1a1a1a;
        --gh-text: #e5e5e5;
        --gh-text-light: #b0b0b0;
        --gh-text-muted: #777777;
        --gh-border: #333333;
    }
    
    .gh-header-wrapper.gh-dark-mode-auto .gh-main-header {
        background: var(--gh-bg);
    }
    
    .gh-header-wrapper.gh-dark-mode-auto .gh-search-wrapper {
        background: #2a2a2a;
    }
    
    .gh-header-wrapper.gh-dark-mode-auto .gh-user-toggle {
        background: #2a2a2a;
    }
    
    .gh-header-wrapper.gh-dark-mode-auto .gh-dropdown {
        background: #1a1a1a;
    }
    
    .gh-header-wrapper.gh-dark-mode-auto .gh-categories-bar {
        background: #151515;
    }
}