/* =====================================================
   TECHNOPARKMOTORS - MAIN STYLESHEET
   Глобальные стили для всех страниц сайта
   ===================================================== */

/* =====================================================
   1. CSS VARIABLES
   ===================================================== */
:root {
    /* Colors */
    --bg-dark: #1a1f2e;
    --bg-medium: #2d3748;
    --bg-light: #f7fafc;
    --accent-blue: #4a90e2;
    --accent-orange: #ff6b35;
    --text-light: #e2e8f0;
    --text-dark: #2d3748;
    --overlay-light: rgba(247, 250, 252, 0.95);
    --overlay-dark: rgba(26, 31, 46, 0.9);
    
    /* Spacing & Sizing */
    --container-max-width: 1200px;
    --border-radius-card: 15px;
    --border-radius-button: 50px;
    --border-radius-modal: 25px;
    
    /* Effects */
    --transition-base: all 0.3s ease;
    --shadow-card: 0 5px 20px rgba(45, 55, 72, 0.1);
    --shadow-card-hover: 0 15px 40px rgba(45, 55, 72, 0.2);
    --shadow-button: 0 10px 30px rgba(255, 107, 53, 0.4);
    --shadow-button-hover: 0 15px 40px rgba(255, 107, 53, 0.6);
    --backdrop-blur: blur(15px);
    
    /* Z-index scale */
    --z-background: -1;
    --z-base: 1;
    --z-dropdown: 100;
    --z-header: 1000;
    --z-mobile-nav: 1001;
    --z-burger: 1002;
    --z-modal: 2000;
    
    /* Breakpoints (для JS, если нужно) */
    --breakpoint-sm: 480px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
}

/* =====================================================
   2. RESET & BASE STYLES
   ===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    background: var(--bg-dark);
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
}

/* Блокировка скролла при открытом мобильном меню */
body.menu-open {
    overflow: hidden;
}

/* =====================================================
   3. TYPOGRAPHY
   ===================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: bold;
    line-height: 1.2;
}

p {
    line-height: 1.6;
}

address {
    font-style: normal;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =====================================================
   4. LAYOUT
   ===================================================== */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Site Background Pattern */
.site-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-background);
    background: var(--bg-dark);
}

.site-background::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 80px,
            rgba(74, 144, 226, 0.03) 80px,
            rgba(74, 144, 226, 0.03) 81px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 80px,
            rgba(74, 144, 226, 0.03) 80px,
            rgba(74, 144, 226, 0.03) 81px
        ),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 100px,
            rgba(255, 107, 53, 0.02) 100px,
            rgba(255, 107, 53, 0.02) 102px
        );
    z-index: 1;
}

.site-background::after {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(74, 144, 226, 0.15) 0%, transparent 25%),
        radial-gradient(circle at 80% 30%, rgba(74, 144, 226, 0.15) 0%, transparent 25%),
        radial-gradient(circle at 50% 60%, rgba(74, 144, 226, 0.1) 0%, transparent 30%),
        radial-gradient(circle at 20% 80%, rgba(255, 107, 53, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 80% 80%, rgba(255, 107, 53, 0.08) 0%, transparent 25%);
    z-index: 2;
}

/* =====================================================
   5. HEADER
   ===================================================== */
   .site-header {
    background: rgba(26, 31, 46, 0.98);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: var(--z-header);
    min-height: 64px;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(74, 144, 226, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 48px;
}

.header-logo {
    color: var(--text-light);
    font-size: 1.3rem;
    font-weight: bold;
    text-decoration: none;
    transition: var(--transition-base);
    white-space: nowrap;
    flex-shrink: 0;
}

.header-logo:hover {
    color: var(--accent-orange);
}

body {
    padding-top: 64px;
}

/* =====================================================
   6. NAVIGATION (Desktop)
   ===================================================== */
.main-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.main-nav > a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition-base);
    padding: 0.5rem 0;
    font-size: 0.95rem;
    white-space: nowrap;
    position: relative;
}

