/*
 * Home > Collections List cards (resources/views/frontend/pages/home/partials/collections.blade.php).
 * One frame for every card: white card, title on top, image below, curved
 * grey band at the bottom, soft shadow. All cards are the same size, so
 * images of any size or shape line up.
 */
.ps-section--collections .coll-grid {
    display: grid;
    grid-template-columns: repeat(var(--coll-count, 5), minmax(0, 1fr));
    gap: clamp(12px, 2.2vw, 36px);
    padding: 8px 4px 18px;
}

.coll-card {
    position: relative;
    display: flex;
    flex-direction: column;
    aspect-ratio: 27 / 26;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 18px -6px rgba(15, 23, 42, .22), 0 1px 3px rgba(15, 23, 42, .06);
    overflow: hidden;
    isolation: isolate;
    color: #1f2937 !important;
    text-decoration: none !important;
    transition: transform .2s ease, box-shadow .2s ease;
}
.coll-card:hover,
.coll-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px -10px rgba(15, 23, 42, .3), 0 2px 6px rgba(15, 23, 42, .08);
    outline: none;
}

/* curved grey band behind the lower part of the image */
.coll-card:not(.coll-card--designed)::before {
    content: "";
    position: absolute;
    left: -15%;
    right: -15%;
    bottom: 0;
    height: 36%;
    background: #e9eef0;
    border-radius: 50% 50% 0 0 / 22% 22% 0 0;
    z-index: -1;
}

.coll-card__title {
    flex: 0 0 auto;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding: 9% 10% 4%;
    font-size: clamp(11px, 1.05vw, 17px);
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    color: #1f2937;
}

.coll-card__media {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: block;
}
.coll-card__media img {
    position: absolute;
    display: block;
    max-width: none;
}

/* photo: fills an inset, rounded frame */
.coll-card--photo .coll-card__media img {
    inset: 0 9% 9%;
    width: 82%;
    height: 91%;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .12);
}

/* cut-out (transparent PNG of a product / person): whole image, on the band */
.coll-card--cutout .coll-card__media img {
    inset: 0 8% 6%;
    width: 84%;
    height: 94%;
    object-fit: contain;
    object-position: center bottom !important;
}

/* old-style image that already is a complete card */
.coll-card--designed {
    background: transparent;
    box-shadow: none;
    overflow: visible;
}
.coll-card--designed:hover { box-shadow: none; }
.coll-card__designed {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: scale(1.06); /* the old PNGs carry a transparent shadow margin */
}
.coll-card__title--over {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding-top: 6%;
}

/* tablets: three per row */
@media (max-width: 991.98px) {
    .ps-section--collections .coll-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .coll-card__title { font-size: 13px; }
}

/* phones: swipe sideways, about two and a half cards visible */
@media (max-width: 575.98px) {
    .ps-section--collections .coll-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
        padding: 6px 16px 16px;
        scroll-padding-left: 16px;
        scrollbar-width: none;
    }
    .ps-section--collections .coll-grid::-webkit-scrollbar { display: none; }
    .coll-card {
        flex: 0 0 40%;
        scroll-snap-align: start;
    }
    .coll-card__title { font-size: 12px; }
}
