/**
 * Карточки каталога — Naked Technologies
 * Стиль: Технопарк
 * 
 * @version 3.0.0
 */

/* ==========================================================================
   ПЕРЕМЕННЫЕ
   ========================================================================== */

:root {
    /* Основные цвета */
    --nt-primary: #2c3df5;
    --nt-primary-light: rgba(44, 61, 245, 0.08);
    
    /* Карточки */
    --nt-card-bg: #ffffff;
    --nt-card-border: #e8e8e8;
    --nt-card-radius: 12px;
    --nt-card-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --nt-card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    /* Текст */
    --nt-text-primary: #1a1a1a;
    --nt-text-secondary: #666666;
    --nt-text-muted: #999999;
    
    /* Статусы */
    --nt-success: #00b341;
    --nt-warning: #ff9500;
    --nt-danger: #ff3b30;
    
    /* Цена */
    --nt-price-color: #1a1a1a;
    --nt-price-old: #999999;
    --nt-bonus-color: #00a0e3;
    
    /* Ширина каталога */
    --nt-catalog-width: 1520px;
    --nt-catalog-padding: 20px;
}

/* ==========================================================================
   КОНТЕЙНЕР КАТАЛОГА
   ========================================================================== */

.woocommerce .products,
.nt-catalog-grid {
    max-width: var(--nt-catalog-width);
    margin: 0 auto;
    padding: 0 var(--nt-catalog-padding);
}

/* ==========================================================================
   СЕТКА КАТАЛОГА — ГОРИЗОНТАЛЬНАЯ (оборудование)
   ========================================================================== */