.main-nav > a:hover {
    color: var(--accent-orange);
}

/* Dropdown Navigation */
.nav-dropdown {
    position: relative;
}

.nav-dropdown > a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition-base);
    padding: 0.5rem 0;
    cursor: pointer;
    font-size: 0.95rem;
    white-space: nowrap;
}

.nav-dropdown > a:hover {
    color: var(--accent-orange);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(26, 31, 46, 0.98);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    min-width: 250px;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    z-index: var(--z-dropdown);
}

.dropdown-content a {
    display: block;
    color: var(--text-light);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    transition: var(--transition-base);
    font-size: 0.95rem;
}

.dropdown-content a:hover {
    background: rgba(74, 144, 226, 0.2);
    color: var(--accent-orange);
}

/* Desktop hover for dropdown */
@media (min-width: 969px) {
    .nav-dropdown:hover .dropdown-content {
        display: block;
        animation: fadeInDown 0.3s ease;
    }
}

/* =====================================================
   7. BURGER MENU (Mobile Navigation)
   ===================================================== */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 0.5rem;
    z-index: var(--z-burger);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.burger-menu span {
    width: 25px;
    height: 3px;
    background: var(--text-light);
    border-radius: 2px;
    transition: var(--transition-base);
}

/* Burger animation to X */
.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Navigation Styles */
@media (max-width: 968px) {
    .burger-menu {
        display: flex;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        background: rgba(26, 31, 46, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: flex-start;
        padding: 5rem 1.5rem 2rem 1.5rem;
        gap: 0;
        overflow-y: auto;
        z-index: var(--z-mobile-nav);
        
        transform: translateX(100%);
        transition: transform 0.3s ease;
        visibility: hidden;
        pointer-events: none;
    }

    .main-nav.active {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
    }

    .main-nav > a,
    .nav-dropdown > a {
        width: 100%;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid rgba(74, 144, 226, 0.1);
        font-size: 1.05rem;
        display: block;
    }

    .nav-dropdown {
        width: 100%;
    }

    .dropdown-content {
        position: static;
        display: none;
        box-shadow: none;
        border-radius: 0;
        margin-top: 0;
        padding-left: 1rem;
        background: transparent;
    }

    .nav-dropdown.active .dropdown-content {
        display: block;
    }

    .dropdown-content a {
        padding: 0.65rem 1.5rem;
        font-size: 0.95rem;
        border-bottom: 1px solid rgba(74, 144, 226, 0.05);
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .header-logo {
        font-size: 1.15rem;
    }

    .main-nav {
        width: 100%;
        max-width: 100%;
    }
}

/* =====================================================
   8. BUTTONS
   ===================================================== */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-orange), #ff8c5a);
    color: white;
    padding: 1.2rem 3rem;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: var(--border-radius-button);
    cursor: pointer;
    transition: var(--transition-base);
    text-decoration: none;
    display: inline-block;
    box-shadow: var(--shadow-button);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-button-hover);
    background: linear-gradient(135deg, #ff8c5a, var(--accent-orange));
}

.btn-secondary {
    background: rgba(74, 144, 226, 0.1);
    color: var(--accent-blue);
    padding: 0.7rem 1.5rem;
    border: 1px solid var(--accent-blue);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition-base);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: var(--accent-blue);
    color: white;
}

.copy-btn {
    padding: 0.5rem 1rem;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition-base);
}

.copy-btn:hover {
    background: var(--accent-orange);
}

