/* ==========================================================================
   Shared product card + table (template-parts/product/card.php, table.php).
   Used on the homepage catalog, the product center and product detail "related".
   ========================================================================== */

.pc-card {
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.pc-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 16px 32px -20px rgba(15, 41, 66, .35);
    transform: translateY(-2px);
}
.pc-card-img {
    transition: transform .45s ease;
}
.pc-card:hover .pc-card-img {
    transform: scale(1.05);
}

/* Sticky product column: soft edge shadow so scrolled columns slide underneath */
.pc-sticky-col {
    box-shadow: 2px 0 6px -3px rgba(15, 23, 42, .12);
}

/* ---------- Phone layout helpers (shared by homepage modules) ---------- */

/* Horizontal swipe row on phones; the breakpoint class (sm:grid / md:grid) turns it back into a grid. */
.m-swipe {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 16px;
    padding: 0 16px 6px;
    margin: 0 -16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.m-swipe::-webkit-scrollbar { display: none; }
.m-swipe > .m-swipe-item {
    flex: 0 0 78%;
    max-width: 320px;
    scroll-snap-align: start;
}
.m-swipe > .m-swipe-item.hidden { display: none; }
@media (min-width: 640px) {
    .m-swipe.sm\:grid { display: grid; overflow: visible; padding: 0; margin: 0; scroll-snap-type: none; }
    .m-swipe.sm\:grid > .m-swipe-item { max-width: none; }
}
@media (min-width: 768px) {
    .m-swipe.md\:grid { display: grid; overflow: visible; padding: 0; margin: 0; scroll-snap-type: none; }
    .m-swipe.md\:grid > .m-swipe-item { max-width: none; }
}
/* Inside the bordered homepage catalog box the row starts at the box edge. */
#catalog-view-grid .m-swipe { margin: 0; }
@media (min-width: 640px) {
    #catalog-view-grid .m-swipe { padding: 0; }
}

/* Category tabs: fade the right edge on small screens so it reads as scrollable. */
@media (max-width: 1023px) {
    .pc-tabs-fade {
        -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
        mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
        padding-right: 28px;
    }
}

/* Phones: product lists always use cards (table + view switch hidden). */
@media (max-width: 767px) {
    #catalog-view-table { display: none !important; }
    #catalog-view-grid.hidden { display: block !important; }
    #catalog-view-grid.grid.hidden { display: grid !important; }
}

@media (prefers-reduced-motion: reduce) {
    .pc-card, .pc-card-img { transition: none !important; }
    .pc-card:hover, .pc-card:hover .pc-card-img { transform: none; }
}
