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

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

/* Общий контейнер для ограничния ширины */
.busya-container {
    width: 100%;
    /* Единая ширина сайта */
    max-width: var(--busya-w, 1000px);
    margin: 0 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);
}

/* Секция глоссария */
.busya-glossary-section {
    padding: 40px 0;
}

/* Секция категорий */
.busya-categories-section {
    padding: 40px 0;
    background-color: transparent;
    /* Можно менять фон */
}

/* Поле поиска */
.busya-search-wrapper {
    margin-bottom: 30px;
    text-align: center;
}

#busya-shop-search {
    width: 100%;
    padding: 15px 24px;
    font-size: 18px;
    border: 2px solid var(--busya-border, #e2e8f0);
    border-radius: 50px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

#busya-shop-search:focus {
    border-color: var(--busya-accent, #3b82f6);
}

/* Алфавитная панель */
.busya-alphabet-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 40px;
}

.busya-alphabet-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px;
}

.busya-char-link {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 28px;
    padding: 10px 4px;
    text-decoration: none;
    color: #475569;
    font-size: 18px;
    font-weight: 700;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.busya-char-link:hover {
    border-color: #3b82f6;
    background-color: #eff6ff;
    color: #3b82f6;
}

.busya-char-link.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.busya-char-link.disabled {
    color: #cbd5e1;
    background: #f8fafc;
    border-color: #f1f5f9;
    pointer-events: none;
}

@media (max-width: 600px) {
    .busya-char-link {
        font-size: 16px;
        padding: 8px 2px;
    }
}

/* Сетка магазинов - 3 колонки */
.busya-shops-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px 30px;
    /* Вертикаль 10px, Горизонталь 30px */
}

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

/* Группы букв */
.busya-char-group {
    grid-column: 1 / -1;
    /* На всю ширину */
    margin-top: 20px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--busya-border, #e2e8f0);
    padding-bottom: 5px;
    font-size: 24px;
    color: var(--busya-accent, #3b82f6);
}

/* Метка для скролла (смещение) */
.busya-anchor-mark {
    display: block;
    height: 0px;
    /* Тестовый сброс */
    margin-top: 0px;
    /* Тестовый сброс */
    visibility: hidden;
    pointer-events: none;
}

/* Элемент списка (простая ссылка) */
.busya-shop-item {
    margin-bottom: 5px;
}

.busya-shop-title {
    color: var(--busya-text, #1e293b);
    text-decoration: none;
    font-size: 16px;
    line-height: 1.4;
    transition: color 0.2s;
    display: block;
    /* Чтобы кликалось нормально */
}

.busya-shop-title:hover {
    color: #3b82f6;
    text-decoration: none;
}

/* Стили для блока категорий внизу */
.busya-cats-section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
}

/* Контейнер для категорий, чтобы сузить его */
.busya-cats-wrapper {
    max-width: 1000px;
    margin: 0 auto;
}

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

/* Адаптивность для категорий */
@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;
    padding: 10px 0;
}

.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;
    color: var(--busya-text, #1e293b);
    transition: color 0.2s;
}

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