/* =============================================================
   Product card — LIST/ROW style. Client-approved design: play icon centered on the
   thumbnail, ±5s skip + a matching play/pause button, a non-clickable play-count pill,
   a public like button, and a dark "অর্ডার করুন →" pill that fills the rest of the row
   and opens the product page (no separate price pill, no round "view product" icon).
   Used on: Home, Search, Category, Wishlist (all via includes/product-card.php,
   all wrapped by a .product-grid container) — and a stripped-down version
   (skip buttons only, no play-count/like/order) on the Checkout page's Order review.
   ============================================================= */

.product-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ---------- Row (= .row in the mockup), now its own boxed card ---------- */
.product-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #e3edf7;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(11, 27, 47, 0.03);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    opacity: 0;
    animation: pcCardIn 0.45s ease forwards;
}
.product-card:hover { box-shadow: 0 8px 20px rgba(11, 27, 47, 0.09); transform: translateY(-2px); }
.product-grid > .product-card:nth-child(1) { animation-delay: 0.05s; }
.product-grid > .product-card:nth-child(2) { animation-delay: 0.1s; }
.product-grid > .product-card:nth-child(3) { animation-delay: 0.15s; }
.product-grid > .product-card:nth-child(4) { animation-delay: 0.2s; }
.product-grid > .product-card:nth-child(5) { animation-delay: 0.25s; }
.product-grid > .product-card:nth-child(6) { animation-delay: 0.3s; }
.product-grid > .product-card:nth-child(n+7) { animation-delay: 0.32s; }
@keyframes pcCardIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Thumbnail (= .thumb) ---------- */
.pc-thumb {
    position: relative;
    flex: none;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    background: #eeedf0;
    cursor: pointer;
    border: none;
    padding: 0;
    display: block;
}
.pc-thumb-static { cursor: default; }
.pc-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-thumb video.pc-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pc-thumb-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: #eeedf0; color: #b9b7bd; font-size: 1.2rem;
}

.pc-dur {
    position: absolute; left: 4px; bottom: 4px;
    background: rgba(0, 0, 0, 0.62); color: #f2efe9;
    font-size: 9.5px; font-weight: 600;
    padding: 1.5px 5px; border-radius: 20px;
    pointer-events: none;
}

/* Dark overlay shown over the thumbnail while playing (= .thumb.playing::after) */
.pc-thumb.is-playing::after {
    content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4);
}

/* Play icon centered on the thumbnail — RED, with a blinking red pulse. Fades out while
   playing (the wave indicator takes over) and the blink animation is switched off then. */
