/*
 * Neptune product tile (web). Same design as the mobile app's ProductTile:
 * white card with a hairline border, inset photo, name, store, price.
 * No description, no rating; heart and cart are bare Neptune icons (no chip
 * behind them); the discount badge and the pre-discount price are sale red.
 *
 * Applies to every `.product-card` on the site, so the markup and the
 * existing cart / favourites JavaScript stay untouched. Loaded last with
 * `html body` specificity to win over the older page-level card styles.
 */
:root {
    --nt-ink: #0F172A;
    --nt-navy: #05213D;
    --nt-muted: #64748B;
    --nt-border: #E2E8F0;
    --nt-border-strong: #CBD5E1;
    --nt-sale: #C41230;
    --nt-radius: 14px;
    --nt-pad: 6px;
}

html body .product-card {
    display: flex !important;
    flex-direction: column !important;
    position: relative;
    background: #fff !important;
    border: 1px solid var(--nt-border) !important;
    border-radius: var(--nt-radius) !important;
    padding: var(--nt-pad) !important;
    box-shadow: none !important;
    transform: none !important;
    overflow: hidden;
    height: auto !important;
    min-height: 0 !important;
}

html body .product-card:hover {
    border-color: var(--nt-border-strong) !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Inset photo, concentric with the card radius. */
html body .product-card .product-image-wrapper {
    position: relative !important;
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    border-radius: calc(var(--nt-radius) - var(--nt-pad)) !important;
    overflow: hidden !important;
    background: #fff !important;
    box-shadow: none !important;
}

html body .product-card .product-image-wrapper > a {
    display: block;
    width: 100%;
    height: 100%;
}

html body .product-card .product-image-wrapper img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 0 !important;
    transform: none !important;
}

/* Heart: bare navy Neptune icon; a light halo keeps it legible on photos. */
html body .product-card .product-wishlist {
    position: absolute !important;
    top: 2px !important;
    right: 2px !important;
    left: auto !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: var(--nt-navy) !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.95));
    cursor: pointer;
}

/* Icons are drawn by the buttons themselves, whatever the page put inside
   them (a Font Awesome <i>, a text glyph, or only a label). */
html body .product-card .product-wishlist > *,
html body .product-card .add-to-cart-btn > * {
    display: none !important;
}

html body .product-card .product-wishlist::before,
html body .product-card .add-to-cart-btn::before {
    content: "" !important;
    display: block !important;
    width: 22px !important;
    height: 22px !important;
    margin: 0 !important;
    background: currentColor !important;
    -webkit-mask: var(--nt-icon) center / contain no-repeat;
    mask: var(--nt-icon) center / contain no-repeat;
}

html body .product-card .product-wishlist {
    --nt-icon: url("../images/neptune-icons/heart.234382b8142c.svg");
}

html body .product-card .product-wishlist.liked {
    --nt-icon: url("../images/neptune-icons/heart-filled.1583abb55b77.svg");
}

/* Discount badge: sale-red pill on the photo. */
html body .product-card .product-badges {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    right: auto !important;
    display: flex;
    gap: 4px;
    z-index: 2;
}

html body .product-card .badge-discount,
html body .product-card .badge-discount-conditional,
html body .product-card .discount-badge,
html body .product-card .product-discount-badge {
    background: var(--nt-sale) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 999px !important;
    padding: 3px 8px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
}

/* Text block */
html body .product-card .product-info {
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto;
    gap: 2px;
    padding: 8px 6px 0 !important;
    background: transparent !important;
}

html body .product-card .product-description,
html body .product-card .product-rating {
    display: none !important;
}

html body .product-card .product-info > a {
    order: 1;
    text-decoration: none !important;
}

html body .product-card .product-name {
    margin: 0 !important;
    text-align: left !important;
    min-height: 34px;
    font-size: 13.5px !important;
    line-height: 1.25 !important;
    font-weight: 600 !important;
    color: var(--nt-ink) !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden !important;
    white-space: normal !important;
}

html body .product-card .product-store {
    order: 2;
    text-align: left !important;
    font-size: 11.5px !important;
    color: var(--nt-muted) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html body .product-card .product-store i {
    display: none !important;
}

html body .product-card .product-price-row {
    order: 3;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    text-align: left !important;
    width: 100% !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px;
    margin-top: auto !important;
    padding: 0 !important;
    border: 0 !important;
    min-height: 40px;
}

html body .product-card .price-container {
    display: flex !important;
    flex: 1 1 auto !important;
    width: auto !important;
    justify-content: flex-start !important;
    text-align: left !important;
    margin: 0 !important;
    align-items: baseline !important;
    flex-wrap: wrap;
    gap: 0 6px;
    min-width: 0;
}

html body .product-card .price-current {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--nt-navy) !important;
    white-space: nowrap;
}

html body .product-card .price-original,
html body .product-card .original-price {
    font-size: 11.5px !important;
    color: var(--nt-sale) !important;
    text-decoration: line-through !important;
    text-decoration-color: var(--nt-sale) !important;
    white-space: nowrap;
}

/* Cart: bare Neptune icon beside the price, 40px tap target. */
html body .product-card .add-to-cart-btn {
    --nt-icon: url("../images/neptune-icons/cart.c96e1aeb1fc5.svg");
    flex: 0 0 auto;
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: var(--nt-navy) !important;
    transform: none !important;
}

html body .product-card .add-to-cart-btn.added {
    --nt-icon: url("../images/neptune-icons/check.0c2a028b8c92.svg");
}

html body .product-card .add-to-cart-btn:disabled {
    color: var(--nt-border-strong) !important;
}

/* Some templates place the cart button after the price row, not in it. */
html body .product-card .product-info > .add-to-cart-btn {
    position: absolute;
    right: 0;
    bottom: 0;
}

html body .product-card .product-info > .add-to-cart-btn ~ *,
html body .product-card .product-info:has(> .add-to-cart-btn) .product-price-row {
    padding-right: 40px !important;
}
