@import url('/css/font-tt-norms-pro.css');

:root {
    --primary-color: #D91656;
    --primary-light: #FF4D87;
    --primary-dark: #B3003D;
    --secondary-color: #333333;
    --border-color: #e0e0e0;
    --text-light: #666666;
    --card-color: #F6F8FA;
    --carousel-ratio: calc(520 / 1360);
    --carousel-transition: transform 0.7s ease-out;
    }

/* ========== ОБЩИЙ КОНТЕЙНЕР ========== */
.content-container {
    width: 100%;
    max-width: 1340px;
    margin: 0 auto;
    padding: 0 10px;
    position: relative;
}

/* ========== ОПТИМИЗИРОВАННАЯ КАРУСЕЛЬ ========== */
.main-carousel-container {
    margin: 30px auto 40px;
}

.main-carousel {
    width: 100%;
    height: 0;
    padding-bottom: 38.235%;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    background: white;
    transform: translateZ(0);
    will-change: transform;
}

#mainCarousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.carousel-inner {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

/* Плавная анимация с аппаратным ускорением */
.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: var(--carousel-transition);
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.carousel-item.active {
    position: relative;
    z-index: 1;
}

/* Изображения с оптимизацией загрузки */
.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 80%;
    display: block;
    transform: translateZ(0);
    transition: transform 0.5s ease;
}

.main-carousel:hover .carousel-item img {
    transform: scale(1.03);
}

/* Градиент только для главной карусели */
.main-carousel .carousel-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, 
        rgba(0,0,0,0.9) 0%, 
        rgba(0,0,0,0.7) 15%, 
        rgba(0,0,0,0.4) 30%, 
        rgba(0,0,0,0) 60%);
    z-index: 1;
    pointer-events: none;
}

/* Контейнер для контента */
.carousel-content-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 0 40px 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Текстовые поля */
.carousel-title-container,
.carousel-description-container {
    padding: 0;
    margin: 0;
    text-align: left;
}

.carousel-title {
    font-size: clamp(1rem, 2vw, 2.2rem);
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
    color: white;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 2.8em;
    text-transform: uppercase;
}

.carousel-title a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.carousel-title a:hover {
    color: var(--primary-light);
}

.carousel-description {
    font-size: clamp(0.8rem, 1.5vw, 1.15rem);
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.5;
    margin: 0;
    font-weight: 400;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 3em;
}

/* Индикаторы - оптимизированы */
.carousel-indicators {
    position: absolute !important;
    bottom: 20px !important;
    margin: 0 !important;
    gap: 12px;
    z-index: 15;
    display: flex;
    justify-content: center;
    list-style: none;
}

.carousel-indicators button {
    width: 14px;
    height: 14px;
    border-radius: 50% !important;
    background-color: rgba(255, 255, 255, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    margin: 0;
    padding: 0;
    transition: all 0.3s ease;
    cursor: pointer;
    box-sizing: border-box;
}

.carousel-indicators button.active {
    background-color: var(--primary-color) !important;
    border-color: white !important;
    transform: scale(1.3);
}

.carousel-indicators button:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.7);
    transform: scale(1.1);
}

/* Числовой индикатор */
.carousel-slide-number {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    font-weight: 600;
    font-family: 'TT Norms Pro', sans-serif;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    pointer-events: none;
    margin-left: auto;
    display: inline-block;
}

.carousel-slide-number .current-slide {
    color: var(--primary-color);
}

/* Стрелки управления */
#mainCarousel .carousel-control-prev,
#mainCarousel .carousel-control-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mainCarousel .carousel-control-prev {
    left: 15px;
}

#mainCarousel .carousel-control-next {
    right: 15px;
}

.main-carousel:hover #mainCarousel .carousel-control-prev,
.main-carousel:hover #mainCarousel .carousel-control-next {
    opacity: 1;
}

.main-carousel:hover #mainCarousel .carousel-control-prev:hover,
.main-carousel:hover #mainCarousel .carousel-control-next:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
}

/* ========== ОСТАЛЬНЫЕ СТИЛИ (БЕЗ ИЗМЕНЕНИЙ) ========== */
#icons .content-container {
    margin: 60px auto;
}

.icon {
    text-align: left;
    padding: 30px 30px;
    border-radius: 10px;
    transition: transform 0.3s, box-shadow 0.3s;
    background: var(--card-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.icon:hover {
    box-shadow: 0 8px 20px rgba(217, 22, 86, 0.1);
}

.icon-img {
    margin-bottom: 20px;
}

.icon h3 {
    text-align: left;
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.icon h3 a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.icon h3 a:hover {
    color: var(--primary-color);
}

.icon ul {
    text-align: left;
    padding-left: 0;
}

.icon li {
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
}

.icon li a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s;
}

.icon li a:hover {
    color: var(--primary-color);
}

/* ========== НОВОСТИ ========== */
#news .content-container {
    margin: 60px auto;
}

.news-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--card-color);
    animation: cardAppear 0.4s ease-out;
    width: 100%;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.news-image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    height: 200px;
    background: var(--card-color);
}

