/* ============================================================
   WCWC Wishlist & Compare — Frontend Styles
   Black & white flat design
   ============================================================ */

/* ---- CSS Variables ---- */
/* Values are set via inline CSS from PHP settings. */
/* These fallbacks are used only if inline CSS is missing. */
:root {
    --wcwc-active-color: #000000;
    --wcwc-border-color: #ccc;
    --wcwc-hover-border-color: #000000;
    --wcwc-active-border-color: #000000;
    --wcwc-border-width: 1px;
    --wcwc-bg: #ffffff;
    --wcwc-text: #000000;
    --wcwc-muted: #999;
    --wcwc-btn-bg: #ffffff;
    --wcwc-btn-hover-bg: #000000;
    --wcwc-btn-active-bg: #000000;
    --wcwc-icon-color: #000000;
    --wcwc-icon-hover-color: #ffffff;
    --wcwc-icon-active-color: #ffffff;
}




/* ---- Product Wrapper (for absolute positioning) ---- */
.wcwc-product-wrapper {
    position: relative;
}

/* ---- Loop / Archive Icons ---- */
.wcwc-actions {
    position: absolute;
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
    width: auto;
    height: auto;
    line-height: 0;
}

/* Position variants */
.wcwc-pos-top-right {
    top: 8px;
    right: 8px;
}

.wcwc-pos-top-left {
    top: 8px;
    left: 8px;
}

.wcwc-pos-bottom-right {
    bottom: 8px;
    right: 8px;
}

.wcwc-pos-bottom-left {
    bottom: 8px;
    left: 8px;
}

/* Allow clicks on buttons inside the container */
.wcwc-actions .wcwc-btn {
    pointer-events: auto;
}

/* Show on hover over the product wrapper */
.wcwc-product-wrapper:hover .wcwc-actions {
    opacity: 1;
}

/* ---- Base Button Styles (loop icons) ---- */
.wcwc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: var(--wcwc-btn-bg);
    border: 1px solid var(--wcwc-border-color);
    border-radius: var(--wcwc-btn-radius, 50%);
    width: 30px;
    height: 30px;
    padding: 0;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    color: #000;
    line-height: 1;
    box-sizing: border-box;
}


.wcwc-btn:hover {
    background: var(--wcwc-btn-hover-bg);
    border-color: var(--wcwc-hover-border-color);
}


.wcwc-btn .wcwc-icon {
    display: block;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    stroke: var(--wcwc-icon-color);
    fill: none;
    transition: stroke 0.15s;
}

.wcwc-btn:hover .wcwc-icon {
    stroke: var(--wcwc-icon-hover-color);
}

.wcwc-btn.wcwc-active .wcwc-icon {
    stroke: var(--wcwc-icon-active-color);
    fill: var(--wcwc-icon-active-color);
}


/* Compare icon is stroke-only — do not fill on active */
.wcwc-btn.wcwc-active .wcwc-icon-compare {
    fill: none;
}

.wcwc-btn.wcwc-active {
    border-color: var(--wcwc-active-border-color);
}

.wcwc-btn.wcwc-active:hover {
    background: var(--wcwc-btn-active-bg);
    border-color: var(--wcwc-hover-border-color);
    filter: brightness(0.8);
}



.wcwc-btn .wcwc-btn-label {
    display: none;
}


/* ---- Single Product Page Actions ---- */
.wcwc-single-actions {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin-left: 10px;
    vertical-align: middle;
}

.wcwc-single-actions .wcwc-btn {
    border-radius: var(--wcwc-btn-radius, 0);
    width: 46px;
    height: 46px;
    border: 1px solid var(--wcwc-border-color);
    background: var(--wcwc-btn-bg);
    position: relative;
}


.wcwc-single-actions .wcwc-btn:hover {
    background: var(--wcwc-btn-hover-bg);
    border-color: var(--wcwc-hover-border-color);
}


