/* Catalog - Kotanyi style */

/* Горизонтальные отступы у контента каталога на телефонах (в т.ч. вырезы iPhone) */
:root {
    --catalog-mobile-inline: max(1.25rem, env(safe-area-inset-left, 0px));
    --catalog-mobile-inline-end: max(1.25rem, env(safe-area-inset-right, 0px));
}

.catalog-main {
    padding-top: calc(70px + env(safe-area-inset-top, 0px));
}

.catalog-hero {
    background: #fff;
    color: inherit;
    padding: 3.5rem 2rem 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.catalog-hero-inner {
    max-width: 800px;
    margin: 0 auto;
}

.catalog-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--color-secondary);
}

.catalog-subtitle {
    font-size: 1.05rem;
    color: rgba(0, 0, 0, 0.55);
    line-height: 1.5;
}

.catalog-section {
    padding: 3rem 2rem 4rem;
    background: #fff;
    overflow: visible;
}

.catalog-container {
    max-width: min(1200px, var(--container-max));
    margin: 0 auto;
    overflow: visible;
}

.catalog-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
}

.catalog-card {
    display: block;
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 12px;
    overflow: visible;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.04);
    /* без transform на <a>: иначе fixed-попап позиционируется относительно карточки, а не вьюпорта */
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    color: inherit;
    backface-visibility: hidden;
}

.catalog-card.visible {
    opacity: 1;
}

.catalog-card:hover {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    z-index: 2;
}

.catalog-card-image {
    aspect-ratio: 1;
    overflow: hidden;
    padding: 1.75rem;
    z-index: 1;
    isolation: isolate;
    border-radius: 12px 12px 0 0;
    background: transparent;
}

.catalog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: scale(1);
    transform-origin: center center;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backface-visibility: hidden;
}

.catalog-card:hover .catalog-card-image img {
    transform: translateY(-4px) scale(1.04);
}

.catalog-card-content {
    padding: 1.25rem 1.35rem 1.5rem;
}

.catalog-card-content h2 {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
    color: var(--color-secondary);
    line-height: 1.3;
}

.catalog-card-content p {
    color: rgba(0, 0, 0, 0.52);
    font-size: 0.88rem;
    line-height: 1.45;
}
.catalog-card-count {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-accent, #2d5016);
    line-height: 1.5;
}

/* Breadcrumbs in content (light bg) */
.breadcrumbs--light {
    margin-bottom: 1.5rem;
}

.breadcrumbs--light a {
    color: var(--color-primary);
}

.breadcrumbs--light a:hover {
    color: var(--color-primary-dark);
}

.breadcrumbs--light span {
    color: var(--color-text-light);
}

/* Categories strip under the header (shared with HoReCa) */
.gourmet-cats {
    max-width: var(--container-max);
    margin: 0 auto;
    margin-top: calc(var(--header-height, 78px) + env(safe-area-inset-top, 0px) + 10px);
    padding: 0.2rem 2rem 0.95rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.gourmet-cat {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    color: rgba(0,0,0,0.52);
    padding: 0.35rem 0.25rem;
    transition: color var(--transition), opacity var(--transition), transform var(--transition);
    min-width: 88px;
}

.gourmet-cat-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
}

.gourmet-cat-icon img {
    width: 44px;
    height: 44px;
    display: block;
    object-fit: contain;
    object-position: center;
}

.gourmet-cat-label {
    font-size: 0.98rem;
    line-height: 1.1;
    text-align: center;
    color: inherit;
}

.gourmet-cat:hover {
    color: rgba(0,0,0,0.75);
    transform: translateY(-1px);
}

.gourmet-cat.is-active {
    color: rgba(45, 90, 39, 0.95);
}

.gourmet-cat.is-active .gourmet-cat-label {
    font-weight: 700;
}

.gourmet-cat:focus-visible {
    outline: 2px solid rgba(196, 30, 58, 0.55);
    outline-offset: 3px;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .gourmet-cats {
        padding-left: max(1rem, env(safe-area-inset-left, 0px));
        padding-right: max(1rem, env(safe-area-inset-right, 0px));
        gap: 1.25rem;
    }
}

/*
 * Pages with the categories strip under the fixed header
 * should not additionally push the whole main content down.
 * HoReCa uses .horeca-main { padding-top: 0; } — mirror that here.
 */
body[data-page="brand_catalog"] #brand-cats + .products-main,
body[data-page="catalog_cat"] #brand-cats + .products-main {
    padding-top: 0;
}

