/* ===== MODERN HEADER & NAVIGATION ===== */

/* Header Styles */
.modern-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(219, 179, 101, 0.2);
    z-index: 1000;
    transition: all 0.3s ease;
    padding: 0;
    box-sizing: border-box;
    min-height: 80px;
}

/* Ensure body has proper top margin for fixed header */
body {
    margin-top: 80px;
}

/* Adjust main content to account for header */
#main {
    position: relative;
}

#hero {
    margin-top: -80px;
    padding-top: 80px;
}

.modern-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
    padding: 5px 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    transition: height 0.3s ease;
}

.modern-header.scrolled .header-container {
    height: 70px;
}

/* Logo Styles */
.modern-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.modern-logo:hover {
    transform: scale(1.05);
}

.logo-image {
    height: 50px;
    width: auto;
    margin-left: 15px;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 10px rgba(219, 179, 101, 0.3));
}

.modern-header.scrolled .logo-image {
    height: 40px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-right: 10px;
}

/* Navigation Styles */
.modern-nav {
    display: flex;
    align-items: center;
}

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

.nav-item {
    position: relative;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 16px;
    padding: 10px 0;
    position: relative;
    transition: all 0.3s ease;
    display: block;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--gradient-primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 2px;
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 100%;
}

.nav-link:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.3s ease;
}

.mobile-toggle:hover {
    transform: scale(1.1);
}

