/* ============================================================
   СЕТКА КАРТОЧЕК
   ============================================================ */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    width: 100%;
}

/* Карточка */
.card {
    position: relative;
    width: 100%;
    max-width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    aspect-ratio: 4 / 3;
    background: #ffffff;
    cursor: pointer;
    min-width: 0;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.15);
}

/* Картинка */
.card .image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #ffffff;
}

.card .image-wrapper .image {
    width: 80%;
    height: 80%;
    object-fit: contain;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.5s ease;
    pointer-events: none;
}

.card:hover .image-wrapper .image {
    transform: translate(-50%, -50%) scale(1.04);
}

.card .image-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background 0.5s ease;
    pointer-events: none;
    z-index: 1;
}

.card:hover .image-wrapper::before,
.card.show-specs .image-wrapper::before {
    background: rgba(255, 255, 255, 0.85);
}

/* Оверлей */
.card .overlay {
    position: absolute;
    inset: 0;
    padding: 14px 18px 12px;
    background: linear-gradient(180deg,
        rgba(255,255,255,0.3) 0%,
        rgba(255,255,255,0.1) 40%,
        rgba(255,255,255,0.5) 100%);
    color: #1a202c;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.4s ease;
    pointer-events: none;
    z-index: 2;
}

.card .overlay a,
.card .overlay .btn-order {
    pointer-events: auto;
}

/* Скрытие первой стороны при show-specs */
.card.show-specs .top-row,
.card.show-specs .btn-order,
.card.show-specs .center-text,
.card.show-specs .bottom-row {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

/* Верхняя строка */
.card .top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* Цены */
.card .prices {
    display: flex;
    align-items: baseline;
    gap: 6px;
    background: rgba(255, 255, 255, 0.85);
    padding: 4px 10px 4px 8px;
    border-radius: 8px;
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card .prices .old-price {
    font-size: 13px;
    font-weight: 600;
    color: #a0aec0;
    text-decoration: line-through;
}

.card .prices .new-price {
    font-size: 20px;
    font-weight: 800;
    color: #e74c3c;
    letter-spacing: -0.5px;
}

.card .prices .new-price .currency {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.7;
    color: #4a5568;
}

/* Бейдж */
.card .badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    background: #e74c3c;
    color: #ffffff;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 20px rgba(231, 76, 60, 0.35);
    animation: pulse-badge 2s ease-in-out infinite;
    backdrop-filter: blur(4px);
    flex-shrink: 0;
    line-height: 1.3;
    text-align: center;
    min-width: 60px;
}

.card .badge .percent { font-size: 15px; }
.card .badge .label   { font-size: 8px; font-weight: 600; opacity: 0.9; letter-spacing: 0.3px; }

@keyframes pulse-badge {
    0%, 100% { transform: scale(1);   box-shadow: 0 4px 20px rgba(231, 76, 60, 0.35); }
    50%      { transform: scale(1.06); box-shadow: 0 6px 30px rgba(231, 76, 60, 0.55); }
}

/* Кнопка "Заказать" */
.card .btn-order {
    display: inline-block;
    margin-top: 4px;
    padding: 6px 16px;
    background: #f1c40f;
    color: #1a202c;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 3px 15px rgba(241, 196, 15, 0.35);
    pointer-events: auto;
    text-align: center;
    align-self: flex-start;
    white-space: nowrap;
}

.card .btn-order:hover {
    background: #f39c12;
    transform: scale(1.04);
    box-shadow: 0 4px 20px rgba(241, 196, 15, 0.5);
}

/* Центр */
.card .center-text {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4px 0;
    overflow: hidden;
}

.card .center-text .main-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    text-align: center;
    color: #1a202c;
    -webkit-text-stroke: 0.5px rgba(255, 255, 255, 0.7);
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
}

.card .center-text .sub-items {
    font-size: 10px;
    font-weight: 500;
    line-height: 1.3;
    opacity: 0.95;
    text-shadow: 0 1px 8px rgba(255, 255, 255, 0.9);
    text-align: justify;
    color: #2d3748;
    max-width: 100%;
    word-break: break-word;
    hyphens: auto;
    white-space: normal;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

.card .center-text .sub-items span {
    display: block;
    margin-bottom: 1px;
    white-space: normal;
    word-wrap: break-word;
}

.card .center-text .sub-items b {
    color: #a1202c;
}

/* Нижняя строка */
.card .bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    flex-shrink: 0;
}

.card .bottom-row .link-model,
.card .btn-wrapper .link-model {
    font-size: 11px;
    font-weight: 700;
    color: #4a5568;
    text-decoration: none;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    transition: all 0.3s ease;
    pointer-events: auto;
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    margin-right: auto;
}