/* Inline catalog search (under categories) */
.catalog-inline-search {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0.35rem 2rem 0.75rem;
}

.catalog-inline-search__inner {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.catalog-inline-search__field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 14px;
    padding: 0.35rem 0.5rem;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
}

.catalog-inline-search__input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.55rem 0.6rem;
    min-width: 0;
}

.catalog-inline-search__clear {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.03);
    cursor: pointer;
    font-size: 1.05rem;
    flex: 0 0 auto;
}

.catalog-inline-search__results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 40;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.14);
    overflow: hidden;
}

.catalog-inline-search__list {
    list-style: none;
    margin: 0;
    padding: 0.35rem;
    display: grid;
    gap: 0.25rem;
    max-height: min(52vh, 520px);
    overflow: auto;
}

.catalog-inline-search__link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 0.55rem 0.55rem;
    border-radius: 12px;
}

.catalog-inline-search__link:hover {
    background: rgba(45, 90, 39, 0.06);
}

.catalog-inline-search__row {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 0.65rem;
    align-items: center;
}

.catalog-inline-search__thumb {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.catalog-inline-search__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.catalog-inline-search__name {
    font-weight: 700;
    color: rgba(44, 44, 44, 0.92);
    line-height: 1.25;
}

.catalog-inline-search__empty {
    padding: 0.85rem 0.9rem;
    color: rgba(44, 44, 44, 0.7);
}

@media (max-width: 768px) {
    .catalog-inline-search {
        padding-left: var(--catalog-mobile-inline);
        padding-right: var(--catalog-mobile-inline-end);
    }
}

/* Каталог: страница категории и хаб бренда (kotanyi / milford / orient) */
body[data-page="catalog_cat"],
body[data-page="brand_catalog_hub"] {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Prevent "page zoomed out" on some mobile browsers due to tiny overflow */
    overflow-x: clip;
}

/* Brand catalog (single page with dynamic category switching) */
body[data-page="brand_catalog"] {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
}

.products-main {
    padding-top: calc(70px + env(safe-area-inset-top, 0px));
    flex: 1 0 auto;
    overflow-x: clip;
}

.products-hero {
    background: #fff;
    color: inherit;
    padding: 3rem 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.products-hero-inner {
    max-width: 800px;
    margin: 0 auto;
}

.products-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--color-secondary);
}

.products-subtitle {
    color: rgba(0, 0, 0, 0.55);
    font-size: 1.02rem;
}

.products-section {
    padding: 3rem 2rem;
    background: #fff;
    overflow: visible;
}

.products-container {
    max-width: 1200px;
    margin: 0 auto;
    overflow: visible;
    max-width: min(1200px, 100%);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
    overflow: visible;
    max-width: 100%;
}

