/**
 * Header Styles
 * MediFlow Theme
 */

/* ==========================================================================
   Top Bar
   ========================================================================== */

.top-bar {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 0;
    font-size: 14px;
}

.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-bar a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.3s ease;
}

.top-bar a:hover {
    color: #3b82f6;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 12px;
}

.social-link {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: #3b82f6;
    color: #ffffff;
}

/* ==========================================================================
   Main Header
   ========================================================================== */

.site-header {
    position: relative;
    z-index: 1000;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

.header-main {
    padding: 20px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

/* Logo */
.header-logo {
    flex-shrink: 0;
}

.header-logo img {
    max-height: 50px;
    width: auto;
}

.site-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
}

/* Navigation */
.main-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
}

.primary-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
}

.primary-menu li {
    position: relative;
}

.primary-menu a {
    color: #1e293b;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    padding: 10px 0;
    display: block;
    transition: color 0.3s ease;
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a {
    color: #3b82f6;
}

/* Dropdown Menu */
.primary-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 10px 0;
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.primary-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.primary-menu .sub-menu a {
    padding: 10px 20px;
    font-size: 14px;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-search-toggle,
.header-cart,
.mobile-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #1e293b;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.header-search-toggle:hover,
.header-cart:hover {
    color: #3b82f6;
}

.header-cart {
    text-decoration: none;
}

.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background: #3b82f6;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: #1e293b;
    transition: all 0.3s ease;
}

/* ==========================================================================
   Sticky Header
   ========================================================================== */

.header-sticky {
    transition: all 0.3s ease;
}

.header-sticky.is-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.header-sticky.is-sticky .header-main {
    padding: 15px 0;
}

/* ==========================================================================
   Transparent Header
   ========================================================================== */

.header-transparent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: transparent;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.header-transparent .primary-menu a,
.header-transparent .site-title,
.header-transparent .header-search-toggle,
.header-transparent .header-cart {
    color: #ffffff;
}

.header-transparent.is-sticky {
    background: #ffffff;
    border-bottom-color: #e2e8f0;
}

.header-transparent.is-sticky .primary-menu a,
.header-transparent.is-sticky .site-title,
.header-transparent.is-sticky .header-search-toggle,
.header-transparent.is-sticky .header-cart {
    color: #1e293b;
}

/* ==========================================================================
   Header Layout 2 - Centered Logo
   ========================================================================== */

.header-layout-2 .header-inner {
    justify-content: space-between;
}

.header-layout-2 .header-logo-center {
    order: 2;
}

.header-layout-2 .nav-left {
    order: 1;
}

.header-layout-2 .header-actions {
    order: 3;
}

/* ==========================================================================
   Header Layout 3 - Minimal
   ========================================================================== */

.header-minimal .container-fluid {
    padding: 0 60px;
}

.header-minimal .header-right {
    display: flex;
    align-items: center;
    gap: 40px;
}

/* ==========================================================================
   Search Overlay
   ========================================================================== */

.header-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.header-search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-form-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.header-search-overlay .search-form input[type="search"] {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid #ffffff;
    color: #ffffff;
    font-size: 32px;
    padding: 20px 60px 20px 0;
    outline: none;
}

.header-search-overlay .search-form input[type="search"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-close {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 10px;
}

/* ==========================================================================
   Mobile Menu
   ========================================================================== */

.mobile-menu-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.mobile-menu-wrapper.active {
    visibility: visible;
    opacity: 1;
}

.mobile-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
}

.mobile-menu-container {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 85%;
    background: #ffffff;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-menu-wrapper.active .mobile-menu-container {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.mobile-logo img {
    max-height: 40px;
}

.mobile-menu-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #1e293b;
}

.mobile-navigation {
    flex: 1;
    padding: 20px;
}

.mobile-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu li {
    border-bottom: 1px solid #f1f5f9;
}

.mobile-menu a {
    display: block;
    padding: 15px 0;
    color: #1e293b;
    text-decoration: none;
    font-weight: 500;
}

.mobile-menu .sub-menu {
    list-style: none;
    padding-left: 20px;
}

.mobile-menu-footer {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 991px) {
    .top-bar {
        display: none;
    }

    .main-navigation {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .header-search-toggle {
        display: none;
    }

    .header-minimal .container-fluid {
        padding: 0 20px;
    }
}

@media (max-width: 768px) {
    .header-main {
        padding: 15px 0;
    }

    .header-logo img {
        max-height: 40px;
    }

    .header-actions {
        gap: 15px;
    }
}