.wcwc-single-actions .wcwc-btn .wcwc-icon {
    width: 16px;
    height: 16px;
    stroke: var(--wcwc-icon-color);
}

.wcwc-single-actions .wcwc-btn:hover .wcwc-icon {
    stroke: var(--wcwc-icon-hover-color);
}

.wcwc-single-actions .wcwc-btn.wcwc-active {
    background: var(--wcwc-btn-active-bg);
    border-color: var(--wcwc-active-border-color);
}

.wcwc-single-actions .wcwc-btn.wcwc-active:hover {
    border-color: var(--wcwc-hover-border-color);
}

.wcwc-single-actions .wcwc-btn.wcwc-active .wcwc-icon {

    stroke: var(--wcwc-icon-active-color);
    fill: var(--wcwc-icon-active-color);
}


.wcwc-single-actions .wcwc-btn.wcwc-active .wcwc-icon-compare {
    fill: none;
}


/* Tooltip on hover */
.wcwc-single-actions .wcwc-btn .wcwc-btn-label {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    font-size: 10px;
    padding: 10px 8px 9px 8px;
    white-space: nowrap;
    z-index: 200;
    pointer-events: none;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 600;
    text-transform: uppercase;
}

.wcwc-single-actions .wcwc-btn:hover .wcwc-btn-label {
    display: block;
}

/* ---- Wishlist Table ---- */
.wcwc-wishlist-wrap {
    max-width: 100%;
    margin: 24px 0;
    border: 1px solid #ddd;
}

.wcwc-wishlist-table {
    width: 100%;
    border-collapse: collapse !important;
    font-size: 14px;
    color: #000;
}

.wcwc-wishlist-table thead th {
    font-weight: 600;
    font-size: 11px;
    padding: 10px 12px !important;
    border-bottom: 1px solid #ddd !important;
    border-top: none !important;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #fff;
    color: #000;
}

.wcwc-wishlist-table tbody td {
    padding: 12px !important;
    border-bottom: 1px solid #eee !important;
    border-top: none !important;
    vertical-align: middle;
}

.wcwc-wishlist-table tbody tr:last-child td {
    border-bottom: none !important;
}

.wcwc-wishlist-table tbody tr:hover {
    background: #f5f5f5;
}

.wcwc-wishlist-image img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    display: block;
}

.wcwc-wishlist-name a {
    color: #000;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.wcwc-wishlist-name a:hover {
    text-decoration: underline;
}

.wcwc-wishlist-price {
    font-size: 14px;
    font-weight: 600;
}

/* Wishlist Add to Cart button */
.wcwc-wishlist-cart .button,
.wcwc-wishlist-cart .add_to_cart_button,
.wcwc-wishlist-cart a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #000;
    color: #fff;
    border: none;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: opacity 0.15s;
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.wcwc-wishlist-cart .button:hover,
.wcwc-wishlist-cart .add_to_cart_button:hover,
.wcwc-wishlist-cart a.button:hover {
    opacity: 0.7;
    color: #fff;
}

.wcwc-wishlist-cart .added_to_cart {
    display: none !important;
}

.wcwc-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #000;
    transition: opacity 0.15s;
    width: 28px;
    height: 28px;
}

.wcwc-remove-btn:hover {
    opacity: 0.5;
}

.wcwc-remove-btn .wcwc-icon {
    width: 16px;
    height: 16px;
    stroke: #000;
}

/* ---- Compare Table ---- */
.wcwc-compare-wrap {
    margin: 24px 0;
    border: 1px solid #ddd;
    max-width: 100%;
    box-sizing: border-box;
}

.wcwc-compare-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
}

.wcwc-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 600px;
}

.wcwc-compare-table th,
.wcwc-compare-table td {
    padding: 10px 12px;
    border: 1px solid #eee;
    text-align: center;
    vertical-align: middle;
    font-weight: 400;
    font-size: 13px;
}

.wcwc-compare-table td * {
    font-weight: inherit !important;
    font-size: inherit !important;
    color: inherit !important;
}

