/* ========================================== 
 * OFFER CARD CSS - ФИНАЛЬНАЯ ВЕРСИЯ
 * Стили для карточки оффера на странице детального просмотра
 * Версия: 1.2 (с системой лайк/дизлайк)
 * ========================================== */

/* ========================================== 
 * HERO SECTION - ОСНОВНАЯ КАРТОЧКА
 * ========================================== */

.offer-header {
    margin-bottom: 25px;
}

.offer-card {
    background: var(--nd-surface);
    border-radius: 14px;
    padding: 25px 30px;
    box-shadow: 0 4px 18px $117,24,23, .05);
    border: 1px solid var(--nd-line);
    transition: box-shadow 0.18s ease;
}

.offer-card:hover {
    box-shadow: 0 10px 28px $117,24,23, .08);
}

.offer-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* ========================================== 
 * ЛЕВАЯ ЧАСТЬ: ЛОГОТИП + ИНФОРМАЦИЯ
 * ========================================== */

.offer-main-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 0;
}

/* Логотип */
.logo-container {
    background: var(--nd-surface);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    max-width: 100px;
    height: 80px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.logo-container:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.offer-logo {
    max-width: 90px;
    max-height: 55px;
    height: auto;
    width: auto;
    object-fit: contain;
    display: block;
}

/* Текстовая информация */
.offer-text {
    flex: 1;
    min-width: 0;
}

.offer-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--nd-graphite-950);
    margin-bottom: 5px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.offer-slogan {
    color: var(--nd-text-muted);
    font-size: 0.85rem;
    margin-bottom: 6px;
    line-height: 1.3;
}

/* Рейтинг */
.offer-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.rating-stars {
    color: #FFB800 !important;
    font-size: 15px !important;
    letter-spacing: 1px;
}

.rating-value {
    color: var(--nd-graphite-950);
    font-weight: 600;
    font-size: 13px;
}

.rating-count {
    color: #8f9c97;
    font-size: 12px;
}

/* ========================================== 
 * ПРАВАЯ ЧАСТЬ: МЕТА-ИНФОРМАЦИЯ + КНОПКИ
 * ========================================== */

.offer-info-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 380px;
    flex-shrink: 0;
}

/* Мета-информация (Телефон, Сайт, Лицензия) */
.offer-meta-info {
    display: flex;
    gap: 15px;
    padding: 10px 0;
    border-top: 1px solid var(--nd-line);
    border-bottom: 1px solid var(--nd-line);
}

.meta-item {
    flex: 1;
    min-width: 0;
}

.meta-label {
    font-size: 10px;
    color: #8f9c97;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.meta-value {
    font-size: 12px;
    color: var(--nd-graphite-950);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meta-value a {
    color: #0A6347;
    text-decoration: none;
    transition: color 0.2s ease;
}

.meta-value a:hover {
    color: #063B2B;
    text-decoration: underline;
}

/* ========================================== 
 * КНОПКИ ДЕЙСТВИЙ
 * ========================================== */

.offer-actions {
    display: flex;
    gap: 8px;
}

/* Основная кнопка "Взять займ" */
.btn.btn-get-money {
    flex: 1.5;
    padding: 13px 20px;
    background: #0D7654;
    color: white;
    font-size: 14px;
    font-weight: 700;
    border-radius: 9px;
    box-shadow: 0 6px 16px rgba(32, 151, 90, .22);
    transition: background 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
    text-decoration: none;
    border: none;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn.btn-get-money:hover {
    background: #07513A;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(32, 151, 90, .28);
    color: white;
}

.btn.btn-get-money:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(32, 151, 90, .22);
}

/* Вторичная кнопка "Написать отзыв" */
.btn.btn-review {
    flex: 1;
    padding: 13px 16px;
    background: var(--nd-surface);
    color: #3a4643;
    font-size: 13px;
    font-weight: 600;
    border-radius: 9px;
    border: 1px solid #dde7e3;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn.btn-review:hover {
    background: #eef3f1;
    border-color: #0D7654;
    color: #07513A;
}

.btn.btn-review:active {
    transform: translateY(0);
}

/* ========================================== 
 * СИСТЕМА ЛАЙК/ДИЗЛАЙК
 * ========================================== */

.vote-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.vote-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #dde7e3;
    background: var(--nd-surface);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
    font-size: 14px;
}

