/* Сброс стилей и базовые настройки */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #8a2be2, #9370db, #d8bfd8);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Обертка для всего сайта с тенями */
.wrapper {
    width: 100%;
    max-width: 1024px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: white;
    box-shadow: 
        0 0 30px rgba(138, 43, 226, 0.4),
        0 0 60px rgba(147, 112, 219, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-left: 1px solid rgba(138, 43, 226, 0.2);
    border-right: 1px solid rgba(138, 43, 226, 0.2);
}

/* Стили для меню (Joomla) */
.menu {
    background-color: #8a2be2;
    height: 80px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 100;
}

.menu-container {
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Навигационные ссылки для Joomla */
.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.nav-links .nav-item {
    position: relative;
}

.nav-links .nav-item a {
    color: white !important;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    padding: 10px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links .nav-item a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Стили для текущего и активного пунктов меню */
.nav-links .nav-item.current a,
.nav-links .nav-item.active a {
    background-color: rgba(255, 255, 255, 0.15);
    font-weight: 700;
}

/* Выпадающие меню (подменю) */
.nav-links .mod-menu__sub {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #8a2be2;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    border-radius: 0 0 5px 5px;
    padding: 10px 0;
}

.nav-links .nav-item.parent:hover .mod-menu__sub,
.nav-links .nav-item.parent:focus-within .mod-menu__sub {
    display: block;
}

.nav-links .mod-menu__sub .nav-item {
    width: 100%;
}

.nav-links .mod-menu__sub .nav-item a {
    padding: 12px 20px;
    border-radius: 0;
    display: block;
}

.nav-links .mod-menu__sub .nav-item a:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

/* Кнопка мобильного меню */
.mobile-menu-btn {
    display: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 101;
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
}

/* Стили для шапки */
.header {
    width: 100%;
    height: 490px;
    background-color: white;
    background-image: url('/media/templates/site/cassiopeia/images/header.avif');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
  position: relative;
}

/* Градиентная маска для плавного перехода */
.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 1) 100%);
    pointer-events: none;
}

/* Стили для основного контента */
.content {
    flex: 1;
    background-color: white;
    padding: 40px 0;
}

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

.content h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 32px;
}

.content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 16px;
}

/* Секция с особенностями */
.features {
    display: flex;
    justify-content: space-between;
    margin: 40px 0;
    gap: 20px;
}

.feature {
    flex: 1;
    text-align: center;
    padding: 25px 15px;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateY(-10px);
}

.feature i {
    font-size: 40px;
    color: #8a2be2;
    margin-bottom: 15px;
}

.feature h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 20px;
}

.feature p {
    color: #666;
    font-size: 14px;
}

/* Текстовый блок */
.text-block {
    background-color: #f9f9f9;
    padding: 30px;
    border-radius: 10px;
    margin-top: 40px;
    border-left: 5px solid #8a2be2;
}

.text-block h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 24px;
}

/* Стили для подвала */
.footer {
    width: 100%;
    height: 356px;
    background-color: white;
    background-image: url('/media/templates/site/cassiopeia/images/footer.avif');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
   position: relative;
}

/* Градиентная маска для плавного перехода в подвале */
.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to top, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 1) 100%);
    pointer-events: none;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 1024px) {
    .wrapper {
        width: 100%;
        max-width: 100%;
    }
    
    .header {
        height: calc(644px * 0.8);
    }
    
    .footer {
        height: calc(356px * 0.8);
    }
}

@media (max-width: 768px) {
    .menu {
        height: 70px;
    }
    
    .mobile-menu-btn {
        display: flex !important; /* Важно: используем !important чтобы перекрыть display: none */
    }
    
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: #8a2be2;
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        gap: 10px;
        display: none !important; /* Важно: скрываем по умолчанию */
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 99;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    
    .nav-links.active {
        display: flex !important; /* Важно: показываем когда активно */
    }
    
    .nav-links .nav-item {
        width: 100%;
    }
    
    .nav-links .nav-item a {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 15px;
    }
    
    /* Подменю для мобильных */
    .nav-links .mod-menu__sub {
        position: static;
        display: none;
        background-color: rgba(255, 255, 255, 0.1);
        box-shadow: none;
        margin-top: 10px;
        padding-left: 20px;
    }
    
    .nav-links .nav-item.parent .mod-menu__sub.active {
        display: block;
    }
    
    .header {
        height: 370px;
    }
    
    .features {
        flex-direction: column;
    }
    
    .feature {
        margin-bottom: 20px;
    }
    
    .footer {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .header {
        height: 215px;
    }
    
    .footer {
        height: 150px;
    }
    
    .content {
        padding: 20px 0;
    }
    
    .content-container {
        padding: 0 15px;
    }
    
    .content h1 {
        font-size: 26px;
    }
    
    .text-block {
        padding: 20px;
    }
}