/* ============================================
   Сергей — Сварочные Услуги (новая версия)
   Индустриальный дизайн, акцент — электрик
   ============================================ */

:root {
    --accent: #00d4ff;
    --accent-dim: rgba(0, 212, 255, 0.15);
    --accent-glow: rgba(0, 212, 255, 0.4);
    --bg: #0a0a0b;
    --bg-card: #141416;
    --bg-elevated: #1a1a1d;
    --text: #f4f4f5;
    --text-muted: #a1a1aa;
    --border: rgba(255, 255, 255, 0.08);
    --font-display: 'Bebas Neue', sans-serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s, background 0.2s;
}

/* ========== Header ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 1.5rem;
    background: rgba(10, 10, 11, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: padding 0.3s;
    overflow: visible;
}

.header.scrolled {
    padding: 0.75rem 1.5rem;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #00d4ff, #7c3aed, #00d4ff);
    background-size: 200% 200%;
    color: var(--bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    animation: buttonGradient 3s linear infinite;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    letter-spacing: 0.05em;
    background: linear-gradient(90deg, #ffffff, #a1a1aa, #00d4ff, #ffffff);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: logoShimmer 4s linear infinite;
}

.logo-accent {
    -webkit-text-fill-color: var(--accent);
    color: var(--accent);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    animation: logoPulse 2s infinite alternate ease-in-out;
}

@keyframes logoShimmer {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes logoPulse {
    0% {
        text-shadow: 0 0 5px rgba(0, 212, 255, 0.4);
    }

    100% {
        text-shadow: 0 0 15px rgba(0, 212, 255, 0.8), 0 0 25px rgba(0, 212, 255, 0.6);
    }
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
    overflow: hidden;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #00d4ff, #7c3aed, #00d4ff);
    background-size: 200% 200%;
    color: var(--bg);
    border: none;
    animation: buttonGradient 3s linear infinite;
}

.btn-primary:hover {
    background-position: right center;
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--text);
}

.btn-outline:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(124, 58, 237, 0.1));
    border-color: var(--accent);
    color: var(--accent);
    animation: buttonGradient 3s linear infinite;
}

.btn-nav {
    background: var(--accent);
    color: var(--bg);
}

.btn-nav:hover {
    background: #00b8e6;
}

/* Специальная кнопка с искрами */
.btn-spark {
    background: #22c55e;
    color: #fff;
    border: none;
    position: relative;
    z-index: 1;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

.btn-spark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    /* Множественные красные искры через box-shadow */
    box-shadow:
        0 0 0 0 rgba(239, 68, 68, 0),
        0 0 0 0 rgba(239, 68, 68, 0);
    animation: fireSparks 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes fireSparks {
    0% {
        box-shadow:
            0 0 0 0 rgba(239, 68, 68, 0.8),
            0 0 0 0 rgba(239, 68, 68, 0.8);
        transform: translate(-50%, -50%) scale(0.5);
    }

    30% {
        opacity: 1;
    }

    100% {
        box-shadow:
            40px -30px 2px 1px rgba(239, 68, 68, 0),
            -35px -40px 3px 1px rgba(239, 68, 68, 0),
            25px 35px 2px 1px rgba(239, 68, 68, 0),
            -45px 20px 4px 1px rgba(239, 68, 68, 0),
            60px 10px 2px 1px rgba(239, 68, 68, 0),
            -20px 55px 3px 1px rgba(239, 68, 68, 0);
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

.btn-spark:hover {
    background: #16a34a;
    transform: scale(1.05);
}

/* ===== Мобильное выпадающее меню ===== */
.mobile-nav {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: rgba(10, 10, 11, 0.99);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.mobile-nav.nav-open {
    display: flex;
}

.mobile-nav a:not(.btn) {
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}

.mobile-nav a:not(.btn):hover {
    color: var(--accent);
}

.mobile-nav .btn {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1rem;
    font-size: 1rem;
}

/* Кнопка Галерея — белый текст чтобы читалась */
.mobile-nav .btn-outline {
    color: var(--text) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

/* Десктопные кнопки в шапке */
.header-desktop-btns {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .h-mobile-hide {
        display: none !important;
    }

    /* ===== ШАПКА ===== */

    /* Убираем blur из шапки — главная причина мерцания на Android */
    .header {
        position: fixed;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(10, 10, 11, 0.97) !important;
        padding-top: 50px;
    }

    /* Логотип — на мобиле скрываем текст, оставляем только иконку */
    .logo-text {
        display: none !important;
    }

    /* Показываем бургер */
    .burger {
        display: flex !important;
        z-index: 1001;
        flex-shrink: 0;
    }

    /* Скрываем десктопные кнопки */
    .header-desktop-btns {
        display: none !important;
    }

    /* ===== АНИМАЦИИ — отключаем всё на мобильных ===== */
    /* Отключаем мигание кнопки входа и всех кнопок */
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.2s !important;
    }

    /* Но плавные переходы у меню оставляем */
    .mobile-nav {
        transition: none !important;
    }

    /* Убираем shimmer/gradient анимации */
    .logo-text,
    .logo-icon,
    .btn-primary,
    .btn-outline,
    .btn-spark,
    .btn-nav,
    .logo-accent,
    .auth-btn {
        animation: none !important;
        -webkit-animation: none !important;
        background-position: 0% 50% !important;
    }

    .logo-accent {
        text-shadow: none !important;
        -webkit-text-fill-color: var(--accent) !important;
    }

    /* ===== МЕРЦАНИЕ ПРИ СКРОЛЛЕ (Android) ===== */

    /* GPU-слой для body чтобы не перерисовывался */
    body {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: none;
    }

    /* Отключаем фиксированные фоны — главная причина лагов */
    .bottom-background-wrap,
    .hero-bg,
    .reviews-page,
    .page-calc {
        background-attachment: scroll !important;
    }

    /* Убираем SVG шум */
    .hero-noise {
        display: none !important;
    }

    /* Отключаем blur везде где он не нужен */
    .service-card,
    .gallery-card,
    .modal-overlay {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* ===== КНОПКА ВХОДА ===== */
    .auth-btn-text {
        display: inline !important;
        font-size: 0.72rem !important;
    }

    .auth-btn {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.72rem !important;
        animation: none !important;
        border: 2px solid rgba(255, 255, 255, 0.3) !important;
        background: transparent !important;
        gap: 0.3rem !important;
        white-space: nowrap;
    }

    /* Фоновые zoom/pulse — главный источник периодического мерцания */
    .ai-widget,
    .ai-chat-window,
    .review-modal-content,
    .modal-content,
    .ai-widget-pulse,
    .hero-scroll-line,
    .ai-chat-header,
    .ai-chat-send {
        animation: none !important;
        -webkit-animation: none !important;
    }

    .ai-widget-pulse {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .bottom-background-wrap {
        background-attachment: scroll !important;
    }
}


.auth-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Глобальный фикс от лагов и мерцаний на мобильных (iOS Safari) */
body {
    -webkit-tap-highlight-color: transparent;
}

.mobile-only {
    display: none;
}

/* Анимация переливания градиента */
@keyframes buttonGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes shimmerPalette {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 400% 50%;
    }
}

.nav a::after {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(90deg,
            #00d4ff, #7c3aed, #ec4899, #f59e0b, #22c55e, #00d4ff);
    background-size: 400% 100%;
    z-index: -1;
    opacity: 0;
    border-radius: 8px;
    transition: opacity 0.15s;
}

.nav a:active::after {
    opacity: 0.9;
    animation: shimmerPalette 0.6s ease-out;
}

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

.btn::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: linear-gradient(90deg,
            #00d4ff, #7c3aed, #ec4899, #f59e0b, #22c55e, #00d4ff);
    background-size: 400% 100%;
    z-index: -1;
    opacity: 0;
    border-radius: 10px;
}

.btn:active::before {
    opacity: 1;
    animation: shimmerPalette 0.6s ease-out;
}

.burger {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.burger span {
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: transform 0.3s, opacity 0.3s;
}

.burger-active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger-active span:nth-child(2) {
    opacity: 0;
}

.burger-active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ========== Hero ========== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 8rem 1.5rem 4rem;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(10, 10, 11, 0.7) 0%,
            rgba(10, 10, 11, 0.5) 50%,
            rgba(10, 10, 11, 0.9) 100%);
}

.hero-noise {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 700px;
}

.hero-tag {
    font-size: 0.9rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
    font-weight: 600;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 5.5rem);
    line-height: 1;
    letter-spacing: 0.02em;
    margin-bottom: 1.5rem;
}

.hero-title-accent {
    color: var(--accent);
    text-shadow: 0 0 40px var(--accent-glow);
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    line-height: 1.7;
}

.hero-services {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
    justify-content: center;
    margin-bottom: 2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.hero-services li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-services li i {
    color: var(--accent);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.hero-scroll span {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.hero-scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {

    0%,
    100% {
        opacity: 0.3;
        transform: scaleY(0.5);
    }

    50% {
        opacity: 1;
        transform: scaleY(1);
    }
}

/* ========== Section ========== */
.section {
    padding: 5rem 1.5rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-heading {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: 0.02em;
    margin-bottom: 3rem;
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.section-num {
    color: var(--accent);
    font-size: 0.6em;
    opacity: 0.8;
}

/* Reveal animation */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.service-card.reveal {
    transition-delay: 0.1s;
}

.service-card:nth-child(2).reveal {
    transition-delay: 0.15s;
}

.service-card:nth-child(3).reveal {
    transition-delay: 0.2s;
}

.service-card:nth-child(4).reveal {
    transition-delay: 0.25s;
}

.gallery-card.reveal {
    transition-delay: 0.05s;
}

/* Специфическая анимация "Сварка" (Spark Reveal) */
.gallery-spark-active {
    animation: sparkFlash 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
    position: relative;
    overflow: hidden;
}

.gallery-spark-active::before {
    content: '';
    position: absolute;
    inset: 0;
    background: white;
    box-shadow: 0 0 60px 20px white;
    opacity: 0;
    z-index: 5;
    pointer-events: none;
    animation: flash 0.6s ease-out forwards;
}

@keyframes sparkFlash {
    0% {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
        filter: brightness(2);
    }

    30% {
        opacity: 1;
        filter: brightness(3) contrast(1.2) hue-rotate(-20deg);
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
        filter: brightness(1) contrast(1);
    }
}

@keyframes flash {
    0% {
        opacity: 0.8;
        transform: scale(0.1);
    }

    10% {
        opacity: 1;
        transform: scale(1.5);
    }

    100% {
        opacity: 0;
        transform: scale(2);
    }
}

/* ========== Services ========== */
.services {
    background: transparent;
}

.bottom-background-wrap {
    background: linear-gradient(to bottom, var(--bg) 0%, transparent 15%, transparent 85%, var(--bg) 100%),
        url('images/i.jpg') no-repeat center/cover scroll;
    position: relative;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: var(--accent-dim);
    backdrop-filter: blur(10px);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.service-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 212, 255, 0.1);
}

.service-card-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    opacity: 0.9;
}

.service-card-icon i {
    opacity: 0.8;
}

.service-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ========== Gallery ========== */
.gallery {
    background: var(--bg-card);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4/3;
}

/* Watermark on gallery cards */
.gallery-card::after {
    content: 'svarkaproserj.ru';
    position: absolute;
    bottom: 10px;
    left: 12px;
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.45);
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.08em;
    z-index: 3;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.gallery-card:hover img {
    transform: scale(1.08);
}

.gallery-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    transform: translateY(100%);
    transition: transform 0.3s;
}

.gallery-card:hover .gallery-card-info {
    transform: translateY(0);
}

.gallery-card-info h4 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.gallery-card-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ========== Contact ========== */
.contact {
    background: transparent;
}

.contact-intro {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s;
}

.contact-card:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.contact-card i {
    font-size: 1.5rem;
    color: var(--accent);
}

.contact-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.contact-value {
    font-weight: 600;
}

/* ========== Footer ========== */
.footer {
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========== Telegram Widget (removed) ========== */

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 260px;
        background: var(--bg-elevated);
        flex-direction: column;
        justify-content: center;
        gap: 1.5rem;
        transform: translateX(100%);
        transition: transform 0.3s;
        border-left: 1px solid var(--border);
    }

    .nav.nav-open {
        transform: translateX(0);
    }

    .burger {
        display: flex;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-services {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ========== Services Modal ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: linear-gradient(rgba(20, 20, 22, 0.85), rgba(20, 20, 22, 0.85)), url('images/125.jfif') no-repeat center/cover;
    border: 1px solid var(--accent);
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: var(--accent);
    color: var(--bg);
}

.modal-title {
    font-size: 1.8rem;
    text-align: center;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-family: var(--font-display);
}

.modal-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* Wrapper for modal gallery images with watermark */
.modal-gallery-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.modal-gallery-wrap::after {
    content: 'svarkaproserj.ru';
    position: absolute;
    bottom: 8px;
    left: 10px;
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.45);
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.08em;
    z-index: 3;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.modal-gallery img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    border: 1px solid var(--border);
}

.modal-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
    border-color: var(--accent);
}

/* ========== Lightbox ========== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-img {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: var(--accent);
}

.lightbox-title {
    color: #fff;
    margin-top: 1rem;
    font-size: 1.2rem;
}

.lightbox-counter {
    color: rgba(255, 255, 255, 0.65);
    margin-top: 0.35rem;
    font-size: 0.9rem;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.12);
    border: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: background 0.2s, transform 0.2s;
    z-index: 2;
}

.lightbox-prev {
    left: 1.5rem;
}

.lightbox-next {
    right: 1.5rem;
}

.lightbox-nav:hover {
    background: var(--accent);
}

.lightbox-nav:active {
    transform: translateY(-50%) scale(0.95);
}

/* ========== AI Chat Bot Widget ========== */
.ai-widget {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    width: 60px;
    height: 60px;
    background-image: url('images/125.jfif');
    background-size: cover;
    background-position: center;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    z-index: 9998;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.ai-widget::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(124, 58, 237, 0.3);
    /* Легкий фиолетовый оттенок поверх картинки */
    z-index: -1;
}

.ai-widget:hover {
    transform: scale(1.1) rotate(5deg);
}

.ai-widget-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #7c3aed;
    border-radius: 50%;
    z-index: -1;
    animation: aiPulse 2.5s infinite;
}

@keyframes aiPulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    70% {
        transform: scale(1.6);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }
}

.ai-chat-window {
    position: fixed;
    bottom: 5.5rem;
    left: 1.5rem;
    width: 350px;
    height: 500px;
    background-image: url('images/125.jfif');
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border);
    border-radius: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.ai-chat-window::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 11, 0.9);
    /* Затемнение для читаемости сообщений */
    z-index: 0;
    pointer-events: none;
}

/* Фикс для слоев в чате, чтобы сообщения были над фоном */
.ai-chat-header,
.ai-chat-body,
.ai-chat-footer {
    position: relative;
    z-index: 1;
}


.ai-chat-window.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.ai-chat-header {
    padding: 1.25rem;
    background: linear-gradient(90deg, #7c3aed, #00d4ff, #7c3aed);
    background-size: 200% 200%;
    color: #fff;
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: buttonGradient 5s linear infinite;
}

.ai-chat-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.ai-chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-body {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.ai-message.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-bottom-left-radius: 2px;
}

.ai-message.user {
    align-self: flex-end;
    background: var(--accent);
    color: var(--bg);
    border-bottom-right-radius: 2px;
}

.ai-chat-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
}

.ai-chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 0.6rem 1rem;
    color: #fff;
    outline: none;
}

