/*
 * Busya: стили шаблона templates/page-categories.php (пакет 8г, Е.15; раньше — блок <style> в HTML страницы).
 * Подключается в Busya::enqueue_assets() после busya-site.css, когда выбран этот шаблон (Busya::remember_template()).
 */

/* ===== Блок 1 ===== */

/* Обеспечиваем растягивание обертки на всю ширину */
.busya-page-wrapper {
    width: 100%;
}

.busya-glossary-container {
    width: 100%;
    max-width: var(--busya-w, 1000px);
    margin: 40px auto;
    padding: 40px;
    /* Increased internal padding */
    font-family: var(--busya-font, system-ui, -apple-system, sans-serif);
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* Сетка категорий - 3 колонки */
.busya-cats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 30px;
}

/* Адаптивность */
@media (max-width: 900px) {
    .busya-cats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .busya-cats-grid {
        grid-template-columns: 1fr;
    }
}

/* Элемент списка (ссылка с иконкой) */
.busya-cat-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    text-decoration: none !important;
    background: none;
    border: none;
    box-shadow: none;
    padding: 10px 0;
    transition: none;
}

.busya-cat-item:hover {
    background: none;
    box-shadow: none;
    transform: none;
}

/* Иконка */
.busya-cat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-right: 12px;
    flex-shrink: 0;
}

.busya-cat-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Точка, если нет иконки */
.busya-cat-bullet {
    color: var(--busya-faint, #94a3b8);
    font-size: 20px;
    margin-right: 10px;
}

/* Название */
.busya-cat-name {
    font-size: 16px;
    font-weight: normal;
    color: var(--busya-text, #1e293b);
    line-height: 1.4;
    transition: color 0.2s;
}

.busya-cat-item:hover .busya-cat-name {
    color: #3b82f6;
    text-decoration: none;
}

/* ===== Блок 2: Популярные магазины (карусель; печатался ниже, перед её разметкой, только если есть популярные) ===== */

.busya-popular-container {
    width: 100%;
    max-width: var(--busya-w, 1000px);
    margin: 0 auto 40px auto;
    padding: 40px 5px; /* Minimal side padding */
    font-family: var(--busya-font, system-ui, -apple-system, sans-serif);
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    position: relative;
}

.busya-pop-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 22px;
    font-weight: 700;
    color: var(--busya-text, #1e293b);
}

.busya-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.busya-carousel-overflow {
    overflow: hidden;
    width: 100%;
    margin: 0 30px; /* Reduced margin for buttons */
}

.busya-carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
}

.busya-carousel-page {
    min-width: 100%;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 12px;
    box-sizing: border-box;
    padding: 4px;
}

@media (max-width: 1100px) {
    .busya-carousel-page { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
    .busya-carousel-page { grid-template-columns: repeat(3, 1fr); }
}

.busya-pop-item {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px;
    transition: all 0.2s;
    color: var(--busya-text, #1e293b);
    border: 1px solid transparent;
}

.busya-pop-item:hover {
    background: #fff;
    /* No transform */
    color: #3b82f6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #e2e8f0;
}

.busya-pop-logo {
    width: 100%;
    height: 64px;
    object-fit: contain;
    flex-shrink: 0;
    background: #fff;
    border-radius: 6px;
    padding: 2px;
}

.busya-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px; 
    height: 60px; /* Higher touch area */
    background: transparent;
    border: none; 
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px; /* Large symbol */
    line-height: 1;
    color: #cbd5e1; /* Light gray */
    z-index: 10;
    transition: color 0.2s;
    padding: 0;
    box-shadow: none;
}

.busya-carousel-btn:hover {
    color: #3b82f6;
    background: transparent;
    box-shadow: none;
    transform: translateY(-50%); /* No scale/move */
}

.busya-carousel-prev { left: -5px; }
.busya-carousel-next { right: -5px; }

@media (max-width: 768px) {
    .busya-carousel-page {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .busya-carousel-overflow {
        margin: 0 25px; 
    }
    .busya-carousel-btn {
        font-size: 24px;
        width: 25px;
    }
    .busya-carousel-prev { left: -5px; }
    .busya-carousel-next { right: -5px; }
    .busya-popular-container {
        padding: 30px 5px;
    }
}
