/* ================= БАЗОВЫЕ СТИЛИ И ПЕРЕМЕННЫЕ ================= */
:root {
    --primary: #0088cc;
    /* Основной цвет (Telegram/Technology blue) */
    --primary-hover: #0077b3;
    --primary-light: #e6f3ff;
    --secondary: #ff6b6b;
    /* Акцентный цвет (для кнопок заказа) */
    --secondary-hover: #ff5252;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --badge-hit: #ff4757;
    --badge-new: #2ed573;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    /* Стандартные свойства для мобильных браузеров (Firefox, новые Safari/Chrome) */
    scrollbar-color: var(--primary) var(--bg-color);
    scrollbar-width: thin;
}

/* Кастомный скроллбар */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 8px;
    border: 2px solid var(--bg-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ================= ХЕДЕР (НАВИГАЦИЯ) ================= */
.top-nav {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    position: relative;
}

.logo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-decoration: none;
    gap: 2px;
}

.logo {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary), #00d2d3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-badge {
    font-size: 9px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-left: 2px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links {
    display: flex;
    gap: 32px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 15px;
    position: relative;
    transition: var(--transition);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a:hover::after {
    width: 100%;
}

.header-phone {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
}

.header-phone:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 136, 204, 0.4);
}

/* Скрытие меню на мобильных, оставление только телефона и лого */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .logo-wrapper {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }

    .logo-badge {
        font-size: 9px;
        margin-top: -4px;
    }

    .header-phone span {
        display: none;
        /* Скрываем текст, оставляем иконку */
    }

    .header-phone {
        padding: 10px;
        border-radius: 50%;
    }
}

/* ================= ТИПОГРАФИКА И КНОПКИ ================= */
h1,
h2,
h3 {
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.section-title {
    text-align: center;
    font-size: 32px;
    margin: 60px 0 40px;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background-color: var(--primary);
    color: #ffffff;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    width: 100%;
    min-height: 48px;
    text-decoration: none;
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--secondary);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

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

.btn-outline:hover {
    background-color: var(--primary-light);
    color: var(--primary);
    box-shadow: none;
}

/* ================= БЛОК HERO (ПЕРВЫЙ ЭКРАН) ================= */
.hero {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%);
    padding: 80px 20px;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 136, 204, 0.05) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-tag {
    display: inline-block;
    padding: 6px 16px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
    border-radius: 50px;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero h1 {
    font-size: clamp(32px, 5vw, 56px);
    /* Адаптивный размер шрифта */
    color: var(--text-main);
    margin-bottom: 24px;
}

.hero p {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--text-muted);
    margin: 0 auto 32px;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: center;
    align-items: stretch;
}

@media (min-width: 600px) {
    .hero-actions {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
        align-items: stretch;
    }

    .hero-actions .btn {
        width: 280px;
        flex-shrink: 0;
    }
}

/* ================= ФИЛЬТР ПО ПЛОЩАДИ ================= */
.area-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
}

.filter-btn {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn span {
    font-weight: 400;
    font-size: 13px;
    opacity: 0.8;
}

.filter-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
}

/* ================= СЕТКА ТОВАРОВ ================= */
.products-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
    padding-bottom: 40px;
}

@media (min-width: 576px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }
}

.card {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

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

.card-img-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    /* Предотвращает CLS */
    background: linear-gradient(120deg, #fdfbfb 0%, #ebedee 100%);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.card-img-placeholder {
    color: #cbd5e1;
    font-size: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: multiply;
}

.card-img-placeholder span {
    font-size: 14px;
    font-weight: 500;
}

.badge {
    position: absolute;
    top: 30px;
    left: 10px;
    padding: 6px 12px;
    border-radius: 6px;
    color: white;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.badge.hit {
    background-color: var(--badge-hit);
}

.badge.new {
    background-color: var(--badge-new);
}

.badge.premium {
    background-color: #8e44ad;
}

.features-layer {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2;
}

.feature-icon {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-main);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
}

.card h3 {
    font-size: 18px;
    margin-bottom: 12px;
    flex-grow: 1;
}

.price {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 20px;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.card-actions .btn {
    flex: 1;
    padding: 10px 0;
    font-size: 14px;
    min-height: 42px;
}

/* ================= УСЛУГИ ================= */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 60px;
}

.service-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

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

.service-content h3 {
    font-size: 22px;
    margin-bottom: 12px;
}

.service-content p {
    color: var(--text-muted);
    font-size: 16px;
}

.service-action {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 768px) {
    .service-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .service-content {
        flex: 1;
        padding-right: 40px;
    }

    .service-action {
        flex-direction: column;
        align-items: flex-end;
        min-width: 200px;
    }

    .service-action .btn {
        width: 100%;
    }
}

.phone-link {
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    transition: var(--transition);
}

.phone-link:hover {
    color: var(--primary);
}

/* ================= ФУТЕР ================= */
.footer {
    background-color: #2d3436;
    color: #b2bec3;
    padding: 60px 20px 40px;
    text-align: center;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-logo {
    font-size: 24px;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 20px;
    display: inline-block;
}

.footer p {
    margin-bottom: 12px;
    font-size: 15px;
}

.footer .legal {
    font-size: 13px;
    opacity: 0.7;
    margin-top: 30px;
}

/* ================= МОДАЛЬНЫЕ ОКНА ================= */
dialog {
    margin: auto;
    border: none;
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    background: var(--card-bg);
}

dialog::backdrop {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Анимация для диалогов */
dialog[open] {
    animation: modalSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-btn:hover {
    background: #e2e8f0;
    color: var(--text-main);
    transform: rotate(90deg);
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-size: 16px;
    outline: none;
    transition: var(--transition);
    background-color: #f8fafc;
    font-family: inherit;
}

.form-group input:focus {
    border-color: var(--primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px var(--primary-light);
}

.dialog-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
    text-align: center;
}

.dialog-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 30px;
    text-align: center;
    background: var(--bg-color);
    padding: 8px;
    border-radius: 8px;
    font-weight: 600;
}

/* ================= МОДАЛКА ТОВАРА ================= */
#product-modal-dialog {
    max-width: 550px;
}

.product-desc {
    margin-bottom: 24px;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.6;
}

.product-specs {
    background: var(--bg-color);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 30px;
    list-style: none;
}

.product-specs li {
    margin-bottom: 12px;
    font-size: 15px;
    border-bottom: 1px dashed #cbd5e1;
    padding-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.product-specs li:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.product-specs span {
    color: var(--text-muted);
}

.product-specs strong {
    color: var(--text-main);
    text-align: right;
}

.product-action-row {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

@media (min-width: 480px) {
    .product-action-row {
        flex-direction: row;
        justify-content: space-between;
    }

    .product-action-row .btn {
        width: auto;
        flex: 1;
    }
}

/* ================= TOAST УВЕДОМЛЕНИЯ ================= */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
    border-left: 4px solid var(--primary);
}

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

.toast.success {
    border-left-color: var(--badge-new);
}

.toast.error {
    border-left-color: var(--badge-hit);
}

.toast.info {
    border-left-color: #3498db;
}

.toast-icon {
    font-size: 24px;
}

.toast-message {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}