/**
 * CPS Custom Header Styles
 * Matches static site design exactly
 */

/* Font Families - Using Adobe Fonts */
#cps-header {
    font-family: 'din-2014', 'ff-din-paneuropean', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Refrigerator Deluxe only for actual headings */
#cps-header h1,
#cps-header h2,
#cps-header h3,
#cps-header h4,
#cps-header h5,
#cps-header h6 {
    font-family: 'refrigerator-deluxe', Impact, 'Arial Black', sans-serif;
}

/* DIN for navigation and buttons */
.cps-main-menu a,
.cps-btn-contact,
.cps-btn-contact-mobile,
.cps-mobile-menu-list a {
    font-family: 'din-2014', 'ff-din-paneuropean', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Container */
.cps-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== TOP BAR ===== */
.cps-top-bar {
    background-color: #D41F38; /* crimson */
    padding: 10px 0;
}

.cps-top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cps-contact-info {
    display: flex;
    gap: 24px;
    align-items: center;
}

.cps-contact-info span {
    color: #FFFFFF;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cps-contact-info i {
    color: #FFFFFF;
}

/* ===== MAIN HEADER ===== */
.cps-main-header {
    background-color: rgba(42, 49, 56, 0.95); /* shark with opacity */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid #374151;
    padding: 16px 0;
}

.cps-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.cps-logo-img {
    max-height: 60px;
    width: auto;
}

/* Desktop Navigation */
.cps-nav-desktop {
    display: flex;
    align-items: center;
    gap: 32px;
}

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

.cps-main-menu > li {
    position: relative;
}

.cps-main-menu > li > a {
    color: #D1D5DB;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cps-main-menu > li > a:hover {
    color: #D41F38; /* crimson */
}

.cps-menu-chevron {
    font-size: 12px;
    margin-left: 4px;
}

/* Contact Sales Button */
.cps-btn-contact {
    background-color: #D41F38; /* crimson */
    color: #FFFFFF;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cps-btn-contact:hover {
    background-color: #7F182C; /* claret */
    transform: scale(1.05);
    color: #FFFFFF;
}

/* Mobile Toggle */
.cps-mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}

/* ===== MEGA MENU ===== */
.has-mega-menu {
    position: relative;
}

.cps-mega-menu {
    position: absolute;
    left: 0;
    top: 100%;
    padding-top: 8px;
    width: 600px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.has-mega-menu:hover .cps-mega-menu {
    opacity: 1;
    visibility: visible;
}

.cps-mega-menu-inner {
    background-color: #2A3138; /* shark */
    border: 1px solid #4B5563;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start; /* Align columns to top to prevent tall menu */
}

/* 2-column layout for Products & Services */
.cps-mega-menu-inner.cps-mega-menu-2col {
    grid-template-columns: 1fr 1fr;
}

/* 3-column layout for Products & Services */
.cps-mega-menu-inner.cps-mega-menu-3col {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Ensure columns have equal minimum height to prevent layout issues */
.cps-mega-menu-column {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.cps-mega-menu-title {
    color: #FFFFFF;
    font-weight: 700;
    font-size: 24px;
    margin-top: 8px;
    margin-bottom: 16px;
}

.cps-mega-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cps-mega-menu-list li {
    margin-bottom: 12px;
}

.cps-mega-menu-list a {
    color: #D1D5DB;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: color 0.3s ease;
}

.cps-mega-menu-list a:hover {
    color: #D41F38; /* crimson */
}

.cps-mega-menu-list i {
    color: #D41F38; /* crimson */
    width: 20px;
    text-align: center;
}

.cps-mega-menu-view-all {
    display: inline-block;
    margin-top: 16px;
    color: #D41F38;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.cps-mega-menu-view-all:hover {
    color: #7F182C;
}

/* Featured Case Study */
.cps-featured-case-study {
    background-color: #141A1F; /* bunker */
    border-radius: 8px;
    padding: 16px;
}

.cps-featured-image {
    width: 100%;
    height: 128px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 16px;
}

.cps-featured-title {
    color: #FFFFFF;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 16px;
}

.cps-featured-desc {
    color: #9CA3AF;
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.cps-featured-link {
    color: #D41F38;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.cps-featured-link:hover {
    color: #7F182C;
}

/* ===== MOBILE MENU ===== */
.cps-mobile-menu {
    display: none;
    background-color: #2A3138; /* shark */
    border-top: 1px solid #374151;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 999;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.cps-mobile-menu.active {
    display: block;
}

.cps-mobile-menu-content {
    padding: 24px 16px;
}

.cps-mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cps-mobile-menu-list li {
    margin-bottom: 16px;
}

.cps-mobile-menu-list > li > a {
    color: #D1D5DB;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    transition: color 0.3s ease;
    cursor: pointer;
}

.cps-mobile-menu-list > li > a:hover {
    color: #D41F38;
}

.cps-mobile-menu-list > li.menu-item-has-children > a {
    cursor: pointer;
}

.cps-mobile-menu-list .cps-menu-chevron {
    transition: transform 0.3s ease;
    margin-left: auto;
}

.cps-mobile-menu-list .cps-menu-chevron.rotated {
    transform: rotate(180deg);
}

/* Mobile submenu styles */
.cps-mobile-submenu,
.cps-mobile-menu-list .sub-menu {
    display: none; /* Hidden by default, shown via accordion */
    margin-left: 16px;
    margin-top: 8px;
    border-left: 2px solid #4B5563;
    padding-left: 16px;
}

.cps-mobile-menu-list li.submenu-open > .sub-menu,
.cps-mobile-menu-list li.submenu-open > .cps-mobile-submenu {
    display: block;
}

.cps-mobile-submenu li {
    margin-bottom: 12px;
}

.cps-mobile-submenu a {
    color: #9CA3AF;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cps-mobile-submenu a i {
    color: #D41F38;
    width: 16px;
    text-align: center;
}

.cps-mobile-submenu a:hover {
    color: #D41F38;
}

.cps-btn-contact-mobile {
    display: block;
    width: 100%;
    background-color: #D41F38;
    color: #FFFFFF;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    margin-top: 16px;
}

.cps-btn-contact-mobile:hover {
    background-color: #7F182C;
    color: #FFFFFF;
}

/* ===== STICKY HEADER ===== */
.cps-sticky-header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.cps-sticky-header.scrolled .cps-logo-img {
    max-height: 50px;
    transition: max-height 0.3s ease;
}

.cps-sticky-header.scrolled .cps-main-header {
    padding: 12px 0;
    transition: padding 0.3s ease;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
    /* Hide desktop nav, show mobile toggle */
    .cps-nav-desktop {
        display: none;
    }

    .cps-mobile-toggle {
        display: block;
    }

    /* Top bar mobile adjustments */
    .cps-contact-info {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .cps-contact-info span {
        font-size: 12px;
    }

    /* Logo size on mobile */
    .cps-logo-img {
        max-height: 50px;
    }

    /* Mega menu full width on mobile */
    .cps-mega-menu {
        width: 100%;
        left: 0;
    }

    .cps-mega-menu-inner {
        grid-template-columns: 1fr;
    }

    /* Stack columns on mobile for all layouts */
    .cps-mega-menu-inner.cps-mega-menu-2col,
    .cps-mega-menu-inner.cps-mega-menu-3col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .cps-top-bar {
        padding: 8px 0;
    }

    .cps-logo-img {
        max-height: 60px;
    }

    .cps-main-header {
        padding: 12px 0;
    }
}