.ai-chat-input:focus {
    border-color: var(--accent);
}

.ai-chat-send {
    background: linear-gradient(135deg, #00d4ff, #7c3aed, #00d4ff);
    background-size: 200% 200%;
    color: var(--bg);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: buttonGradient 3s linear infinite;
}

.typing-indicator {
    align-self: flex-start;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    display: none;
}


/* ========== Review Form ========== */
.review-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #fff;
    outline: none;
    font-family: var(--font-body);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}

.rating-input {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
}

.stars {
    display: flex;
    flex-direction: row-reverse;
    gap: 5px;
}

.stars input {
    display: none;
}

.stars label {
    cursor: pointer;
    font-size: 1.2rem;
    color: #444;
    transition: color 0.2s;
}

.stars input:checked~label,
.stars label:hover,
.stars label:hover~label {
    color: #ffcc00;
}

@media (max-width: 480px) {
    .ai-chat-window {
        width: 90vw;
        left: 5vw;
        bottom: 5rem;
    }
}

/* Стили для модального окна отзывов с анимированным фоном */
.review-modal-content {
    position: relative;
    background-image: url('images/125.jfif');
    background-size: cover;
    background-position: center;
    overflow: hidden;
    z-index: 1;
}

.review-modal-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 11, 0.85);
    /* Затемнение фона для читаемости */
    z-index: -1;
}


