/* v2 Product Card — shared component used on home, category, search, etc.
   Auto-loaded by v2_switch listener for every v2 page. */

.v2-pcard {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 280px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    padding: 0 0 14px;
    box-shadow: 0 2px 8px rgba(28, 32, 33, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
@media (hover: hover) {
    .v2-pcard:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 24px rgba(28, 32, 33, 0.10);
    }
}

/* Caption fills remaining vertical space so actions stick to bottom — keeps
   buttons aligned across cards regardless of name/description length. */
.v2-pcard__caption { flex: 1 0 auto; }

/* media (image + badge + quickview overlay) */
.v2-pcard__media {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--bg-white);
}
.v2-pcard__badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--hot-pink);
    color: #fff;
    font-family: var(--ff-body);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
    padding: 4px 12px;
    letter-spacing: 0.08em;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(229, 23, 104, 0.25);
}
.v2-pcard__img {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    background: transparent;
}
.v2-pcard__img img {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.25s;
}
.v2-pcard__img-hover {
    position: absolute;
    inset: 0;
    opacity: 0;
}
/* Image swap only on real hover devices — touch sticky-hover would
   leave the primary image hidden after tapping Add to Cart. */
@media (hover: hover) {
    .v2-pcard:hover .v2-pcard__img-primary { opacity: 0; }
    .v2-pcard:hover .v2-pcard__img-hover { opacity: 1; }
}

/* Quickview overlay — appears on hover, top of image */
.v2-pcard__quickview {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    border: 1px solid rgba(0, 0, 0, 0.06);
    font-family: var(--ff-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s, transform 0.2s, background 0.15s;
}
@media (hover: hover) {
    .v2-pcard:hover .v2-pcard__quickview,
    .v2-pcard:focus-within .v2-pcard__quickview {
        opacity: 1;
        transform: translateY(0);
    }
}
.v2-pcard__quickview:hover {
    background: var(--brand-teal);
    color: #fff;
}

/* caption */
.v2-pcard__caption {
    display: flex;
    flex-direction: column;
    padding: 14px 14px 0;
}
.v2-pcard__name {
    font-family: var(--ff-head);
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    margin: 6px 0 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.v2-pcard__name a { color: inherit; text-decoration: none; }
.v2-pcard__name a:hover { color: var(--brand-teal); }

.v2-pcard__desc {
    font-family: var(--ff-body);
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-muted);
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 39px;
}

.v2-pcard__price {
    font-family: var(--ff-head);
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-teal-deep);
    margin: 4px 0 10px;
}

.v2-pcard__actions {
    margin-top: auto;
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.v2-pcard__stepper {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #d8d4c8;
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    flex: 0 0 auto;
}
.v2-pcard__step {
    background: transparent;
    border: 0;
    width: 32px;
    min-height: 44px;
    cursor: pointer;
    color: var(--ink-muted);
    font-size: 18px;
    line-height: 1;
    padding: 0;
    transition: background 0.12s, color 0.12s;
}
.v2-pcard__step:hover { background: var(--bg-section); color: var(--ink); }
.v2-pcard__stepper input {
    width: 32px;
    border: 0;
    border-left: 1px solid #d8d4c8;
    border-right: 1px solid #d8d4c8;
    text-align: center;
    font-family: var(--ff-body);
    /* 16px+ avoids iOS Safari auto-zoom on focus. */
    font-size: 16px;
    color: var(--ink);
    background: transparent;
    padding: 0;
    -moz-appearance: textfield;
}
.v2-pcard__stepper input::-webkit-outer-spin-button,
.v2-pcard__stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.v2-pcard__cart {
    flex: 1 1 auto;
    min-height: 44px;
    background: var(--brand-teal);
    color: #fff;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 11px 14px;
    font-family: var(--ff-body);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.18s, filter 0.18s;
}
.v2-pcard__cart:hover {
    background: var(--brand-teal);
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(74, 143, 168, 0.3);
}
.v2-pcard__cart[disabled] { opacity: 0.8; cursor: default; }

.v2-pcard__wish {
    flex: 0 0 auto;
    width: 44px;
    min-height: 44px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--ink-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.v2-pcard__wish:hover {
    background: rgba(229, 23, 104, 0.06);
    color: var(--hot-pink);
    border-color: var(--hot-pink);
}

/* Touch fallback — hide hover-only affordances */
@media (hover: none) {
    .v2-pcard__quickview { display: none; }
    .v2-pcard__img-hover { display: none; }
}

@media (max-width: 900px) {
    .v2-pcard__stepper { display: none; }
}

@media (max-width: 720px) {
    .v2-pcard,
    .v2-pcard__media { width: 230px; }
    .v2-pcard__media { height: 230px; }

    .v2-pcard__name { font-size: 14px; }
    .v2-pcard__desc { font-size: 12px; min-height: 0; }
    .v2-pcard__price { font-size: 14px; margin: 4px 0 8px; }
    .v2-pcard__cart {
        min-height: 44px;
        font-size: 13px;
        padding: 11px 8px;
        letter-spacing: 0.3px;
    }
    .v2-pcard__wish { width: 44px; min-height: 44px; }
}
