/**
 * BNG Global Header & Mega Menu Styles v1.0.0
 * BiznesNaGotowo - Materiały B2B dla firm
 */

/* ==========================================================================
   Variables & Base
   ========================================================================== */

:root {
    --bng-header-height: 72px;
    --bng-info-bar-height: 36px;
    --bng-primary: #1e3a8a;
    --bng-primary-light: #3b82f6;
    --bng-gray-900: #111827;
    --bng-gray-700: #374151;
    --bng-gray-500: #6b7280;
    --bng-gray-200: #e5e7eb;
    --bng-gray-100: #f3f4f6;
    --bng-white: #ffffff;
    --bng-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --bng-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --bng-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --bng-transition: 0.2s ease;
}

/* ==========================================================================
   Skip Link (Accessibility)
   ========================================================================== */

.bng-skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--bng-primary);
    color: var(--bng-white);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 0;
}

.bng-skip-link:focus {
    top: 0;
}

/* ==========================================================================
   Info Bar (Top)
   ========================================================================== */

.bng-info-bar {
    background: var(--bng-primary);
    color: var(--bng-white);
    height: var(--bng-info-bar-height);
    display: flex;
    align-items: center;
    font-size: 13px;
    letter-spacing: 0.2px;
}

.bng-info-bar__text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    text-align: center;
}

.bng-info-bar__icon {
    width: 14px;
    height: 14px;
    color: #fbbf24;
}

/* ==========================================================================
   Main Header
   ========================================================================== */

.bng-site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bng-white);
}

.bng-main-header {
    height: var(--bng-header-height);
    border-bottom: 1px solid var(--bng-gray-200);
    box-shadow: var(--bng-shadow-sm);
}

.bng-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
}

.bng-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 32px;
}

/* ==========================================================================
   Logo
   ========================================================================== */

.bng-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.bng-logo-svg {
    height: 40px;
    width: auto;
}

/* ==========================================================================
   Main Navigation
   ========================================================================== */

.bng-main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.bng-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.bng-menu-item > a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    color: var(--bng-gray-700);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    transition: all var(--bng-transition);
}

.bng-menu-item > a:hover,
.bng-menu-item > a:focus {
    color: var(--bng-primary);
    background: var(--bng-gray-100);
}

.bng-dropdown-arrow {
    width: 12px;
    height: 12px;
    transition: transform var(--bng-transition);
}

.bng-has-megamenu:hover .bng-dropdown-arrow {
    transform: rotate(180deg);
}

/* ==========================================================================
   Mega Menu
   ========================================================================== */

.bng-megamenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bng-white);
    border-radius: 12px;
    box-shadow: var(--bng-shadow-lg);
    border: 1px solid var(--bng-gray-200);
    opacity: 0;
    visibility: hidden;
    transition: all var(--bng-transition);
    padding: 24px;
    min-width: 800px;
    z-index: 100;
}

.bng-has-megamenu {
    position: relative;
}

.bng-has-megamenu:hover .bng-megamenu,
.bng-has-megamenu:focus-within .bng-megamenu {
    opacity: 1;
    visibility: visible;
}

.bng-megamenu__inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.bng-megamenu__heading {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bng-gray-500);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--bng-gray-200);
}

.bng-megamenu__col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bng-megamenu__col li {
    margin-bottom: 4px;
}

.bng-megamenu__col a {
    display: block;
    padding: 8px 10px;
    color: var(--bng-gray-700);
    text-decoration: none;
    font-size: 14px;
    border-radius: 6px;
    transition: all var(--bng-transition);
}

.bng-megamenu__col a:hover {
    background: var(--bng-gray-100);
    color: var(--bng-primary);
}

.bng-megamenu__footer {
    grid-column: 1 / -1;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--bng-gray-200);
    text-align: center;
}

.bng-megamenu__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bng-primary);
    color: var(--bng-white);
    text-decoration: none;
    font-weight: 600;
    border-radius: 8px;
    transition: all var(--bng-transition);
}

