/* ── Component: PLP Product Card ─────────────────────────────────── */

.plp-card {
    display: flex;
    flex-direction: column;
    background: transparent;
}

/* ── Image ───────────────────────────────────────────────────────── */
.plp-card__img-wrap {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--border-color);
}

.plp-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.plp-card:hover .plp-card__img {
    transform: scale(1.04);
}

.plp-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--warm);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    z-index: 2;
}

/* ── Wishlist Heart ──────────────────────────────────────────────── */
.plp-card__wish {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    color: var(--secondary);
    transition: background 0.15s, color 0.15s, transform 0.15s;
    padding: 0;
}

.plp-card__wish:hover {
    background: #fff;
    transform: scale(1.12);
}

.plp-card__wish svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
    transition: fill 0.15s;
}

.plp-card__wish.is-wishlisted {
    color: #e53935;
}

/* ── Body ────────────────────────────────────────────────────────── */
.plp-card__body {
    padding: 14px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    flex-grow: 1;
}

.plp-card__name {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary);
    line-height: 1.35;
    margin: 0;
}

.plp-card__name a {
    color: inherit;
    text-decoration: none;
}

.plp-card__name a:hover {
    color: var(--primary);
}

/* ── Price ───────────────────────────────────────────────────────── */
.plp-card__price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.plp-card__price {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
}

.plp-card__price-orig {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.6;
}

.plp-card__weight {
    display: block;
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: #888;
    margin-top: 2px;
}

.plp-card__out {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: #b0a090;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Quick View Stock Badge ──────────────────────────────────────── */
.plp-qv__stock-badge {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.plp-qv__stock-badge--in {
    background: #e8f5e9;
    color: #2e7d32;
}

.plp-qv__stock-badge--out {
    background: #ffebee;
    color: #c62828;
}

/* ── Cart Summary ────────────────────────────────────────────────── */
.plp-qv__cart-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border-radius: 6px;
    padding: 8px 14px;
    font-family: var(--font-ui);
    font-size: 0.82rem;
}

.plp-qv__cart-summary.is-hidden {
    display: none;
}

.plp-qv__cart-summary-qty {
    color: var(--text-muted);
    font-weight: 500;
}

.plp-qv__cart-summary-price {
    color: var(--secondary);
    font-weight: 700;
}

/* ── Variant Dropdown ────────────────────────────────────────────── */
.plp-vd {
    position: relative;
    width: 100%;
}

.plp-vd__trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-full);
    background: transparent;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    color: var(--secondary);
    cursor: pointer;
    transition: border-color 0.15s;
}

.plp-vd__trigger:hover,
.plp-vd.is-open .plp-vd__trigger {
    border-color: var(--secondary);
}

.plp-vd__chevron {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.plp-vd.is-open .plp-vd__chevron {
    transform: rotate(180deg);
}

.plp-vd__panel {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    z-index: 50;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.plp-vd.is-open .plp-vd__panel {
    display: block;
}

.plp-vd__opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 9px 14px;
    background: none;
    border: none;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    color: var(--secondary);
    cursor: pointer;
    text-align: left;
    transition: background 0.12s;
}

.plp-vd__opt:hover {
    background: var(--surface);
}

.plp-vd__opt.is-selected {
    font-weight: 700;
    /* background: var(--surface); */
}

.plp-vd__opt.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.plp-vd__oos {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ── CTA Button ──────────────────────────────────────────────────── */
.plp-card__cta {
    display: inline-block;
    margin-top: auto;
    padding: 9px 24px;
    border: 1.5px solid var(--secondary);
    border-radius: var(--radius-full);
    background: transparent;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--secondary);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    letter-spacing: 0.02em;
}

.plp-card__cta:hover {
    background: var(--secondary);
    color: var(--white);
}

/* ══════════════════════════════════════════════════════════════════
   Quick-View Modal
══════════════════════════════════════════════════════════════════ */

.plp-qv-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.plp-qv-overlay.is-open {
    display: flex;
}

.plp-qv-modal {
    background: var(--white);
    width: min(900px, 92vw);
    overflow: hidden;
    position: relative;
    animation: plpQvFadeIn 0.22s ease;
}

/* Body is always the 2-col grid — skeleton and PHP content both slot in */
#plp-qv-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    align-items: start;
}

