/* Product cards in archive / related loops */
.woocommerce ul.products li.product {
    position: relative;
}

/* Each image in the single product gallery */
.single-product .woocommerce-product-gallery__image {
    position: relative;
}

/* Heart overlay icon: always top-right */
.wishlist-icon-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    left: auto;
    z-index: 20;
    background: transparent;
    padding: 4px;
    cursor: pointer;
    pointer-events: auto;
}

.wishlist-icon-overlay svg {
    width: 20px;
    height: 20px;
    fill: white;
    stroke: #000;
    stroke-width: 1;
    transition: fill 0.3s ease, stroke 0.3s ease;
}

.wishlist-icon-overlay.active svg {
    fill: black;
    stroke: transparent;
}

/* Add to wishlist button on single product page */
.wishlist-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.wishlist-inline svg {
    width: 20px;
    height: 20px;
    fill: white;
    stroke: #000;
    stroke-width: 1;
    transition: fill 0.3s ease, stroke 0.3s ease;
}

.wishlist-inline.active svg {
    fill: black;
    stroke: transparent;
}

/* Header heart icon (fixed: white with black stroke) */
.wishlist-header-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.wishlist-header-icon svg {
    width: 22px;
    height: 22px;
    fill: white;
    stroke: #000;
    stroke-width: 1.6;
    transition: none;
}

/* Header counter badge */
.wishlist-badge {
    position: absolute;
    bottom: 12px;
    right: -8px;
    background: #444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
    padding: 3px 0px;
    border-radius: 50%;
    min-width: 16px;
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

#wishlist-count.is-hidden {
    display: none !important;
}

/* Wishlist table */
.wishlist-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.wishlist-table thead th {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #ccc;
}

.wishlist-table td {
    padding: 12px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
}

.wishlist-table tr:hover {
    background-color: #fafafa;
}

.wishlist-table img {
    border-radius: 4px;
    object-fit: cover;
}

.wishlist-table .button {
    padding: 6px 12px;
    font-size: 0.9em;
}

/* Top border on first header row */
.magicwishlist-table thead:first-child tr:first-child th {
    border-top: 1px solid #ebebeb !important;
}

/* Outer border */
.magicwishlist-table {
    border: 1px solid #ebebeb;
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
}

/* Inner borders */
.magicwishlist-table th,
.magicwishlist-table td {
    border: 1px solid #ebebeb;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 10px;
    vertical-align: middle;
}

/* Remove icon */
.magicwishlist-remove-icon {
    color: #000;
    transition: color 0.2s ease;
    border-radius: 20px;
    padding: 6px;
    background-color: #f5f5f5;
}

.magicwishlist-table-remove:hover .magicwishlist-remove-icon {
    color: #000;
}

.magicwishlist-table-remove svg {
    width: 28px !important;
    height: 28px !important;
    display: inline-block;
    vertical-align: middle;
}

/* Product name */
td.magicwishlist-table-name a {
    font-size: 16px;
    color: #000 !important;
    font-weight: 600 !important;
}

/* Price */
.magicwishlist-table-price span.woocommerce-Price-amount.amount {
    color: #000;
    font-size: 15px;
}

/* Add to cart / See options buttons */
a.magicwishlist-table-button.button.add_to_cart_button.ajax_add_to_cart,
a.magicwishlist-table-button.button {
    background-color: #444;
    padding: 10px 20px;
    color: #fff;
    font-size: 15px;
}

a.magicwishlist-table-button.button.add_to_cart_button.ajax_add_to_cart:hover,
a.magicwishlist-table-button.button:hover {
    background-color: #7b7b7b;
    padding: 10px 20px;
    color: #fff;
}

/* Default white background for all rows (prevent zebra striping) */
.magicwishlist-table tbody > tr:nth-child(odd) > td,
.magicwishlist-table tbody > tr:nth-child(odd) > th,
.magicwishlist-table tbody > tr:nth-child(even) > td,
.magicwishlist-table tbody > tr:nth-child(even) > th {
    background-color: #fff !important;
}

.magicwishlist-table tbody > tr > td,
.magicwishlist-table tbody > tr > th {
    background-color: #fff;
    transition: background-color 0.2s ease;
}

/* Row hover */
.magicwishlist-table tbody > tr:hover > td,
.magicwishlist-table tbody > tr:hover > th {
    background-color: #fafafa !important;
}

/* Responsive wishlist table */
@media (max-width: 767px) {
    .magicwishlist-table,
    .magicwishlist-table thead,
    .magicwishlist-table tbody,
    .magicwishlist-table th,
    .magicwishlist-table td,
    .magicwishlist-table tr {
        display: block;
        width: 100%;
    }

    .magicwishlist-table thead {
        display: none;
    }

    .magicwishlist-table-row {
        margin-bottom: 20px;
        border: 1px solid #ddd;
        border-radius: 6px;
        overflow: hidden;
        background: #fff;
    }

    .magicwishlist-table-row > td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 12px;
        border: none !important;
        border-bottom: 1px solid #eee;
    }

    .magicwishlist-table-row > td:last-child {
        border-bottom: none;
    }

    .magicwishlist-table-col-image img {
        width: 60px;
        height: 60px;
        object-fit: cover;
        border-radius: 4px;
    }

    .magicwishlist-table-col-name,
    .magicwishlist-table-col-price,
    .magicwishlist-table-col-action {
        font-size: 14px;
        flex: 1;
        margin-left: 12px;
    }

    .magicwishlist-table-remove {
        justify-content: flex-end;
        text-align: right;
    }

    .magicwishlist-table-remove svg {
        width: 20px;
        height: 20px;
        color: #d00;
        cursor: pointer;
    }

    .magicwishlist-table-button {
        font-size: 13px;
        padding: 6px 10px;
    }
}
