/* ===================================
   CELLNAMA HEADER - Global Styles
   Used across all pages
   =================================== */

/* ===================================
   CSS Variables - CELLNAMA Color Palette
   =================================== */
:root {
    /* CELLNAMA Brand Colors */
    --cellnama-red: #E30613;
    --cellnama-dark-red: #B10510;
    --cellnama-blue: #003C7D;
    --cellnama-light-blue: #0066CC;
    --cellnama-dark-blue: #002654;
}

/* ===================================
   CELLNAMA-STYLE HEADER
   =================================== */

/* Header Container */
.cellnama-header {
    position: relative;
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    z-index: 100;
    transition: box-shadow 0.3s ease;
}

.cellnama-header.scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Top Row: Logo, Search, Mobile */
.header-top-row {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 12px 0;
}

/* Bottom Row: Navigation */
.header-bottom-row {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 8px;
    /* Add spacing between search bar and nav menu */
    position: static;
}

/* Logo */
.header-logo {
    flex-shrink: 0;
}

.header-logo a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.header-logo a:hover {
    opacity: 0.8;
}

.header-logo img {
    height: 100px;
    /* width: 84px; */
}

.logo-text {
    font-size: 28px;
    font-weight: 700;
    color: #003C7D;
    font-family: 'Roboto', Arial, sans-serif;
    letter-spacing: -0.5px;
}

.logo-text i {
    color: #E30613;
    font-style: italic;
}

/* Navigation */
.header-nav {
    display: flex;
    justify-content: center;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.nav-item {
    position: static;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 16px 20px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: none;
    /* Remove border */
    border-radius: 4px;
    position: relative;
}

.nav-link:hover {
    color: #0066CC;
    background: rgba(0, 102, 204, 0.05);
}

.nav-link i {
    font-size: 10px;
    margin-right: 4px;
}

/* Active state - Highlight without border */
.nav-item.active>.nav-link {
    color: #0066CC;
    background: rgba(0, 102, 204, 0.08);
}

/* Add bottom indicator instead of border */
.nav-item.active>.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 3px;
    background: #0066CC;
    border-radius: 2px 2px 0 0;
}

/* Dropdown Menu - Multi-column (Full Width) */
.cellnama-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: #ffffff;
    border-top: 0 solid #e0e0e0;
    border-bottom: 0 solid #e0e0e0;
    box-shadow: none;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    z-index: 9999 !important;
    pointer-events: none;
    display: block;
}

/* Show dropdown when active */
.nav-item.active .cellnama-dropdown {
    max-height: 800px;
    border-top-width: 1px;
    border-bottom-width: 1px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
}

/* Instant close without transition */
.cellnama-dropdown.instant-close {
    transition: none !important;
}

.dropdown-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
    background: #ffffff;
    /* Ensure white background */
}

.dropdown-column h4 {
    font-size: 14px;
    font-weight: 700;
    color: #003C7D;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #E30613;
    background: #ffffff;
    /* Ensure white background */
}

.dropdown-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #ffffff;
    /* Ensure white background */
}

.dropdown-column li {
    margin-bottom: 8px;
    background: #ffffff;
    /* Ensure white background */
}

.dropdown-column a {
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
    display: block;
    padding: 8px 12px;
    /* Increased padding for better click area */
    background: #ffffff;
    /* Ensure white background */
    border-radius: 4px;
}

.dropdown-column a:hover {
    color: #0066CC;
    background: #f5f9fc;
    /* Subtle background on hover */
    padding-right: 20px;
}

/* Small Dropdown (for single column menus) */
.dropdown-small {
    min-width: 200px;
    background: #ffffff;
    /* Ensure white background */
}

.dropdown-small ul {
    list-style: none;
    padding: 10px 0;
    margin: 0;
    background: #ffffff;
    /* Ensure white background */
}

.dropdown-small li {
    background: #ffffff;
    /* Ensure white background */
}

.dropdown-small li a {
    display: block;
    padding: 10px 20px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
    background: #ffffff;
    /* Ensure white background */
}