/* Отдельно для оборота — жёлтый hover */
.card .btn-wrapper .link-model:hover {
    background: #f1c40f;     /* жёлтый, как у .btn-order */
    border-color: #f1c40f;
    color: #1a202c;          /* тёмный текст для контраста */
    transform: scale(1.04);
    box-shadow: 0 3px 15px rgba(241, 196, 15, 0.35);
}

.card .bottom-row .link-model:hover {
    background: #edf2f7;
    color: #2d3748;
    border-color: #cbd5e0;
    transform: scale(1.04);
}

/* ===== ХАРАКТЕРИСТИКИ (ВТОРАЯ СТОРОНА) ===== */
.card .specs-wrapper {
    position: absolute;
    inset: 0;
    padding: 12px 16px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.4s ease;
    pointer-events: none;
    overflow-y: auto;
    border-radius: 20px;
    z-index: 3;
}

.card.show-specs .specs-wrapper {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.card .specs-wrapper .specs-title {
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #2b6cb0;
    margin-bottom: 6px;
}

.card .specs-wrapper .specs-list {
    font-size: 9px;
    line-height: 1.5;
    color: #2d3748;
    text-align: left;
    padding-left: 4px;
    max-height: 100%;
    overflow-y: auto;
}

.card .specs-wrapper .specs-list .spec-item {
    display: block;
    opacity: 0.9;
    padding: 1px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card .specs-wrapper .specs-list .highlight {
    color: #1a202c;
    font-weight: 700;
}

/* Кнопка "Запросить инструкцию" */
.card .btn-instruct {
    display: inline-block;
    padding: 6px 14px;
    background: #2b6cb0;
    color: #ffffff;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    pointer-events: auto;
    white-space: nowrap;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(43, 108, 176, 0.3);
}

.card .btn-instruct:hover {
    background: #1a4f7a;
    transform: scale(1.04);
}

.card .specs-wrapper .btn-wrapper {
    display: flex;
    justify-content: space-between;  /* ← ИЗМЕНЕНО: разнести по краям */
    align-items: center;             /* ← ДОБАВЛЕНО: выровнять по центру */
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    gap: 8px;                        /* ← ДОБАВЛЕНО */
}

/* ===== КНОПКА ПЕРЕХОДА В КАТЕГОРИЮ (на лице) ===== */
.card .bottom-row .btn-category {
    display: inline-block;
    padding: 5px 12px;
    background: #ebf8ff;             /* мягкий голубой фон */
    color: #2b6cb0;                  /* синий текст */
    border: 1px solid #bee3f8;       /* голубая рамка */
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    pointer-events: auto;
    white-space: normal;
    letter-spacing: 0.3px;
    text-align: center;
    line-height: 1.3;
}

.card .bottom-row .btn-category:hover {
    background: #2b6cb0;             /* при наведении — заливаем синим */
    color: #ffffff;
    border-color: #2b6cb0;
    transform: scale(1.02);
}

/* ===== ЛЕЙБЛ МОДЕЛИ И КНОПКА КАТЕГОРИИ (на лице) ===== */
.card .bottom-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;   /* ← ДОБАВЛЕНО: прижать влево */
    align-items: baseline;   /* выровнять по базовой линии */
    gap: 4px 6px;
}

.card .bottom-row .model-label {
    font-size: 13px;        /* крупнее */
    font-weight: 800;
    color: #1a202c;
    letter-spacing: 0.2px;
    white-space: nowrap;
    line-height: 1.2;
}

.card .bottom-row .model-in {
    font-size: 10px;        /* мелкий */
    font-weight: 400;
    color: #718096;         /* серый */
    white-space: nowrap;
    line-height: 1.2;
}

.card .bottom-row .btn-category {
    font-size: 10px;        /* как сейчас */
    padding: 4px 10px;
    background: #ebf8ff;
    color: #2b6cb0;
    border: 1px solid #bee3f8;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    line-height: 1.2;
    display: inline-block;
    vertical-align: baseline;
}

.card .bottom-row .btn-category:hover {
    background: #2b6cb0;
    color: #ffffff;
    border-color: #2b6cb0;
}

/* ===== РАЗДЕЛИТЕЛЬ 6+3 В СЕТКЕ КАРТОЧЕК ===== */
.catalog-divider {
    grid-column: 1 / -1;       /* растянуть на всю ширину сетки */
    height: 1px;
    background: #e2e8f0;       /* тонкая серая линия */
    margin: 12px 0 24px;       /* отступы сверху и снизу */
}