.vote-btn:hover {
    box-shadow: 0 4px 12px $117,24,23, .06);
}

.vote-btn .icon {
    font-size: 18px;
}

.vote-btn .count {
    font-weight: 600;
    color: #7c8a85;
}

.vote-btn.like-btn:hover {
    border-color: #0D7654;
    background: #eef3f1;
}

.vote-btn.like-btn.active {
    border-color: #07513A;
    background: #07513A;
    color: white;
}

.vote-btn.like-btn.active .count {
    color: white;
}

.vote-btn.dislike-btn:hover {
    border-color: #D94B4B;
    background: #FEF2F2;
}

.vote-btn.dislike-btn.active {
    border-color: #D94B4B;
    background: #D94B4B;
    color: white;
}

.vote-btn.dislike-btn.active .count {
    color: white;
}

.vote-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Анимации уведомлений */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ========================================== 
 * ПЛАНШЕТЫ (769px - 1024px)
 * ========================================== */

@media (max-width: 1024px) {
    .offer-card {
        padding: 20px 25px;
    }

    .offer-card-body {
        gap: 18px;
    }

    .offer-info-actions {
        min-width: 320px;
        max-width: 320px;
    }

    .offer-meta-info {
        gap: 12px;
    }

    .meta-value {
        font-size: 11px;
    }

    .btn.btn-get-money,
    .btn.btn-review {
        padding: 11px 18px;
        font-size: 13px;
    }
}

/* ========================================== 
 * МОБИЛЬНЫЕ УСТРОЙСТВА (≤768px)
 * ========================================== */

@media (max-width: 768px) {
    .offer-header {
        margin-bottom: 20px;
    }

    .offer-card {
        padding: 20px;
        border-radius: 12px;
    }

    .offer-card-body {
        flex-direction: column;
        gap: 20px;
    }

    /* Вертикальная компоновка на мобильных */
    .offer-main-info {
        flex-direction: column;
        text-align: center;
        width: 100%;
        gap: 15px;
    }

    /* Логотип по центру */
    .logo-container {
        margin: 0 auto;
        min-width: auto;
        max-width: 120px;
    }

    .offer-logo {
        max-width: 90px;
        max-height: 55px;
    }

    /* Текст по центру */
    .offer-text {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .offer-title {
        font-size: 1.4rem;
        text-align: center;
    }

    .offer-slogan {
        text-align: center;
        font-size: 0.85rem;
    }

    .offer-rating {
        justify-content: center;
    }

    /* Мета-информация на мобильных */
    .offer-info-actions {
        width: 100%;
        min-width: auto;
        max-width: 100%;
    }

    .offer-meta-info {
        flex-direction: column;
        gap: 0;
        padding: 0;
        background: #f3f7f5;
        border-radius: 10px;
        border: none;
        overflow: hidden;
    }

    .meta-item {
        text-align: center;
        padding: 12px 15px;
        border-bottom: 1px solid var(--nd-line);
    }

    .meta-item:last-child {
        border-bottom: none;
    }

    .meta-label {
        font-size: 10px;
        margin-bottom: 3px;
    }

    .meta-value {
        font-size: 13px;
        white-space: normal;
        word-break: break-word;
    }

    /* Кнопки на всю ширину */
    .offer-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .btn.btn-get-money,
    .btn.btn-review {
        width: 100%;
        flex: none;
    }

    /* Кнопки голосования на мобильных */
    .vote-buttons {
        justify-content: center;
    }
}

/* ========================================== 
 * МАЛЕНЬКИЕ МОБИЛЬНЫЕ (≤480px)
 * ========================================== */

@media (max-width: 480px) {
    .offer-card {
        padding: 15px;
    }

    .offer-title {
        font-size: 1.2rem;
    }

    .offer-slogan {
        font-size: 0.8rem;
    }

    .logo-container {
        max-width: 100px;
        height: 75px;
        padding: 10px;
    }

    .offer-logo {
        max-width: 80px;
        max-height: 50px;
    }

    .rating-stars {
        font-size: 14px !important;
    }

    .rating-value {
        font-size: 13px;
    }

    .rating-count {
        font-size: 12px;
    }

    .btn.btn-get-money,
    .btn.btn-review {
        padding: 12px 20px;
        font-size: 14px;
    }

    .meta-item {
        padding: 10px 12px;
    }
}

/* ========================================== 
 * ДОПОЛНИТЕЛЬНЫЕ УТИЛИТЫ
 * ========================================== */

/* Анимация появления карточки */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.offer-card {
    animation: fadeInUp 0.5s ease-out;
}

/* Индикатор загрузки для кнопок */
.btn.btn-get-money.loading,
.btn.btn-review.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.btn.btn-get-money.loading::after,
.btn.btn-review.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Состояние фокуса для доступности */
.btn.btn-get-money:focus,
.btn.btn-review:focus {
    outline: 3px solid rgba(47, 191, 113, 0.35);
    outline-offset: 2px;
}

/* Print стили */
@media print {
    .offer-actions {
        display: none;
    }

    .offer-card {
        box-shadow: none;
        border: 1px solid #c7cfcc;
    }

    .vote-buttons {
        display: none;
    }
}
/* ==========================================
 * УСЛОВИЯ ЗАЙМА - GRID КАРТОЧКИ
 * ========================================== */







.condition-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: 24px 16px;
    border: 1px solid var(--nd-line);
    border-radius: 12px;
    background: var(--nd-surface);
    min-height: 140px;
    box-sizing: border-box;
    float: none;
    width: 100%;
    margin: 0;
}