/* Стили для списка отзывов */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.reviews-list::-webkit-scrollbar {
    width: 4px;
}

.reviews-list::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

.review-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    transition: transform 0.3s;
}

.review-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-glow);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.review-author {
    font-weight: 600;
    color: var(--accent);
    font-size: 1rem;
}

.review-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.review-stars {
    color: #ffcc00;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.review-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.review-photo {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid var(--border);
}

.review-delete-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.review-delete-btn:hover {
    background: #ef4444;
    color: #fff;
}

/* ========== Advantages Section ========== */
.advantages {
    background: rgba(255, 255, 255, 0.02);
    padding: 100px 0;
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.advantage-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 2.5rem;
    border-radius: 16px;
    transition: transform 0.3s, border-color 0.3s;
    text-align: left;
}

.advantage-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.advantage-icon {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
    display: block;
    transition: transform 0.3s, filter 0.3s;
}

.advantage-card:hover .advantage-icon {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 10px var(--accent));
}

.advantage-card h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.advantage-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ========== Work Steps Section ========== */
.steps-section {
    padding: 100px 0;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    position: relative;
    margin-top: 3rem;
}

/* Connecting line for steps */
.steps-grid::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 100px;
    right: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    z-index: 0;
}

@media (max-width: 768px) {
    .steps-grid::before {
        display: none;
    }
}

