/* ==========================================================================
   1. ГЛОБАЛЬНЫЕ НАСТРОЙКИ (ПРОТИВ ТРЯСКИ)
   ========================================================================== */
html {
    scroll-behavior: smooth;
    background: #050505;
}

body {
    width: 100%;
    overflow-x: hidden;
    position: relative;
    margin: 0;
    padding: 0;
    color: white;
    font-family: sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Убираем синее мерцание при тапе на мобилках */
* {
    -webkit-tap-highlight-color: transparent;
}

/* ==========================================================================
   2. БЕГУЩАЯ СТРОКА
   ========================================================================== */
.marquee-top { 
    background: #2563eb; 
    padding: 8px 0; 
    overflow: hidden; 
    display: flex; 
    white-space: nowrap; 
    position: relative;
    z-index: 60; 
}

.marquee-content { 
    display: inline-block; 
    animation: marquee 30s linear infinite; 
    font-size: 10px; 
    font-weight: 900; 
    text-transform: uppercase; 
    padding-right: 50px; 
}

@keyframes marquee { 
    0% { transform: translateX(0); } 
    100% { transform: translateX(-50%); } 
}

/* ==========================================================================
   3. ГРАДИЕНТЫ И ЛОГОТИПЫ
   ========================================================================== */
.gradient-text {
    background: linear-gradient(to right, #fff, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-logo-bg { 
    font-size: 18vw; 
    font-weight: 900; 
    color: rgba(255,255,255,0.02); 
    position: absolute; 
    bottom: -40px; 
    left: 0; 
    line-height: 0.8; 
    pointer-events: none; 
}

/* ==========================================================================
   4. КАРТОЧКИ (УСЛУГИ, ПРЕИМУЩЕСТВА)
   ========================================================================== */
.service-card {
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 32px; /* Красивые скругленные углы у самой карточки */
    padding: 32px 24px; /* Тот самый отступ: 32px сверху/снизу, 24px по бокам */
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.3s ease;
}
@media (min-width: 768px) {
    .service-card { border-radius: 32px; padding: 32px; }
}

.service-card:hover { 
    transform: scale(1.03); 
    border-color: #2563eb; 
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.1);
}

.card-image { 
    border-radius: 16px; 
    margin-bottom: 24px; 
    width: 100%; 
    height: auto; /* Убираем жесткую высоту, чтобы пропорции сохранялись */
    object-fit: contain; /* Картинка влезает целиком, ничего не обрезается */
    opacity: 0.7; 
    transition: 0.3s; 
}
.service-card:hover .card-image { opacity: 1; }
.card-list { list-style-type: disc; list-style-position: inside; }
.card-list li { margin-bottom: 0.5rem; }

.benefit-card { 
    border: 1px solid #f59e0b; 
    padding: 16px 20px; 
    position: relative; 
    background: transparent; 
    display: flex; 
    align-items: center; 
    gap: 16px; 
    border-radius: 8px; 
    font-size: 14px;
}

@media (min-width: 768px) {
    .benefit-card { padding: 20px 30px; font-size: 16px; gap: 20px; }
}

.benefit-card::before { 
    content: ''; 
    position: absolute; 
    top: -1px; 
    left: -1px; 
    width: 15px; 
    height: 15px; 
    border-top: 3px solid #f59e0b; 
    border-left: 3px solid #f59e0b; 
}

/* ==========================================================================
   5. ЭТАПЫ РАБОТЫ (АККОРДЕОН)
   ========================================================================== */
.step-item { border-bottom: 1px solid rgba(255,255,255,0.05); }
.step-header { cursor: pointer; transition: 0.3s; padding: 1.5rem 0; -webkit-tap-highlight-color: transparent; }
.step-content { max-height: 0; overflow: hidden; transition: max-height 0.6s ease-in-out; }
.step-item.active .step-content { max-height: 2500px; display: block !important; }
.step-item.active .step-header { color: #3b82f6; }
.step-item.active .arrow-icon { transform: rotate(180deg); color: #3b82f6; }

/* ==========================================================================
   6. КАТЕГОРИИ
   ========================================================================== */
#categoryGrid { max-height: 300px; overflow: hidden; transition: max-height 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
#categoryGrid.show-all { max-height: 3000px; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
@media (min-width: 768px) { .cat-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; } }

.cat-item { background: #0f0f0f; padding: 14px; border-radius: 12px; font-size: 10px; font-weight: 700; text-transform: uppercase; border: 1px solid #1a1a1a; text-align: center; transition: 0.3s; }
.cat-item:hover { border-color: #2563eb; color: #2563eb; }
.cat-item.hidden-cat { display: none; }
.cat-grid.show-all .cat-item.hidden-cat { display: block; }

/* ==========================================================================
   7. ПОРТФОЛИО
   ========================================================================== */
.portfolio-slider-container { touch-action: pan-y; }
#portfolio-img { transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out; will-change: opacity, transform; }
.pointer-events-auto { pointer-events: auto !important; }

/* ==========================================================================
   8. НОВОСТИ
   ========================================================================== */
.news-img { width: 100%; height: 200px; object-fit: cover; border-radius: 18px; }

/* ==========================================================================
   9. МОДАЛЬНЫЕ ОКНА И ЭФФЕКТЫ СТЕКЛА
   ========================================================================== */
.glass-modal {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

#modal { background: rgba(0,0,0,0.85); backdrop-filter: blur(12px); }
.modal-input { background: #1a1a1a; border: 1px solid #222; outline: none; transition: 0.3s; width: 100%; color: white; border-radius: 12px; padding: 16px; }
@media (min-width: 768px) { .modal-input { border-radius: 18px; padding: 20px; } }
.modal-input:focus { border-color: #2563eb; background: #222; }

/* Кастомный скроллбар */
.glass-modal::-webkit-scrollbar { width: 4px; }
@media (min-width: 768px) { .glass-modal::-webkit-scrollbar { width: 6px; } }
.glass-modal::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 10px; }

/* Анимации окон */
.animate-zoom { animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Капсула (Alert) */
.capsule-wrapper {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(25px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5) !important;
}

@keyframes capsuleMoveDown {
    0% { opacity: 0; transform: translateY(-40px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.animate-capsule-final {
    animation: capsuleMoveDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

/* Блокировка инструментов просмотра PDF (PDF.js) */
#toolbarViewer, 
#secondaryToolbar, 
#sidebarContainer {
    display: none !important;
}

/* Убираем отступ сверху, который остается после скрытия панели */
#viewerContainer {
    top: 0 !important;
}

/* Дополнительно: запрет выделения текста в просмотрщике */
#viewer {
    user-select: none;
    -webkit-user-select: none;
}
