/* ─────────────────────────────────────────────────────────────────────────────
   Shared product display card — wishlist.php and the cart (add-to-cart.php /
   cart-load.php, rendered by renderCartItemRow() in cart-manager.js).

   Both surfaces are the same three-part flex row:

       .pcard-thumb  |  .pcard-body                      |  .pcard-end
       ------------- | --------------------------------- | ----------------
       wishlist      |  title, variant, price+mrp,       |  Add to Cart,
                     |  status, added-on                 |  Move to ▾
       cart          |  title, variant, unit price,      |  line total
                     |  qty stepper + delete             |  (price × qty)

   Extracted from wishlist.php's inline <style> (the card half only — tabs,
   dropdowns and notifications stay there) plus the stepper/remove rules from
   cart-temp.css, which this file retires.

   Classes are .pcard-* prefixed on purpose: the originals were bare globals
   (.price, .variant, .stock, .no-image, .added-date) that were only safe while
   scoped to one page's inline <style>. Loaded on the cart pages too, they would
   collide.
   ───────────────────────────────────────────────────────────────────────────── */

.pcard {
    display: flex;
    gap: 15px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    transition: box-shadow 0.2s ease;
}

.pcard:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Row that can't be acted on (out of stock / no longer available). */
.pcard.is-unavailable {
    opacity: 0.85;
    border-color: #ffb3b3;
}

/* ─── Column 1: thumbnail ─────────────────────────────────────────────────── */

.pcard-thumb img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.pcard-noimg {
    width: 100px;
    height: 100px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
    text-align: center;
}

/* ─── Column 2: details ───────────────────────────────────────────────────── */

.pcard-body {
    flex: 1;
    min-width: 0;             /* lets long titles ellipsis instead of stretching the row */
}

.pcard-title {
    color: #333;
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
}

.pcard-title a {
    color: inherit;
    text-decoration: none;
}

.pcard-title a:hover {
    text-decoration: underline;
}

.pcard-variant {
    color: #666;
    margin: 4px 0;
    font-size: 14px;
}

.pcard-price {
    color: #e74c3c;
    font-weight: bold;
    margin: 8px 0;
    font-size: 18px;
}

/* Struck-through MRP. Was inline-styled in wishlist.php, which is why the cart
   could never reuse it. */
.pcard-mrp {
    text-decoration: line-through;
    color: #888;
    font-weight: normal;
    font-size: 0.85em;
    margin-left: 6px;
}

/* ─── Availability + meta (wishlist) ──────────────────────────────────────── */

.pcard-status {
    font-size: 14px;
    margin: 4px 0;
}

.pcard-status.is-instock     { color: #27ae60; }
.pcard-status.is-oos         { color: #e74c3c; }
.pcard-status.is-unavailable { color: #b9770e; font-weight: 600; }

.pcard-meta {
    color: #999;
    font-size: 12px;
    margin: 4px 0;
}

/* Cart stock warning ("Only N available", "Out of Stock — remove to continue"). */
.pcard-warn {
    color: #c0392b;
    font-size: 13px;
    font-weight: 600;
    margin-top: 6px;
}

/* ─── Quantity stepper + delete (cart) ────────────────────────────────────── */

/* handleQtyDelta() finds .add_qty/.rmv_qty via the qty input's DIRECT parent, so
   all three MUST stay inside .pcard-qty-ctl together. */
.pcard-qty {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.pcard-qty-ctl {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
}

.pcard-qty-ctl .qty {
    width: 46px;
    height: 34px;
    border: 0;
    border-left: 1px solid #d1d5db;
    border-right: 1px solid #d1d5db;
    text-align: center;
    font-size: 14px;
    background: #fff;
    color: #111827;
    -moz-appearance: textfield;
}

.pcard-qty-ctl .qty::-webkit-outer-spin-button,
.pcard-qty-ctl .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pcard-qty-ctl .add_qty,
.pcard-qty-ctl .rmv_qty {
    width: 34px;
    height: 34px;
    border: 0;
    background: #fff;
    color: #111827;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.pcard-qty-ctl .add_qty:hover,
.pcard-qty-ctl .rmv_qty:hover { background: #f3f4f6; }

.pcard-qty-ctl .add_qty:disabled,
.pcard-qty-ctl .rmv_qty:disabled { opacity: 0.4; cursor: not-allowed; }

.pcard-del {
    background: none;
    border: 0;
    padding: 4px;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.pcard-del:hover { color: #dc2626; }

/* .mIcon sets font-size:1.5rem; the delete glyph reads smaller in this context. */
.pcard-del .mIcon { font-size: 1.25rem; top: 0; }

/* ─── Column 3: right rail ────────────────────────────────────────────────── */

.pcard-end {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    justify-content: flex-start;
    white-space: nowrap;
}

/* Cart line total (price × qty). */
.pcard-total {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

/* Wishlist buttons. */
.pcard-btn {
    background: #27ae60;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.pcard-btn:hover:not(:disabled) { background: #219150; }

.pcard-btn:disabled {
    background: #c8cdd2;
    cursor: not-allowed;
}

/* ─── Free-gift rows (cart) ───────────────────────────────────────────────── */

.pcard-freebie {
    border: 1px solid #28a745;
    background: #f4fdf6;
}

.pcard-freebie.is-oos-gift {
    opacity: 0.85;
    border: 1px dashed #f0ad4e;
    background: #fffbea;
}

.pcard-gift-note {
    color: #28a745;
    font-size: 12px;
    margin-top: 4px;
}

.pcard-gift-warn {
    color: #856404;
    font-size: 13px;
    margin-top: 6px;
}

.pcard-free {
    color: #28a745;
    font-weight: 600;
}

/* The freebie's struck-through MRP stacks above FREE rather than sitting inline. */
.pcard-freebie .pcard-mrp {
    margin-left: 0;
    font-size: 13px;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .pcard {
        flex-direction: column;
        text-align: center;
    }

    .pcard-thumb img,
    .pcard-noimg { margin: 0 auto; }

    .pcard-qty {
        justify-content: center;
    }

    .pcard-end {
        flex-direction: row;
        justify-content: center;
        align-items: center;
    }
}