.nt-catalog--horizontal {
    display: flex;
    flex-direction: column;
    gap: 16px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nt-catalog--horizontal .product,
.nt-catalog--horizontal > li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   ГОРИЗОНТАЛЬНАЯ КАРТОЧКА (Десктоп) — стиль Технопарка
   ========================================================================== */

.nt-catalog-card {
    display: flex;
    align-items: stretch;
    background: var(--nt-card-bg);
    border: 1px solid var(--nt-card-border);
    border-radius: var(--nt-card-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.nt-catalog-card:hover {
    border-color: var(--nt-primary);
    box-shadow: var(--nt-card-shadow-hover);
}

/* --- Изображение (слева) --- */
.nt-card--horizontal .nt-card__image {
    position: relative;
    width: 280px;
    min-width: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #fafafa;
    border-right: 1px solid var(--nt-card-border);
}

.nt-card--horizontal .nt-card__img {
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.nt-card--horizontal:hover .nt-card__img {
    transform: scale(1.03);
}

/* Слайдер точки */
.nt-card__dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.nt-card__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nt-card__dot.active {
    background: var(--nt-primary);
}

/* --- Центральная часть: Информация --- */
.nt-card--horizontal .nt-card__info {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Статус наличия */
.nt-card__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

.nt-card__status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--nt-success);
}

.nt-card__status--in-stock {
    color: var(--nt-success);
}

.nt-card__status--on-order {
    color: var(--nt-warning);
}

.nt-card__status--on-order::before {
    background: var(--nt-warning);
}

/* Заголовок */
.nt-card__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--nt-text-primary);
    line-height: 1.4;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nt-catalog-card:hover .nt-card__title {
    color: var(--nt-primary);
}

/* Рейтинг */
.nt-card__rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 12px;
}

.nt-card__star {
    color: #ffc107;
    font-size: 14px;
}

.nt-card__rating-value {
    font-weight: 600;
    color: var(--nt-text-primary);
}

.nt-card__rating-count {
    color: var(--nt-text-muted);
}

/* --- ХАРАКТЕРИСТИКИ (таблица как у Технопарка) --- */
.nt-card__specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 24px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.nt-card__spec {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.nt-card__spec-label {
    color: var(--nt-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.nt-card__spec-value {
    color: var(--nt-text-primary);
    font-weight: 500;
}

/* --- Правая часть: Цена и действия --- */
.nt-card--horizontal .nt-card__sidebar {
    width: 240px;
    min-width: 240px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    background: #fafafa;
    border-left: 1px solid var(--nt-card-border);
}

/* Цена */
.nt-card__price-block {
    margin-bottom: 16px;
}

.nt-card__price {
    font-size: 24px;
    font-weight: 700;
    color: var(--nt-price-color);
    line-height: 1.2;
}

.nt-card__price del {
    display: block;
    font-size: 14px;
    font-weight: 400;
    color: var(--nt-price-old);
    text-decoration: line-through;
    margin-bottom: 4px;
}

.nt-card__price ins {
    text-decoration: none;
}

/* Бонусы */
.nt-card__bonus {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--nt-bonus-color);
    margin-top: 6px;
}

.nt-card__bonus-icon {
    width: 16px;
    height: 16px;
}

/* Кнопка В корзину */
.nt-card__button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: var(--nt-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
}

.nt-card__button:hover {
    background: #1e2ed4;
    color: #fff;
}

/* Рассрочка */
.nt-card__credit {
    display: block;
    margin-top: 12px;
    font-size: 13px;
    color: var(--nt-primary);
    text-align: center;
    text-decoration: underline;
}

.nt-card__credit:hover {
    text-decoration: none;
}

/* Сервисы */
.nt-card__services {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #e8e8e8;
}

.nt-card__service {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.nt-card__service-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.nt-card__service-label {
    color: var(--nt-text-muted);
}

.nt-card__service-value {
    color: var(--nt-text-primary);
    font-weight: 500;
    margin-left: auto;
}

/* ==========================================================================
   БЕЙДЖИ
   ========================================================================== */

.nt-card__badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
}

.nt-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: 4px;
    color: #fff;
}

.nt-badge--hit,
.nt-badge--хит {
    background: #ff3b30;
}

.nt-badge--sale {
    background: #00b341;
}

.nt-badge--new,
.nt-badge--новинка {
    background: var(--nt-primary);
}

/* ==========================================================================
   ПЛИТОЧНАЯ СЕТКА (запчасти)
   ========================================================================== */

.nt-catalog--tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nt-card--tile {
    flex-direction: column;
    height: 100%;
}

.nt-card--tile .nt-card__image {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: #fafafa;
    border-bottom: 1px solid var(--nt-card-border);
}

.nt-card--tile .nt-card__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.nt-card--tile:hover .nt-card__img {
    transform: scale(1.05);
}

.nt-card--tile .nt-card__info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nt-card--tile .nt-card__title {
    font-size: 14px;
    -webkit-line-clamp: 3;
    margin-bottom: 0;
}

.nt-card--tile .nt-card__price-block {
    margin-top: auto;
}

.nt-card--tile .nt-card__price {
    font-size: 18px;
}

/* Совместимость */
.nt-card__compat {
    font-size: 12px;
    color: var(--nt-text-muted);
}

.nt-card__compat-value {
    color: var(--nt-text-secondary);
}

/* Состояние */
.nt-card__condition {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    background: #e8f5e9;
    color: #2e7d32;
    width: fit-content;
}

.nt-card__condition--refurbished {
    background: #fff3e0;
    color: #e65100;
}

.nt-card__condition--used {
    background: #f5f5f5;
    color: #757575;
}

/* ==========================================================================
   АДАПТИВ — ПЛАНШЕТ (до 1200px)
   ========================================================================== */

@media (max-width: 1200px) {
    :root {
        --nt-catalog-padding: 16px;
    }
    
    .nt-card--horizontal .nt-card__image {
        width: 220px;
        min-width: 220px;
    }
    
    .nt-card--horizontal .nt-card__sidebar {
        width: 200px;
        min-width: 200px;
    }
    
    .nt-card__specs {
        grid-template-columns: 1fr;
    }
    
    .nt-catalog--tiles {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==========================================================================
   АДАПТИВ — ПЛАНШЕТ МАЛЕНЬКИЙ (до 1024px)
   ========================================================================== */

@media (max-width: 1024px) {
    .nt-card--horizontal {
        flex-wrap: wrap;
    }
    
    .nt-card--horizontal .nt-card__image {
        width: 180px;
        min-width: 180px;
    }
    
    .nt-card--horizontal .nt-card__info {
        flex: 1;
        min-width: 200px;
    }
    
    .nt-card--horizontal .nt-card__sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        border-left: none;
        border-top: 1px solid var(--nt-card-border);
    }
    
    .nt-card__price-block {
        margin-bottom: 0;
    }
    
    .nt-card__button {
        width: auto;
        padding: 12px 24px;
    }
    
    .nt-card__services {
        flex-direction: row;
        gap: 16px;
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }
    
    .nt-card__credit {
        margin-top: 0;
    }
}

/* ==========================================================================
   АДАПТИВ — МОБИЛЬНЫЙ (до 768px)
   Карточка как у Технопарка на мобилке
   ========================================================================== */

@media (max-width: 768px) {
    .nt-catalog--horizontal {
        gap: 12px;
    }
    
    /* Вертикальная карточка на мобилке */
    .nt-card--horizontal {
        flex-direction: column;
    }
    
    .nt-card--horizontal .nt-card__image {
        width: 100%;
        min-width: 100%;
        aspect-ratio: 4/3;
        max-height: 280px;
        border-right: none;
        border-bottom: 1px solid var(--nt-card-border);
    }
    
    .nt-card--horizontal .nt-card__img {
        max-height: 100%;
    }
    
    .nt-card--horizontal .nt-card__info {
        padding: 16px;
    }
    
    .nt-card__title {
        font-size: 15px;
    }
    
    .nt-card__specs {
        grid-template-columns: 1fr;
        gap: 4px;
        padding-top: 8px;
    }
    
    .nt-card__spec {
        font-size: 12px;
    }
    
    .nt-card--horizontal .nt-card__sidebar {
        padding: 16px;
        flex-direction: column;
        gap: 12px;
        background: var(--nt-card-bg);
    }
    
    .nt-card__price-block {
        text-align: center;
    }
    
    .nt-card__price {
        font-size: 22px;
    }
    
    .nt-card__button {
        width: 100%;
    }
    
    .nt-card__services {
        display: none; /* Скрываем на мобилке */
    }
    
    .nt-catalog--tiles {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* ==========================================================================
   АДАПТИВ — МАЛЕНЬКИЙ МОБИЛЬНЫЙ (до 480px)
   ========================================================================== */

@media (max-width: 480px) {
    .nt-card--horizontal .nt-card__image {
        aspect-ratio: 1;
        max-height: 250px;
    }
    
    .nt-card__specs {
        display: none; /* Скрываем характеристики на очень маленьких */
    }
    
    .nt-card--horizontal .nt-card__sidebar {
        padding: 12px 16px;
    }
    
    .nt-card__price {
        font-size: 20px;
    }
    
    .nt-catalog--tiles {
        grid-template-columns: 1fr;
    }
    
    .nt-card--tile .nt-card__image {
        aspect-ratio: 4/3;
    }
}

/* ==========================================================================
   СЛАЙДЕР
   ========================================================================== */

.nt-card__slider {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   ДОПОЛНИТЕЛЬНО: Иконки действий (избранное, сравнение)
   ========================================================================== */

.nt-card__actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 3;
}

.nt-card__action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--nt-text-muted);
}

.nt-card__action-btn:hover {
    border-color: var(--nt-primary);
    color: var(--nt-primary);
}

.nt-card__action-btn svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   СТРАНИЦА КАТАЛОГА — ОБЩИЕ СТИЛИ
   ========================================================================== */

/* Обёртка каталога */
.woocommerce-page .site-main,
.archive .site-main {
    max-width: var(--nt-catalog-width);
    margin: 0 auto;
    padding: 0 var(--nt-catalog-padding);
}

/* Сортировка */
.woocommerce-ordering {
    margin-bottom: 20px;
}

/* Пагинация */
.woocommerce-pagination {
    margin-top: 40px;
    text-align: center;
}

.woocommerce-pagination ul {
    display: inline-flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-pagination li a,
.woocommerce-pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--nt-card-bg);
    border: 1px solid var(--nt-card-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--nt-text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.woocommerce-pagination li a:hover {
    border-color: var(--nt-primary);
    color: var(--nt-primary);
}

.woocommerce-pagination li span.current {
    background: var(--nt-primary);
    border-color: var(--nt-primary);
    color: #fff;
}
