/* COMPARE BUTTON */
/* Базовые стили для кнопки сравнения */
.co_compare_button {
    position: absolute !important;
    z-index: 10 !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    background-color: #2196f3;
    color: #ffffff;
}

.co_compare_button:hover {
    opacity: 0.8;
    text-decoration: none;
    color: #ffffff;
}

.co_compare_button.is_compare {
    background-color: #ff5722 !important;
    color: #ffffff !important;
}

.co_compare_button.is_compare:hover {
    background-color: #e64a19 !important;
}

.co_compare_button i {
    font-size: 14px;
}

.co_compare_button span {
    font-size: 13px;
}

/* BOTTOM-RIGHT - внизу справа (значение по умолчанию) */
.co_floating_compare.co_position_bottom-right {
    bottom: 20px !important;
    right: 20px !important;
}

/* ============================================
   FLOATING BUTTON - НОВЫЕ СТИЛИ
   ============================================ */
.co_floating_compare {
    position: fixed;
    z-index: 9999;
    display: flex;
    align-items: center;
    background: #2196f3;
    color: #fff;
    padding: 10px 18px;
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    animation: co_bounce 0.5s;
    cursor: pointer;
}

.co_floating_compare:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.co_floating_compare .co_float_btn {
    color: #fff !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.co_floating_compare .co_float_btn:hover {
    color: #fff !important;
    text-decoration: none !important;
}

.co_floating_compare .co_float_btn i {
    font-size: 16px;
}

.co_floating_compare .co_float_clear {
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid rgba(255,255,255,0.3);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    line-height: 1;
}

.co_floating_compare .co_float_clear:hover {
    opacity: 0.7;
}

//* ============================================
   ПЛАВАЮЩАЯ КНОПКА (FIXED)
   ============================================ */
.co_floating_compare {
    position: fixed !important;  /* <-- ГЛАВНОЕ - делаем fixed */
    z-index: 9999 !important;
    display: flex;
    align-items: center;
    background: #2196f3;
    color: #fff;
    padding: 10px 18px;
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    animation: co_bounce 0.5s;
    cursor: pointer;
    /* Убираем все transform по умолчанию */
    transform: none !important;
}

.co_floating_compare:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.co_floating_compare .co_float_btn {
    color: #fff !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.co_floating_compare .co_float_btn:hover {
    color: #fff !important;
    text-decoration: none !important;
}

.co_floating_compare .co_float_btn i {
    font-size: 16px;
}

.co_floating_compare .co_float_clear {
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid rgba(255,255,255,0.3);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    line-height: 1;
}

.co_floating_compare .co_float_clear:hover {
    opacity: 0.7;
}

/* ============================================
   ПОЗИЦИИ ПЛАВАЮЩЕЙ КНОПКИ - ВСЕ СТОРОНЫ
   ============================================ */

