/* Shop: product card, favourites heart, product grids (hand-written, no build). Card: views/overall/product-card.twig. */

.sfProduct { --sf-line: #ececec; --sf-muted: #6f6f6f; --sf-soft: #f7f6f3; position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; overflow: hidden; border: 1px solid var(--sf-line); border-radius: 18px; background: #fff; color: #111; font-family: 'Montserrat', sans-serif; text-align: left; transition: box-shadow .2s, transform .2s, border-color .2s; }
.sfProduct *, .sfProduct *::before, .sfProduct *::after { box-sizing: border-box; }
.sfProduct p { margin: 0; }
.sfProduct:hover { border-color: #dedede; box-shadow: 0 10px 28px rgba(0, 0, 0, .08); transform: translateY(-2px); }
.sfProductMedia { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: var(--sf-soft); }
.sfProductMedia picture, .sfProductMedia img { display: block; width: 100%; height: 100%; margin: 0 !important; object-fit: cover; border-radius: 0 !important; transition: transform .35s; }
.sfProduct:hover .sfProductMedia img { transform: scale(1.04); }
.sfProductMedia .sfProductPlaceholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 100%; color: #b9b9b9; font-size: 12px; }
.sfProductMedia .sfProductPlaceholder svg { width: 56px; height: auto; }
.sfProductStatus { position: absolute; left: 12px; top: 12px; padding: 5px 9px; border-radius: 20px; background: rgba(255, 255, 255, .92); color: #18794e; font-size: 11px; font-weight: 600; line-height: 1.2; backdrop-filter: blur(4px); pointer-events: none; }
.sfProductStatus.is-to_order { color: #a15c00; }
.sfProductStatus.is-out_of_stock { color: #b42318; }
.sfProduct.is-unavailable .sfProductMedia img { filter: grayscale(.6); opacity: .75; }

.sfFav { position: absolute; z-index: 2; top: 10px; right: 10px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #111; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .08); transition: transform .15s, background .15s, color .15s; }
.sfFav svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; transition: fill .15s; }
.sfFav:hover { transform: scale(1.08); }
.sfFav.is-active { color: #e5484d; }
.sfFav.is-active svg { fill: currentColor; }
.sfFav.is-busy { opacity: .6; pointer-events: none; }
.sfFav.is-pop svg { animation: sf-fav-pop .35s ease; }
.sfFav:focus-visible { outline: 2px solid #111; outline-offset: 2px; }
@keyframes sf-fav-pop { 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

.sfProductBody { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.sfProductCategory { color: var(--sf-muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.sfProductTitle { display: -webkit-box; margin: 0; overflow: hidden; font-size: 15px; font-weight: 600; line-height: 1.35; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.sfProductTitle a { color: inherit; text-decoration: none; }
.sfProductTitle a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.sfProductTitle a:hover { text-decoration: underline; }
.sfProductMeta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 18px; color: var(--sf-muted); font-size: 13px; }
.sfProductRating { display: inline-flex; align-items: center; gap: 3px; color: #111; font-weight: 600; }
.sfProductRating svg { width: 14px; height: 14px; fill: #f8a618; }
.sfProductRating small { color: var(--sf-muted); font-weight: 500; }
.sfProductFoot { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 8px; }
.sfProductPrice { font-size: 24px; font-weight: 700; line-height: 1; white-space: nowrap; }
.sfProductPrice span { font-size: 15px; font-weight: 500; }
.sfProductBuy, .sfProductMore { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border: 0; border-radius: 40px; background: #111; color: #fff; font: 600 14px/1.2 'Montserrat', sans-serif; text-decoration: none; white-space: nowrap; cursor: pointer; transition: opacity .15s; }
.sfProductBuy:hover, .sfProductMore:hover { opacity: .85; color: #fff; text-decoration: none; }
.sfProductBuy svg { display: block; width: 17px; height: 17px; margin: 0; fill: currentColor; }
.sfProductMore { background: #f1f0ec; color: #111; }
.sfProductMore:hover { color: #111; }
.sfProductSoldOut { color: var(--sf-muted); font-size: 13px; font-weight: 600; }
@media (max-width: 540px) {
    .sfProductBody { padding: 10px 11px 12px; gap: 4px; }
    .sfProductTitle { font-size: 13px; }
    .sfProductPrice { font-size: 19px; }
    .sfProductFoot { flex-wrap: wrap; }
    .sfProductBuy, .sfProductMore { width: 100%; min-height: 36px; padding: 7px 10px; font-size: 13px; }
    .sfFav { width: 34px; height: 34px; top: 8px; right: 8px; }
    .sfFav svg { width: 18px; height: 18px; }
    .sfProductStatus { left: 8px; top: 8px; font-size: 10px; }
}

/* The old catalog block grids keep their columns; the cell itself is now the card. */
.main-catalog .customBlock .goods .item.sfProductItem, .singleCatalogItemWrapper .goods .item.sfProductItem { display: flex; padding: 0; border: 0; border-radius: 18px; box-shadow: none; }
.main-catalog .customBlock .goods .item.sfProductItem:hover, .singleCatalogItemWrapper .goods .item.sfProductItem:hover { box-shadow: none; transform: none; }
.main-catalog .customBlock .goods .item.sfProductItem.show, .singleCatalogItemWrapper .goods .item.sfProductItem.show { transform: none; }
.main-catalog .customBlock .goods .item.sfProductItem .sfProductBuy, .singleCatalogItemWrapper .goods .item.sfProductItem .sfProductBuy { background: #111; color: #fff; }
.main-catalog .customBlock .goods .item.sfProductItem .sfProductBuy span, .singleCatalogItemWrapper .goods .item.sfProductItem .sfProductBuy span { color: #fff; }
.main-catalog .customBlock .goods .item.sfProductItem .sfProductBuy svg, .singleCatalogItemWrapper .goods .item.sfProductItem .sfProductBuy svg { fill: #fff; margin: 0; }
.main-catalog .customBlock .goods .item.sfProductItem .sfFav, .singleCatalogItemWrapper .goods .item.sfProductItem .sfFav { padding: 0; background: rgba(255, 255, 255, .92); }
.main-catalog .customBlock .goods .item.sfProductItem .sfFav svg, .singleCatalogItemWrapper .goods .item.sfProductItem .sfFav svg { margin: 0; width: 21px; height: 21px; fill: none; }
.main-catalog .customBlock .goods .item.sfProductItem .sfFav.is-active svg, .singleCatalogItemWrapper .goods .item.sfProductItem .sfFav.is-active svg { fill: currentColor; }
.main-catalog .customBlock .goods .item.sfProductItem .sfFav:hover, .singleCatalogItemWrapper .goods .item.sfProductItem .sfFav:hover { background: #fff; }

/* Plain responsive grid (profile lists). */
.sfProductGrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1200px) { .sfProductGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .sfProductGrid { gap: 10px; } }

/* Product page: «В улюблені» next to «Купити». */
.sfFavWide { position: static; display: inline-flex; gap: 8px; width: auto; height: 44px; padding: 0 18px; border: 1.5px solid #e1e1e1; border-radius: 40px; background: #fff; box-shadow: none; font: 600 14px/1 'Montserrat', sans-serif; }
.sfFavWide:hover { transform: none; border-color: #111; }
.sfFavWide.is-active { border-color: #f3c4c5; background: #fff5f5; }
.sfFavWide .sfFavText { color: #111; }
.singleCatalogItemWrapper .sfBuyRow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.singleCatalogItemWrapper .sfBuyRow .sfFavWide svg { width: 20px; height: 20px; margin: 0; padding: 0; fill: none; stroke: currentColor; stroke-width: 1.8; }
.singleCatalogItemWrapper .sfBuyRow .sfFavWide.is-active svg { fill: currentColor; }
.singleCatalogItemWrapper .sfBuyRow .sfFavWide span { color: #111; }
.singleCatalogItemWrapper .sfBuyRow .sfFavWide:hover { background: #fff; }
.singleCatalogItemWrapper .sfBuyRow .sfFavWide:hover svg { fill: none; }
.singleCatalogItemWrapper .sfBuyRow .sfFavWide.is-active:hover svg { fill: currentColor; }
.singleCatalogItemWrapper .priceAndCart .sfBuyRow .sfFavWide svg { fill: none; stroke: #111; }
.singleCatalogItemWrapper .priceAndCart .sfBuyRow .sfFavWide.is-active svg, .singleCatalogItemWrapper .priceAndCart .sfBuyRow .sfFavWide.is-active:hover svg { fill: #e5484d; stroke: #e5484d; }
.singleCatalogItemWrapper .priceAndCart .sfBuyRow .sfFavWide:hover svg { fill: none; stroke: #fff; }
.singleCatalogItemWrapper .priceAndCart .sfBuyRow .sfFavWide:hover span { color: #fff; }
.main-catalog .customBlock .goods .item.sfProductItem .sfFav, .singleCatalogItemWrapper .goods .item.sfProductItem .sfFav { color: #111; }
.main-catalog .customBlock .goods .item.sfProductItem .sfFav.is-active, .singleCatalogItemWrapper .goods .item.sfProductItem .sfFav.is-active { color: #e5484d; }
.main-catalog .customBlock .goods .item.sfProductItem .sfFav:hover svg, .singleCatalogItemWrapper .goods .item.sfProductItem .sfFav:hover svg { fill: none; }
.main-catalog .customBlock .goods .item.sfProductItem .sfFav.is-active:hover svg, .singleCatalogItemWrapper .goods .item.sfProductItem .sfFav.is-active:hover svg { fill: currentColor; }

/* Product slider of the catalog block (views/blocks/main/catalog.twig, assets/js/shop.js). */
.sfRail { --rail-gap: 20px; position: relative; margin: 0 0 8px; }
/* The first card lines up with the content grid; the others run on to the edges of the screen (both ways once
   scrolled) — the block clips them there instead of at the grid. clip, unlike hidden, makes no scroll box. */
.customBlockWrapper:has(.sfRail) { overflow-x: clip; }
.sfRail .sfRailSwiper.swiper-initialized { overflow: visible; }
.sfRailSwiper { padding: 4px 0 8px; margin-top: -4px; }
.sfRailSwiper .swiper-wrapper { align-items: stretch; }
.sfRailSlide { height: auto; display: flex; }
.sfRailSlide > .sfProduct { width: 100%; }
/* No JS yet (editor preview, slow connection): a row that scrolls sideways instead of wrapping. */
.sfRailSwiper:not(.swiper-initialized) .swiper-wrapper { display: flex; gap: var(--rail-gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.sfRailSwiper:not(.swiper-initialized) .sfRailSlide { flex: 0 0 calc((100% - 3 * var(--rail-gap)) / 4); scroll-snap-align: start; }
.sfRail.is-grabbing .sfProduct a { pointer-events: none; }
.sfRailControls { display: flex; align-items: center; gap: 16px; max-width: 520px; margin: 22px auto 0; }
.sfRailNav { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1.5px solid #dedbd4; border-radius: 50%; background: #fff; color: #111; cursor: pointer; transition: background .2s, border-color .2s, color .2s, opacity .2s; }
.sfRailNav:hover { border-color: #111; background: #111; color: #fff; }
.sfRailNav:focus-visible { outline: 2px solid #111; outline-offset: 3px; }
.sfRailNav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sfRailNav.swiper-button-disabled { opacity: .35; cursor: default; pointer-events: none; }
.sfRailScrollbar { position: relative; flex: 1; height: 4px; border-radius: 4px; background: #ebe8e1; cursor: pointer; }
.sfRailScrollbar .swiper-scrollbar-drag { height: 100%; border-radius: 4px; background: #111; cursor: grab; }
.sfRailScrollbar .swiper-scrollbar-drag:active { cursor: grabbing; }
/* Everything fits: no controls. */
.sfRailControls:has(.swiper-button-lock), .sfRailControls:has(.swiper-scrollbar-lock) { display: none; }
@media (max-width: 1100px) { .sfRail { --rail-gap: 16px; } }
@media (max-width: 767px) {
    .sfRail { --rail-gap: 12px; }
    .sfRailNav { display: none; }
    .sfRailControls { margin-top: 16px; max-width: none; }
    .sfRailSwiper:not(.swiper-initialized) .sfRailSlide { flex-basis: 46%; }
}