.wcwc-compare-table thead th {
    background: #fff;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #ddd;
}

/* Sticky first column — labels */
.wcwc-compare-table td:first-child,
.wcwc-compare-table th:first-child {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 3;
    font-weight: 600;
    text-align: left;
    min-width: 130px;
    color: #000;
}

.wcwc-compare-table th:first-child {
    font-weight: 600;
    font-size: 13px;
    letter-spacing: normal;
    text-transform: none;
    z-index: 4;
}

/* Product header cell */
.wcwc-compare-product {
    min-width: 180px;
    vertical-align: top;
}

.wcwc-compare-product-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.wcwc-compare-product-inner img {
    width: 100px;
    height: 100px;
    object-fit: cover;
}

.wcwc-compare-product-name {
    color: #000;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    line-height: 1.3;
}

.wcwc-compare-product-name:hover {
    text-decoration: underline;
}

.wcwc-compare-product-sku {
    font-size: 11px;
    color: #999;
    font-weight: 400;
}

.wcwc-compare-product-price {
    font-size: 14px;
    font-weight: 600;
}

.wcwc-compare-product-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

/* Compare Add to Cart button */
.wcwc-compare-product-actions .button,
.wcwc-compare-product-actions .add_to_cart_button,
.wcwc-compare-product-actions a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #000;
    color: #fff;
    border: none;
    padding: 5px 12px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: opacity 0.15s;
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.wcwc-compare-product-actions .button:hover,
.wcwc-compare-product-actions .add_to_cart_button:hover,
.wcwc-compare-product-actions a.button:hover {
    opacity: 0.7;
    color: #fff;
}

.wcwc-compare-product-actions .added_to_cart {
    display: none !important;
}

/* Uniform rows (same value across all products) */
.wcwc-uniform td:not(:first-child) {
    opacity: 0.5;
}

/* ---- Empty State ---- */
.wcwc-empty {
    padding: 40px 20px;
    text-align: center;
    font-size: 15px;
    color: #999;
    border: 1px solid #ddd;
}

/* ---- Count Badge ---- */
.wcwc-count {
    font-size: 14px;
    font-weight: 600;
}

/* ---- Button Visibility Options ---- */

/* Always visible on desktop */
.wcwc-show-always .wcwc-actions {
    opacity: 1;
    pointer-events: auto;
}

/* Always visible on mobile */
@media (max-width: 768px) {
    .wcwc-show-mobile .wcwc-actions {
        opacity: 1;
        pointer-events: auto;
    }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {

    .wcwc-wishlist-wrap {
        border: none;
    }

    .wcwc-wishlist-table {
        display: block;
        border: none;
    }

    .wcwc-wishlist-table thead {
        display: none;
    }

    .wcwc-wishlist-table tbody {
        display: block;
    }

    .wcwc-wishlist-table tbody tr {
        display: block;
        padding: 20px 16px 16px;
        border: 1px solid #ddd;
        margin-bottom: 12px;
        position: relative;
    }

    .wcwc-wishlist-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .wcwc-wishlist-table tbody td {
        display: block;
        border: none !important;
        padding: 4px 0;
    }

    .wcwc-wishlist-image {
        text-align: center;
        margin-bottom: 10px;
    }

    .wcwc-wishlist-image img {
        width: 100px;
        height: 100px;
        margin: 0 auto;
    }

    .wcwc-wishlist-name {
        text-align: center;
        margin-bottom: 4px;
    }

    .wcwc-wishlist-price {
        text-align: center;
        margin-bottom: 10px;
    }

    .wcwc-wishlist-cart {
        text-align: center;
    }

    .wcwc-wishlist-remove {
        position: absolute;
        top: 8px;
        right: 8px;
    }

    .wcwc-compare-table {
        font-size: 12px;
    }

    .wcwc-compare-table td:first-child,
    .wcwc-compare-table th:first-child {
        min-width: 100px;
    }
}