/* Mobile button adjustments */
@media (max-width: 768px) {
    .btn-primary {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    .address-actions {
        flex-direction: column;
    }

    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .btn-primary {
        padding: 0.9rem 1.8rem;
        font-size: 0.95rem;
    }
}

/* =====================================================
   9. MODAL
   ===================================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: var(--z-modal);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    padding: 1rem 0;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius-modal);
    padding: 3rem;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-dark);
    transition: transform 0.3s ease;
}

.modal-close:hover {
    transform: rotate(90deg);
}

.modal-content h2 {
    color: var(--text-dark);
    margin-bottom: 2rem;
    text-align: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: rgba(74, 144, 226, 0.05);
    border-radius: var(--border-radius-card);
    transition: var(--transition-base);
}

.contact-item:hover {
    background: rgba(74, 144, 226, 0.1);
    transform: translateX(5px);
}

.contact-icon {
    font-size: 2rem;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-icon svg {
    width: 32px;
    height: 32px;
}

.contact-info {
    flex: 1;
}

.contact-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.3rem;
}

.contact-value {
    font-size: 1.1rem;
    color: var(--text-dark);
    font-weight: bold;
    text-decoration: none;
}

.contact-value:hover {
    color: var(--accent-orange);
}

/* Modal Mobile Responsive */
@media (max-width: 768px) {
    .modal-content {
        padding: 2rem 1.25rem;
        max-width: 95%;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .contact-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.85rem 0.75rem;
        margin-bottom: 0.85rem;
    }
    
    .contact-icon {
        align-self: flex-start;
        min-width: 32px;
        font-size: 1.5rem;
    }
    
    .contact-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .contact-info {
        width: 100%;
        text-align: left;
    }
    
    .contact-label {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }
    
    .contact-value {
        font-size: 0.95rem;
        word-break: break-all;
    }
    
    .copy-btn {
        width: 100%;
        padding: 0.6rem 0.85rem;
        font-size: 0.9rem;
        margin-top: 0.2rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 1.5rem 0.9rem;
        border-radius: 18px;
        max-height: 85vh;
    }
    
    .modal-content h2 {
        font-size: 1.35rem;
        margin-bottom: 1.2rem;
    }
    
    .contact-item {
        padding: 0.7rem 0.6rem;
        margin-bottom: 0.65rem;
        gap: 0.45rem;
    }
    
    .contact-icon {
        min-width: 28px;
        font-size: 1.3rem;
    }
    
    .contact-icon svg {
        width: 22px;
        height: 22px;
    }
    
    .contact-label {
        font-size: 0.75rem;
    }
    
    .contact-value {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .copy-btn {
        padding: 0.55rem 0.75rem;
        font-size: 0.85rem;
        border-radius: 6px;
    }
    
    .modal-close {
        font-size: 1.5rem;
        width: 32px;
        height: 32px;
        top: 0.75rem;
        right: 0.75rem;
    }
}

@media (max-width: 360px) {
    .modal-content {
        padding: 1.25rem 0.75rem;
        max-height: 80vh;
    }

    .modal-content h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .contact-item {
        padding: 0.6rem 0.5rem;
        margin-bottom: 0.55rem;
    }

    .contact-value {
        font-size: 0.85rem;
    }
    
    .copy-btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.65rem;
    }
}

/* =====================================================
   10. FOOTER
   ===================================================== */
.footer {
    background: rgba(26, 31, 46, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-light);
    padding: 3rem 2rem;
    border-top: 1px solid rgba(74, 144, 226, 0.2);
}

.footer-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    text-align: center;
}

.footer h3 {
    margin-bottom: 1rem;
    color: var(--accent-orange);
    font-size: 1.5rem;
}

.footer p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

.footer-address {
    margin-top: 1.5rem;
    font-size: 0.95rem;
    opacity: 0.9;
}

.footer-links {
    margin: 2rem 0;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition-base);
}

.footer-links a:hover {
    color: var(--accent-orange);
}

/* =====================================================
   11. ANIMATIONS
   ===================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes heroImageFadeIn {
    0% {
        filter: brightness(0.2);
    }
    100% {
        filter: brightness(0.4);
    }
}

/* =====================================================
   12. UTILITY CLASSES
   ===================================================== */
.service-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* =====================================================
   END OF MAIN.CSS
   ===================================================== */