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

/* Основной лейаут (как на странице магазина) */
.busya-single-shop-layout {
    /* Общая ширина сайта: контент слева, сайдбар справа */
    width: 100%;
    max-width: var(--busya-w, 1000px);
    margin: 20px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 24px;
    font-family: system-ui, -apple-system, sans-serif;
    align-items: start;
    box-sizing: border-box;
}

/* Блок основного контента */
.busya-block-main {
    min-width: 0;
    width: 100%;
    grid-column: 1;
}

/* Сайдбар — один грид-элемент с двумя виджетами внутри.
   grid-row: 1 + grid-column: 2 фиксируют позицию независимо от HTML-порядка. */
.busya-sidebar {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
    /* Сброс возможных стилей темы на <aside> */
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

/* Единый стиль плашки */
.busya-plaque-container {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 0 20px 0;
    /* Было 40px */
    padding: 20px;
    /* Было 40px */
    font-family: 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;
}

/* Разделитель внутри плашки */
.busya-plaque-divider {
    height: 1px;
    background-color: var(--busya-border, #e2e8f0);
    margin: 30px -40px;
    width: calc(100% + 80px);
}

/* Особенности купонных карточек */
.busya-plaque-container .busya-coupon-card .bcc-link {
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    transform: none !important;
    min-height: auto !important;
}

.busya-plaque-container.busya-compact {
    padding: 10px 20px;
    margin-bottom: 15px;
}

.busya-compact .bcc-content {
    display: -webkit-box !important;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 3px;
}

.busya-compact .bcc-info {
    padding: 5px 15px !important;
    justify-content: center;
    min-width: 0 !important;
}

.busya-compact .bcc-excerpt {
    margin: 0 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    display: block !important;
    max-width: 100%;
    line-height: 1.4;
}

.busya-compact .bcc-link {
    min-height: 50px !important;
}

.busya-compact .bcc-discount {
    padding: 5px !important;
}

.busya-compact .bcc-discount img {
    max-height: 40px !important;
    width: auto !important;
    object-fit: contain !important;
}

.busya-plaque-container .busya-coupon-card .bcc-link:hover .bcc-excerpt {
    color: #3b82f6 !important;
    transition: color 0.2s;
}

/* САЙДБАР — стили плашек */

.busya-sidebar-plaque {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.cats-widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1e293b;
}

.cats-vertical-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cat-vertical-item {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #334155;
    font-size: 15px;
    padding: 8px 0;
    transition: color 0.2s;
    border-bottom: 1px solid #f1f5f9;
    box-sizing: border-box;
}

.cat-vertical-item:last-child {
    border-bottom: none;
}

.cat-vertical-item:hover {
    color: #3b82f6;
}

.cat-vertical-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Логотипы «Популярных магазинов» крупнее иконок категорий (пакет 8б, Д.10). */
.cat-vertical-icon.is-logo {
    width: 48px;
    height: 40px;
}

.cat-bullet {
    color: #cbd5e1;
    font-size: 20px;
    margin-right: 12px;
}

.shop-link-btn {
    display: block;
    width: fit-content;
    min-width: 140px;
    margin-left: auto;
    margin-right: auto;
    padding: 8px 20px;
    background: #3b82f6;
    color: #fff;
    border: none;
    text-align: center;
    border-radius: var(--busya-radius-btn, 8px);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
    box-sizing: border-box;
}

.shop-link-btn:hover {
    background: #2563eb;
    color: #fff;
    border: none;
}

/* MOBILE / TABLET < 1100px */
@media (max-width: 1100px) {
    .busya-single-shop-layout {
        grid-template-columns: 1fr;
    }

    /* Сбрасываем grid-placement */
    .busya-block-main,
    .busya-sidebar {
        grid-column: 1;
        grid-row: auto;
    }

    /* Порядок: купоны → сайдбар (магазины + категории внутри) */
    .busya-block-main { order: 1; }
    .busya-sidebar    { order: 2; }
}

@media (max-width: 480px) {
    .busya-plaque-container {
        padding: 20px;
    }

    .busya-plaque-divider {
        margin: 20px -20px;
        width: calc(100% + 40px);
    }
}