/* BOTTOM - внизу по центру */
.co_floating_compare.co_position_bottom {
    bottom: 30px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* TOP - вверху по центру */
.co_floating_compare.co_position_top {
    top: 30px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* LEFT - слева по центру */
.co_floating_compare.co_position_left {
    left: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    flex-direction: column;
    padding: 12px 10px;
    border-radius: 8px;
}

/* RIGHT - справа по центру */
.co_floating_compare.co_position_right {
    right: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    flex-direction: column;
    padding: 12px 10px;
    border-radius: 8px;
}

/* TOP-LEFT - вверху слева */
.co_floating_compare.co_position_top-left {
    top: 20px !important;
    left: 20px !important;
}

/* TOP-RIGHT - вверху справа */
.co_floating_compare.co_position_top-right {
    top: 20px !important;
    right: 20px !important;
}

/* BOTTOM-LEFT - внизу слева */
.co_floating_compare.co_position_bottom-left {
    bottom: 20px !important;
    left: 20px !important;
}

/* BOTTOM-RIGHT - внизу справа (по умолчанию) */
.co_floating_compare.co_position_bottom-right {
    bottom: 20px !important;
    right: 20px !important;
}

/* CENTER - по центру экрана */
.co_floating_compare.co_position_center {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

/* CENTER-TOP - по центру вверху */
.co_floating_compare.co_position_center-top {
    top: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* CENTER-BOTTOM - по центру внизу */
.co_floating_compare.co_position_center-bottom {
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* CENTER-LEFT - по центру слева */
.co_floating_compare.co_position_center-left {
    left: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    flex-direction: column;
    padding: 12px 10px;
    border-radius: 8px;
}

/* CENTER-RIGHT - по центру справа */
.co_floating_compare.co_position_center-right {
    right: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    flex-direction: column;
    padding: 12px 10px;
    border-radius: 8px;
}

/* COMPARE TABLE */
.co_compare_table_wrap {
    overflow-x: auto;
    margin: 20px 0;
}
.co_compare_table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.co_compare_table th,
.co_compare_table td {
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    text-align: center;
    vertical-align: middle;
    min-width: 120px;
}
.co_compare_table th {
    background: #f5f5f5;
    font-weight: 600;
}
.co_compare_table .co_field_name {
    background: #fafafa;
    font-weight: 600;
    text-align: left;
    min-width: 150px;
}
.co_compare_table .co_item_header {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.co_compare_table .co_item_header img {
    max-width: 80px;
    height: auto;
    margin-bottom: 8px;
    border-radius: 4px;
}
.co_compare_table .co_item_header a {
    color: #333;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.co_compare_table .co_item_header a:hover {
    color: #2196f3;
}
.co_compare_table .co_remove_item {
    cursor: pointer;
    color: #ff5722;
    margin-top: 5px;
    font-size: 14px;
}
.co_compare_table .co_remove_item:hover {
    color: #e64a19;
}

/* ACTIONS */
.co_compare_actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.co_compare_actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.co_button_continue {
    background: #2196f3;
    color: #fff;
}
.co_button_continue:hover {
    background: #1976d2;
}
.co_button_clear {
    background: #ff5722;
    color: #fff;
}
.co_button_clear:hover {
    background: #e64a19;
}

/* SAVE FORM */
.co_save_form {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.co_save_form input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}
.co_save_form .co_button_save {
    padding: 8px 20px;
    background: #4caf50;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.co_save_form .co_button_save:hover {
    background: #388e3c;
}

/* MY COMPARISONS */
.co_comparisons_list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.co_comparison_item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s;
}
.co_comparison_item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.co_comp_info h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
}
.co_comp_info p {
    margin: 5px 0;
    color: #666;
    font-size: 13px;
}
.co_comp_info .co_date {
    color: #999;
    font-size: 12px;
}
.co_comp_actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}
.co_comp_actions a {
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}
.co_btn_view {
    background: #2196f3;
    color: #fff;
}
.co_btn_view:hover {
    background: #1976d2;
    color: #fff;
}
.co_btn_delete {
    background: #ff5722;
    color: #fff;
}
.co_btn_delete:hover {
    background: #e64a19;
    color: #fff;
}

/* EMPTY MESSAGE */
.co_empty_message {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 20px 0;
}
.co_empty_message p {
    font-size: 16px;
    color: #666;
    margin: 10px 0;
}
.co_empty_message a {
    color: #2196f3;
    text-decoration: none;
    font-weight: 600;
}
.co_empty_message a:hover {
    text-decoration: underline;
}

/* MESSAGES */
#co_message {
    display: block;
    position: fixed;
    right: 20px;
    top: 20px;
    width: 280px;
    z-index: 99999999;
}
#co_message .co_simple {
    float: left;
    clear: both;
    margin-bottom: 15px;
    cursor: pointer;
    width: 280px;
    padding: 12px 10px;
    font-size: 13px;
    border: 1px solid #ccc;
    color: #444;
    line-height: 16px;
    background: #f0f0f0;
    opacity: 0.8;
}
#co_message .co_simple:hover {
    opacity: 1;
}

/* Левое выравнивание для описания */
.co_compare_table .co_description_cell {
    text-align: left !important;
    max-width: 300px;
    word-wrap: break-word;
    font-size: 13px;
    line-height: 1.5;
}

/* Стили для всех текстовых полей */
.co_compare_table td {
    text-align: center;
    vertical-align: middle;
}

.co_compare_table .co_field_name {
    text-align: left;
    font-weight: 600;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .co_floating_compare {
        padding: 8px 14px;
        font-size: 12px;
    }
    .co_floating_compare .co_float_btn {
        font-size: 12px;
    }
    .co_compare_table th,
    .co_compare_table td {
        padding: 8px 10px;
        font-size: 12px;
        min-width: 80px;
    }
    .co_compare_table .co_field_name {
        min-width: 80px;
    }
    .co_compare_table .co_item_header img {
        max-width: 50px;
    }
    .co_compare_actions {
        flex-direction: column;
    }
    .co_compare_actions button {
        width: 100%;
        justify-content: center;
    }
    .co_comparisons_list {
        grid-template-columns: 1fr;
    }
    .co_save_form {
        flex-direction: column;
    }
    .co_save_form input[type="text"] {
        width: 100%;
    }
    .co_save_form .co_button_save {
        width: 100%;
    }
    
    /* Мобильные позиции */
    .co_floating_compare.co_position_left,
    .co_floating_compare.co_position_right {
        padding: 10px 8px;
    }
    .co_floating_compare.co_position_left .co_float_btn i,
    .co_floating_compare.co_position_right .co_float_btn i {
        font-size: 16px;
    }
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .co_compare_table .co_description_cell {
        max-width: 150px;
        font-size: 12px;
    }
    
    .co_compare_table td {
        padding: 6px 8px;
        font-size: 12px;
        min-width: 60px;
    }
    
    .co_compare_table .co_field_name {
        min-width: 60px;
        font-size: 12px;
    }
}

/* Стили для читаемости */
.co_compare_table .co_description_cell {
    text-align: left !important;
    max-width: 300px;
    word-wrap: break-word;
    font-size: 13px;
    line-height: 1.6;
    color: #444;
}

/* RTL support */
html[dir="rtl"] .co_compare_table .co_field_name {
    text-align: right;
}

html[dir="rtl"] .co_compare_actions {
    direction: rtl;
}

html[dir="rtl"] .co_floating_compare .co_float_clear {
    margin-left: 0;
    margin-right: 12px;
    padding-left: 0;
    padding-right: 12px;
    border-left: none;
    border-right: 1px solid rgba(255,255,255,0.3);
}