/* Сбрасываем Bootstrap h3 внутри карточки */
.condition-card h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #7c8a85;
    margin: 0 0 8px 0;
    font-weight: 600;
    text-align: center;
    width: 100%;
    /* сброс возможных Bootstrap стилей */
    border-bottom: none;
    padding-bottom: 0;
    line-height: 1.3;
}

.condition-card .condition-icon {
    font-size: 2rem;
    margin: 0 0 10px 0;
    text-align: center;
    width: 100%;
    line-height: 1;
}

/* Сбрасываем Bootstrap p внутри карточки */
.condition-card p.condition-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--nd-graphite-950);
    margin: 0;
    text-align: center;
    width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}
@media (max-width: 768px) {
    /* центрируем основную карточку */
    .offer-header .offer-card {
        max-width: 400px;          /* любая разумная фикс/макс‑ширина */
        margin-left: auto;
        margin-right: auto;        /* margin: 0 auto; */
    }

    /* на всякий случай центрируем контейнер */
    .offer-header .container,
    .offer-header {
        display: block;
    }
}

/* ==== moved from offer-detail-credit.php (was an inline <style> block) ==== */
.credit-detail-page .breadcrumbs {
    padding-top: 20px;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

/* ==== moved from offer-detail-card.php (was an inline <style> block) ==== */
.credit-detail-page .breadcrumbs {
    padding-top: 20px;
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.credit-text {
    font-size: 15px;
    line-height: 1.8;
    color: #47544f;
}
.credit-card-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

/* ==== Категорийный вид (offer.php: фильтры категорий + сетка офферов) ==== */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: clamp(22px, 3vw, 30px);
    padding-bottom: clamp(18px, 2.4vw, 24px);
    border-bottom: 1px solid var(--nd-line);
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    border: 1px solid var(--nd-line);
    border-radius: 999px;
    background: var(--nd-surface);
    color: var(--nd-text-secondary);
    font-size: var(--nd-fs-sm);
    font-weight: 600;
    letter-spacing: -.005em;
    text-decoration: none;
    white-space: nowrap;
    transition:
        background var(--nd-t) var(--nd-ease),
        border-color var(--nd-t) var(--nd-ease),
        color var(--nd-t) var(--nd-ease),
        box-shadow var(--nd-t) var(--nd-ease),
        transform var(--nd-t) var(--nd-ease);
}
.filter-btn:hover {
    background: #FFFFFF;
    border-color: var(--nd-platinum-500);
    color: var(--nd-text);
    box-shadow: var(--nd-shadow-sm);
    transform: translateY(-1px);
}
.filter-btn.active {
    background: linear-gradient(180deg, var(--nd-emerald-700) 0%, var(--nd-emerald-900) 100%);
    border-color: var(--nd-emerald-900);
    color: #FFFFFF;
    box-shadow: 0 14px 26px -16px rgba(6,59,43,.95);
    transform: none;
}
.filter-btn:focus-visible { outline: 2px solid var(--nd-accent); outline-offset: 2px; }

.offer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--nd-s-5);
    align-items: stretch;
}

