/* ===== FICHI PLATES - СТИЛИ ===== */

/* Контейнер с плашками */
.fichi-plates-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

/* На мобильных - горизонтальный скролл */
@media (max-width: 768px) {
    .fichi-plates-container {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 8px 0;
        margin: 10px -10px;
        padding-left: 10px;
        padding-right: 10px;
        scrollbar-width: none;
    }
    
    .fichi-plates-container::-webkit-scrollbar {
        display: none;
    }
}

/* Плашка - ОСНОВНОЙ СТИЛЬ */
.fichi-plate {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #FFD700;
    color: #000000;
    padding: 10px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: default;
    white-space: nowrap;
    user-select: none;
    flex-shrink: 0;
    transition: all 0.2s;
    position: relative;
}

/* Плашка с видео */
.fichi-plate.fichi-video {
    cursor: pointer;
    padding-right: 42px;
}

.fichi-plate.fichi-video:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: #FFE44D;
}

/* Плашка со ссылкой */
.fichi-plate.fichi-link {
    cursor: pointer;
    padding-right: 40px;
}

.fichi-plate.fichi-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: #FFE44D;
}

/* Иконка галочки */
.fichi-check-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #000000;
    color: #FFD700;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

/* Цвет галочки для видео */
.fichi-video .fichi-check-icon {
    background: #FF0000;
}

/* Цвет галочки для ссылки */
.fichi-link .fichi-check-icon {
    background: #2196F3;
    color: white;
}

/* Иконка внутри галочки для видео */
.fichi-video .fichi-check-icon svg {
    width: 10px;
    height: 10px;
}

/* Текст плашки */
.fichi-text {
    flex: 1;
    font-weight: 700;
}

/* Иконка YouTube - КРАСНАЯ как на YouTube */
.fichi-youtube-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: #FF0000;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fichi-youtube-icon svg {
    width: 14px;
    height: 14px;
    fill: white;
}

/* Иконка ссылки */
.fichi-link-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    background: #2196F3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fichi-link-icon svg {
    width: 12px;
    height: 12px;
    fill: white;
}

/* ===== МОДАЛЬНОЕ ОКНО ===== */
.fichi-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.fichi-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.fichi-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    animation: fichiModalAppear 0.3s ease;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
}

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

/* Заголовок модального окна */
.fichi-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 26px;
    border-bottom: 1px solid #f0f0f0;
    background: white;
}

.fichi-modal-title {
    font-size: 20px;
    font-weight: 800;
    color: #333;
    display: flex;
    align-items: center;
    gap: 12px;
}

.fichi-modal-title svg {
    width: 24px;
    height: 24px;
    fill: #FF0000;
    flex-shrink: 0;
}

.fichi-close-modal {
    background: #f8f9fa;
    border: none;
    font-size: 32px;
    color: #666;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    line-height: 1;
    flex-shrink: 0;
}

.fichi-close-modal:hover {
    background: #e9ecef;
    color: #000;
}

/* Тело модального окна */
.fichi-modal-body {
    padding: 0;
}

/* Контейнер для видео */
.fichi-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
}

/* Футер модального окна - ЖЕЛТАЯ КНОПКА "ПОДРОБНЕЕ" */
.fichi-modal-footer {
    padding: 24px 26px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
    background: #fafafa;
}

.fichi-details-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #000000;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    padding: 14px 28px;
    border-radius: 50px;
    background: #FFD700;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

/* Эффект свечения при наведении */
.fichi-details-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s ease;
}

.fichi-details-link:hover::before {
    left: 100%;
}

.fichi-details-link:hover {
    background: #FFE44D;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
    border-color: rgba(0,0,0,0.1);
}

.fichi-details-link:active {
    transform: translateY(-1px);
}

.fichi-details-link svg {
    fill: #000000;
    width: 20px;
    height: 20px;
    transition: transform 0.3s;
}

.fichi-details-link:hover svg {
    transform: translateX(4px);
}

.fichi-details-link span {
    position: relative;
    z-index: 1;
    font-weight: 800;
}

/* ===== АДАПТИВНОСТЬ ===== */

/* Планшеты */
@media (max-width: 1024px) {
    .fichi-plates-container {
        gap: 10px;
        margin: 18px 0;
    }
    
    .fichi-plate {
        padding: 11px 18px;
        font-size: 14.5px;
    }
    
    .fichi-modal-content {
        max-width: 95%;
    }
    
    .fichi-video-container {
        min-height: 450px;
    }
}

