/* ==========================================================================
   STORE PRODUCT CARD (templates/store/partials/_product_card.html)
   Own `spc-` namespace so it no longer inherits the shared course-card
   (.hv2-card) rules. Colours come from the --hv-* tokens defined on .home-v2
   in home-redesign.css, so light/dark themes follow the rest of the site.
   Same visual family as the refined ad card (.hv2-ad-card): soft photo tile,
   glassy pills and tools, gradient hairline for featured products, price-led
   footer and a quiet "sold by" strip.
   ========================================================================== */

.home-v2.hv2-embed { display: flex; flex-direction: column; width: 100%; height: 100%; }

.home-v2 .spc {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    background: var(--hv-surface);
    border: 1px solid var(--hv-line-soft);
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -18px rgba(15, 23, 42, .25);
    overflow: hidden;
    cursor: pointer;
    transition: border-color .35s ease, box-shadow .35s ease, transform .35s cubic-bezier(.2, .8, .2, 1);
}
.home-v2 .spc:hover {
    border-color: var(--hv-brand-line);
    box-shadow: 0 2px 4px rgba(15, 23, 42, .04), 0 22px 40px -22px rgba(75, 49, 94, .45);
    transform: translateY(-4px);
}
/* Featured: gradient hairline border (accent → brand) */
.home-v2 .spc--featured {
    border: 1px solid transparent;
    background:
        linear-gradient(var(--hv-surface), var(--hv-surface)) padding-box,
        linear-gradient(135deg, var(--hv-accent) 0%, var(--hv-accent-line) 45%, var(--hv-brand-line) 100%) border-box;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 26px -18px rgba(255, 96, 1, .45);
}

