/* ===== Базовые стили ===== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', 'Segoe UI', Tahoma, sans-serif;
    margin: 0;
    padding: 0;
    background: #f5f8fc;
    color: #2d2d2d;
    line-height: 1.5;
}

h1 {
    color: #2d2d2d;
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 8px 0;
}

h2 {
    color: #2d2d2d;
    font-size: 20px;
    font-weight: 700;
    margin: 32px 0 16px 0;
}

a {
    color: #1565c0;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===== Контейнер контента ===== */
.content {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 20px 40px 20px;
}

/* ===== Шапка на весь экран с прилипанием ===== */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    padding: 16px 0;
    margin-bottom: 32px;
    transition: box-shadow 0.2s ease;
    overflow: visible;
}

header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

header .header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: visible;
    min-height: 56px;
}

header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 800;
    color: #1565c0;
    text-decoration: none;
    letter-spacing: -0.5px;
    position: absolute;
    top: 0;
    left: 20px;
    transition: transform 0.2s ease;
    z-index: 1001;
}

header .logo:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

header .logo-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 12px rgba(21, 101, 192, 0.2));
    display: block;
}

/* Правый блок шапки: селект города + корзина */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.city-select-wrapper {
    width: 240px;
}

.city-select-wrapper .select2-container {
    width: 100% !important;
}

/* ===== Корзина в шапке ===== */
.cart-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: #1565c0;
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.2s;
}

.cart-link:hover {
    background: #e3f2fd;
    text-decoration: none;
}

.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #1565c0;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ===== Карточки ===== */
.card {
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

/* ===== Сетка плиток ===== */
.grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 12px;
    text-decoration: none;
    color: #2d2d2d;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: normal;
    word-break: break-word;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.item:hover {
    background: #1565c0;
    border-color: #1565c0;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.3);
}

/* ===== Категории ===== */
.category-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.category-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 12px;
    text-decoration: none;
    color: #2d2d2d;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: normal;
    word-break: break-word;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.category-card:hover {
    background: #1565c0;
    border-color: #1565c0;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.3);
}

.category-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.category-card:hover .category-icon {
    filter: brightness(0) invert(1);
}

/* ===== Ссылки «назад» ===== */
.back {
    display: inline-block;
    margin-bottom: 20px;
    color: #1565c0;
    font-weight: 600;
    text-decoration: none;
}

.back:hover {
    text-decoration: underline;
}

/* ===== Хлебные крошки ===== */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumbs a {
    color: #1565c0;
    font-weight: 600;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs .sep {
    color: #999;
}

.breadcrumbs .current {
    color: #666;
}

/* ===== Формы ===== */
.form-row {
    margin-bottom: 16px;
}

.form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 14px;
    color: #2d2d2d;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    background: #f5f8fc;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #1565c0;
    background: #fff;
}

button {
    background: #1565c0;
    color: #fff;
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    transition: all 0.2s ease;
}

button:hover {
    background: #0d47a1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.3);
}

/* ===== Таблицы ===== */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

th {
    background: #f5f8fc;
    font-weight: 700;
    color: #666;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover td {
    background: #f1f6fc;
}

.price {
    font-weight: 800;
    color: #1565c0;
    font-size: 15px;
}

/* ===== Пустые состояния ===== */
.empty {
    color: #999;
    font-style: italic;
    font-size: 14px;
}

/* ===== Select2 кастомизация ===== */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: 42px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 6px 10px;
    background: #f5f8fc;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 28px;
    color: #2d2d2d;
    font-family: 'Nunito', sans-serif;
    padding-right: 25px;
    padding-left: 10px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #1565c0;
    background: #fff;
}

.select2-dropdown {
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    font-family: 'Nunito', sans-serif;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #1565c0;
}

/* ===== Статистика на странице товара ===== */
.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.stat-card {
    flex: 1;
    min-width: 160px;
    padding: 16px;
    background: #f5f8fc;
    border: 1px solid #e3f2fd;
    border-radius: 12px;
    text-align: center;
    display: block;
}