/* Планшет: три колонки вместо четырёх */
@media (max-width: 1100px) and (min-width: 769px) {
    .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

/* Карточки продуктов в сетке: подъём только у изображения, не у <a> (см. fixed-попап) */
.products-grid .product-card {
    opacity: 1;
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.products-grid .product-card:hover {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    z-index: 4;
}
.products-grid .product-card .product-card-image img,
.products-grid .product-card .product-card-image .carousel-slide img {
    transform: scale(1);
    transform-origin: center center;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backface-visibility: hidden;
}
.products-grid .product-card:hover .product-card-image img,
.products-grid .product-card:hover .product-card-image .carousel-slide img {
    transform: translateY(-4px) scale(1.04);
}

/* Product card — без transform на <a> (fixed-попап); появление — только opacity */
.product-card {
    display: block;
    position: relative;
    z-index: 1;
    background: transparent;
    border-radius: 12px;
    overflow: visible;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.04);
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    text-align: center;
    padding: 0.85rem 0.65rem 1rem;
    backface-visibility: hidden;
}

.product-card.visible {
    opacity: 1;
}

/* Hover для карточек вне .products-grid */
.product-card:hover {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    z-index: 2;
}
.product-card:hover .product-card-image img,
.product-card:hover .product-card-image .carousel-slide img {
    transform: translateY(-4px) scale(1.04);
}

.product-card-image {
    height: 188px;
    min-height: 188px;
    aspect-ratio: unset;
    overflow: visible;
    margin: 0 auto 0.75rem;
    position: relative;
    z-index: 1;
    isolation: isolate;
    border-radius: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
}

.product-card-image:not(.product-carousel) {
    width: 152px;
}

/* Карусель: высота трека как у HoReCa-блока, точки под ним */
.product-card-image.product-carousel {
    height: auto;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

.product-card-image.product-carousel .carousel-track {
    height: 188px;
    min-height: 188px;
    flex-shrink: 0;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    max-height: 188px;
    object-fit: contain;
    object-position: center center;
    display: block;
    border-radius: 0;
    transform: scale(1);
    transform-origin: center center;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backface-visibility: hidden;
}

body[data-cat="novinki"]:not([data-horeca-catalog="true"]) .product-card-image img,
body[data-cat="barbekyu"]:not([data-horeca-catalog="true"]) .product-card-image img {
    width: 126%;
    height: 126%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    clip-path: inset(4% 12% 8% 12%);
    transform: scale(1);
}

body[data-cat="novinki"]:not([data-horeca-catalog="true"]) .product-card:hover .product-card-image img,
body[data-cat="novinki"]:not([data-horeca-catalog="true"]) .product-card:hover .product-card-image .carousel-slide img,
body[data-cat="barbekyu"]:not([data-horeca-catalog="true"]) .product-card:hover .product-card-image img,
body[data-cat="barbekyu"]:not([data-horeca-catalog="true"]) .product-card:hover .product-card-image .carousel-slide img {
    transform: translateY(-4px) scale(1.04);
}

body[data-cat="novinki"]:not([data-horeca-catalog="true"]) .product-card-image:not(.product-carousel),
body[data-cat="barbekyu"]:not([data-horeca-catalog="true"]) .product-card-image:not(.product-carousel) {
    width: 152px;
}

body[data-cat="novinki"]:not([data-horeca-catalog="true"]) .product-card-image,
body[data-cat="novinki"]:not([data-horeca-catalog="true"]) .product-card-image.product-carousel .carousel-track,
body[data-cat="barbekyu"]:not([data-horeca-catalog="true"]) .product-card-image,
body[data-cat="barbekyu"]:not([data-horeca-catalog="true"]) .product-card-image.product-carousel .carousel-track {
    height: 188px;
    min-height: 188px;
    overflow: visible;
}

.product-card-image > img,
.product-card-image .carousel-track {
    position: relative;
    z-index: 1;
}

.product-card-title {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.35;
    color: rgba(0, 0, 0, 0.55);
    margin-bottom: 0.25rem;
    transition: color var(--transition);
}

.product-card:hover .product-card-title {
    color: rgba(0, 0, 0, 0.72);
}

/* Место под бренд зарезервировано — карточка не растёт по высоте при наведении */
.product-card-packaging {
    font-size: 0.75rem;
    color: var(--color-text-light);
    min-height: 1.5rem;
    opacity: 0;
    transition: opacity 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.product-card:hover .product-card-packaging {
    opacity: 1;
}

.products-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--color-text-light);
}

/* Product detail page */
.product-detail-main {
    padding-top: calc(70px + env(safe-area-inset-top, 0px));
    flex: 1 0 auto;
}

.product-detail-hero {
    background: #fff;
    padding: 3rem 2rem;
}

.product-detail-container {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    align-items: start;
}

.product-detail-image {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.product-detail-image img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: contain;
    object-position: center center;
    display: block;
    border-radius: 12px;
}

/* Страница товара: карусель с тем же скруглением и пропорциями */
.product-detail-image.product-carousel {
    aspect-ratio: 3/4;
}
.product-detail-image .carousel-track {
    height: 100%;
    min-height: 0;
}
.product-detail-image .carousel-slide {
    height: 100%;
    overflow: hidden;
}
.product-detail-image .carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    border-radius: 12px;
}

.product-detail-content h1 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--color-dark);
}

.product-detail-content .product-packaging {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
}

.product-detail-content .product-description {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.product-detail-content .product-composition {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
}

.product-detail-content .product-storage {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-top: 0.5rem;
}

.product-detail-section {
    padding: 2rem;
    background: white;
}

.product-detail-section h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--color-dark);
}

