:root
{
    --btn-bg-color-active:#e63946;
}

/* ========================================
   OFFER CARD COMPONENT
   ======================================== */

.offer-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin: 25px auto 20px auto; /* Центрирование */
    width: 80%; /* Ширина 80% */
    max-width: 1200px; /* Максимальная ширина */
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.offer-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* --- ТЕЛО КАРТОЧКИ (flex layout) --- */
div.offer-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 20px;
    padding-top: 20px;
    gap: 24px;
}

/* --- БРЕНД (левая часть) --- */
div.offer-card-brand {
    display: flex;
    gap: 16px;
    width: 30%;
    min-width: 280px;
}

.offer-card-logo {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    min-width: 80px;
    max-width: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f7fa;
}

.offer-card-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: transparent;
}

.offer-card-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    flex: 1;
}

.offer-card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.offer-card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a2e;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-width: 100%;
}

.offer-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.offer-card-title a:hover {
    color: #e63946;
}

.offer-card-verified {
    color: #007bff;
    font-size: 16px;
}

.offer-card-product-type {
    font-size: 14px;
    color: #6c757d;
    font-weight: 400;
}

/* Рейтинг оффера */
.offer-card-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.offer-card-rating i {
    color: #ffc107;
    font-size: 16px;
}

.offer-card-rating strong {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

/* Рейтинг банка */
.offer-card-bank-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 14px;
    color: #6c757d;
}

.offer-card-bank-rating i {
    color: #e63946;
    font-size: 16px;
}

.offer-card-bank-rating strong {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.offer-card-bank-rating span {
    font-size: 13px;
    color: #6c757d;
}


/* --- ПАРАМЕТРЫ (центральная часть) --- */
.offer-card-params {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    align-content: start;
    flex: 1;
}

.offer-card-param {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: calc((100% - 24px * 3) / 4);
    min-width: 140px; /* Минимальная ширина, чтобы не сжимались слишком сильно */
    overflow: hidden;
}

.offer-card-param-label {
    font-size: 13px;
    color: #6c757d;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.offer-card-param-value {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}



.offer-card-param-info {
    color: #adb5bd;
    cursor: help;
    font-size: 14px;
}

.offer-card-param-info:hover {
    color: #6c757d;
}

.offer-card-param-value {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* --- ДЕЙСТВИЯ (правая часть) --- */
.offer-card-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center; /* ← центрируем кнопки по горизонтали */
    justify-content: center; /* ← центрируем по вертикали */
    min-width: 200px;
}

.offer-card-btn {
    display: block;
    width: 100%;
    padding: 12px 0px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.offer-card-btn-primary {
    background: #e63946;
    color: #ffffff;
}

.offer-card-btn-primary:hover {
    background: #c1121f;
    transform: scale(1.02);
}

.offer-card-btn-primary:active {
    transform: scale(0.98);
}

.offer-card-btn-secondary {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.offer-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #e63946;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s;
}

.offer-card-link:hover {
    color: #c1121f;
}

.offer-card-link i {
    font-size: 16px;
}

/* --- ТЕГИ (нижняя часть) --- */
.offer-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.offer-card-tags span,
.offer-card-tags a {
    display: inline-block;
    padding: 6px 14px;
    background: #fff0f3;
    color: #e63946;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.offer-card-tags a:hover,
.offer-card-tags span:hover {
    background: #e63946;
    color: #ffffff;
}

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

@media (max-width: 1024px) {
    div.offer-card-body {
        flex-wrap: wrap;
    }
    
    div.offer-card-brand {
        width: 100%;
        min-width: auto;
    }
    
    .offer-card-params {
        width: 100%;
    }
    
    .offer-card-actions {
        width: 100%;
        flex-direction: row;
        align-items: center;
    }
    
    .offer-card-btn-primary {
        width: auto;
        flex: 1;
    }
    
    .offer-card-btn-secondary {
        flex: 1;
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .offer-card {
        padding: 20px;
    }
    
    div.offer-card-body {
        flex-direction: column;
        padding-right: 0;
    }
    
    div.offer-card-brand {
        flex-direction: row;
        width: 100%;
    }
    
    .offer-card-params {
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
    }
    
    .offer-card-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .offer-card-btn-primary {
        width: 100%;
    }
    
    .offer-card-btn-secondary {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .offer-card {
        padding: 16px;
    }
    
    div.offer-card-brand {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .offer-card-params {
        grid-template-columns: 1fr;
    }
    
    .offer-card-param-label,
    .offer-card-param-value {
        white-space: normal;
        word-break: break-word;
    }
    
    .offer-card-tags {
        justify-content: center;
    }
}

/* ========================================
   СОСТОЯНИЕ КНОПКИ "СРАВНИТЬ"
   ======================================== */

.offer-card-compare-btn.is-active {
    color: #e63946;
    font-weight: 600;
}

.offer-card-compare-btn.is-active i {
    color: #e63946;
}

/* ========================================
   УВЕДОМЛЕНИЯ
   ======================================== */

.offer-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 24px;
    background: #1a1a2e;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
    pointer-events: none;
}

.offer-notification.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.offer-notification--success {
    background: #2d6a4f;
}

.offer-notification--info {
    background: #457b9d;
}

/* ========================================
   ТУЛТИП
   ======================================== */

.offer-tooltip {
    position: absolute;
    padding: 8px 12px;
    background: #1a1a2e;
    color: #ffffff;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 9998;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.offer-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1a1a2e;
}

/* Исправляем структуру карточки */
div.offer-card-body {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px;
    padding-right: 0;
    padding-top: 20px;
}

/* Левая часть - бренд */
div.offer-card-brand {
    width: 30%;
    min-width: 280px;
    flex-shrink: 0;
}

/* Центральная часть - параметры */
.offer-card-params {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 20px;
    flex: 1;
    min-width: 0;
}

.offer-card-param {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: calc(32% - 15px);
    min-width: 140px;
}

/* Правая часть - кнопки */
.offer-card-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
    min-width: 200px;
}

/* Рейтинг банка */
div.offer-card-bank-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

div.offer-card-bank-rating > i.bi.bi-star-fill {
    color: #e63946;
    font-size: 16px;
}

/* Адаптивность */
@media (max-width: 1024px) {
    div.offer-card-brand {
        width: 100%;
        min-width: auto;
    }
    
    .offer-card-params {
        width: 100%;
    }
    
    .offer-card-actions {
        width: 100%;
        flex-direction: row;
    }
}

@media (max-width: 768px) {
    div.offer-card-body {
        flex-direction: column;
    }
    
    div.offer-card-brand {
        width: 100%;
    }
    
    .offer-card-params {
        width: 100%;
    }
    
    .offer-card-param {
        width: calc(50% - 10px);
    }
    
    .offer-card-actions {
        width: 100%;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .offer-card-param {
        width: 100%;
    }
}

div.offer-card-btn-secondary > a, 
div.offer-card-btn-secondary > button
{
    border: 1px solid var(--btn-bg-color-active);
    border-radius: 8px;
    padding: 1px 6px 1px 6px;
    text-decoration: none;
    color: var(--btn-bg-color-active);
}

div.offer-card-btn-secondary > a:hover,
div.offer-card-btn-secondary > button:hover
{
    color: white;
    background-color: var(--btn-bg-color-active);
    border: 1px solid var(--btn-bg-color-active);
}