.bng-megamenu__cta:hover {
    background: var(--bng-gray-900);
    transform: translateY(-1px);
}

/* ==========================================================================
   Header Actions
   ========================================================================== */

.bng-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bng-cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--bng-gray-700);
    text-decoration: none;
    border-radius: 10px;
    transition: all var(--bng-transition);
}

.bng-cart-icon:hover {
    background: var(--bng-gray-100);
    color: var(--bng-primary);
}

.bng-cart-icon svg {
    width: 22px;
    height: 22px;
}

.bng-cart-count {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ef4444;
    color: var(--bng-white);
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* ==========================================================================
   Mobile Toggle
   ========================================================================== */

.bng-mobile-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 8px;
}

.bng-mobile-toggle:hover {
    background: var(--bng-gray-100);
}

.bng-hamburger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    height: 100%;
}

.bng-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--bng-gray-700);
    border-radius: 2px;
    transition: all var(--bng-transition);
}

.bng-mobile-toggle[aria-expanded="true"] .bng-hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.bng-mobile-toggle[aria-expanded="true"] .bng-hamburger span:nth-child(2) {
    opacity: 0;
}

.bng-mobile-toggle[aria-expanded="true"] .bng-hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ==========================================================================
   Mobile Menu
   ========================================================================== */

.bng-mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bng-white);
    border-top: 1px solid var(--bng-gray-200);
    box-shadow: var(--bng-shadow-lg);
    max-height: calc(100vh - var(--bng-header-height) - var(--bng-info-bar-height));
    overflow-y: auto;
}

.bng-mobile-menu[aria-hidden="false"] {
    display: block;
}

.bng-mobile-nav ul {
    list-style: none;
    margin: 0;
    padding: 16px;
}

.bng-mobile-nav li {
    margin-bottom: 4px;
}

.bng-mobile-nav a {
    display: block;
    padding: 12px 16px;
    color: var(--bng-gray-700);
    text-decoration: none;
    font-size: 15px;
    border-radius: 8px;
    transition: all var(--bng-transition);
}

.bng-mobile-nav a:hover {
    background: var(--bng-gray-100);
    color: var(--bng-primary);
}

.bng-mobile-section {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bng-gray-500);
    padding: 16px 16px 8px;
    margin-top: 8px;
}

.bng-mobile-divider {
    height: 1px;
    background: var(--bng-gray-200);
    margin: 16px 0;
}

/* ==========================================================================
   Admin Bar Fix
   ========================================================================== */

body.admin-bar .bng-site-header {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .bng-site-header {
        top: 46px;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .bng-megamenu {
        min-width: 700px;
    }

    .bng-megamenu__inner {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .bng-info-bar {
        font-size: 11px;
        height: 32px;
    }

    .bng-main-nav {
        display: none;
    }

    .bng-mobile-toggle {
        display: flex;
    }

    .bng-container {
        padding: 0 16px;
    }

    .bng-header-inner {
        gap: 16px;
    }

    .bng-logo-svg {
        height: 36px;
    }
}

/* ==========================================================================
   Focus States (Accessibility)
   ========================================================================== */

.bng-menu-item > a:focus,
.bng-cart-icon:focus,
.bng-mobile-toggle:focus,
.bng-megamenu__col a:focus,
.bng-megamenu__cta:focus {
    outline: 2px solid var(--bng-primary-light);
    outline-offset: 2px;
}

/* ==========================================================================
   Body Padding (Account for sticky header)
   ========================================================================== */

body {
    padding-top: calc(var(--bng-header-height) + var(--bng-info-bar-height));
}

body.admin-bar {
    padding-top: calc(var(--bng-header-height) + var(--bng-info-bar-height) + 32px);
}

@media (max-width: 782px) {
    body.admin-bar {
        padding-top: calc(var(--bng-header-height) + var(--bng-info-bar-height) + 46px);
    }
}
