/* ==========================================================================
   Header & Navigation Styling
   Modern, Balanced Navigation Layout
   ========================================================================== */

.site-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1px 0;
    background: rgba(245, 245, 245, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transition: background-color 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}

/* Navbar Flex Alignment - Desktop Centered / Grouped Layout */
.header-nav {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Logo Area */
.header-logo-wrap {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    margin-right: 108px;
    margin-left: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
    flex-shrink: 0;
}

.header-logo-wrap:hover {
    transform: translateY(-1px);
    opacity: 0.92;
}

.header-logo {
    display: block;
    max-height: 60px;
    width: auto;
    object-fit: contain;
}

/* Fallback/placeholder indicator when src is empty so layout stays intact */
.header-logo:not([src]),
.header-logo[src=""] {
    min-width: 60px;
    min-height: 50px;
    visibility: hidden;
}

/* Navbar Collapse Container on Desktop */
@media (min-width: 992px) {
    .header-nav .navbar-collapse {
        display: flex !important;
        flex-basis: auto !important;
        flex-grow: 0 !important;
        align-items: center;
        justify-content: flex-start;
    }
}

/* Center Navigation Menu */
.header-menu {
    display: flex;
    align-items: center;
    gap: 32px;
    margin: 0 !important;
    padding: 0;
    list-style: none;
}

.header-menu .nav-item .nav-link {
    color: rgba(255, 255, 255, 0.95);
    font-family: var(--font-main);
    font-size: 1.02rem;
    font-weight: 500;
    padding: 0.5rem 0.35rem;
    position: relative;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    transition: color 0.25s ease, text-shadow 0.25s ease;
    white-space: nowrap;
}

/* Smooth Animated Underline */
.header-menu .nav-item .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2.5px;
    background-color: var(--white);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-menu .nav-item .nav-link:hover {
    color: var(--white);
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.65);
}

.header-menu .nav-item .nav-link:hover::after,
.header-menu .nav-item .nav-link.active::after {
    width: 100%;
}

.header-menu .nav-item .nav-link.active {
    font-weight: 600;
    
}

/* Right Actions Area (License & Quote Button) */
.header-right-action {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: 100px;
    flex-shrink: 0;
}

.certificate-info {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.certificate-info .cert-title {
    color: rgb(255,0,0);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
}

.certificate-info .cert-number {
    color: rgb(255,0,0);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 1.3px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
}

/* Get a Quote Button */
.btn-get-quote {
    background-color: var(--white);
    color: var(--primary-navy);
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.65rem 1.45rem;
    border-radius: var(--radius-md, 12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    min-width: 125px;
    text-align: center;
    text-decoration: none;
    box-shadow: var(--shadow-btn, 0 4px 14px rgba(8, 15, 92, 0.20));
    transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
    white-space: nowrap;
}

.btn-get-quote:hover {
    background-color: #f8fafc;
    color: var(--secondary-navy);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

/* Small Desktop / Large Tablet (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .header-logo-wrap {
        margin-right: 28px;
    }

    .header-menu {
        gap: 20px;
    }

    .header-menu .nav-item .nav-link {
        font-size: 0.95rem;
        padding: 0.4rem 0.2rem;
    }

    .header-right-action {
        margin-left: 28px;
        gap: 16px;
    }

    .certificate-info .cert-title {
        font-size: 0.85rem;
    }

    .certificate-info .cert-number {
        font-size: 0.92rem;
        letter-spacing: 0.8px;
    }

    .btn-get-quote {
        padding: 0.55rem 1.15rem;
        font-size: 0.9rem;
        min-width: 110px;
    }
}

/* Mobile & Tablet Portrait (< 992px) */
@media (max-width: 991.98px) {
    .site-header {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        background: rgba(245, 245, 245, 0.45);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
        padding: 14px 0;
    }

    .header-nav {
        justify-content: space-between;
    }

    .header-logo-wrap {
        margin-right: 0;
    }

    .navbar-toggler {
        border-color: rgba(8, 15, 92, 0.18);
        padding: 6px 10px;
        border-radius: var(--radius-sm, 8px);
    }

    .navbar-toggler:focus {
        box-shadow: 0 0 0 2px rgba(8, 15, 92, 0.15);
    }

    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23080F5C' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }

    .navbar-collapse {
        background: rgba(227, 227, 233, 0.85);
        
        padding: 1.35rem;
        margin-top: 0.85rem;
        border-radius: var(--radius-md, 12px);
        border: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow: var(--shadow-dropdown, 0 12px 36px rgba(0, 0, 0, 0.35));
    }

    .header-menu {
        gap: 0.5rem;
        margin-bottom: 1rem !important;
        flex-direction: column;
        align-items: flex-start;
    }

    .header-menu .nav-item .nav-link {
        color: rgba(0, 0, 0, 0.95);
        padding: 0.6rem 0;
    }

    .header-menu .nav-item .nav-link::after {
        background-color: #000;
        box-shadow: none;
    }

    .header-right-action {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.95rem;
        padding-top: 0.85rem;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        margin-left: 0;
        width: 100%;
    }

    .certificate-info .cert-title {
        font-size: 0.85rem;
    }

    .certificate-info .cert-number {
        font-size: 0.95rem;
    }

    .btn-get-quote {
        width: 100%;
        background-color: var(--white);
        color: var(--primary-navy);
    }

    .btn-get-quote:hover {
        background-color: #f8fafc;
        color: var(--primary-navy);
    }
}