/* Мобильные устройства */
@media (max-width: 768px) {
    .fichi-plates-container {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 10px 0;
        margin: 15px -15px;
        padding-left: 15px;
        padding-right: 15px;
        scrollbar-width: none;
    }
    
    .fichi-plates-container::-webkit-scrollbar {
        display: none;
    }
    
    .fichi-plate {
        padding: 10px 18px;
        font-size: 14px;
        min-width: max-content;
    }
    
    .fichi-video {
        padding-right: 48px;
    }
    
    .fichi-link {
        padding-right: 44px;
    }
    
    .fichi-check-icon {
        width: 22px;
        height: 22px;
        font-size: 12px;
    }
    
    .fichi-video .fichi-check-icon svg {
        width: 11px;
        height: 11px;
    }
    
    .fichi-youtube-icon {
        width: 26px;
        height: 26px;
        right: 14px;
    }
    
    .fichi-youtube-icon svg {
        width: 15px;
        height: 15px;
    }
    
    .fichi-link-icon {
        width: 24px;
        height: 24px;
        right: 14px;
    }
    
    .fichi-link-icon svg {
        width: 13px;
        height: 13px;
    }
    
    .fichi-modal-overlay {
        padding: 10px;
    }
    
    .fichi-modal-content {
        max-width: 100%;
        margin: 0;
        border-radius: 12px;
    }
    
    .fichi-modal-header {
        padding: 18px 22px;
    }
    
    .fichi-modal-title {
        font-size: 18px;
        gap: 10px;
    }
    
    .fichi-modal-title svg {
        width: 22px;
        height: 22px;
    }
    
    .fichi-close-modal {
        width: 36px;
        height: 36px;
        font-size: 28px;
    }
    
    .fichi-modal-footer {
        padding: 20px 22px;
    }
    
    .fichi-details-link {
        padding: 12px 24px;
        font-size: 15px;
        gap: 10px;
    }
    
    .fichi-details-link svg {
        width: 18px;
        height: 18px;
    }
}

/* Маленькие мобильные */
@media (max-width: 480px) {
    .fichi-plates-container {
        margin: 12px -10px;
        padding-left: 10px;
        padding-right: 10px;
        gap: 8px;
    }
    
    .fichi-plate {
        padding: 9px 16px;
        font-size: 13.5px;
    }
    
    .fichi-video {
        padding-right: 44px;
    }
    
    .fichi-link {
        padding-right: 40px;
    }
    
    .fichi-check-icon {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }
    
    .fichi-video .fichi-check-icon svg {
        width: 10px;
        height: 10px;
    }
    
    .fichi-youtube-icon {
        width: 24px;
        height: 24px;
        right: 12px;
    }
    
    .fichi-youtube-icon svg {
        width: 14px;
        height: 14px;
    }
    
    .fichi-link-icon {
        width: 22px;
        height: 22px;
        right: 12px;
    }
    
    .fichi-link-icon svg {
        width: 12px;
        height: 12px;
    }
    
    .fichi-modal-overlay {
        padding: 5px;
    }
    
    .fichi-modal-content {
        max-height: 95vh;
        border-radius: 10px;
    }
    
    .fichi-modal-header {
        padding: 16px 20px;
    }
    
    .fichi-modal-title {
        font-size: 17px;
        gap: 10px;
    }
    
    .fichi-modal-title svg {
        width: 20px;
        height: 20px;
    }
    
    .fichi-close-modal {
        width: 34px;
        height: 34px;
        font-size: 26px;
    }
    
    .fichi-modal-footer {
        padding: 18px 20px;
    }
    
    .fichi-details-link {
        padding: 10px 20px;
        font-size: 14px;
        gap: 8px;
    }
    
    .fichi-details-link svg {
        width: 16px;
        height: 16px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
    .fichi-plate {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .fichi-video {
        padding-right: 40px;
    }
    
    .fichi-link {
        padding-right: 36px;
    }
    
    .fichi-check-icon {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    .fichi-video .fichi-check-icon svg {
        width: 9px;
        height: 9px;
    }
    
    .fichi-youtube-icon {
        width: 22px;
        height: 22px;
    }
    
    .fichi-youtube-icon svg {
        width: 13px;
        height: 13px;
    }
    
    .fichi-link-icon {
        width: 20px;
        height: 20px;
    }
    
    .fichi-link-icon svg {
        width: 11px;
        height: 11px;
    }
}

/* Минимальные улучшения для UX */
.fichi-plate:active {
    transform: translateY(0);
}

.fichi-video .fichi-youtube-icon,
.fichi-link .fichi-link-icon {
    transition: transform 0.2s;
}

.fichi-video:hover .fichi-youtube-icon {
    transform: translateY(-50%) scale(1.1);
}

.fichi-link:hover .fichi-link-icon {
    transform: translateY(-50%) scale(1.1);
}
/* ===== FIXES FOR CLS (Cumulative Layout Shift) ===== */

/* Резервируем место для контейнера фичей */
.product-fichi-horizontal {
    min-height: 80px !important; /* Важно для предотвращения прыжков */
    position: relative;
    margin-top: 15px;
    overflow: hidden;
}

/* Для мобильных - больше места */
@media (max-width: 768px) {
    .product-fichi-horizontal {
        min-height: 100px !important;
    }
}

/* Резервируем место для плашек */
.fichi-plates-container {
    min-height: 50px !important;
    position: relative;
}

/* Резервируем место для кредитного калькулятора в блоке цен */
.prices {
    min-height: 150px !important;
    position: relative;
}

.credit-calculator-wrapper,
.mvelo-credit-calculator {
    min-height: 50px !important;
    position: relative;
}

/* Фиксируем размеры для карусели чтобы не прыгала */
.product-detail-carousel {
    min-height: 400px !important;
    position: relative;
}

.product-detail-carousel__carousel .preview-wrap {
    aspect-ratio: 1/1;
    position: relative;
    overflow: hidden;
}

/* Фиксируем размеры изображений */
.product-detail-carousel__carousel img.lazyload,
.product-detail-carousel__carousel img.preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
}