/*
 * common.css - Refactored for SwiftAutoWorks
 * English comments followed by Russian translations.
 */

/* 1. Font-Face: Montserrat Local Fonts
   Подключение локального шрифта Montserrat */
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat-Regular.ttf') format('truetype');
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat-Italic.ttf') format('truetype');
    font-style: italic;
    font-display: swap;
}


/* 2. Root Variables for Theme
   Переменные темы */
:root {
    /* Color Palette
       Палитра цветов */
    --color-primary: #1a1f36;
    /* Dark slate-blue for headers and text */
    --color-secondary: #FF5722;
    /* Vibrant orange accent for CTAs */
    --color-accent-light: #FF8A50;
    /* Lighter accent for hover states */
    --color-bg: #FFFFFF;
    /* Background white */
    --color-bg-light: #F4F4F4;
    /* Light background sections */
    --color-bg-dark: #1f1f1f;
    /* Dark background sections */
    --color-text: #222222;
    /* Primary text color */
    --color-text-muted: #555555;
    /* Secondary text color */
    --color-text-inverse: #FFFFFF;
    /* Inverse text on dark bg */

    /* Typography
       Типографика */
    --font-family-base: 'Montserrat', sans-serif;
    --font-size-base: 1rem;
    /* 16px */
    --font-size-lg: 1.125rem;
    /* 18px */
    --font-size-xl: 1.5rem;
    /* 24px */
    --font-size-xxl: 2rem;
    /* 32px */
    --line-height-base: 1.6;

    /* Spacing Scale
       Масштаб отступов */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;

    /* Breakpoints (mobile-first)
       Точки останова */
    --breakpoint-sm: 480px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
    --breakpoint-xxl: 1600px;

    /* Transitions
       Переходы */
    --transition-time: 0.3s;
}

/* 3. Global Reset & Base Styles
   Сброс и базовые стили */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 100%;
    /* 16px */
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background-color: var(--color-bg);
    overflow-x: hidden;
}

.hidden {
    display: none;
}

img,
video {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

button {
    font-family: var(--font-family-base);
    background: none;
    border: none;
    cursor: pointer;
}

input,
textarea,
select {
    font-family: var(--font-family-base);
}

/* 4. Container and Layout Utilities
   Контейнер и утилиты компоновки */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.flex-space-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
}

.section {
    padding-top: var(--spacing-xxl);
    padding-bottom: var(--spacing-xxl);
}

/* Full-width background wrapper
   Обёртка для фонов на всю ширину */
.section-fullwidth {
    width: 100%;
    margin-left: calc((100% - 100vw) / 2);
    margin-right: calc((100% - 100vw) / 2);
}

/* 5. Header & Footer Styles
   Стили для Header и Footer */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--color-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.header-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-list {
    display: flex;
    gap: var(--spacing-lg);
}

.nav-item a {
    position: relative;
    padding: var(--spacing-sm) 0;
}

.nav-item a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-secondary);
    transition: width var(--transition-time);
}

.nav-item a:hover::after,
.nav-item a:focus::after {
    width: 100%;
}

.footer {
    background-color: var(--color-bg-dark);
    color: var(--color-text-inverse);
    padding-top: var(--spacing-xxl);
    padding-bottom: var(--spacing-xxl);
}

.footer .container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}

.footer-section {
    flex: 1 1 200px;
}

.footer a {
    color: var(--color-secondary);
}

.footer a:hover,
.footer a:focus {
    color: var(--color-accent-light);
}

/* 6. Typography
   Типографика */
h1 {
    font-size: var(--font-size-xxl);
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
    text-transform: capitalize;
}

h2 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
    text-transform: capitalize;
}

h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
    text-transform: capitalize;
}

p {
    margin-bottom: var(--spacing-md);
    color: var(--color-text-muted);
}

.text-center {
    text-align: center;
}