.toggle-line {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-toggle.active .toggle-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-toggle.active .toggle-line:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active .toggle-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Contact Info */
.header-contact {
    display: flex;
    align-items: center;
    gap: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.contact-item:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.contact-icon {
    width: 20px;
    height: 20px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

/* Floating Action Buttons */
.floating-actions {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 999;
}

.floating-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 24px;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.floating-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.floating-btn:hover::before {
    transform: scale(1);
}

.floating-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: var(--shadow-heavy);
}

.floating-btn.whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.floating-btn.phone {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.floating-btn.scroll-top {
    background: var(--gradient-dark);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.floating-btn.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Tooltip for floating buttons */
.floating-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--dark-color);
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.floating-btn:hover::after {
    opacity: 1;
    visibility: visible;
    right: 75px;
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 768px) {
    .modern-header {
        padding: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    }

    .header-container {
        padding: 0 15px;
        height: 70px;
        position: relative;
    }

    .modern-header.scrolled .header-container {
        height: 65px;
    }

    /* Logo adjustments for mobile */
    .modern-logo {
        flex: 1;
        justify-content: flex-start;
    }

    .logo-image {
        height: 45px;
        margin-left: 10px;
    }

    .modern-header.scrolled .logo-image {
        height: 38px;
    }

    .logo-text {
        font-size: 18px;
        margin-right: 8px;
    }

    /* Mobile toggle button */
    .mobile-toggle {
        display: flex;
        order: 3;
        z-index: 1001;
        position: relative;
        padding: 8px;
        border-radius: 6px;
        transition: all 0.3s ease;
    }

    .mobile-toggle:hover {
        background: rgba(219, 179, 101, 0.1);
    }

    .toggle-line {
        width: 22px;
        height: 2px;
        background: var(--primary-color);
        margin: 2.5px 0;
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        border-radius: 1px;
    }

    /* Enhanced mobile menu */
    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 40px 20px 20px;
        gap: 25px;
        transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        z-index: 1000;
        overflow-y: auto;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        right: 0;
    }

    /* Mobile nav items */
    .nav-item {
        width: 100%;
        text-align: center;
        opacity: 0;
        transform: translateX(50px);
        transition: all 0.3s ease;
    }

    .nav-menu.active .nav-item {
        opacity: 1;
        transform: translateX(0);
    }

    .nav-menu.active .nav-item:nth-child(1) { transition-delay: 0.1s; }
    .nav-menu.active .nav-item:nth-child(2) { transition-delay: 0.2s; }
    .nav-menu.active .nav-item:nth-child(3) { transition-delay: 0.3s; }
    .nav-menu.active .nav-item:nth-child(4) { transition-delay: 0.4s; }
    .nav-menu.active .nav-item:nth-child(5) { transition-delay: 0.5s; }
    .nav-menu.active .nav-item:nth-child(6) { transition-delay: 0.6s; }

    .nav-link {
        font-size: 20px;
        padding: 15px 30px;
        border-radius: 12px;
        width: 100%;
        text-align: center;
        background: rgba(219, 179, 101, 0.05);
        margin: 5px 0;
        transition: all 0.3s ease;
        border: 1px solid transparent;
    }

    .nav-link:hover,
    .nav-link.active {
        background: rgba(219, 179, 101, 0.15);
        border-color: rgba(219, 179, 101, 0.3);
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(219, 179, 101, 0.2);
    }

    .nav-link::before {
        display: none;
    }

    /* Hide contact info on mobile */
    .header-contact {
        display: none;
    }

    /* Floating buttons adjustments */
    .floating-actions {
        bottom: 20px;
        right: 15px;
        gap: 12px;
    }

    .floating-btn {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    .floating-btn::after {
        display: none;
    }

    /* Body scroll lock when menu is open */
    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .modern-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }

    .header-container {
        height: 65px;
        padding: 0 12px;
        min-height: 65px;
    }

    .modern-header.scrolled .header-container {
        height: 60px;
        min-height: 60px;
    }

    .logo-image {
        height: 38px;
        margin-left: 8px;
    }

    .modern-header.scrolled .logo-image {
        height: 35px;
    }

    .logo-text {
        font-size: 16px;
        margin-right: 6px;
    }

    .mobile-toggle {
        padding: 6px;
    }

    .toggle-line {
        width: 20px;
        height: 2px;
        margin: 2px 0;
    }

    .nav-menu {
        top: 65px;
        height: calc(100vh - 65px);
        padding: 30px 15px 15px;
        gap: 20px;
    }

    .modern-header.scrolled + * .nav-menu {
        top: 60px;
        height: calc(100vh - 60px);
    }

    .nav-link {
        font-size: 18px;
        padding: 12px 25px;
    }

    .floating-actions {
        bottom: 15px;
        right: 12px;
        gap: 10px;
    }

    .floating-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .header-container {
        height: 60px;
        padding: 0 10px;
    }

    .logo-image {
        height: 35px;
        margin-left: 6px;
    }

    .logo-text {
        font-size: 14px;
        margin-right: 4px;
    }

    .nav-menu {
        top: 60px;
        height: calc(100vh - 60px);
        padding: 25px 12px 12px;
        gap: 18px;
    }

    .nav-link {
        font-size: 16px;
        padding: 10px 20px;
    }

    .floating-btn {
        width: 42px;
        height: 42px;
        font-size: 15px;
    }
}

/* Fix for iOS Safari viewport issues */
@supports (-webkit-touch-callout: none) {
    .modern-header {
        position: -webkit-sticky;
        position: sticky;
        top: 0;
    }

    .nav-menu {
        position: fixed;
        top: env(safe-area-inset-top, 0);
        padding-top: calc(env(safe-area-inset-top, 0) + 40px);
    }
}

/* Prevent horizontal scroll on mobile */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    .modern-header {
        width: 100vw;
        max-width: 100%;
        left: 0;
        right: 0;
    }

    .header-container {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Adjust body margin for mobile */
    body {
        margin-top: 70px;
    }

    #hero {
        margin-top: -70px;
        padding-top: 70px;
    }
}

/* Additional mobile fixes */
@media (max-width: 480px) {
    body {
        margin-top: 65px;
    }

    #hero {
        margin-top: -65px;
        padding-top: 65px;
    }

    .modern-header.scrolled + #main #hero {
        margin-top: -60px;
        padding-top: 60px;
    }
}

