/* ==========================================================================
   New design (Carrot, Oct 2026): product cards and the list heading above them
   Shared by the collection pages, Search and Favourites. Values from the delivered
   prototype (app.css .p-grid, .p-card, .p-fav, .col-products-head). Loaded only for Preview users.
   ========================================================================== */

/* ---------- "ALL MAXSOFT PRODUCTS          8 fabrics" ---------- */
.s2-list-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 16px 12px;
    font-family: var(--s2-font);
}
.s2-list-head-ruled {
    margin-top: 18px;
    border-top: 1px solid var(--s2-border);
}
.s2-list-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--s2-indigo);
}
.s2-list-count {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--s2-text-muted);
}

/* ---------- Two cards per row, 4px apart ---------- */
.s2-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding-bottom: 24px;
}
.s2-card {
    min-width: 0;
    font-family: var(--s2-font);
}
.s2-card-media {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--s2-light-gray);
}
.s2-card-link {
    position: absolute;
    inset: 0;
    display: block;
    -webkit-tap-highlight-color: transparent;
}
.s2-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s var(--s2-ease-out), opacity 0.45s ease;
}
/* Pressing the photo or the name zooms the photo a little; pressing the heart leaves the card still */
.s2-card-link:active .s2-card-img,
.s2-card:has(.s2-card-name:active) .s2-card-img {
    transform: scale(1.06);
    transition-duration: 0.2s;
}
.s2-js .s2-card-img:not(.is-loaded) {
    opacity: 0;
}

.s2-card-name {
    display: block;
    padding: 8px 10px 14px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--s2-indigo);
    text-decoration: none;
}

/* ---------- Heart: white plate in the corner, fills when saved ---------- */
.s2-fav {
    position: absolute;
    top: 0;
    right: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: rgba(255, 255, 255, 0.88);
    color: var(--s2-indigo);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.s2-fav svg {
    transition: fill 0.2s ease;
}
.s2-fav.is-fav svg {
    fill: var(--s2-indigo);
}
.s2-fav.pop svg {
    animation: s2FavPop 0.45s var(--s2-ease-spring);
}
.s2-fav[disabled] {
    cursor: default;
}
@keyframes s2FavPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.35); }
    100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .s2-fav.pop svg { animation: none; }
}