.news-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    animation: fadeInImage 0.3s ease forwards;
}

.news-card:hover .news-card-img {
    transform: scale(1.05);
}

.news-card-img.no-image {
    object-fit: contain;
    opacity: 0.7;
    padding: 20px;
    background: #f8f9fa;
}

.news-date-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--secondary-color);
    border-radius: 6px;
    padding: 4px 8px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.3);
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-date-badge .badge-date {
    display: block;
    font-size: 0.75rem;
    line-height: 1.2;
}

.news-card .card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.news-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    color: var(--secondary-color);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.news-title a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s;
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.news-title a:hover {
    color: var(--primary-color);
}

.news-excerpt {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 15px;
    flex-grow: 1;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.news-read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    font-size: 0.9rem;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.news-read-more:hover {
    color: var(--primary-dark);
}

.news-read-more .fa-arrow-right {
    margin-left: 5px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

#news h2,
#feedback-carousel-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--primary-color) !important;
}

#news .btn-outline-primary,
#feedback-carousel-section .btn-outline-primary {
    background: white;
    color: var(--primary-color);
    padding: 16px 28px;
    border-radius: 32px;
    text-decoration: none;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    white-space: nowrap;
    min-width: 220px;
    height: 60px;
    font-family: 'TT Norms Pro', sans-serif;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
}

#news .btn-outline-primary:hover,
#feedback-carousel-section .btn-outline-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

/* Анимации */
@keyframes fadeInImage {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.news-card:nth-child(2) {
    animation-delay: 0.1s;
}

.news-card:nth-child(3) {
    animation-delay: 0.2s;
}

/* ========== АККОРДЕОН ========== */
#faq {
    margin: 60px auto;
}

#faq h2 {
    font-size: 2.7rem;
    font-weight: 700;
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--primary-color) !important;
}

.accordion {
    border-radius: 12px;
    overflow: visible;
    box-shadow: none;
    border: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.accordion-item {
    background-color: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.accordion-button {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--secondary-color);
    background-color: var(--card-color);
    padding: 25px 30px;
    border: none;
    box-shadow: none;
    position: relative;
    transition: all 0.3s ease;
    line-height: 1.5;
    border-radius: 10px 10px 0 0;
}

.accordion-button:not(.collapsed) {
    color: var(--primary-color);
    background-color: white;
    box-shadow: none;
    border-bottom: 1px solid var(--border-color);
}

.accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}

.accordion-question {
    display: block;
    padding-right: 50px;
    line-height: 1.5;
}

.accordion-button::after {
    background-image: none !important;
    content: '+';
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 25px;
    top: 0;
    bottom: 0;
    margin: auto 0;
    font-size: 2.7rem;
    font-weight: 400;
    color: var(--primary-color);
    transition: all 0.3s ease;
    background-color: rgba(217, 22, 86, 0.1);
    border-radius: 50%;
    line-height: 1;
}

.accordion-button:not(.collapsed)::after {
    content: '−';
    color: var(--primary-color);
    background-color: rgba(217, 22, 86, 0.15);
}

.accordion-button:hover {
    background-color: rgba(217, 22, 86, 0.03);
}

.accordion-button:hover::after {
    background-color: rgba(217, 22, 86, 0.15);
}

.accordion-collapse {
    background-color: white;
}

.accordion-body {
    padding: 25px 30px;
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--text-light);
    background-color: white;
    border-radius: 0 0 10px 10px;
}

.accordion-body p:last-child {
    margin-bottom: 0;
}

/* ========== КАРУСЕЛЬ ОТЗЫВОВ ========== */
#feedback-carousel-section .content-container {
    margin: 60px auto;
}

.feedback-carousel-container {
    position: relative;
}

#feedbackCarousel .carousel-control-prev,
#feedbackCarousel .carousel-control-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

#feedbackCarousel .carousel-control-prev {
    left: 15px;
}

#feedbackCarousel .carousel-control-next {
    right: 15px;
}

.feedback-carousel-container:hover #feedbackCarousel .carousel-control-prev,
.feedback-carousel-container:hover #feedbackCarousel .carousel-control-next {
    opacity: 1;
}

.feedback-carousel-container:hover #feedbackCarousel .carousel-control-prev:hover,
.feedback-carousel-container:hover #feedbackCarousel .carousel-control-next:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
}

.feedback-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--card-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    height: 100%;
    min-height: 280px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.feedback-card-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}