/* Landscape orientation fixes */
@media (max-width: 768px) and (orientation: landscape) {
    .nav-menu {
        height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-link {
        padding: 10px 25px;
        font-size: 16px;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Critical Mobile Header Fixes */
@media screen and (max-width: 768px) {
    /* Force header to stay at top */
    .modern-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        max-width: 100% !important;
        z-index: 9999 !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1) !important;
        border-bottom: 1px solid rgba(219, 179, 101, 0.2) !important;
    }

    /* Header container fixes */
    .header-container {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 70px !important;
        min-height: 70px !important;
        padding: 0 15px !important;
        box-sizing: border-box !important;
        position: relative !important;
    }

    /* Logo fixes */
    .modern-logo {
        display: flex !important;
        align-items: center !important;
        flex: 1 !important;
        max-width: calc(100% - 60px) !important;
        overflow: hidden !important;
    }

    .logo-image {
        height: 45px !important;
        width: auto !important;
        max-width: 50px !important;
        object-fit: contain !important;
        margin-left: 10px !important;
    }

    .logo-text {
        font-size: 18px !important;
        margin-right: 8px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: calc(100% - 60px) !important;
    }

    /* Mobile toggle fixes */
    .mobile-toggle {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        width: 40px !important;
        height: 40px !important;
        padding: 8px !important;
        border-radius: 6px !important;
        background: transparent !important;
        border: none !important;
        cursor: pointer !important;
        z-index: 10001 !important;
        position: relative !important;
        transition: all 0.3s ease !important;
    }

    .mobile-toggle:hover {
        background: rgba(219, 179, 101, 0.1) !important;
    }

    .toggle-line {
        display: block !important;
        width: 22px !important;
        height: 2px !important;
        background: var(--primary-color, #1e3c72) !important;
        margin: 2.5px 0 !important;
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
        border-radius: 1px !important;
        transform-origin: center !important;
    }

    /* Mobile toggle animation */
    .mobile-toggle.active .toggle-line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px) !important;
    }

    .mobile-toggle.active .toggle-line:nth-child(2) {
        opacity: 0 !important;
    }

    .mobile-toggle.active .toggle-line:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px) !important;
    }

    /* Mobile menu fixes */
    .nav-menu {
        position: fixed !important;
        top: 70px !important;
        right: -100% !important;
        width: 100vw !important;
        height: calc(100vh - 70px) !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(25px) !important;
        -webkit-backdrop-filter: blur(25px) !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: center !important;
        padding: 40px 20px 20px !important;
        gap: 25px !important;
        transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
        z-index: 9998 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1) !important;
        box-sizing: border-box !important;
    }

    .nav-menu.active {
        right: 0 !important;
    }

    /* Hide contact info on mobile */
    .header-contact {
        display: none !important;
    }

    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
    }

    /* Ensure proper spacing for content */
    body {
        margin-top: 70px !important;
        padding-top: 0 !important;
    }

    #main {
        position: relative !important;
        margin-top: 0 !important;
    }

    #hero {
        margin-top: -70px !important;
        padding-top: 70px !important;
    }
}

/* Extra fixes for very small screens */
@media screen and (max-width: 480px) {
    .header-container {
        height: 65px !important;
        min-height: 65px !important;
        padding: 0 12px !important;
    }

    .logo-image {
        height: 38px !important;
        max-width: 45px !important;
        margin-left: 8px !important;
    }

    .logo-text {
        font-size: 16px !important;
        margin-right: 6px !important;
    }

    .mobile-toggle {
        width: 36px !important;
        height: 36px !important;
        padding: 6px !important;
    }

    .toggle-line {
        width: 20px !important;
        height: 2px !important;
        margin: 2px 0 !important;
    }

    .nav-menu {
        top: 65px !important;
        height: calc(100vh - 65px) !important;
        padding: 30px 15px 15px !important;
        gap: 20px !important;
    }

    body {
        margin-top: 65px !important;
    }

    #hero {
        margin-top: -65px !important;
        padding-top: 65px !important;
    }
}
