/* Base Responsive Styles */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #ffffff;
    --bg-light: #f9fafb;
    --border: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    position: relative;
}

/* Container */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header & Navigation */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.topbar {
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.topbar-contacts a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.topbar-contacts a:hover {
    color: var(--primary);
}

.topbar-social {
    display: flex;
    gap: 1rem;
}

.topbar-social a {
    color: var(--text-light);
    transition: var(--transition);
}

.topbar-social a:hover {
    color: var(--primary);
}

/* Main Navigation */
.main-nav {
    position: relative;
    height: 70px;
    display: flex;
    align-items: center;
}

.nav-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
}

/* Logo */
.nav-brand {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text);
}

.logo-img {
    height: 40px;
    width: auto;
    margin-right: 0.75rem;
}

.logo-text {
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Mobile Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    position: relative;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger {
    display: block;
    position: relative;
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: var(--transition);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--text);
    left: 0;
    transition: var(--transition);
}

.hamburger::before {
    top: -8px;
    width: 20px;
}

.hamburger::after {
    bottom: -8px;
    width: 16px;
}

.nav-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
}

.nav-toggle[aria-expanded="true"] .hamburger::before {
    transform: rotate(45deg) translate(5px, 6px);
    width: 24px;
}

.nav-toggle[aria-expanded="true"] .hamburger::after {
    transform: rotate(-45deg) translate(5px, -6px);
    width: 24px;
}

/* Main Menu */
.main-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem;
}

.menu-item {
    position: relative;
    display: flex;
    align-items: center;
}

.menu-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.75rem 0.5rem;
    position: relative;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

.menu-link:hover,
.menu-link:focus,
.menu-link.active {
    color: var(--primary);
}

.menu-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.5rem;
    right: 0.5rem;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

/* Submenu */
.has-submenu {
    position: relative;
}

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 220px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1000;
    list-style: none;
}

.has-submenu:hover .submenu,
.has-submenu:focus-within .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu li {
    padding: 0;
    margin: 0;
}

.submenu a {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9375rem;
}

.submenu a:hover,
.submenu a:focus {
    background: var(--bg-light);
    color: var(--primary);
}

/* Submenu Toggle */
.submenu-toggle {
    display: none;
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    padding: 0;
    color: var(--text-light);
    transition: var(--transition);
}

.submenu-toggle[aria-expanded="true"] .plus {
    transform: rotate(45deg);
}

.plus {
    display: block;
    font-size: 1.25rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: 2rem;
}

/* Search */
.search-container {
    position: relative;
}

.search-toggle {
    background: none;
    border: none;
    color: var(--text);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition);
}

.search-toggle:hover,
.search-toggle:focus {
    background: var(--bg-light);
    color: var(--primary);
    outline: none;
}

.search-box {
    position: absolute;
    top: 100%;
    right: 0;
    width: 300px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1000;
}

.search-toggle[aria-expanded="true"] + .search-box {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-box input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.9375rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9375rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-outline {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(37, 99, 235, 0.1);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* Nav Overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .nav-actions {
        gap: 1rem;
    }
    
    .nav-buttons {
        display: flex;
        gap: 0.75rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    html, body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    body {
        position: relative;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0 1rem;
        overflow: hidden;
    }
    
    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 1002;
    }
    
    .nav-container {
        padding: 0 1rem;
        position: relative;
    }
    
    .site-header {
        width: 100%;
        overflow: visible;
        position: relative;
    }
    
    .nav-menu-container {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: #fff;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        padding: 1.5rem;
        transition: right 0.3s ease-in-out;
        z-index: 1001;
        overflow-y: auto;
    }
    
    .nav-menu-container[aria-expanded="true"] {
        right: 0;
    }
    
    .main-menu {
        flex-direction: column;
        padding: 0;
        margin: 0;
        list-style: none;
    }
    
    .menu-item {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .menu-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 0;
        color: #333;
        text-decoration: none;
        font-weight: 500;
        font-size: 1rem;
        width: 100%;
    }
    
    .menu-link.active {
        color: #2563eb;
    }
    
    /* Ensure contact link is properly styled in mobile */
    .menu-item:last-child {
        border-bottom: none;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #f0f0f0;
    }
    
    .menu-item:last-child .menu-link {
        color: #2563eb;
        font-weight: 600;
    }
    
    .has-submenu {
        position: relative;
    }
    
    .submenu-toggle {
        background: none;
        border: none;
        padding: 0.5rem;
        margin-left: 0.5rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .submenu {
        list-style: none;
        padding-left: 1rem;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .has-submenu[aria-expanded="true"] .submenu {
        max-height: 500px;
    }
    
    .submenu a {
        display: block;
        padding: 0.75rem 0;
        color: #666;
        text-decoration: none;
        font-size: 0.9rem;
    }
    
    .submenu a:hover {
        color: #2563eb;
    }
    
    .nav-menu-container {
        position: fixed;
        top: 0;
        right: -100%;
        width: 90%;
        max-width: 320px;
        height: 100vh;
        background: var(--bg);
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        padding: 1.5rem;
        overflow-y: auto;
        transition: right 0.3s ease;
        z-index: 1000;
    }
    
    .nav-menu-container[aria-expanded="true"] {
        right: 0;
    }
    
    .main-menu {
        flex-direction: column;
        gap: 0;
        margin-bottom: 1.5rem;
    }
    
    .menu-item {
        border-bottom: 1px solid var(--border);
    }
    
    .menu-link {
        padding: 1rem 0;
        width: 100%;
        justify-content: space-between;
    }
    
    .has-submenu {
        position: relative;
    }
    
    .submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .has-submenu .submenu {
        padding-left: 1rem;
    }
    
    .submenu a {
        padding: 0.75rem 0;
        color: var(--text-light);
    }
    
    .submenu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-actions {
        flex-direction: column;
        margin-left: 0;
        padding-top: 1rem;
        border-top: 1px solid var(--border);
    }
    
    .search-container {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .search-box {
        position: static;
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        margin: 0.5rem 0 0;
    }
    
    .nav-buttons {
        display: flex;
        width: 100%;
        gap: 1rem;
    }
    
    .btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .topbar-inner {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .logo-text {
        font-size: 1.25rem;
    }
    
    .nav-menu-container {
        width: 100%;
        max-width: none;
    }
    
    .nav-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn {
        width: 100%;
    }

    /* Contact Section Responsive */
    .contact-cta {
        padding: 2rem 1rem;
    }

    .contact-cta-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .contact-cta-text h3 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .contact-cta-text p {
        font-size: 0.9375rem;
        line-height: 1.5;
    }

    .contact-cta .btn-primary {
        width: 100%;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    /* Footer Contact */
    .footer-contact {
        padding: 2rem 1rem;
    }

    .footer-contact-row {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .footer-email {
        justify-content: center;
        margin-bottom: 1rem;
    }

    .footer-social {
        justify-content: center;
        gap: 1.5rem;
    }

    .footer-social a {
        width: 36px;
        height: 36px;
    }
}