.pc-thumb-play {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    color: #e11d2e; pointer-events: none; z-index: 1;
    opacity: 1; transition: opacity 0.25s ease;
}
/* Red pulse ring behind the icon */
.pc-thumb-play::before {
    content: ""; position: absolute; top: 50%; left: 50%;
    width: 30px; height: 30px; margin: -15px 0 0 -15px;
    border-radius: 50%; background: rgba(225, 29, 46, 0.35);
    animation: pcPlayPulse 1.4s ease-out infinite;
}
.pc-thumb-play svg {
    position: relative; width: 22px; height: 22px;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.9)) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
    animation: pcPlayBlink 1.2s ease-in-out infinite;
}
.pc-thumb.is-playing .pc-thumb-play { opacity: 0; }
.pc-thumb.is-playing .pc-thumb-play::before,
.pc-thumb.is-playing .pc-thumb-play svg { animation: none; }
@keyframes pcPlayBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.88); }
}
@keyframes pcPlayPulse {
    0% { transform: scale(0.6); opacity: 0.9; }
    100% { transform: scale(1.7); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .pc-thumb-play::before, .pc-thumb-play svg { animation: none; }
}

/* Centered wave/equalizer indicator (= .wave-icon), only visible while playing */
.pc-wave {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    display: none; align-items: center; gap: 1.6px; z-index: 2;
}
.pc-thumb.is-playing .pc-wave { display: flex; }
.pc-wave span { width: 2px; border-radius: 2px; background: #fff; box-shadow: 0 0 4px rgba(0, 0, 0, 0.5); }
.pc-wave span:nth-child(1) { height: 7px; }
.pc-wave span:nth-child(2) { height: 16px; }
.pc-wave span:nth-child(3) { height: 10px; }
.pc-wave span:nth-child(4) { height: 22px; }
.pc-wave span:nth-child(5) { height: 13px; }
.pc-wave span:nth-child(6) { height: 26px; }
.pc-wave span:nth-child(7) { height: 12px; }
.pc-wave span:nth-child(8) { height: 20px; }
.pc-wave span:nth-child(9) { height: 9px; }
.pc-wave span:nth-child(10) { height: 17px; }
.pc-wave span:nth-child(11) { height: 8px; }
.pc-wave span:nth-child(12) { height: 14px; }
.pc-thumb.is-playing .pc-wave span { animation-name: pcWaveBounce; animation-iteration-count: infinite; animation-timing-function: ease-in-out; }
.pc-thumb.is-playing .pc-wave span:nth-child(1) { animation-duration: .7s; animation-delay: 0s; }
.pc-thumb.is-playing .pc-wave span:nth-child(2) { animation-duration: 1.05s; animation-delay: .08s; }
.pc-thumb.is-playing .pc-wave span:nth-child(3) { animation-duration: .85s; animation-delay: .02s; }
.pc-thumb.is-playing .pc-wave span:nth-child(4) { animation-duration: 1.2s; animation-delay: .16s; }
.pc-thumb.is-playing .pc-wave span:nth-child(5) { animation-duration: .9s; animation-delay: .05s; }
.pc-thumb.is-playing .pc-wave span:nth-child(6) { animation-duration: 1.3s; animation-delay: .22s; }
.pc-thumb.is-playing .pc-wave span:nth-child(7) { animation-duration: .75s; animation-delay: .1s; }
.pc-thumb.is-playing .pc-wave span:nth-child(8) { animation-duration: 1.1s; animation-delay: .14s; }
.pc-thumb.is-playing .pc-wave span:nth-child(9) { animation-duration: .8s; animation-delay: .03s; }
.pc-thumb.is-playing .pc-wave span:nth-child(10) { animation-duration: 1s; animation-delay: .18s; }
.pc-thumb.is-playing .pc-wave span:nth-child(11) { animation-duration: .65s; animation-delay: .07s; }
.pc-thumb.is-playing .pc-wave span:nth-child(12) { animation-duration: .95s; animation-delay: .12s; }
@keyframes pcWaveBounce {
    0%, 100% { transform: scaleY(0.3); }
    50% { transform: scaleY(1); }
}

/* ---------- Content: title / description / controls (= .content) ----------
   container-type lets the control row below react to ITS OWN available width (not the
   viewport), which matters because .pc-content's width also depends on the thumbnail
   size and any remove button next to it — see the @container rule near .pc-ctrl-row. */
.pc-content { flex: 1; min-width: 0; container-type: inline-size; }

.pc-title-link { display: block; text-decoration: none; color: inherit; }

.pc-title-line { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: 0; max-width: 100%; overflow: hidden; }
.pc-title {
    color: #1c1b1f; font-weight: 600; font-size: 15px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex: 1; min-width: 0;
}

.pc-desc {
    margin-top: 3px; color: #6f6d75; font-size: 12.5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}

/* ---------- Playback control strip (= .ctrl-row) ---------- */
.pc-ctrl-row { margin-top: 10px; display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }

.pc-skip-btn {
    display: flex; align-items: center; gap: 3px;
    border: none; background: #f0eff2; color: #57555e;
    border-radius: 999px; padding: 6px 7px; cursor: pointer; flex: none;
    transition: transform 0.1s ease;
}
.pc-skip-btn:active { transform: scale(0.9); background: #e2e1e5; }
.pc-skip-btn svg { width: 14px; height: 14px; }
.pc-skip-num { font-size: 10.5px; font-weight: 700; color: #57555e; white-space: nowrap; }

/* Tight rows (narrow content column, e.g. a remove button eating into it on wishlist, or
   a small phone): shrink gaps/padding/icons so back-5s, play, fwd-5s, plays and like all
   still fit on one line without wrapping. */
@container (max-width: 330px) {
    .pc-ctrl-row { gap: 3px; }
    .pc-skip-btn, .pc-play-btn { padding: 6px 5px; gap: 2px; }
    .pc-skip-btn svg, .pc-play-btn svg { width: 12px; height: 12px; }
    .pc-skip-num { font-size: 10px; }
    .pc-plays, .pc-like-btn { padding: 5px 6px; gap: 2px; }
    .pc-plays svg, .pc-like-btn svg { width: 12px; height: 12px; }
    .pc-plays-count, .pc-like-count { font-size: 10.5px; }
}

/* Play/pause button (= .pb in the mockup) — same grey pill as the skip buttons, sitting
   between them. Drives/reflects the exact same playback as tapping the thumbnail (see
   footer.php); .is-on = currently playing, swaps to the pause glyph in red. */
.pc-play-btn {
    flex: none; display: flex; align-items: center; justify-content: center;
    border: none; background: #f0eff2; color: #57555e;
    border-radius: 999px; padding: 6px 7px; cursor: pointer;
    transition: transform 0.1s ease;
}
.pc-play-btn:active { transform: scale(0.9); background: #e2e1e5; }
.pc-play-btn svg { width: 14px; height: 14px; }
.pc-play-btn .pc-pause-ic { display: none; }
.pc-play-btn.is-on .pc-play-ic { display: none; }
.pc-play-btn.is-on .pc-pause-ic { display: block; }
.pc-play-btn.is-on { color: #e11d2e; }

/* Play-count pill (= .vw in the mockup) — non-clickable, just shows how many times the
   sample has been played (see play-count.php). Same pill shape as the like button. */
.pc-plays {
    flex: none; display: flex; align-items: center; gap: 3px; white-space: nowrap;
    border-radius: 999px; padding: 5px 9px; font-size: 10.5px; font-weight: 700;
    background: #f4f6fa; border: 1px solid #dfe5ee; color: #5f6c80; cursor: default;
    user-select: none;
}
.pc-plays svg { width: 13px; height: 13px; }

.pc-like-btn {
    display: flex; align-items: center; gap: 3px; white-space: nowrap;
    border: 1px solid #f0d7db; background: #fdf1f3; color: #c94a5c;
    border-radius: 999px; padding: 5px 9px; cursor: pointer; flex: none;
}
.pc-like-btn svg { width: 13px; height: 13px; transition: transform 0.15s ease; }
.pc-like-btn.liked { background: #fbe1e5; border-color: #f3b9c1; color: #c0293f; }
.pc-like-btn.liked svg { transform: scale(1.1); }
.pc-like-btn.pc-pop { animation: pcLikePop 0.35s ease; }
@keyframes pcLikePop {
    0% { transform: scale(1); }
    35% { transform: scale(1.22); }
    60% { transform: scale(0.94); }
    100% { transform: scale(1); }
}
.pc-like-count { display: inline-block; font-size: 10.5px; font-weight: 700; transition: transform 0.18s ease, opacity 0.18s ease; }
.pc-like-count.pc-roll { animation: pcCountRoll 0.3s ease; }
@keyframes pcCountRoll {
    0% { transform: translateY(0); opacity: 1; }
    45% { transform: translateY(-6px); opacity: 0; }
    55% { transform: translateY(6px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* ---------- Order button (= .ob in the mockup) ----------
   Dark pill that closes the control row: opens the full product page (same destination
   the old "view product" icon and the title link go to). It fills every bit of space the
   skip/play/plays/like items leave behind (flex: 1 1 0) — never a tiny tap target — and
   is itself a container: as the row gets tighter (like/plays counts growing, or a small
   screen), its own two text spans drop out one at a time so the pill keeps fitting on
   one line: "অর্ডার করুন →" → "অর্ডার →" → just "→". The arrow gets a small periodic
   nudge to draw the eye toward it; disabled for reduced-motion. */
.pc-order-btn {
    flex: 1 1 0; min-width: 30px;
    display: flex; align-items: center; justify-content: center; gap: 4px;
    background: #0b1b2f; color: #fff; text-decoration: none;
    border-radius: 999px; padding: 6px 10px; font-size: 11px; font-weight: 700;
    white-space: nowrap; overflow: hidden;
    container-type: inline-size;
}
.pc-order-btn:active { background: #1e3a5e; }
.pc-order-btn svg { width: 12px; height: 12px; flex: none; animation: pcOrderNudge 1.6s ease-in-out infinite; }
@keyframes pcOrderNudge {
    0%, 55%, 100% { transform: translateX(0); }
    70% { transform: translateX(4px); }
    85% { transform: translateX(0); }
    92% { transform: translateX(3px); }
}
@media (prefers-reduced-motion: reduce) {
    .pc-order-btn svg { animation: none; }
}
@container (max-width: 88px) { .pc-order-t2 { display: none; } }
@container (max-width: 54px) { .pc-order-t1 { display: none; } }

/* ---------- Remove-from-wishlist button — wishlist page only ---------- */
.pc-remove-form { flex: none; align-self: center; margin: 0; }
.pc-remove-btn {
    width: 36px; height: 36px; border-radius: 50%; border: none;
    background: #fdecee; color: #e74c5e;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 15px;
}
.pc-remove-btn:active { background: #f9d4d8; }

/* ---------- Empty state ---------- */
.empty-results {
    padding: 2.5rem 1rem; text-align: center; color: #7a93ae; font-size: 0.9rem;
    display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
}
.empty-results > i { font-size: 1.8rem; color: #c2d2e5; }
.empty-results .shop-link { color: #2563eb; font-weight: 600; text-decoration: none; }

@media (max-width: 480px) {
    .product-card { padding: 12px 14px; gap: 10px; }
    .pc-thumb { width: 56px; height: 56px; }
    .pc-title { font-size: 14px; }
}