.stat-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: #1565c0;
    margin-bottom: 6px;
}

.stat-link {
    font-size: 13px;
    color: #1565c0;
    font-weight: 600;
    text-decoration: none;
}

.stat-link:hover {
    text-decoration: underline;
}

/* ===== Сортировка таблицы ===== */
th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

th.sortable:hover {
    background: #e3f2fd;
}

.sort-arrow {
    color: #999;
    font-size: 12px;
    margin-left: 4px;
}

/* Ссылки в таблицах */
.table-link {
    color: #1565c0;
    text-decoration: none;
}

.table-link:hover {
    text-decoration: none;
}

td:first-child .table-link:hover {
    text-decoration: underline;
}

/* ===== Заголовок категории ===== */
.category-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 4px;
}

.category-header-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.category-header h1 {
    margin: 0;
}

/* ===== Кнопка «Добавить в корзину» ===== */
.product-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.product-header h1 {
    margin: 0;
}

.btn-cart {
    display: inline-block;
    padding: 10px 20px;
    background: #1565c0;
    color: #fff;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-cart:hover {
    background: #0d47a1;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.3);
}

.btn-cart-remove {
    background: #e5e5e5;
    color: #666;
}

.btn-cart-remove:hover {
    background: #ffcdd2;
    color: #c62828;
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.2);
}

/* ===== Элементы корзины ===== */
.cart-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 10px 18px;
}

.cart-item-link {
    color: #2d2d2d;
    text-decoration: none;
}

.cart-item-remove {
    color: #999;
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
    padding: 0 4px;
}

.cart-item-remove:hover {
    color: #c62828;
    text-decoration: none;
}

/* ===== Адаптивность ===== */
@media (max-width: 600px) {
    .content {
        padding: 20px 12px 32px 12px;
    }

    header .header-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }

    header .logo {
        position: static;
        font-size: 18px;
        gap: 6px;
    }

    header .logo-icon {
        width: 40px;
        height: 40px;
    }

    .header-right {
        gap: 8px;
    }

    .city-select-wrapper {
        width: auto;
        min-width: 120px;
        max-width: 180px;
        flex-shrink: 1;
    }

    .select2-container--default .select2-selection--single .select2-selection__rendered {
        padding-left: 4px;
        padding-right: 20px;
    }

    h1 {
        font-size: 22px;
    }

    h2 {
        font-size: 18px;
    }

    .card {
        padding: 16px;
        border-radius: 12px;
    }

    .item,
    .category-card {
        white-space: normal;
        word-break: break-word;
        max-width: 100%;
    }

    .hide-mobile {
        display: none;
    }
}

/* ===== Выбранный город в корзине ===== */
.selected-city-row td {
    background: #e3f2fd !important;
}

.selected-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #1565c0;
    background: #e3f2fd;
    padding: 2px 8px;
    border-radius: 8px;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Всплывающая подсказка в корзине ===== */
.cart-city-name {
    cursor: help;
    border-bottom: 1px dashed #1565c0;
}

.cart-city-price {
    cursor: help;
    border-bottom: 1px dashed transparent;
}

.cart-city-price:hover {
    border-bottom-color: #1565c0;
}

.cart-tooltip {
    display: none;
    position: absolute;
    z-index: 2000;
    min-width: 260px;
    max-width: 360px;
    background: #fff;
    border: 1px solid #e3f2fd;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(21, 101, 192, 0.2);
    padding: 14px 16px;
    font-size: 13px;
    pointer-events: none;
}

.tooltip-title {
    font-weight: 800;
    font-size: 14px;
    color: #1565c0;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e3f2fd;
}

.tooltip-table {
    width: 100%;
    border-collapse: collapse;
}

.tooltip-table td {
    padding: 4px 0;
    font-size: 13px;
    border: none;
    vertical-align: top;
}