.step-card {
    text-align: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--accent);
    color: var(--bg);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.step-card h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.step-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .advantage-card {
        padding: 1.5rem;
    }
}

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

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

/* ========== Calculator Section ========== */
.calculator-section {
    padding: 100px 0;
    background: rgba(0, 0, 0, 0.2);
}

.calc-container {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(20, 20, 22, 0.7);
    backdrop-filter: blur(15px);
    border: 1px solid var(--accent);
    border-radius: 24px;
    padding: 3rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    align-items: start;
    position: relative;
}

.calc-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.calc-close:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
    transform: rotate(90deg);
}

@media (min-width: 1024px) {
    .calc-container {
        max-width: 1100px;
        grid-template-columns: 1.1fr 0.9fr;
        padding: 4rem;
    }
}

.calc-inputs {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
}

.calc-select,
.calc-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.calc-select:focus,
.calc-input:focus {
    outline: none;
    border-color: var(--accent);
}

.calc-result {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: rgba(0, 212, 255, 0.05);
    border-radius: 20px;
    padding: 2rem;
    border: 1px dashed var(--accent);
    position: sticky;
    top: 100px;
}

.result-label {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.result-price {
    font-family: var(--font-display);
    font-size: 3.5rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.calc-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

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

    .result-price {
        font-size: 2.5rem;
    }

    /* Mobile Bottom Nav Bar (App Style) */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 65px;
        background: rgba(16, 16, 20, 0.95);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 10000;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.4);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: rgba(255, 255, 255, 0.5);
        text-decoration: none;
        font-size: 0.65rem;
        gap: 4px;
        transition: all 0.3s;
        flex: 1;
    }

    .mobile-nav-item i {
        font-size: 1.25rem;
    }

    .mobile-nav-item.active {
        color: var(--accent);
    }

    .mobile-nav-item span {
        font-weight: 500;
    }

    /* Hide burger-menu navigation in favor of bottom nav if preferred, 
       but keeping both for now for better UX */

    body {
        padding-bottom: 70px;
    }
}

