/* ============================================================
   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;
    --wcwc-qty-btn-bg: #f7f7f7;
    --wcwc-qty-btn-hover-bg: #000000;
    --wcwc-qty-btn-color: #111111;
    --wcwc-qty-btn-hover-color: #ffffff;
    --wcwc-qty-input-bg: #ffffff;
    --wcwc-qty-input-color: #111111;
    --wcwc-qty-border-color: #e2e8f0;
    --wcwc-qty-border-hover-color: #000000;
    --wcwc-qty-radius: 4px;
    --wcwc-qty-border-width: 1px;
    --wcwc-qty-height: 44px;
    --wcwc-qty-width: 130px;
    --wcwc-qty-btn-width: 38px;
    --wcwc-qty-font-size: 15px;
}




/* ---- 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 {
    background: var(--wcwc-btn-active-bg);
    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;
    }
}

/* ============================================================
   Custom WooCommerce Quantity Input with +/- Buttons
   ============================================================ */
.quantity.wcwc-qty-wrapper,
.woocommerce .quantity.wcwc-qty-wrapper,
.woocommerce form.cart .quantity.wcwc-qty-wrapper,
.woocommerce div.product form.cart .quantity.wcwc-qty-wrapper,
.woocommerce-page .quantity.wcwc-qty-wrapper,
body .quantity.wcwc-qty-wrapper,
body.woocommerce div.product form.cart .quantity.wcwc-qty-wrapper,
body.woocommerce div.product form.cart div.quantity.wcwc-qty-wrapper {
    display: inline-flex !important;
    align-items: stretch !important;
    vertical-align: middle !important;
    position: relative !important;
    width: var(--wcwc-qty-width, 130px) !important;
    min-width: var(--wcwc-qty-width, 130px) !important;
    max-width: 100% !important;
    height: var(--wcwc-qty-height, 44px) !important;
    min-height: var(--wcwc-qty-height, 44px) !important;
    background: var(--wcwc-qty-input-bg, #ffffff) !important;
    border: var(--wcwc-qty-border-width, 1px) solid var(--wcwc-qty-border-color, #e2e8f0) !important;
    border-radius: var(--wcwc-qty-radius, 4px) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 12px 0 0 !important;
    float: none !important;
    transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.quantity.wcwc-qty-wrapper:hover,
.quantity.wcwc-qty-wrapper:focus-within,
.woocommerce .quantity.wcwc-qty-wrapper:hover,
.woocommerce .quantity.wcwc-qty-wrapper:focus-within {
    border-color: var(--wcwc-qty-border-hover-color, #000000) !important;
}

/* Screen reader text accessibility */
.quantity.wcwc-qty-wrapper .screen-reader-text,
.woocommerce .quantity.wcwc-qty-wrapper .screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Minus and Plus buttons */
.quantity.wcwc-qty-wrapper .wcwc-qty-btn,
.woocommerce .quantity.wcwc-qty-wrapper .wcwc-qty-btn,
body .quantity.wcwc-qty-wrapper .wcwc-qty-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 var(--wcwc-qty-btn-width, 38px) !important;
    width: var(--wcwc-qty-btn-width, 38px) !important;
    min-width: var(--wcwc-qty-btn-width, 38px) !important;
    max-width: var(--wcwc-qty-btn-width, 38px) !important;
    height: 100% !important;
    min-height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: var(--wcwc-qty-btn-bg, #f7f7f7) !important;
    color: var(--wcwc-qty-btn-color, #111111) !important;
    font-size: calc(var(--wcwc-qty-font-size, 15px) + 2px) !important;
    font-family: inherit !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.quantity.wcwc-qty-wrapper .wcwc-qty-minus {
    border-right: var(--wcwc-qty-border-width, 1px) solid var(--wcwc-qty-border-color, #e2e8f0) !important;
}

.quantity.wcwc-qty-wrapper .wcwc-qty-plus {
    border-left: var(--wcwc-qty-border-width, 1px) solid var(--wcwc-qty-border-color, #e2e8f0) !important;
}

.quantity.wcwc-qty-wrapper:hover .wcwc-qty-minus,
.quantity.wcwc-qty-wrapper:focus-within .wcwc-qty-minus,
.quantity.wcwc-qty-wrapper:hover .wcwc-qty-plus,
.quantity.wcwc-qty-wrapper:focus-within .wcwc-qty-plus {
    border-color: var(--wcwc-qty-border-hover-color, #000000) !important;
}

.quantity.wcwc-qty-wrapper .wcwc-qty-btn:hover:not(:disabled) {
    background: var(--wcwc-qty-btn-hover-bg, #000000) !important;
    color: var(--wcwc-qty-btn-hover-color, #ffffff) !important;
}

.quantity.wcwc-qty-wrapper .wcwc-qty-btn:active:not(:disabled) {
    opacity: 0.75 !important;
}

.quantity.wcwc-qty-wrapper .wcwc-qty-btn:disabled,
.quantity.wcwc-qty-wrapper .wcwc-qty-btn[disabled] {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Number input field */
.quantity.wcwc-qty-wrapper input.qty,
.woocommerce .quantity.wcwc-qty-wrapper input.qty,
.woocommerce div.product form.cart .quantity.wcwc-qty-wrapper input.qty,
body .quantity.wcwc-qty-wrapper input.qty {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 100% !important;
    margin: 0 !important;
    padding: 0 4px !important;
    border: none !important;
    border-radius: 0 !important;
    background: var(--wcwc-qty-input-bg, #ffffff) !important;
    color: var(--wcwc-qty-input-color, #111111) !important;
    font-size: var(--wcwc-qty-font-size, 15px) !important;
    font-family: inherit !important;
    font-weight: 600 !important;
    text-align: center !important;
    box-shadow: none !important;
    outline: none !important;
    -moz-appearance: textfield !important;
}

.quantity.wcwc-qty-wrapper input.qty::-webkit-outer-spin-button,
.quantity.wcwc-qty-wrapper input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* WooCommerce cart table alignment */
.woocommerce-cart-form table.cart td.product-quantity .quantity.wcwc-qty-wrapper {
    margin: 0 auto !important;
}

@media (max-width: 768px) {
    .quantity.wcwc-qty-wrapper {
        max-width: 100% !important;
    }
}