.tooltip-table td:first-child {
    color: #2d2d2d;
    padding-right: 12px;
}

.tooltip-price {
    font-weight: 700;
    color: #1565c0;
    white-space: nowrap;
    text-align: right;
}

.tooltip-missing {
    color: #999;
    font-style: italic;
    white-space: nowrap;
    text-align: right;
}

/* ===== Кнопка «Очистить корзину» ===== */
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-clear-cart {
    display: inline-block;
    padding: 8px 16px;
    background: #fff;
    color: #c62828;
    border: 1px solid #ffcdd2;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-clear-cart:hover {
    background: #ffcdd2;
    color: #b71c1c;
    text-decoration: none;
}

/* ===== Футер ===== */
footer {
    background: #fff;
    border-top: 1px solid #f0f0f0;
    margin-top: 60px;
    padding: 40px 0 20px 0;
}

.footer-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-col {
    flex: 1;
    min-width: 200px;
}

.footer-logo {
    font-size: 20px;
    font-weight: 800;
    color: #1565c0;
    margin-bottom: 8px;
}

.footer-desc {
    font-size: 13px;
    color: #888;
    margin: 0;
}

.footer-title {
    font-size: 14px;
    font-weight: 700;
    color: #2d2d2d;
    margin-bottom: 12px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #666;
    font-size: 14px;
    text-decoration: none;
}

.footer-links a:hover {
    color: #1565c0;
    text-decoration: underline;
}

.footer-bottom {
    max-width: 960px;
    margin: 30px auto 0;
    padding: 20px 20px 0;
    border-top: 1px solid #f0f0f0;
    font-size: 13px;
    color: #999;
    text-align: center;
}

/* ===== Форма обратной связи ===== */
.alert-success {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    color: #1565c0;
    padding: 16px 20px;
    border-radius: 10px;
    font-weight: 600;
    margin-bottom: 16px;
}

.form-error {
    color: #c62828;
    font-size: 13px;
    margin-top: 4px;
}

/* ===== Адаптивность футера ===== */
@media (max-width: 600px) {
    .footer-inner {
        flex-direction: column;
        gap: 24px;
    }

    footer {
        padding: 30px 0 15px 0;
    }
}

/* ===== Потребительская корзина ===== */
.basket-hero {
    text-align: center;
    padding: 32px 24px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f5f8fc 100%);
}

.basket-hero-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.basket-hero-city {
    font-size: 20px;
    font-weight: 700;
    color: #1565c0;
    margin-bottom: 12px;
}

.basket-hero-value {
    font-size: 48px;
    font-weight: 800;
    color: #1565c0;
    line-height: 1;
    margin-bottom: 12px;
}

.basket-hero-note {
    font-size: 13px;
    color: #888;
}

/* ===== Товары в корзине (список) ===== */
.basket-items-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.basket-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f5f8fc;
    border: 1px solid #e3f2fd;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.basket-item-row:hover {
    background: #e3f2fd;
    border-color: #1565c0;
    transform: translateX(2px);
}

.basket-item-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    text-decoration: none;
    color: #2d2d2d;
}

.basket-item-link:hover {
    text-decoration: none;
}

.basket-item-action {
    flex-shrink: 0;
}

.btn-cart-small {
    display: inline-block;
    padding: 6px 12px;
    background: #1565c0;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-cart-small:hover {
    background: #0d47a1;
    color: #fff;
    text-decoration: none;
}

.btn-cart-small-remove {
    background: #e5e5e5;
    color: #666;
}

.btn-cart-small-remove:hover {
    background: #ffcdd2;
    color: #c62828;
}

.basket-item-name {
    font-weight: 600;
    font-size: 14px;
}

.basket-item-price {
    font-weight: 800;
    color: #1565c0;
    font-size: 15px;
    white-space: nowrap;
}

/* ===== Блок «Что умеет Ценатоп» ===== */
.site-about {
    margin-top: 20px;
}