.dropdown-small li a:hover {
    background: #f5f9fc;
    color: #0066CC;
}

/* Search Bar - Cellnama Style (takes up space between logo and edge) */
.header-search-wrapper {
    flex: 1;
    display: flex;
    align-items: stretch;
    max-width: 700px;
    margin: 0 20px;
    direction: rtl;
    height: 42px;
}

.search-input-main {
    flex: 1;
    padding: 0 18px;
    border: 1px solid #d5d5d5;
    border-left: none;
    border-radius: 0 4px 4px 0;
    font-size: 14px;
    outline: none;
    transition: all 0.25s ease;
    background: #fafafa;
    direction: rtl;
    text-align: right;
    height: 100%;
    line-height: 42px;
}

.search-input-main:focus {
    border-color: #0066CC;
    background: #ffffff;
}

.search-input-main::placeholder {
    color: #888;
    font-size: 13px;
}

.search-btn-main {
    padding: 0 24px;
    background: #0066CC;
    color: white;
    border: none;
    border-radius: 4px 0 0 4px;
    cursor: pointer;
    font-size: 17px;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    height: 100%;
    min-width: 60px;
}

.search-btn-main:hover {
    background: #0052a3;
}

.search-btn-main i {
    display: block;
}

/* Mobile Controls Container */
.mobile-controls {
    display: none;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* Mobile Toggle */
.mobile-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-toggle span {
    width: 25px;
    height: 3px;
    background: #003C7D;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mobile Search Toggle */
.mobile-search-toggle {
    display: flex;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #003C7D;
    font-size: 20px;
}

.mobile-search-toggle:hover {
    color: #0066CC;
}

.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Responsive Header */
@media (max-width: 1200px) {
    .header-container {
        padding: 0 30px;
    }

    .nav-link {
        padding: 24px 14px;
        font-size: 13px;
    }

    .dropdown-menu {
        min-width: 500px;
    }

    .dropdown-content {
        gap: 20px;
        padding: 25px;
    }
}

@media (max-width: 992px) {
    .header-container {
        padding: 0 20px;
    }

    .nav-link {
        padding: 24px 12px;
        font-size: 13px;
    }

    .dropdown-menu {
        min-width: 400px;
    }

    .dropdown-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .header-container {
        height: 65px;
        position: relative;
    }

    .header-top-row {
        position: relative;
    }

    .header-logo img {
        height: 55px;
    }

    .logo-text {
        font-size: 24px;
    }

    /* Show mobile controls */
    .mobile-controls {
        display: flex;
        position: absolute;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
        margin-left: 0;
    }

    .mobile-controls button {
        outline: none;
        border: none;
    }

    .mobile-controls button:focus,
    .mobile-controls button:active {
        outline: none;
        border: none;
    }

    .mobile-search-toggle:focus,
    .mobile-search-toggle:active,
    .mobile-toggle:focus,
    .mobile-toggle:active {
        outline: none !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* Hide desktop search on mobile */
    .header-search-wrapper:not(.mobile-search-active) {
        display: none !important;
    }

    /* Sliding menu from right */
    .header-nav {
        display: block;
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: #ffffff;
        box-shadow: -4px 0 15px rgba(0, 0, 0, 0.2);
        margin: 0;
        padding: 80px 0 20px 0;
        z-index: 10000;
        overflow-y: auto;
        transition: right 0.3s ease-in-out;
    }

    .header-nav.mobile-active {
        right: 0;
    }

    /* Mobile menu overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: -100%;
        width: calc(100% - 300px);
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9999;
        opacity: 0;
        transition: left 0.3s ease-in-out, opacity 0.3s ease-in-out;
    }

    .mobile-menu-overlay.active {
        left: 0;
        opacity: 1;
    }

    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }

    .nav-list {
        flex-direction: column;
        gap: 0;
    }

    .nav-link {
        padding: 15px 30px;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-item.active>.nav-link {
        border-bottom: 1px solid #f0f0f0;
        border-left: 3px solid #0066CC;
    }

    .cellnama-dropdown {
        position: static !important;
        width: 100% !important;
        left: auto !important;
        right: auto !important;
        box-shadow: none;
        border: none;
        border-left: 3px solid #E30613;
        margin: 0;
        padding: 0;
        background: #f9f9f9;
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    }

    .nav-item.active .cellnama-dropdown {
        opacity: 1;
        visibility: visible;
        max-height: 1000px;
    }

    .dropdown-content {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px 30px;
        width: 100%;
    }

    .dropdown-small {
        width: 100%;
    }

    .dropdown-small ul {
        padding: 0;
        margin: 0;
        width: 100%;
    }

    .dropdown-small li {
        width: 100%;
    }

    .dropdown-small li a {
        padding: 10px 30px;
        background: #f9f9f9;
        width: 100%;
        display: block;
    }

    /* Hide desktop search */
    .header-search-wrapper {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        max-width: 100vw;
        width: 100vw;
        margin: 0;
        background: #ffffff;
        padding: 15px 20px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
        z-index: 10000;
        height: auto;
    }

    .header-search-wrapper.mobile-search-active {
        display: flex;
    }

    .search-form-main {
        width: 100%;
    }

    /* Show mobile search icon */
    .mobile-search-toggle {
        display: flex;
    }

    .mobile-toggle {
        display: flex;
    }

    .search-input-main {
        font-size: 16px;
        padding: 12px 60px 12px 15px;
        width: 100%;
        border: 1px solid #ddd;
        border-radius: 8px;
    }

    .search-btn-main {
        width: 50px;
        height: 50px;
        border-radius: 8px;
    }

    .search-btn-main i {
        font-size: 20px;
    }
}

/* Fix horizontal overflow on small mobile screens */
@media (max-width: 600px) {
    .cellnama-header {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .header-container {
        padding: 0 15px;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        position: relative;
    }

    .header-top-row {
        width: 100%;
        max-width: 100%;
        gap: 15px;
        position: relative;
    }

    .mobile-controls {
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
        margin-left: 0;
    }

    .mobile-controls button {
        outline: none;
        border: none;
    }

    .mobile-controls button:focus,
    .mobile-controls button:active {
        outline: none;
        border: none;
    }

    .mobile-search-toggle:focus,
    .mobile-search-toggle:active,
    .mobile-toggle:focus,
    .mobile-toggle:active {
        outline: none !important;
        border: none !important;
        box-shadow: none !important;
    }

    .header-bottom-row {
        width: 100%;
        max-width: 100%;
    }

    .logo-text {
        font-size: 20px;
    }

    .search-input-main {
        font-size: 16px;
        padding: 12px 60px 12px 15px;
        width: 100%;
        border: 1px solid #ddd;
        border-radius: 8px;
    }

    .search-btn-main {
        width: 50px;
        height: 50px;
        border-radius: 8px;
    }

    .search-btn-main i {
        font-size: 20px;
    }

    .header-nav {
        width: 280px;
        max-width: 85vw;
        right: -100%;
        left: auto;
        z-index: 10001 !important;
    }

    .header-nav.mobile-active {
        right: 0;
    }

    .mobile-menu-overlay {
        z-index: 10000 !important;
        width: calc(100% - 280px);
    }

    .mobile-menu-overlay:not(.active) {
        left: -100%;
    }

    /* For very small screens, adjust overlay to account for menu max-width */
    @media (max-width: 330px) {
        .mobile-menu-overlay {
            width: 15vw;
        }
    }

    .nav-link {
        padding: 12px 20px;
    }

    .cellnama-dropdown {
        width: 100% !important;
    }

    .dropdown-content {
        padding: 10px 20px;
        width: 100%;
    }

    .dropdown-small {
        width: 100%;
    }

    .dropdown-small ul {
        width: 100%;
    }

    .dropdown-small li {
        width: 100%;
    }

    .dropdown-small li a {
        padding: 8px 20px;
        width: 100%;
        display: block;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 10px;
    }

    .header-top-row {
        gap: 10px;
    }

    .logo-text {
        font-size: 18px;
    }
}