/*
 * Redesigned product card (front.inc.items.product_card). Layouts: .pc--grid (grids and carousels), .pc--row
 * (picture beside the text), .pc--compact (small row), .pc--row-mobile (grid, a row on phones).
 * The picture sits whole on a soft tile (sellers' photos come in every style); labels on it are frosted glass.
 * Built on the gozar-ui.css tokens.
 */

.pc {
    --pc-pad: 12px;
    --pc-tile: #F4F2F7;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--gz-border);
    border-radius: var(--gz-radius-lg);
    background: var(--gz-surface);
    font-family: var(--gz-font);
    transition: border-color var(--gz-normal), box-shadow var(--gz-normal);
}
.pc:hover { border-color: var(--gz-brand-200); box-shadow: 0 12px 28px rgba(40, 25, 51, .10); }
/* carousels: a slide takes its content's height, so cards of one row could not match; slides of cards stretch to the
   tallest instead */
.swiper-slide:has(> .pc) { height: auto; }

/* ---- picture ---- */
.pc-media {
    position: relative;
    aspect-ratio: 1;
    margin: 6px 6px 0;
    overflow: hidden;
    border-radius: calc(var(--gz-radius-lg) - 4px);
    background: var(--pc-tile);
}
.pc .pc-img {
    display: block; width: 100% !important; height: 100% !important;
    object-fit: contain;
    mix-blend-mode: multiply; /* a white background melts into the tile */
    transition: transform .45s var(--gz-ease), opacity var(--gz-normal);
}
.pc:hover .pc-img { transform: scale(1.04); }
.pc.is-out .pc-img { opacity: .5; filter: grayscale(.7); }

/* the second photo, shown instead of the first on hover where there is a mouse (product-card.js loads it and adds
   .has-alt once it is in); the first is hidden then, as two photos multiplied together turn dark */
.pc .pc-img-alt { position: absolute; inset: 0; opacity: 0; }
@media (hover: hover) {
    .pc.has-alt:hover .pc-img-alt { opacity: 1; }
    .pc.has-alt:hover .pc-img:not(.pc-img-alt) { opacity: 0; }
}