.category-seo-text {
    margin-top: clamp(28px, 4vw, 40px);
    padding: clamp(20px, 3vw, 28px);
    background: var(--nd-surf-platinum);
    border: 1px solid var(--nd-line);
    border-radius: var(--nd-r-xl);
    font-size: var(--nd-fs-sm);
    line-height: 1.78;
    color: var(--nd-text-secondary);
}
.category-seo-text > *:first-child { margin-top: 0; }
.category-seo-text > *:last-child { margin-bottom: 0; }
.category-seo-text a { color: var(--nd-accent); text-underline-offset: 3px; }
.category-seo-text a:hover { color: var(--nd-accent-hover); }

@media (max-width: 640px) {
    .offer-grid { grid-template-columns: minmax(0, 1fr); gap: var(--nd-s-4); }
    .filter-btn { padding: 8px 14px; font-size: var(--nd-fs-xs); }
}

/* ==========================================
 * Компонент renderOfferCard (§11 / §13)
 * Ранее эти элементы были объявлены только в cards.css,
 * который на /zaymy/, /credits/ и /offer/ не подключается.
 * ========================================== */

/* Логотип + название в шапке карточки */
.offer-logo-container {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}
.offer-card-header .offer-name {
    margin: 0;
    font-size: var(--nd-fs-lg);
    font-weight: 700;
    line-height: 1.3;
    color: var(--nd-text);
    overflow-wrap: anywhere;
}

/* Звёзды рейтинга */
.offer-rating-stars {
    color: #FFB800;
    font-size: 15px;
    letter-spacing: .06em;
    line-height: 1;
    white-space: nowrap;
}

/* Список параметров */
.offer-params {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.offer-param {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}
.offer-param-label { color: var(--nd-text-muted); }
.offer-param-value {
    max-width: 60%;
    font-weight: 600;
    color: var(--nd-text);
    text-align: right;
}

/* Подвал с кнопками */
.offer-card-footer {
    margin-top: auto;
    display: flex;
    gap: 10px;
}
.offer-details-button,
.offer-cta-button {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 14px;
    border-radius: var(--nd-r-sm);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background var(--nd-t) var(--nd-ease), border-color var(--nd-t) var(--nd-ease),
                color var(--nd-t) var(--nd-ease);
}
.offer-details-button {
    background: var(--nd-surface);
    border: 1.5px solid var(--nd-line);
    color: var(--nd-text-secondary);
}
.offer-details-button:hover {
    border-color: var(--nd-accent-line);
    background: var(--nd-accent-soft);
    color: var(--nd-accent-hover);
}
.offer-cta-button {
    flex: 1.4;
    background: var(--nd-accent);
    border: 1.5px solid var(--nd-accent);
    color: var(--nd-text-invert);
}
.offer-cta-button:hover { background: var(--nd-accent-hover); border-color: var(--nd-accent-hover); }

@media (max-width: 575px) {
    .offer-logo-container { gap: 12px; }
    .offer-card-footer { flex-direction: column; }
    .offer-cta-button { flex: 1; }
}