/* ── Media ─────────────────────────────────────────────────────────────── */
.home-v2 .spc-media {
    position: relative;
    aspect-ratio: 1 / 1;
    margin: .5rem .5rem 0;
    border-radius: 13px;
    background:
        radial-gradient(120% 90% at 50% 35%, var(--hv-surface) 0%, var(--hv-surface-2) 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.home-v2 .spc-media .spc-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    margin: 0;
    padding: 10%;
    border-radius: 0;
    object-fit: contain;
    mix-blend-mode: multiply;           /* blends white product shots into the tile */
    filter: drop-shadow(0 10px 12px rgba(15, 23, 42, .12));
    transition: transform .7s cubic-bezier(.2, .8, .2, 1);
}
.home-v2 .spc:hover .spc-media .spc-img { transform: scale(1.06); }
.home-v2 .spc-img-empty { font-size: 2.5rem; color: var(--hv-faint); }

.home-v2 .spc--out .spc-img { opacity: .55; filter: grayscale(.6); }
.home-v2 .spc-out-label {
    position: absolute;
    inset-inline: .6rem;
    bottom: .6rem;
    padding: .3rem .6rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, .78);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    text-align: center;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

/* Tags (top-start): sale = solid accent, featured = glassy pill */
.home-v2 .spc-tags {
    position: absolute;
    top: .6rem;
    inset-inline-start: .6rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .3rem;
    z-index: 2;
}
.home-v2 .spc-tag {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .22rem .6rem;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: .01em;
    box-shadow: 0 4px 12px -4px rgba(15, 23, 42, .3);
}
.home-v2 .spc-tag--sale {
    background: linear-gradient(135deg, #ff8a3d 0%, var(--hv-accent) 100%);
    color: #fff;
    direction: ltr;                     /* keep "-10%" in reading order */
}
.home-v2 .spc-tag--featured {
    background: rgba(255, 255, 255, .92);
    color: var(--hv-ink);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.home-v2 .spc-tag--featured i { font-size: .62rem; color: #f59e0b; }

/* Tools (top-end): glassy, hidden until hover on pointer devices */
.home-v2 .spc-tools {
    position: absolute;
    top: .6rem;
    inset-inline-end: .6rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    z-index: 2;
}
.home-v2 .spc-tool {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    color: var(--hv-text);
    font-size: .78rem;
    box-shadow: 0 4px 12px -4px rgba(15, 23, 42, .35);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    cursor: pointer;
    transition: background .2s ease, color .2s ease, opacity .25s ease, transform .25s ease;
}
.home-v2 .spc-tool:hover { background: var(--hv-brand); color: #fff; }
.home-v2 .spc-tool.saved { color: #e11d48; }
.home-v2 .spc-tool.saved:hover { background: #e11d48; color: #fff; }
.home-v2 .spc-tool.active { background: var(--hv-brand); color: #fff; }

@media (hover: hover) and (pointer: fine) {
    .home-v2 .spc-tool { opacity: 0; transform: translateX(6px); }
    [dir="rtl"] .home-v2 .spc-tool { transform: translateX(-6px); }
    .home-v2 .spc:hover .spc-tool,
    .home-v2 .spc:focus-within .spc-tool,
    .home-v2 .spc-tool.saved,
    .home-v2 .spc-tool.active { opacity: 1; transform: none; }
    .home-v2 .spc-tools .spc-tool:nth-child(2) { transition-delay: .04s; }
    .home-v2 .spc-tools .spc-tool:nth-child(3) { transition-delay: .08s; }
}

/* ── Body ──────────────────────────────────────────────────────────────── */
.home-v2 .spc-body {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    flex: 1 1 auto;
    padding: .85rem 1.1rem .5rem;
}
.home-v2 .spc-kicker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    min-height: 1.4rem;
}
.home-v2 .spc-brand {
    min-width: 0;
    max-width: 65%;
    padding: .16rem .6rem;
    border-radius: 999px;
    background: var(--hv-brand-soft);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--hv-brand-text);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .03em;
}
.home-v2 .spc-rating {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    margin-inline-start: auto;
    color: var(--hv-ink);
    font-size: .74rem;
    font-weight: 800;
}
.home-v2 .spc-rating i { color: #f59e0b; font-size: .68rem; }
.home-v2 .spc-rating.is-new {
    padding: .14rem .5rem;
    border: 1px solid var(--hv-line);
    border-radius: 999px;
    color: var(--hv-muted);
    font-size: .66rem;
    font-weight: 700;
}
.home-v2 .spc-rating.is-new i { color: var(--hv-faint); font-size: .58rem; }

.home-v2 .spc-title {
    margin: 0;
    font-size: .95rem;
    font-weight: 800;
    line-height: 1.5;
    letter-spacing: -.005em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(.95rem * 1.5 * 2);
}
.home-v2 .spc-title a { color: var(--hv-ink); text-decoration: none; transition: color .2s ease; }
.home-v2 .spc:hover .spc-title a { color: var(--hv-brand-text); }

.home-v2 .spc-model {
    align-self: flex-start;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--hv-muted);
    font-size: .7rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.home-v2 .spc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem 0;
    margin: auto 0 0;
    padding: .2rem 0 0;
    list-style: none;
    color: var(--hv-muted);
    font-size: .7rem;
}
.home-v2 .spc-meta li { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.home-v2 .spc-meta li + li::before {
    content: "";
    width: 3px;
    height: 3px;
    margin-inline: .5rem;
    border-radius: 50%;
    background: var(--hv-faint);
    opacity: .6;
}
.home-v2 .spc-meta i { color: var(--hv-success); font-size: .68rem; }

/* ── Footer: price + action ────────────────────────────────────────────── */
.home-v2 .spc-foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: .75rem;
    margin: 0 1.1rem;
    padding: .7rem 0 .9rem;
    border-top: 1px dashed var(--hv-line);
}
.home-v2 .spc-price-block { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; gap: .1rem; }
.home-v2 .spc-price-label { color: var(--hv-muted); font-size: .68rem; font-weight: 600; }
.home-v2 .spc-old-price { color: var(--hv-faint); font-size: .72rem; font-weight: 600; text-decoration-thickness: 1px; }
.home-v2 .spc-price {
    color: var(--hv-ink);
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: -.01em;
    white-space: nowrap;
}
.home-v2 .spc-price small { color: var(--hv-muted); font-size: .68rem; font-weight: 700; }
.home-v2 .spc .spc-old-price + .spc-price { color: var(--hv-accent-text); }

.home-v2 .spc-cart {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8a3d 0%, var(--hv-accent) 100%);
    color: #fff;
    font-size: .9rem;
    text-decoration: none;
    box-shadow: 0 8px 16px -8px rgba(255, 96, 1, .7);
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease, color .25s ease;
}
.home-v2 .spc-cart:hover { color: #fff; transform: scale(1.08); box-shadow: 0 10px 20px -8px rgba(255, 96, 1, .8); }
.home-v2 .spc-cart--link {
    background: var(--hv-brand-soft);
    color: var(--hv-brand-text);
    box-shadow: none;
}
.home-v2 .spc:hover .spc-cart--link,
.home-v2 .spc-cart--link:hover {
    background: var(--hv-brand);
    color: #fff;
    box-shadow: 0 8px 18px -8px rgba(75, 49, 94, .6);
}
.home-v2 .spc-cart--link i { transition: transform .25s ease; }
.home-v2 .spc:hover .spc-cart--link i { transform: translateX(-2px); }
[dir="ltr"] .home-v2 .spc:hover .spc-cart--link i { transform: translateX(2px); }

/* ── Seller strip ──────────────────────────────────────────────────────── */
.home-v2 .spc-seller {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1.1rem;
    border-top: 1px solid var(--hv-line-soft);
    background: linear-gradient(to bottom, var(--hv-surface-2), var(--hv-surface));
    color: var(--hv-text);
    font-size: .74rem;
    font-weight: 700;
    text-decoration: none;
    transition: color .2s ease;
}
.home-v2 .spc-seller:hover { color: var(--hv-brand-text); }
.home-v2 .spc-seller-logo {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--hv-surface);
    box-shadow: 0 0 0 1.5px var(--hv-surface), 0 0 0 2.5px rgba(15, 23, 42, .08);
    overflow: hidden;
    font-size: .6rem;
    color: var(--hv-faint);
}
.home-v2 .spc-seller-logo img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
    object-fit: cover;
    transform: none;
}
.home-v2 .spc-seller-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.home-v2 .spc-seller-verified { flex-shrink: 0; color: #0ea5e9; font-size: .74rem; }

/* ── Dark theme ────────────────────────────────────────────────────────── */
[data-theme='dark'] .home-v2 .spc-media .spc-img,
[data-bs-theme='dark'] .home-v2 .spc-media .spc-img { mix-blend-mode: normal; filter: none; }
[data-theme='dark'] .home-v2 .spc-tool,
[data-bs-theme='dark'] .home-v2 .spc-tool,
[data-theme='dark'] .home-v2 .spc-tag--featured,
[data-bs-theme='dark'] .home-v2 .spc-tag--featured { background: rgba(31, 28, 36, .82); color: var(--hv-ink); }
[data-theme='dark'] .home-v2 .spc-tool.saved,
[data-bs-theme='dark'] .home-v2 .spc-tool.saved { color: #fb7185; }

@media (prefers-reduced-motion: reduce) {
    .home-v2 .spc,
    .home-v2 .spc-img,
    .home-v2 .spc-tool,
    .home-v2 .spc-cart { transition: none; }
    .home-v2 .spc:hover,
    .home-v2 .spc:hover .spc-media .spc-img { transform: none; }
}
