/* Базовые сбросы и настройки */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Стили, специфичные для body на этой странице, если нужны */
/* .page-template-template-equipment body { ... } */

/* Оставляем .container, т.к. он используется в шаблоне */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Стили хедера и футера УДАЛЕНЫ - они берутся из header.php и footer.php */

/* Заголовок страницы (уже стилизован в основном style.css, но можно переопределить) */
.page-template-template-equipment .page-title {
    font-family: 'LXGW WenKai TC', sans-serif;
    font-size: 2.8em;
    color: #222;
    margin-top: 40px; /* Добавлен верхний отступ */
    margin-bottom: 40px;
    text-align: center;
    font-weight: 400;
}

/* Сетка товаров */
.stuff-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px; /* Добавлен нижний отступ */
}

/* Отдельный товар */
.stuff-item {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.stuff-item:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-6px);
}

.stuff-item-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    text-align: center;
}

.stuff-item-image-wrapper {
    margin-bottom: 15px;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    overflow: hidden;
}

.stuff-item-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.stuff-item-link:hover .stuff-item-image {
     transform: scale(1.05);
}

.stuff-item-title {
    font-family: 'LXGW WenKai TC', sans-serif;
    font-size: 1.4em;
    font-weight: 400;
    margin-bottom: 8px;
    flex-grow: 1;
    color: #333;
    line-height: 1.4;
}

.stuff-item-description {
    font-family: 'Source Serif 4', serif;
    font-size: 0.95em;
    color: #555;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 12px;
    min-height: 2.85em; /* Примерная высота для 2 строк, чтобы выровнять */
}

.stuff-item-price {
    font-family: 'Source Serif 4', serif;
    font-size: 1.1em;
    font-weight: 700;
    color: #333;
    margin-top: auto;
}

/* Стили для Лайтбокса */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: none; /* Скрыт по умолчанию */
    align-items: center;
    justify-content: center;
    z-index: 10000; /* Высокий z-index */
    padding: 20px;
    cursor: pointer;
}

.lightbox-overlay.active {
    display: flex; /* Показываем */
}

/* Блокировка скролла */
body.lightbox-open {
    overflow: hidden;
}

.lightbox-content {
    position: relative;
    background-color: #fff;
    padding: 10px;
    border-radius: 5px;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    cursor: default;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#lightbox-image {
    display: block;
    max-width: 100%;
    max-height: calc(90vh - 20px); /* С учетом padding */
    height: auto;
    width: auto;
    object-fit: contain;
    cursor: pointer; /* Можно кликать на картинку для закрытия */
}

.lightbox-close {
    position: absolute;
    top: -15px;
    right: -15px;
    background: white;
    color: #333;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 24px;
    line-height: 35px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.2s, color 0.2s;
    z-index: 10010; /* Выше контента */
    display: block; /* Убедимся, что видна */
    font-family: sans-serif; /* Для крестика */
}

.lightbox-close:hover {
    background-color: #eee;
}

/* Адаптивность */
@media (max-width: 992px) {
    .stuff-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .page-template-template-equipment .page-title {
        font-size: 2.4em;
    }
}

@media (max-width: 767px) {
     /* На мобильных убираем кнопку "X", закрытие по клику на фон/картинку */
    .lightbox-close {
        display: none;
    }
     .lightbox-content {
         max-width: 95%;
         padding: 5px;
     }
     #lightbox-image {
         max-height: calc(95vh - 10px);
     }
}

@media (max-width: 576px) {
    .stuff-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
     .container { /* Переопределение основного, если нужно */
        padding: 0 10px;
    }
     .page-template-template-equipment .page-title {
        font-size: 2em;
        margin-top: 25px;
        margin-bottom: 25px;
    }
    .stuff-item-title {
        font-size: 1.3em;
    }
    .stuff-item-description {
        font-size: 0.9em;
        min-height: 0; /* Сбрасываем мин. высоту на мобильных */
    }
    .stuff-item-price {
        font-size: 1em;
    }
}