.about-features {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.about-feature {
    flex: 1;
    min-width: 220px;
    padding: 16px;
    background: #f5f8fc;
    border: 1px solid #e3f2fd;
    border-radius: 12px;
    text-decoration: none;
    color: #2d2d2d;
    transition: all 0.2s ease;
}

.about-feature:hover {
    background: #e3f2fd;
    border-color: #1565c0;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.15);
}

.about-feature-title {
    font-size: 15px;
    font-weight: 700;
    color: #1565c0;
    margin-bottom: 6px;
}

.about-feature-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.btn-cart-small {
    display: inline-block;
    padding: 6px 12px;
    background: #1565c0;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-cart-small:hover {
    background: #0d47a1;
    color: #fff;
}

.btn-cart-small-remove {
    background: #e5e5e5;
    color: #666;
}

.btn-cart-small-remove:hover {
    background: #ffcdd2;
    color: #c62828;
}


/* ===== Плашка «Ваш город?» ===== */
.city-detect-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px 20px;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
}

.city-detect-text {
    color: #2d2d2d;
}

.city-detect-text strong {
    color: #1565c0;
}

.city-detect-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-city-confirm {
    padding: 6px 14px;
    background: #1565c0;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.btn-city-confirm:hover {
    background: #0d47a1;
}

.btn-city-change {
    padding: 6px 14px;
    background: transparent;
    color: #1565c0;
    border: 1px solid #1565c0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-city-change:hover {
    background: #1565c0;
    color: #fff;
    text-decoration: none;
}

@media (max-width: 600px) {
    .city-detect-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .city-detect-actions {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .hide-mobile {
        display: none !important;
    }
}

/* ===== Hero-блок категории ===== */
/* ===== Hero-блок категории на всю ширину ===== */
.category-hero {
    position: relative;
    overflow: hidden;
    padding: 60px 40px;
    margin-bottom: 24px;
    background-size: cover;
    background-position: center;
    background-color: #1565c0;
    color: #fff;
    min-height: 340px;
    display: flex;
    align-items: center;
    /* Растягиваем на всю ширину экрана */
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.category-hero-content {
    position: relative;
    z-index: 2;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
}

.category-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 1;
}

.category-hero h1 {
    color: #fff;
    font-size: 32px;
    font-weight: 800;
    margin: 12px 0 16px 0;
    line-height: 1.2;
}

.category-hero-desc {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Селект в hero-блоке — крупнее */
.category-hero-search {
    max-width: 560px;
}

.category-hero-search .select2-container {
    width: 100% !important;
}

.category-hero-search .select2-container--default .select2-selection--single {
    background: #fff;
    border: none;
    height: 56px;
    border-radius: 12px;
    padding: 8px 18px;
}

.category-hero-search .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px;
    font-size: 16px;
    color: #2d2d2d;
}

.category-hero-search .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 54px;
    right: 14px;
}

.breadcrumbs-light a {
    color: rgba(255, 255, 255, 0.85);
}

.breadcrumbs-light a:hover {
    color: #fff;
}

.breadcrumbs-light .current {
    color: rgba(255, 255, 255, 0.7);
}

.breadcrumbs-light .sep {
    color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 600px) {
    .category-hero {
        padding: 32px 20px;
        min-height: 240px;
    }
    .category-hero h1 {
        font-size: 22px;
    }
    .category-hero-desc {
        font-size: 14px;
    }
}

/* Убираем отступы для страниц с hero-блоком */
body[data-has-hero="1"] header {
    margin-bottom: 0;
}

body[data-has-hero="1"] .content {
    padding-top: 0;
}

body[data-has-hero="1"] .category-hero {
    margin-top: 0;
}

/* ===== Плитки категорий с изображениями ===== */
.category-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.category-tile {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    border-radius: 16px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-color: #1565c0;
    text-decoration: none;
    color: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(21, 101, 192, 0.3);
    text-decoration: none;
}