.feedback-text-area {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.feedback-text-container {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

.feedback-text {
    color: var(--secondary-color);
    margin: 0;
    padding: 0;
    font-style: normal;
    text-align: left;
    line-height: 1.5;
    font-size: clamp(0.625rem, 1.5vw, 1.125rem);
    width: 100%;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.read-more-placeholder {
    color: var(--primary-light);
    font-weight: 600;
    cursor: default;
    pointer-events: none;
    display: inline;
}

.feedback-author-area {
    flex-shrink: 0;
    padding-top: 15px;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.feedback-author-area h5 {
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(0.75rem, 1.2vw, 1rem);
}

.feedback-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text-light);
}

.feedback-city,
.feedback-period {
    display: flex;
    align-items: center;
    line-height: 1.3;
}

.feedback-city span,
.feedback-period span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.feedback-city i,
.feedback-period i {
    color: var(--primary-color);
    width: 14px;
    flex-shrink: 0;
    margin-right: 6px;
    font-size: clamp(0.6rem, 0.9vw, 0.8rem);
}

/* Адаптивность */
@media (max-width: 1400px) {
    .carousel-content-container {
        padding: 0 30px 25px;
    }
    
    .carousel-indicators {
        gap: 10px;
    }
    
    .carousel-indicators button {
        width: 12px;
        height: 12px;
    }
    
    .feedback-card {
        min-height: 260px;
    }
}

@media (max-width: 1200px) {
    .carousel-content-container {
        padding: 0 25px 20px;
    }
    
    #mainCarousel .carousel-control-prev,
    #mainCarousel .carousel-control-next {
        width: 45px;
        height: 45px;
    }
    
    .news-image-container {
        height: 180px;
    }
    
    .feedback-card {
        min-height: 240px;
    }
}

@media (max-width: 992px) {
    .main-carousel-container {
        margin: 20px auto 30px;
    }
    
    .carousel-content-container {
        padding: 0 20px 15px;
    }
    
    #mainCarousel .carousel-control-prev,
    #mainCarousel .carousel-control-next {
        width: 40px;
        height: 40px;
    }
    
    .carousel-indicators {
        bottom: 15px !important;
        gap: 8px;
    }
    
    .carousel-indicators button {
        width: 10px;
        height: 10px;
        border-width: 1.5px;
    }
    
    .carousel-slide-number {
        font-size: 0.9rem;
        padding: 5px 10px;
    }
    
    #news h2,
    #feedback-carousel-section h2 {
        font-size: 1.6rem;
    }
    
    .news-image-container {
        height: 170px;
    }
    
    .feedback-card {
        min-height: 220px;
    }
}

@media (max-width: 768px) {
    .main-carousel {
        padding-bottom: 50%;
    }
    
    .carousel-content-container {
        padding: 0 15px 10px;
    }
    
    #mainCarousel .carousel-control-prev,
    #mainCarousel .carousel-control-next {
        width: 35px;
        height: 35px;
        opacity: 0.7;
    }
    
    .carousel-indicators {
        bottom: 10px !important;
        gap: 6px;
    }
    
    .carousel-indicators button {
        width: 8px;
        height: 8px;
    }
    
    .carousel-slide-number {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    
    .news-card {
        max-width: 350px;
        margin: 0 auto;
    }
    
    #news h2,
    #feedback-carousel-section h2 {
        font-size: 1.5rem;
    }
    
    .news-image-container {
        height: 180px;
    }
    
    .feedback-card {
        min-height: 200px;
    }
}

@media (max-width: 576px) {
    .main-carousel {
        padding-bottom: 60%;
    }
    
    .carousel-content-container {
        padding: 0 10px 8px;
    }
    
    #mainCarousel .carousel-control-prev,
    #mainCarousel .carousel-control-next {
        width: 30px;
        height: 30px;
    }
    
    .carousel-indicators {
        bottom: 5px !important;
        gap: 4px;
    }
    
    .carousel-indicators button {
        width: 6px;
        height: 6px;
        border-width: 1px;
    }
    
    .carousel-slide-number {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
    
    .news-card .card-body {
        padding: 15px;
    }
    
    .news-title {
        font-size: 1rem;
    }
    
    #news h2,
    #feedback-carousel-section h2 {
        font-size: 1.4rem;
    }
    
    .news-image-container {
        height: 160px;
    }
    
    .feedback-card {
        min-height: 180px;
    }
}

@media (max-width: 400px) {
    .main-carousel {
        padding-bottom: 70%;
    }
    
    .carousel-indicators {
        display: none !important;
    }
    
    .carousel-slide-number {
        font-size: 0.6rem;
        padding: 2px 4px;
    }
}

/* Доступность */
#mainCarousel .carousel-control-prev:focus,
#mainCarousel .carousel-control-next:focus,
.carousel-indicators button:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

#mainCarousel .carousel-control-prev:active,
#mainCarousel .carousel-control-next:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-indicators button:active {
    transform: scale(0.9);
}

@media (max-width: 768px) {
    .carousel-inner {
        touch-action: pan-y pinch-zoom;
    }
}