/* ==================== Переменные ==================== */
:root {
    /* Основная палитра — синий + белый */
    --primary: #1E3A5F;          /* глубокий синий — надежность */
    --primary-dark: #152C4A;     /* темнее для hover */
    --primary-light: #2E5984;    /* средний синий */
    --secondary: #2E5984;        /* вторичный синий */
    --accent: #3B82F6;           /* яркий синий — CTA */
    --accent-hover: #2563EB;     /* акцент при наведении */

    /* Текст */
    --dark: #1E293B;             /* темно-синий графит */
    --gray-900: #1E293B;
    --gray-700: #334155;
    --gray-500: #64748B;         /* серо-синий */
    --gray-300: #CBD5E1;
    --gray-100: #F1F5F9;
    --white: #FFFFFF;

    /* Фон */
    --background: #F5F3EF;       /* бежевый мраморный */
    --surface: #FDFCFA;          /* карточки - тёплый белый */
    --border: #E8E4DD;           /* границы - тёплые */

    /* Статусы */
    --danger: #DC2626;
    --success: #059669;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* ==================== Сброс и базовые стили ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-700);
    background: var(--background);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

/* ==================== Типографика ==================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--dark);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }

p {
    margin-bottom: 1rem;
}

/* ==================== Контейнер ==================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==================== Кнопки ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #047857;
    color: var(--white);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ==================== Хедер ==================== */
.header {
    background: var(--background);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    flex-shrink: 0;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.nav a {
    padding: 0.5rem 0.5rem;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius);
    transition: all 0.2s;
    white-space: nowrap;
}

.nav a:hover {
    color: var(--primary);
    background: var(--gray-100);
}

.nav a.active {
    background: var(--primary);
    color: var(--background);
}

.header-phone {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-phone svg {
    color: var(--primary);
}

/* Мобильное меню */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--dark);
}

@media (max-width: 968px) {
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
    }

    .nav.active {
        display: flex;
    }

    .nav a {
        width: 100%;
        padding: 1rem;
    }

    .mobile-menu-btn {
        display: block;
    }

    .header-phone {
        display: none;
    }
}

/* ==================== Hero секция ==================== */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.hero h1 {
    color: var(--white);
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero .btn-primary {
    background: var(--white);
    color: var(--primary);
}

.hero .btn-primary:hover {
    background: var(--gray-100);
    transform: translateY(-2px);
}

.hero .btn-secondary {
    border-color: var(--white);
    color: var(--white);
}

.hero .btn-secondary:hover {
    background: var(--white);
    color: var(--primary);
}

/* ==================== Секции ==================== */
.section {
    padding: 5rem 0;
}

.section-gray {
    background: #EBE8E2;
    border-top: 1px solid var(--border);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    margin-bottom: 1rem;
}

.section-title p {
    color: var(--gray-500);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ==================== Карточки услуг ==================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.features-cards {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.features-cards .service-card {
    padding: 1.5rem;
}

@media (max-width: 1024px) {
    .features-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .features-cards {
        grid-template-columns: 1fr;
    }
}

.service-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.service-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    margin-bottom: 1.5rem;
}

.service-card h3 {
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

/* ==================== Преимущества ==================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-item {
    text-align: center;
    padding: 2rem;
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--primary);
}

.feature-item h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.feature-item p {
    color: var(--gray-500);
    font-size: 0.9375rem;
}

/* ==================== Портфолио ==================== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.portfolio-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 4/3;
    background: var(--gray-200);
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: var(--white);
}

.portfolio-overlay h4 {
    color: var(--white);
    margin-bottom: 0.25rem;
}

.portfolio-overlay p {
    font-size: 0.875rem;
    opacity: 0.8;
    margin: 0;
}

/* ==================== Продукт ==================== */
.product-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

@media (max-width: 768px) {
    .product-section {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.product-image {
    background: var(--gray-100);
    border-radius: var(--radius-xl);
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    max-height: 400px;
    object-fit: contain;
}

.product-info h1 {
    margin-bottom: 1rem;
}

.product-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.product-price small {
    font-size: 1rem;
    font-weight: 400;
    color: var(--gray-500);
}

/* Характеристики */
.specs-list {
    list-style: none;
    margin-bottom: 2rem;
}

.specs-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.specs-list li:last-child {
    border-bottom: none;
}

.specs-list svg {
    color: var(--secondary);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.specs-list strong {
    color: var(--dark);
}

/* ==================== Формы ==================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    transition: all 0.2s;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-input::placeholder {
    color: var(--gray-500);
}

textarea.form-input {
    resize: vertical;
    min-height: 120px;
}

select.form-input {
    cursor: pointer;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E") no-repeat right 1rem center;
    appearance: none;
}

/* Форма заказа */
.order-form {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.order-form h3 {
    margin-bottom: 1.5rem;
}

/* ==================== Калькулятор ==================== */
.calculator {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.calculator h3 {
    margin-bottom: 1.5rem;
}

.calc-result {
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    margin-top: 1.5rem;
}

.calc-result-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.calc-result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

/* ==================== О компании ==================== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.about-image {
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.about-image img {
    width: 100%;
    height: auto;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ==================== Контакты ==================== */
.contacts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

@media (max-width: 768px) {
    .contacts-grid {
        grid-template-columns: 1fr;
    }
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    flex-shrink: 0;
}

.contact-item h4 {
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.contact-item p {
    margin: 0;
    color: var(--gray-500);
}

.contact-item a {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-link {
    width: 48px;
    height: 48px;
    background: var(--gray-100);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-700);
    transition: all 0.2s;
}

.social-link:hover {
    background: var(--primary);
    color: var(--white);
}

/* ==================== Футер ==================== */
.footer {
    background: var(--dark);
    color: var(--gray-300);
    padding: 3rem 0 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.footer-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 1rem;
}

.footer h4 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--gray-300);
}

.footer-links a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid var(--gray-700);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
}

/* ==================== CTA секция ==================== */
.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
}

.cta-section h2 {
    color: var(--white);
    margin-bottom: 1rem;
}

.cta-section p {
    opacity: 0.9;
    margin-bottom: 2rem;
    font-size: 1.125rem;
}

.cta-section .btn {
    background: var(--white);
    color: var(--primary);
}

.cta-section .btn:hover {
    background: var(--gray-100);
}

/* ==================== Модальное окно ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
}

/* ==================== Уведомления ==================== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--dark);
    color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1001;
}

.toast.active {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

/* ==================== Админка ==================== */
.admin-header {
    background: var(--dark);
    color: var(--white);
    padding: 1rem 0;
}

.admin-header h1 {
    color: var(--white);
    font-size: 1.5rem;
    margin: 0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.admin-table th {
    background: var(--gray-100);
    font-weight: 600;
    color: var(--dark);
}

.admin-table tr:hover {
    background: var(--gray-50);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.badge-processed {
    background: #d1fae5;
    color: #065f46;
}

/* ==================== Страница логина ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
}

.login-form {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-form h1 {
    text-align: center;
    margin-bottom: 2rem;
}

/* ==================== Утилиты ==================== */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--gray-500); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ==================== Анимации ==================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Placeholder для изображений */
.placeholder-img {
    background: linear-gradient(135deg, var(--gray-200), var(--gray-300));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    font-size: 0.875rem;
}
