/* --- Оптимізовані шрифти --- */
@font-face {
    font-family: 'TT Firs Neue';
    src: url('fonts/TTFirsNeue-Bold.woff2') format('woff2'); /* WOFF2 пріоритетний */
    font-weight: 700;
    font-style: normal;
    font-display: swap; /* Дозволяє тексту з'явитися миттєво до завантаження шрифту */
}

@font-face {
    font-family: 'TT Firs Neue';
    src: url('fonts/TTFirsNeue-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* --- Global Config & Tailwind Restoration --- */
:root {
    --primary: #45287E;
    --primary-medium: #654993;
    --primary-light: #846ba8;
    --primary-soft: rgba(69, 40, 126, 0.05);
    --brand-beige: #ECD6B4;
    --brand-light: #FAF8F5;
    --bg-tint: rgba(69, 40, 126, 0.02);
}

/* Base style restoration with optimized rendering */
body {
    background-color: var(--bg-tint);
    color: var(--primary);
    font-family: 'TT Firs Neue', 'Manrope', sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility; /* Покращує швидкість відображення */
}

* { font-style: normal !important; }

/* Tailwind Bridge */
.text-primary { color: var(--primary); }
.bg-primary { background-color: var(--primary); }
.text-primary-medium { color: var(--primary-medium); }
.text-primary-light { color: var(--primary-light); }
.bg-primary-soft { background-color: var(--primary-soft); }
.border-primary { border-color: var(--primary); }

/* --- Utility Components --- */
.hero-gradient {
    background: linear-gradient(90deg, #FFFFFF 0%, rgba(255, 255, 255, 0.95) 40%, rgba(255, 255, 255, 0) 100%);
}

.tab-active {
    background-color: var(--primary) !important;
    color: white !important;
    box-shadow: 0 10px 15px -3px rgba(69, 40, 126, 0.3) !important;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #FAF8F5; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

/* --- Animations --- */
.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Layout Containers --- */
.catalog-scroll-container, .gallery-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 2rem;
    padding-bottom: 2rem;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    position: relative;
    z-index: 10;
}
.catalog-scroll-container::-webkit-scrollbar, .gallery-scroll-container::-webkit-scrollbar {
    display: none;
}
.catalog-card {
    flex: 0 0 100%;
    max-width: 100%;
    scroll-snap-align: start;
    pointer-events: auto;
}
.gallery-item {
    flex: 0 0 85%;
    aspect-ratio: 16/9;
    scroll-snap-align: center;
}
@media (min-width: 768px) {
    .catalog-card { flex: 0 0 calc(50% - 1rem); }
    .gallery-item { flex: 0 0 60%; }
}
@media (min-width: 1024px) {
    .catalog-card { flex: 0 0 calc(33.333% - 1.35rem); }
    .gallery-item { flex: 0 0 45%; }
}

/* --- Modals --- */
#success-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    align-items: center;
    justify-content: center;
    background-color: rgba(69, 40, 126, 0.4);
    backdrop-filter: blur(8px);
}
#success-modal.active { display: flex; }

/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* --- Infrastructure & Special Sections --- */
.benefit-video-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    opacity: 0.12;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
}
.group:hover .benefit-video-wrapper {
    opacity: 0.25;
}

@media (max-width: 640px) {
    .benefit-video-wrapper {
        opacity: 0.15;
    }
}

.shadow-premium {
    box-shadow: 0 20px 40px -15px rgba(69, 40, 126, 0.12);
}