/* Responsive — мобильные: две карточки в ряд + отступы от краёв экрана */
@media (max-width: 768px) {
    .catalog-categories {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: clamp(0.7rem, 2.8vw, 0.95rem);
    }

    .catalog-hero,
    .products-hero {
        padding-top: 2.5rem;
        padding-bottom: 2rem;
        padding-left: var(--catalog-mobile-inline);
        padding-right: var(--catalog-mobile-inline-end);
    }

    .catalog-section,
    .products-section {
        padding-top: 1.75rem;
        padding-bottom: 2.5rem;
        padding-left: var(--catalog-mobile-inline);
        padding-right: var(--catalog-mobile-inline-end);
    }

    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: clamp(0.7rem, 2.8vw, 0.95rem);
    }

    .breadcrumbs.breadcrumbs--light {
        margin-bottom: 1.25rem;
    }

    .product-detail-hero {
        padding-left: var(--catalog-mobile-inline);
        padding-right: var(--catalog-mobile-inline-end);
    }

    .product-detail-section {
        padding-left: var(--catalog-mobile-inline);
        padding-right: var(--catalog-mobile-inline-end);
    }

    .product-detail-container {
        grid-template-columns: 1fr;
    }

    .product-detail-image {
        max-width: 280px;
        margin: 0 auto;
    }
}

/* Product image carousel (multiple packaging formats) */
.product-card-image.product-carousel {
    border-radius: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
    position: relative;
}
.product-carousel {
    position: relative;
    width: 100%;
    overflow: visible;
    border-radius: 0;
}
/* Карусель в карточке: фиксированная высота трека; overflow visible — иначе hover scale/translate обрезает картинку */
.product-card-image .carousel-track {
    flex: 0 0 auto;
    position: relative;
    min-height: 188px;
    height: 188px;
    overflow: visible;
    border-radius: 0;
}
.product-card-image.product-carousel > .carousel-nav {
    top: 94px;
    transform: translateY(-50%);
}
.product-carousel .carousel-track {
    display: flex;
    transition: transform 0.35s ease;
}
.product-card-image .carousel-slide {
    height: 100%;
    min-height: 0;
    overflow: visible;
    border-radius: 0;
}
.product-carousel .carousel-slide {
    min-width: 100%;
    flex-shrink: 0;
    display: none;
}
.product-carousel .carousel-slide.active {
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-carousel .carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
    vertical-align: middle;
    /* Та же анимация при наведении, что у .catalog-card-image img */
    transform: scale(1);
    transform-origin: center center;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backface-visibility: hidden;
}
.product-card-image .carousel-slide img {
    border-radius: 0;
}
.product-carousel .carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.4);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.2s;
}
.product-carousel .carousel-nav:hover {
    background: rgba(0,0,0,0.6);
}
.product-carousel .carousel-prev { left: 8px; }
.product-carousel .carousel-next { right: 8px; }
.product-carousel .carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}
.product-carousel .carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: #ccc;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}
.product-carousel .carousel-dot.active {
    background: var(--color-primary);
}
/* Show nav only when more than one image */
.product-carousel.has-multiple .carousel-nav,
.product-carousel.has-multiple .carousel-dots { display: flex; }
.product-carousel:not(.has-multiple) .carousel-nav,
.product-carousel:not(.has-multiple) .carousel-dots { display: none !important; }

/* Orient brand badge */
.brand-orient {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #c41e3a;
    background: rgba(196, 30, 58, 0.1);
    padding: 0.2em 0.5em;
    border-radius: 4px;
    margin-top: 0.35rem;
}
.product-card .brand-orient { margin-top: 0.25rem; }

.brand-milford {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9a1830;
    background: rgba(196, 30, 58, 0.1);
    padding: 0.2em 0.5em;
    border-radius: 4px;
    margin-top: 0.35rem;
}
.product-card .brand-milford { margin-top: 0.25rem; }

.product-card-packaging.brand-milford,
.product-packaging.brand-milford {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.2rem;
    background: transparent;
    color: inherit;
    padding: 0;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
}

.product-detail-content .product-packaging.brand-milford {
    align-items: flex-start;
}

.product-detail-content .product-packaging.brand-milford .product-detail-pack-variant {
    text-align: left;
}

.product-card-brand-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9a1830;
    background: rgba(196, 30, 58, 0.1);
    padding: 0.2em 0.5em;
    border-radius: 4px;
}

.product-card-pack-variant {
    font-size: 0.68rem;
    line-height: 1.25;
    font-weight: 500;
    color: rgba(44, 44, 44, 0.78);
    text-align: center;
    max-width: 13rem;
}

.product-detail-pack-variant {
    display: block;
    font-size: 0.9rem;
    line-height: 1.35;
    font-weight: 500;
    color: rgba(44, 44, 44, 0.75);
    margin-top: 0.15rem;
}