@keyframes plpQvFadeIn {
    from {
        opacity: 0;
        transform: scale(0.97);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ── Close ───────────────────────────────────────────────────────── */
.plp-qv__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: color 0.15s;
}

.plp-qv__close:hover {
    color: var(--secondary);
}

.plp-qv__close svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ── Image pane ──────────────────────────────────────────────────── */
.plp-qv__img-wrap {
    overflow: hidden;
    background: var(--surface);
    aspect-ratio: 1 / 1;
    width: 100%;
}

.plp-qv__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Content pane ────────────────────────────────────────────────── */
.plp-qv__content {
    padding: 2rem 2rem 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    max-height: min(450px, 46vw);
}

.plp-qv__name {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--secondary);
    line-height: 1.2;
    margin: 0;
}

.plp-qv__desc {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Price ───────────────────────────────────────────────────────── */
.plp-qv__price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.plp-qv__price {
    font-family: var(--font-ui);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--secondary);
}

.plp-qv__price-orig {
    font-family: var(--font-ui);
    font-size: 1rem;
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.6;
}

/* ── Variant dropdown ────────────────────────────────────────────── */
.plp-qv__field-label {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--secondary);
    margin-bottom: 6px;
    display: block;
}

.plp-qv__select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 0;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--secondary);
    background: var(--white);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath stroke='%23303030' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
    transition: border-color 0.15s;
}

.plp-qv__select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ── Qty ─────────────────────────────────────────────────────────── */
.plp-qv__qty-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--border-color);
    width: fit-content;
}

.plp-qv__qty-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    font-family: var(--font-ui);
}

.plp-qv__qty-btn:hover {
    background: var(--surface);
}

.plp-qv__qty-val {
    width: 44px;
    text-align: center;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    color: var(--secondary);
    border-left: 1.5px solid var(--border-color);
    border-right: 1.5px solid var(--border-color);
    line-height: 40px;
    user-select: none;
}

/* ── Actions ─────────────────────────────────────────────────────── */
.plp-qv__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.plp-qv__btn-cart {
    width: 100%;
    padding: 13px;
    border: 1.5px solid var(--secondary);
    border-radius: var(--radius-full);
    background: transparent;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    letter-spacing: 0.02em;
}

.plp-qv__btn-cart:hover {
    background: var(--secondary);
    color: var(--white);
}

.plp-qv__btn-cart:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ── View full link ──────────────────────────────────────────────── */
.plp-qv__full-link {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    transition: gap 0.2s;
}

.plp-qv__full-link:hover {
    gap: 8px;
}

/* ── Skeleton (loading state) ────────────────────────────────────── */

.plp-qv-skel__img {
    width: 100%;
    height: 100%;
    background: oklch(93% 0.008 80);
    animation: plpSkelPulse 1.5s ease-in-out infinite;
}

.plp-qv-skel__side {
    padding: 2rem 2rem 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.plp-qv-skel__line {
    height: 14px;
    border-radius: 2px;
    background: oklch(91% 0.008 80);
    animation: plpSkelPulse 1.5s ease-in-out infinite;
}

.plp-qv-skel__line--title {
    width: 75%;
    height: 28px;
    animation-delay: 0.05s;
}

.plp-qv-skel__line--med {
    width: 90%;
    animation-delay: 0.1s;
}

.plp-qv-skel__line--short {
    width: 55%;
    animation-delay: 0.15s;
}

.plp-qv-skel__line--price {
    width: 40%;
    height: 22px;
    animation-delay: 0.2s;
}

.plp-qv-skel__line--select {
    width: 100%;
    height: 42px;
    border-radius: 0;
    animation-delay: 0.25s;
}

.plp-qv-skel__line--btn {
    width: 100%;
    height: 46px;
    border-radius: 999px;
    margin-top: auto;
    animation-delay: 0.3s;
}

@keyframes plpSkelPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.plp-qv__error {
    grid-column: 1 / -1;
    padding: 3rem;
    text-align: center;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .plp-qv-modal {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
    }

    #plp-qv-body {
        display: block;
        height: 100%;
        overflow-y: auto;
    }

    .plp-qv__img-wrap {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .plp-qv__content {
        padding: 1.25rem;
        height: auto;
        overflow-y: unset;
    }
}