/* top row: the delivery line (or out of stock) and, in the other corner, one highlight; they share the width */
.pc-top {
    position: absolute; top: 8px; right: 8px; left: 8px; z-index: 1;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; pointer-events: none;
}
.pc-ribbon {
    display: inline-flex; align-items: center; gap: 4px; min-width: 0; height: 26px; padding: 0 10px;
    overflow: hidden; border-radius: var(--gz-radius-pill); white-space: nowrap;
    background: rgba(255, 255, 255, .78); color: var(--gz-ink-2);
    -webkit-backdrop-filter: blur(10px) saturate(160%); backdrop-filter: blur(10px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, .6); box-shadow: 0 2px 8px rgba(28, 18, 36, .08);
    font-size: 11.5px; font-weight: 700;
}
.pc-ribbon .gzi { flex-shrink: 0; font-size: 15px; stroke-width: 2; }
.pc-ribbon span { overflow: hidden; text-overflow: ellipsis; }
.pc-ribbon.is-courier { border-color: rgba(255, 255, 255, .2); background: rgba(37, 99, 235, .88); color: #fff; }
.pc-ribbon.is-green .gzi { color: var(--gz-success); }
.pc-ribbon.is-brand { border-color: rgba(255, 255, 255, .2); color: #fff; background: linear-gradient(135deg, rgba(147, 57, 217, .92), rgba(100, 37, 150, .92)); }
.pc-ribbon.is-out { background: rgba(36, 29, 41, .7); color: #fff; border-color: transparent; }

/* the other corner: one highlight */
.pc-flag {
    flex-shrink: 0; margin-inline-start: auto;
    display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px;
    border-radius: var(--gz-radius-pill); color: #fff; font-size: 10.5px; font-weight: 800; white-space: nowrap;
    box-shadow: 0 2px 8px rgba(28, 18, 36, .12);
}
.pc-flag .gzi { font-size: 13px; stroke-width: 2.4; }
.pc-flag.is-drop { background: var(--gz-danger); }
.pc-flag.is-hot { background: #EA580C; }
.pc-flag.is-new { background: var(--gz-success); }

/* bottom: video mark and the shop's coupon */
.pc-media-foot { position: absolute; right: 0; left: 0; bottom: 0; z-index: 1; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pc-video {
    display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin: 0 8px;
    border-radius: 50%; background: rgba(255, 255, 255, .78); color: var(--gz-ink); font-size: 14px;
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.pc-coupon {
    display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; height: 30px; padding: 0 8px;
    overflow: hidden; background: rgba(36, 29, 41, .72); color: #fff; font-size: 11.5px; font-weight: 600; white-space: nowrap;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.pc-coupon .gzi { flex-shrink: 0; font-size: 15px; color: #FDE68A; }
.pc-coupon b { font-weight: 800; letter-spacing: .3px; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .pc-ribbon { background: rgba(255, 255, 255, .95); }
    .pc-coupon { background: rgba(36, 29, 41, .88); }
}

/* ---- text ---- */
.pc-body { display: flex; flex: 1; flex-direction: column; gap: 6px; min-width: 0; padding: 10px var(--pc-pad) var(--pc-pad); }

.pc-shop { display: flex; align-items: center; gap: 5px; min-width: 0; color: var(--gz-ink-3); font-size: 11.5px; }
/* !important: carousels stretch every picture in a slide (main.css .swiper-slide img) */
.pc .pc-shop img { width: 18px !important; height: 18px !important; flex-shrink: 0; border: 1px solid var(--gz-border); border-radius: 50%; object-fit: cover; }
.pc-shop-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pc-shop-badge { display: inline-flex; flex-shrink: 0; }
.pc .pc-shop-badge svg, .pc .pc-shop-badge img { width: 14px !important; height: 14px !important; }
.pc-shop-city { flex-shrink: 0; margin-inline-start: auto; color: var(--gz-ink-4); white-space: nowrap; }

.pc-title { margin: 0; font-size: 13.5px; font-weight: 500; line-height: 1.75; min-height: 3.5em; }
.pc-link {
    display: -webkit-box; overflow: hidden; color: var(--gz-ink) !important; text-decoration: none;
    -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.pc-link::after { content: ""; position: absolute; inset: 0; z-index: 0; } /* the whole card opens the product */
.pc:hover .pc-link { color: var(--gz-brand-700) !important; }

/* rating · sales · ad */
.pc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--gz-ink-4); font-size: 11.5px; }
.pc-rating { display: inline-flex; align-items: center; gap: 3px; }
.pc-rating .gzi { font-size: 14px; color: var(--gz-star); }
.pc-rating b { color: var(--gz-ink-2); font-weight: 700; }
.pc-sales { color: var(--gz-ink-3); font-weight: 600; }
.pc-ad { padding: 0 6px; border: 1px solid var(--gz-border-strong); border-radius: var(--gz-radius-xs); font-size: 10px; line-height: 16px; }

/* rows: the delivery line and the coupon as text (the picture is too small for them) */
.pc-signals { display: none; flex-direction: column; align-items: flex-start; gap: 4px; font-size: 11.5px; font-weight: 600; }
.pc-signal { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; color: var(--gz-ink-2); white-space: nowrap; overflow: hidden; }
.pc-signal .gzi { flex-shrink: 0; font-size: 14px; stroke-width: 2; color: var(--gz-brand-500); }
.pc-signal.is-courier, .pc-signal.is-courier .gzi { color: #2563EB; }
.pc-signal.is-green .gzi { color: var(--gz-success); }
.pc-signal.is-coupon { padding: 1px 8px; border: 1px dashed rgba(225, 29, 72, .45); border-radius: var(--gz-radius-xs); background: var(--gz-danger-50); color: var(--gz-danger); }
.pc-signal.is-coupon .gzi { color: var(--gz-danger); }

/* ---- price and cart ---- */
.pc-buy { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 2px; }
.pc-price { min-width: 0; }
.pc-was { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.pc-was del { color: var(--gz-ink-4); font-size: 12px; }
.pc-off {
    display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: var(--gz-radius-pill);
    background: var(--gz-danger); color: #fff; font-size: 11px; font-weight: 800;
}
.pc-now { color: var(--gz-ink); font-size: 16px; font-weight: 800; white-space: nowrap; }
.pc-now small { margin-inline-end: 3px; color: var(--gz-ink-3); font-size: 12px; font-weight: 400; }
.pc-unit { margin-inline-start: 3px; color: var(--gz-ink-3); font-size: 11px; font-weight: 400; }
.pc-low { display: flex; align-items: center; gap: 3px; margin-top: 3px; color: var(--gz-danger); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pc-low .gzi { font-size: 13px; }
.pc-unavailable { color: var(--gz-ink-4); font-size: 13px; font-weight: 700; }

.pc-add {
    position: relative; z-index: 2; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0;
    border: 0; border-radius: var(--gz-radius-md); background: var(--gz-brand-50); color: var(--gz-brand-600);
    cursor: pointer; transition: background var(--gz-fast), color var(--gz-fast), transform var(--gz-fast);
}
.pc-add .gzi { font-size: 20px; stroke-width: 2.2; }
.pc-add:hover { background: var(--gz-brand-500); color: #fff; }
.pc-add:active { transform: scale(.92); }
.pc-add-count { font-size: 14px; font-weight: 800; }
.pc-add-count:empty { display: none; }
.pc-add.in-cart { background: var(--gz-success); color: #fff; }
.pc-add.in-cart .pc-add-plus { display: none; }

.pc-add-btn {
    position: relative; z-index: 2;
    display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 40px; margin-top: 4px;
    border: 1px solid transparent; border-radius: var(--gz-radius-md); background: var(--gz-brand-500); color: #fff;
    font: 700 13px/1 var(--gz-font); cursor: pointer; transition: background var(--gz-fast), transform var(--gz-fast);
}
.pc-add-btn .gzi { font-size: 18px; stroke-width: 2.2; }
.pc-add-btn:hover { background: var(--gz-brand-600); }
.pc-add-btn:active { transform: scale(.98); }
.pc-add-btn .pc-add-check, .pc-add-btn .pc-add-label-in { display: none; }
.pc-add-btn.in-cart { border-color: rgba(22, 163, 74, .3); background: var(--gz-success-50); color: var(--gz-success); }
.pc-add-btn.in-cart .pc-add-plus, .pc-add-btn.in-cart .pc-add-label { display: none; }
.pc-add-btn.in-cart .pc-add-check, .pc-add-btn.in-cart .pc-add-label-in { display: inline; }

/* ---- row: picture beside the text; the picture's tile runs the card's full height ---- */
.pc--row { flex-direction: row; }
.pc--row .pc-media {
    width: 120px; min-height: 120px; flex-shrink: 0; align-self: stretch; aspect-ratio: auto;
    margin: 6px; margin-inline-end: 0;
}
.pc--row .pc-body { gap: 5px; padding: 10px 12px; }
.pc--row .pc-title { min-height: 0; }
.pc--row .pc-signals { display: flex; }
.pc--row .pc-top { top: 5px; right: 5px; left: 5px; }
.pc--row .pc-ribbon:not(.is-out), .pc--row .pc-coupon { display: none; }

/* ---- compact: a small row ---- */
.pc--compact { flex-direction: row; align-items: center; border-radius: var(--gz-radius-md); }
.pc--compact .pc-media { width: 68px; flex-shrink: 0; margin: 5px; margin-inline-end: 0; border-radius: var(--gz-radius-sm); }
.pc--compact .pc-body { gap: 3px; padding: 6px 10px; }
.pc--compact .pc-title { min-height: 0; font-size: 13px; }
.pc--compact .pc-link { -webkit-line-clamp: 1; }
.pc--compact .pc-now { font-size: 14px; }
.pc--compact .pc-add { width: 32px; height: 32px; }

/* ---- phones ---- */
@media (max-width: 575.98px) {
    .pc { --pc-pad: 9px; border-radius: var(--gz-radius-md); }
    .pc-media { margin: 4px 4px 0; border-radius: var(--gz-radius-sm); }
    .pc-title { font-size: 12.5px; }
    .pc-now { font-size: 14.5px; }
    .pc-add { width: 34px; height: 34px; }
    .pc-top { top: 6px; right: 6px; left: 6px; }
    .pc-ribbon { height: 23px; padding: 0 8px; font-size: 10.5px; }
    .pc-ribbon .gzi { font-size: 13px; }
    .pc-flag { height: 20px; padding: 0 6px; font-size: 10px; }
    .pc-coupon { height: 26px; font-size: 10.5px; }
    .pc-shop-city { display: none; }
}
@media (max-width: 767.98px) {
    /* the phone list: no card frame, rows parted by a thin line, like an app's list */
    .pc--row-mobile { flex-direction: row; padding: 0 12px; border: 0; border-bottom: 1px solid var(--gz-border); border-radius: 0; background: transparent; }
    .pc--row-mobile:hover { box-shadow: none; }
    .pc--row-mobile .pc-media {
        width: 112px; min-height: 112px; flex-shrink: 0; align-self: stretch; aspect-ratio: auto;
        margin: 10px 0; border-radius: var(--gz-radius-md);
    }
    .pc--row-mobile .pc-body { gap: 5px; padding: 10px 0; padding-inline-start: 12px; }
    .pc--row-mobile .pc-title { min-height: 0; }
    .pc--row-mobile .pc-signals { display: flex; }
    .pc--row-mobile .pc-top { top: 5px; right: 5px; left: 5px; }
    .pc--row-mobile .pc-ribbon:not(.is-out), .pc--row-mobile .pc-coupon { display: none; }
    .pc--row-mobile .pc-shop-city { display: inline; }
}
