/* ============================================
   WISHLIST FUNCTIONALITY
   ============================================ */

/* Add to Wishlist Button Shortcode */
.bollypiano-wishlist-button {
    display: flex !important;
    width: 100% !important;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: 1px solid #1f1f1f !important;
    color: #1f1f1f !important;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
    box-shadow: none !important;
    outline: none !important;
}

.bollypiano-wishlist-button:hover {
    background-color: var(--secondary, #3E9906);
    color: #FFFFFF;
    text-decoration: none;
}

.bollypiano-wishlist-button:hover svg path {
    fill: #FFFFFF;
    stroke: #FFFFFF;
}

.bollypiano-wishlist-button.in-wishlist {
    background-color: #1f1f1f !important;
    color: #FFFFFF !important;
    border-color: #1f1f1f !important;
}

.bollypiano-wishlist-button.in-wishlist svg path {
    fill: #FFFFFF !important;
    stroke: #FFFFFF !important;
}

.bollypiano-wishlist-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bollypiano-wishlist-button svg {
    flex-shrink: 0;
    margin-right: 8px;
}

.bollypiano-wishlist-button .wishlist-button-text {
    white-space: nowrap;
}

/* Wishlist Heart Icon */
.bollypiano-product-image-wrapper {
    position: relative;
}

.bollypiano-wishlist-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: #FFFFFF !important;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bollypiano-wishlist-btn:hover:not(.active) {
    background-color: var(--secondary) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: scale(1.1);
}

.bollypiano-wishlist-btn:hover:not(.active) svg {
    color: #FFFFFF !important;
}

.bollypiano-wishlist-btn:hover:not(.active) svg path {
    fill: #FFFFFF !important;
    stroke: #FFFFFF !important;
}

/* Default state: white bg, black icon */
.bollypiano-wishlist-btn svg {
    width: 16px;
    height: 16px;
    color: #1f1f1f;
    transition: all 0.3s ease;
}

.bollypiano-wishlist-btn svg path {
    fill: none;
    stroke: #1f1f1f;
    stroke-width: 2;
    transition: all 0.3s ease;
}

/* Active state: secondary color bg (#3E9906), white icon */
.bollypiano-wishlist-btn.active {
    background-color: var(--secondary) !important;
}

.bollypiano-wishlist-btn.active svg {
    color: #FFFFFF !important;
}

.bollypiano-wishlist-btn.active svg path {
    fill: #FFFFFF !important;
    stroke: #FFFFFF !important;
}

.bollypiano-wishlist-btn.active:hover {
    background-color: #3A8A05 !important;
}

/* Wishlist Tooltip - Hover tooltip using ::before (shows below button) */
.bollypiano-wishlist-btn::before {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background-color: #1f1f1f;
    color: #FFFFFF;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.bollypiano-wishlist-btn::after {
    content: '';
    position: absolute;
    top: calc(100% + 0.25rem);
    right: 0.5rem;
    border: 5px solid transparent;
    border-bottom-color: #1f1f1f;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    z-index: 21;
}

.bollypiano-wishlist-btn:hover::before,
.bollypiano-wishlist-btn:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Wishlist Tooltip - Click tooltip (for non-logged-in users, shows below icon) */
.wishlist-tooltip {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background-color: #1f1f1f;
    color: #FFFFFF;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.wishlist-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 1rem;
    border: 5px solid transparent;
    border-bottom-color: #1f1f1f;
}

.wishlist-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.wishlist-tooltip a,
.wishlist-tooltip .wishlist-tooltip-link {
    color: #FFFFFF;
    text-decoration: underline;
    pointer-events: auto;
}

.wishlist-tooltip a:hover,
.wishlist-tooltip .wishlist-tooltip-link:hover {
    color: #FFFFFF;
    opacity: 0.9;
}

/* Responsive tooltip */
@media (max-width: 768px) {
    .wishlist-tooltip {
        right: auto;
        left: 50%;
        transform: translateX(-50%) translateY(-5px);
        white-space: normal;
        max-width: 200px;
        text-align: center;
    }
    
    .wishlist-tooltip::after {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .wishlist-tooltip.show {
        transform: translateX(-50%) translateY(0);
    }
}

/* Ensure product card has relative positioning for absolute heart icon */
ul.products li.product.bollypiano-product-card {
    position: relative;
}

/* Wishlist Page */
.bollypiano-wishlist-page {
    width: 100%;
    background-color: #FFFFFF;
    border: 1px solid #E7E2DA;
    border-radius: 20px;
    padding: 2rem;
}

/* Empty Wishlist State */
.wishlist-empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.wishlist-empty-message {
    font-size: 1.125rem;
    color: #1f1f1f;
    margin-bottom: 1.5rem;
}

.wishlist-browse-button {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: var(--primary);
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.wishlist-browse-button:hover {
    background-color: #C57200;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 129, 0, 0.3);
    color: #FFFFFF;
}

/* Wishlist Products Grid - 3 columns */
.wishlist-products-grid {
    width: 100%;
}

.wishlist-products-grid .woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Override WooCommerce default width for wishlist products */
.wishlist-products-grid .woocommerce ul.products.columns-3 li.product,
.wishlist-products-grid .woocommerce-page ul.products.columns-3 li.product,
.wishlist-products-grid ul.products.columns-3 li.product {
    width: 100% !important;
    flex: 0 0 auto !important;
    max-width: 100% !important;
}

/* Remove WooCommerce ::before and ::after pseudo-elements that interfere with grid */
.wishlist-products-grid .woocommerce ul.products::before,
.wishlist-products-grid .woocommerce ul.products::after,
.wishlist-products-grid .woocommerce-page ul.products::before,
.wishlist-products-grid .woocommerce-page ul.products::after,
.wishlist-products-grid ul.products::before,
.wishlist-products-grid ul.products::after {
    content: none !important;
    display: none !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .wishlist-products-grid .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .wishlist-products-grid .woocommerce ul.products {
        grid-template-columns: 1fr;
    }
}

/* Pagination Styles (reuse shop pagination styles) */
.bollypiano-pagination-wrapper {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #E5E5E5;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bollypiano-pagination-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.bollypiano-pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0.5rem 0.75rem;
    background-color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 8px;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bollypiano-pagination-btn:hover:not(.disabled):not(.active) {
    background-color: #C57200;
    border-color: #C57200;
    color: #FFFFFF;
}

.bollypiano-pagination-btn.active {
    background-color: color-mix(in srgb, var(--primary) 70%, black);
    color: #FFFFFF;
    border-color: color-mix(in srgb, var(--primary) 70%, black);
    opacity: 1;
}

.bollypiano-pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.bollypiano-pagination-dots {
    padding: 0 0.5rem;
    color: #999;
}

.bollypiano-pagination-btn .pagination-text {
    display: inline;
}

.bollypiano-pagination-btn .pagination-arrow {
    display: none;
}

@media (max-width: 768px) {
    .bollypiano-pagination-btn .pagination-text {
        display: none;
    }
    
    .bollypiano-pagination-btn .pagination-arrow {
        display: inline;
    }
}

.wishlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E5E5E5;
}

.wishlist-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f1f1f;
    margin: 0;
}

.bollypiano-add-all-to-cart {
    background-color: var(--primary) !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 0.75rem 1.5rem !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.bollypiano-add-all-to-cart:hover {
    background-color: #C57200 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 129, 0, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .wishlist-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .wishlist-header h2 {
        font-size: 1.25rem;
    }
    
    .bollypiano-add-all-to-cart {
        width: 100%;
    }
}