/* ========== Improved Text Readability ========== */
.hero-bg::after {
    background: linear-gradient(180deg,
            rgba(5, 5, 6, 0.75) 0%,
            rgba(5, 5, 6, 0.55) 40%,
            rgba(5, 5, 6, 0.85) 100%) !important;
}

.hero-title {
    color: #ffffff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.7), 0 0 60px rgba(0, 0, 0, 0.5);
}

.hero-desc {
    color: #e4e4e7 !important;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
    font-size: 1.15rem !important;
}

.hero-services {
    color: #d4d4d8 !important;
}

.hero-services li {
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

.hero-tag {
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

/* ========== Advantages Cards Text ========== */
.advantage-card h3,
.service-card h3,
.step-card h3 {
    color: #ffffff;
}

.advantage-card p,
.service-card p,
.step-card p {
    color: #a1a1aa;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ========== Calc Home Section ========== */
.calc-home-section {
    background: transparent;
    position: relative;
}

.calc-home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
    position: relative;
}

@media (max-width: 900px) {
    .calc-home-grid {
        grid-template-columns: 1fr;
    }
}

.calc-home-inputs {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.calc-home-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calc-home-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.calc-home-result {
    position: sticky;
    top: 90px;
}

.calc-home-result-inner {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(124, 58, 237, 0.08));
    border: 1px solid var(--accent);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.08);
}

/* Calc inputs shared styles */
.calc-select,
.calc-input {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color 0.2s;
    outline: none;
}

.calc-select:focus,
.calc-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.result-price {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--accent);
    text-shadow: 0 0 30px var(--accent-glow);
    letter-spacing: 0.02em;
}