.brand-catalog-hub.products-mega-menu-grid--hub {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.25rem;
    max-width: 1000px;
    margin: 1.5rem auto 0;
}

.brand-catalog-hub__card[data-empty-category="true"] {
    opacity: 0.55;
}

/* Всплывающее описание (как HoReCa; позиция fixed задаётся в catalog-popover.js) */
/* z-index выше .product-card-image: иначе блок с картинкой/каруселью (идёт следом в DOM) перекрывает попап */
.product-card-popover,
.catalog-card-popover {
    position: absolute;
    z-index: 5;
    left: 50%;
    bottom: calc(100% + 14px);
    transform: translateX(-50%) translateY(10px);
    /*
     * IMPORTANT: don't use vw/dvw here.
     * On some mobile browsers it can make the layout slightly wider than the viewport,
     * which triggers the "page zoomed out" effect. Use container-based sizing instead.
     */
    width: min(300px, calc(100% - 2rem));
    max-width: calc(100% - 2rem);
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
    padding: 0.75rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 220ms ease, transform 240ms ease, visibility 0s linear 220ms;
    transition-delay: 0s;
}

.product-card-popover strong,
.catalog-card-popover strong {
    font-size: 0.92rem;
    line-height: 1.25;
    color: #1f1f1f;
}

.product-card-popover span,
.catalog-card-popover span {
    font-size: 0.84rem;
    line-height: 1.4;
    color: rgba(0, 0, 0, 0.68);
}

.product-card-popover::after,
.catalog-card-popover::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 100%;
    width: 12px;
    height: 12px;
    background: #fff;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    transform: translateX(-50%) rotate(45deg);
}

/* Попап под карточкой — стрелка сверху окна, указывает на товар */
.product-card-popover.is-popover-below::after,
.catalog-card-popover.is-popover-below::after {
    top: 0;
    bottom: auto;
    margin-top: -6px;
    border-right: none;
    border-bottom: none;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    transform: translate(-50%, -50%) rotate(45deg);
}

/* Видимость попапа — вне (hover+fine): иначе на touch / эмуляции телефона окно никогда не показывается */
.product-card.is-popover-open .product-card-popover,
.catalog-card.is-popover-open .catalog-card-popover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 5000;
    transition-delay: 0s;
}

/* Размытие фона только при «настоящем» hover мышью */
@media (hover: hover) and (pointer: fine) {
    .products-main.is-focus-active .products-hero,
    .products-main.is-focus-active .breadcrumbs,
    .products-main.is-focus-active .product-card {
        filter: blur(2px);
        opacity: 0.38;
        transition: filter 220ms ease, opacity 220ms ease;
    }

    .products-main.is-focus-active .product-card.is-active-focus {
        filter: none;
        opacity: 1;
    }

    .catalog-main.is-focus-active .catalog-hero,
    .catalog-main.is-focus-active .catalog-card {
        filter: blur(2px);
        opacity: 0.38;
        transition: filter 220ms ease, opacity 220ms ease;
    }

    .catalog-main.is-focus-active .catalog-card.is-active-focus {
        filter: none;
        opacity: 1;
    }
}

.product-card:focus-visible,
.catalog-card:focus-visible {
    outline: 2px solid rgba(196, 30, 58, 0.55);
    outline-offset: 6px;
    border-radius: 10px;
}

@media (prefers-reduced-motion: reduce) {
    .product-card-detail-visual,
    .product-card-popover,
    .catalog-card-popover {
        transition: none !important;
    }
}

/* Узкие экраны: по-прежнему 2 колонки, чуть компактнее карточки */
@media (max-width: 480px) {
    .catalog-categories,
    .products-grid {
        gap: 0.65rem;
    }

    .catalog-card-image {
        padding: 1rem;
    }

    .catalog-card-content {
        padding: 0.8rem 0.65rem 1rem;
    }

    .catalog-card-content h2 {
        font-size: 0.92rem;
    }

    .catalog-card-content p {
        font-size: 0.8rem;
    }

    .product-card {
        padding: 0.5rem 0.4rem 0.7rem;
    }

    .product-card-title {
        font-size: 0.8rem;
        line-height: 1.28;
    }

    .product-card-packaging {
        font-size: 0.68rem;
        min-height: 1.35rem;
    }

    .product-card-image .carousel-track {
        min-height: 136px;
        height: 136px;
    }

    .product-card-image.product-carousel > .carousel-nav {
        top: 68px;
    }

}
