/**
 * Global Header & Navigation Styles
 * Lab Grown Diamond CVD - Phase 1
 */

/* ===========================
   Top Bar
   =========================== */
.lgd-header__top-bar {
    background: #001f3f;
    color: #ffffff;
    font-size: 0.813rem;
    padding: 8px 0;
}

.lgd-header__top-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lgd-header__announcements {
    flex: 1;
}

.lgd-header__top-links {
    display: flex;
    gap: 20px;
}

.lgd-header__top-link {
    color: #ffffff;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.lgd-header__top-link:hover {
    opacity: 0.8;
}

/* ===========================
   Main Header
   =========================== */
.lgd-header__main {
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    padding: 20px 0;
    position: relative;
    z-index: 100;
}

.lgd-header.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    animation: slideDown 0.3s ease;
}

.lgd-header.sticky .lgd-header__top-bar {
    display: none;
}

.lgd-header.sticky .lgd-header__main {
    padding: 12px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.lgd-header__wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

/* ===========================
   Logo
   =========================== */
.lgd-header__logo {
    flex-shrink: 0;
}

.lgd-header__logo-text {
    text-decoration: none;
}

.lgd-header__logo .site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #001f3f;
    font-family: 'Playfair Display', serif;
}

.lgd-header__logo img {
    max-height: 50px;
    width: auto;
}

/* ===========================
   Main Navigation
   =========================== */
.lgd-header__nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.lgd-nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
}

.lgd-nav-menu > .menu-item > a {
    color: #212121;
    text-decoration: none;
    font-size: 0.938rem;
    font-weight: 500;
    padding: 10px 0;
    position: relative;
    transition: color 0.3s ease;
}

.lgd-nav-menu > .menu-item > a:hover,
.lgd-nav-menu > .menu-item.current-menu-item > a {
    color: #0047AB;
}

.lgd-nav-menu > .menu-item > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #0047AB;
    transition: width 0.3s ease;
}

.lgd-nav-menu > .menu-item > a:hover::after,
.lgd-nav-menu > .menu-item.current-menu-item > a::after {
    width: 100%;
}

.lgd-nav-menu > .menu-item-has-children > a::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    margin-left: 6px;
    vertical-align: middle;
}

/* ===========================
   Utility Icons
   =========================== */
.lgd-header__utilities {
    display: flex;
    align-items: center;
    gap: 20px;
}

.lgd-header__utility-btn {
    background: none;
    border: none;
    color: #212121;
    cursor: pointer;
    padding: 8px;
    position: relative;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.lgd-header__utility-btn:hover {
    color: #0047AB;
}

.lgd-header__utility-count,
.lgd-header__cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background: #0047AB;
    color: #ffffff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.688rem;
    font-weight: 600;
}

.lgd-header__mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
}

.lgd-header__mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #212121;
    transition: all 0.3s ease;
}

/* ===========================
   Mega Menu
   =========================== */
.lgd-mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e5e5e5;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 40px 0;
    z-index: 99;
}

.lgd-mega-menu__content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}

.lgd-mega-menu__column h3 {
    font-size: 0.938rem;
    font-weight: 600;
    color: #212121;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lgd-mega-menu__column ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lgd-mega-menu__column li {
    margin-bottom: 12px;
}

.lgd-mega-menu__column a {
    color: #666666;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.lgd-mega-menu__column a:hover {
    color: #0047AB;
}

/* ===========================
   Mobile Drawer
   =========================== */
.lgd-mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s ease, opacity 0.3s ease;
}

.lgd-mobile-drawer.active {
    visibility: visible;
    opacity: 1;
}

.lgd-mobile-drawer__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.lgd-mobile-drawer__content {
    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;
}

.lgd-mobile-drawer.active .lgd-mobile-drawer__content {
    transform: translateX(0);
}

.lgd-mobile-drawer__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.lgd-mobile-drawer__header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #212121;
}

.lgd-mobile-drawer__close {
    background: none;
    border: none;
    color: #212121;
    cursor: pointer;
    padding: 8px;
}

.lgd-mobile-drawer__nav {
    padding: 20px;
}

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

.lgd-mobile-nav .menu-item {
    margin-bottom: 16px;
}

.lgd-mobile-nav .menu-item > a {
    color: #212121;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    display: block;
    padding: 12px 0;
    transition: color 0.3s ease;
}

.lgd-mobile-nav .menu-item > a:hover {
    color: #0047AB;
}

.lgd-mobile-nav .menu-item-has-children > a::after {
    content: '+';
    float: right;
    font-size: 1.25rem;
}

.lgd-mobile-nav .sub-menu {
    list-style: none;
    padding-left: 20px;
    margin-top: 8px;
    display: none;
}

.lgd-mobile-nav .menu-item-has-children.open > .sub-menu {
    display: block;
}

.lgd-mobile-nav .sub-menu .menu-item {
    margin-bottom: 8px;
}

.lgd-mobile-nav .sub-menu a {
    font-size: 0.875rem;
    color: #666666;
}

/* ===========================
   Search Overlay
   =========================== */
.lgd-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lgd-search-overlay.active {
    display: flex;
}

.lgd-search-overlay__close {
    position: absolute;
    top: 30px;
    right: 30px;
    color: #ffffff;
    font-size: 3rem;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.3s ease;
}

.lgd-search-overlay__close:hover {
    opacity: 0.7;
}

.lgd-search-overlay__content {
    width: 100%;
    max-width: 800px;
}

.lgd-search-form {
    position: relative;
    margin-bottom: 40px;
}

.lgd-search-input {
    width: 100%;
    background: #ffffff;
    border: none;
    padding: 20px 60px 20px 20px;
    font-size: 1.5rem;
    color: #212121;
    outline: none;
}

.lgd-search-submit {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #212121;
    cursor: pointer;
    padding: 10px;
}

.lgd-search-suggestions {
    color: #ffffff;
}

.lgd-search-suggestions__section h3 {
    font-size: 1rem;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.lgd-search-suggestions__section ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.lgd-search-suggestions__section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.lgd-search-suggestions__section a:hover {
    color: #ffffff;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 1024px) {
    .lgd-nav-menu {
        gap: 20px;
    }

    .lgd-nav-menu > .menu-item > a {
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    .lgd-header__top-bar {
        font-size: 0.75rem;
        padding: 6px 0;
    }

    .lgd-header__top-links {
        gap: 12px;
    }

    .lgd-header__main {
        padding: 15px 0;
    }

    .lgd-header__wrapper {
        gap: 20px;
    }

    .lgd-header__nav {
        display: none;
    }

    .lgd-header__utilities {
        gap: 12px;
    }

    .lgd-header__mobile-toggle {
        display: flex;
    }

    .lgd-header__utility-btn {
        padding: 6px;
    }

    .lgd-search-input {
        font-size: 1.125rem;
        padding: 16px 50px 16px 16px;
    }

    .lgd-search-suggestions__section ul {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .lgd-header__announcements {
        font-size: 0.688rem;
    }

    .lgd-header__top-links {
        display: none;
    }

    .lgd-header__logo .site-title {
        font-size: 1.25rem;
    }

    .lgd-header__utilities {
        gap: 8px;
    }
}