/* ========================================
   📱 MOBILE POLISH — дополнительная полировка
   ======================================== */

/* --- Анимация появления мобильного dropdown-меню --- */
.mobile-nav {
    /* Сдвиг вместо display:none — позволяет анимировать */
    display: flex !important;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.3s ease,
        opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    padding-top: 0;
    padding-bottom: 0;
}

.mobile-nav.nav-open {
    max-height: 400px;
    padding: 1.25rem 1.5rem;
    opacity: 1;
    pointer-events: auto;
}

/* --- Нижняя навигация — скрыта на десктопе --- */
.mobile-bottom-nav {
    display: none;
}

/* --- Улучшенная нижняя навигация на мобиле --- */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background: rgba(14, 14, 16, 0.98);
        border-top: 1px solid rgba(255, 255, 255, 0.07);
        z-index: 10000;
        justify-content: space-around;
        align-items: center;
        /* Учитываем safe-area-inset на iPhone (нотч/кнопка Home) */
        padding-bottom: env(safe-area-inset-bottom, 0px);
        height: calc(60px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: rgba(255, 255, 255, 0.4);
        text-decoration: none;
        font-size: 0.6rem;
        gap: 3px;
        flex: 1;
        padding: 6px 0;
        /* Плавный переход цвета */
        transition: color 0.2s ease, transform 0.15s ease;
        /* Увеличиваем tap-зону */
        min-height: 44px;
        position: relative;
    }

    .mobile-nav-item i {
        font-size: 1.2rem;
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .mobile-nav-item span {
        font-family: var(--font-body);
        font-weight: 500;
        letter-spacing: 0.02em;
    }

    /* Активная вкладка */
    .mobile-nav-item.active {
        color: var(--accent);
    }

    .mobile-nav-item.active i {
        transform: translateY(-2px) scale(1.15);
        filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.6));
    }

    /* Активный индикатор — точка над иконкой */
    .mobile-nav-item.active::before {
        content: '';
        position: absolute;
        top: 2px;
        left: 50%;
        transform: translateX(-50%);
        width: 24px;
        height: 3px;
        background: var(--accent);
        border-radius: 0 0 4px 4px;
        box-shadow: 0 0 8px var(--accent-glow);
    }

    /* Tap-эффект (ripple на нажатие) */
    .mobile-nav-item:active {
        color: var(--accent);
        transform: scale(0.92);
    }

    .mobile-nav-item:active i {
        transform: translateY(-1px) scale(1.05);
    }

    /* Отступ снизу для содержимого страницы */
    body {
        padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    }

    /* --- Очень маленькие экраны (iPhone SE, старые Android ≤375px) --- */
    @media (max-width: 375px) {
        .mobile-nav-item span {
            font-size: 0.52rem;
        }

        .mobile-nav-item i {
            font-size: 1.1rem;
        }

        .auth-btn-text {
            display: none !important;
        }

        .auth-btn {
            padding: 0.4rem 0.5rem !important;
        }

        .hero-title {
            font-size: clamp(2.2rem, 9vw, 3.5rem) !important;
        }

        .section {
            padding: 3rem 1rem;
        }

        .calc-container {
            padding: 1rem;
        }
    }

    /* --- Улучшение форм на мобиле --- */
    .form-group input,
    .form-group textarea,
    .calc-select,
    .calc-input {
        font-size: 16px !important;
        /* Предотвращает zoom на iOS при фокусе */
    }

    /* --- Lightbox на мобиле --- */
    .lightbox-img {
        max-width: 95%;
        max-height: 70vh;
    }

    .lightbox-close {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }

    .lightbox-nav {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .lightbox-prev {
        left: 0.75rem;
    }

    .lightbox-next {
        right: 0.75rem;
    }

    /* --- Modal на мобиле --- */
    .modal-content {
        width: 95%;
        padding: 1.5rem 1rem;
        max-height: 85vh;
    }

    /* --- Галерея-фильтры на мобиле — горизонтальный скролл --- */
    .gallery-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 1.5rem 1rem 0;
        gap: 0.5rem;
        /* Скрываем скроллбар, но оставляем скролл */
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .gallery-filters::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        white-space: nowrap;
        flex-shrink: 0;
        /* Увеличиваем tap-зону */
        min-height: 40px;
    }

    /* --- Карточки услуг --- */
    .service-card {
        padding: 1.5rem;
    }

    /* --- Контактные карточки --- */
    .contact-card {
        padding: 1.5rem 1rem;
    }

    /* --- Hero scroll-indicator скрываем на мобиле --- */
    .hero-scroll {
        display: none;
    }
}

/* Скрыть кнопки входа/регистрации */
.auth-btn,
#loginBtnNav,
#logoutBtn {
    display: none !important;
}

/* ============================================================
   PERF: отключаем бесконечные анимации, вызывающие мерцание
   (логотип, кнопки, AI-виджет). Оставляем hover-эффекты.
   ============================================================ */
.logo-text {
    animation: none !important;
    background-position: 0 50% !important;
}

.logo-accent {
    animation: none !important;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.5) !important;
}

.logo-icon {
    animation: none !important;
    background-position: 0 0 !important;
}

.btn-primary {
    animation: none !important;
    background-position: 0 0 !important;
}

.btn-primary:hover {
    background-position: 100% 0 !important;
}

.btn-outline:hover {
    animation: none !important;
}

.ai-widget-btn {
    animation: none !important;
}

.ai-btn-glow::before,
.ai-btn-pulse,
[class*="aiPulse"] {
    animation: none !important;
}

.hero-title-fire,
.spark,
.fire-sparks {
    animation: none !important;
}

.scroll-line,
.hero-scroll::before {
    animation: none !important;
}

/* Пользователь отключил анимации в системе */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}