/* 7. Buttons
   Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 12px 24px;
    border-radius: 6px;
    font-size: var(--font-size-base);
    font-weight: 600;
    transition: background-color var(--transition-time) ease, transform var(--transition-time) ease;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--color-secondary);
    color: var(--color-text-inverse);
    border: 2px solid var(--color-secondary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--color-bg);
    color: var(--color-secondary);
    transform: translateY(-2px);
    outline: 2px solid var(--color-primary);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-secondary);
    border: 2px solid var(--color-secondary);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--color-secondary);
    color: var(--color-text-inverse);
    transform: translateY(-2px);
}

/* 8. Link underline animation
   Анимация подчёркивания ссылок */
.link-underline {
    position: relative;
}

.link-underline::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background-color: var(--color-secondary);
    transition: width var(--transition-time) ease;
}

.link-underline:hover::after,
.link-underline:focus::after {
    width: 100%;
}

/* 9. Forms
   Формы */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: var(--font-size-base);
    transition: border-color var(--transition-time) ease, box-shadow var(--transition-time) ease;
    background-color: var(--color-bg);
    color: var(--color-text);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.2);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

/* 10. Image Utilities
    Утилиты для изображений */
.img-hover-scale {
    transition: transform var(--transition-time) ease;
}

.img-hover-scale:hover {
    transform: scale(1.05);
}

.lazyload {
    opacity: 0;
    transition: opacity var(--transition-time) ease;
}

.lazyload-loaded {
    opacity: 1;
}

/* 11. Section Variations
    Различные стили секций */
.section-light {
    background-color: var(--color-bg-light);
    color: var(--color-text);
}

.section-dark {
    background-color: var(--color-bg-dark);
    color: var(--color-text-inverse);
}

.section-overlay {
    position: relative;
}

.section-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

/* 12. Hero Section Styles
    Стили для Hero секции */
.hero {
    position: relative;
    width: 100%;
    height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-inverse);
}

.hero .hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hero .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.hero .hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: var(--spacing-lg);
}

.hero h1 {
    font-size: var(--font-size-xxl);
    margin-bottom: var(--spacing-md);
}

.hero p {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-lg);
}

/* 13. Swiper Integration Overrides
    Переопределения стилей Swiper */
/* Ensure Swiper CSS is included separately */
.swiper-container {
    width: 100%;
}

.swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Navigation buttons */
.swiper-button-next,
.swiper-button-prev {
    color: var(--color-secondary);
    transition: color var(--transition-time) ease;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    color: var(--color-accent-light);
}

/* Pagination bullets */
.swiper-pagination-bullet {
    background: var(--color-secondary);
    opacity: 0.7;
}

.swiper-pagination-bullet-active {
    background: var(--color-secondary);
    opacity: 1;
}

/* 14. Animations Keyframes
    Анимации */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 15. Responsive Media Queries
    Адаптивные медиа-запросы */
/* Mobile-first: base styles apply to small screens */
@media (min-width: var(--breakpoint-sm)) {
    /* >= 480px */
}

@media (min-width: var(--breakpoint-md)) {

    /* >= 768px */
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: var(--breakpoint-lg)) {

    /* >= 1024px */
    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 2.5rem;
    }

    .container {
        max-width: 1200px;
    }
}

@media (min-width: var(--breakpoint-xl)) {

    /* >= 1280px */
    h1 {
        font-size: 3.5rem;
    }
}

/* 16. Dark Mode Support (Optional)
    Поддержка тёмной темы */
@media (prefers-color-scheme: dark) {
    body {
        background-color: var(--color-bg-dark);
        color: var(--color-text-inverse);
    }

    header {
        background-color: var(--color-bg-dark);
        box-shadow: 0 2px 4px rgba(255, 255, 255, 0.05);
    }

    .footer {
        background-color: #000;
    }

    input,
    textarea,
    select {
        background-color: #222;
        color: #fff;
        border-color: #444;
    }

    .btn-primary {
        background-color: var(--color-secondary);
        color: var(--color-text-inverse);
    }

    .btn-primary:hover,
    .btn-primary:focus {
        background-color: var(--color-bg-dark);
        color: var(--color-secondary);
    }
}

/* End of common.css */