.category-tile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
    transition: background 0.2s ease;
}

.category-tile:hover .category-tile-overlay {
    background: linear-gradient(180deg, rgba(21, 101, 192, 0.6) 0%, rgba(13, 71, 161, 0.8) 100%);
}

.category-tile-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 20px;
    width: 100%;
}

.category-tile-name {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    margin-bottom: 6px;
}

.category-tile-count {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Мобильная версия */
@media (max-width: 900px) {
    .category-tiles {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .category-tiles {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .category-tile {
        aspect-ratio: 16 / 9;
    }

    .category-tile-name {
        font-size: 18px;
    }

    .category-tile-count {
        font-size: 12px;
    }
}

.category-tile-age {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

body[data-has-hero="1"] {
    overflow-x: hidden;
}

/* ===== Hero-блок товара ===== */
.product-hero {
    position: relative;
    overflow: hidden;
    padding: 60px 40px;
    margin-bottom: 24px;
    background-size: cover;
    background-position: center;
    background-color: #1565c0;
    color: #fff;
    min-height: 340px;
    display: flex;
    align-items: center;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.product-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 1;
}

.product-hero-content {
    position: relative;
    z-index: 2;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
}

.product-hero h1 {
    color: #fff;
    font-size: 32px;
    font-weight: 800;
    margin: 12px 0 20px 0;
    line-height: 1.2;
}

.product-hero-price {
    margin-bottom: 20px;
}

.product-hero-price-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 4px;
}

.product-hero-price-value {
    font-size: 40px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.product-hero-actions {
    margin-top: 8px;
}

.product-hero-actions .btn-cart {
    background: #fff;
    color: #1565c0;
    font-size: 15px;
    padding: 12px 28px;
}

.product-hero-actions .btn-cart:hover {
    background: #e3f2fd;
    color: #0d47a1;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.product-hero-actions .btn-cart-remove {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.product-hero-actions .btn-cart-remove:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}

@media (max-width: 600px) {
    .product-hero {
        padding: 32px 20px;
        min-height: 280px;
    }
    .product-hero h1 {
        font-size: 22px;
    }
    .product-hero-price-value {
        font-size: 32px;
    }
}

/* ===== Hero-блок на главной ===== */
.main-hero {
    position: relative;
    overflow: hidden;
    padding: 80px 40px;
    margin-bottom: 32px;
    background-size: cover;
    background-position: center;
    background-color: #1565c0;
    color: #fff;
    min-height: 480px;
    display: flex;
    align-items: center;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.main-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 1;
}

.main-hero-content {
    position: relative;
    z-index: 2;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
    text-align: center;
}

.main-hero h1 {
    color: #fff;
    font-size: 40px;
    font-weight: 800;
    margin: 0 0 20px 0;
    line-height: 1.2;
}

.main-hero-desc {
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
    margin-bottom: 32px;
    line-height: 1.5;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.main-hero-search {
    max-width: 560px;
    margin: 0 auto 32px auto;
}

.main-hero-search .select2-container--default .select2-selection--single {
    background: #fff;
    border: none;
    height: 56px;
    border-radius: 12px;
    padding: 8px 18px;
}

.main-hero-search .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px;
    font-size: 16px;
    color: #2d2d2d;
}

.main-hero-search .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 54px;
    right: 14px;
}

.main-hero-cities {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 800px;
    margin: 0 auto;
}

.main-hero-city {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.main-hero-city:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
}

/* Мобильная версия */
@media (max-width: 600px) {
    .main-hero {
        padding: 48px 20px;
        min-height: 380px;
    }

    .main-hero h1 {
        font-size: 24px;
    }

    .main-hero-desc {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .main-hero-search .select2-container--default .select2-selection--single {
        height: 48px;
        padding: 6px 14px;
    }

    .main-hero-search .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 34px;
        font-size: 14px;
    }

    .main-hero-city {
        font-size: 12px;
        padding: 5px 10px;
    }
}