/**
 * Wishlist Component Styles
 * Handles styling for wishlist functionality
 */

/* ==========================================================================
   WISHLIST BUTTON BASE STYLES
   ========================================================================== */

/* Base button styles */
.wishlist-button, 
.wishlist-button:hover,
.wishlist-button:focus,
.wishlist-button:active {
    display: inline-flex;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    outline: none;
    transition: all 0.2s ease;
    font-family: "Ebony";
    font-size: 14px;
    font-weight: 400;
    color: var(--e-global-color-text);
}

/* In wishlist state button */
.wishlist-button.in-wishlist {
    border: none;
    background: transparent;
    color: var(--e-global-color-text);
}

/* Icon-only button variant */
.wishlist-button.icon-only {
    padding: 8px;
    min-width: 36px;
    min-height: 36px;
    justify-content: center;
}

.wishlist-button.icon-only .wishlist-text {
    display: none;
}

/* ==========================================================================
   WISHLIST ICONS BASE STYLES
   ========================================================================== */

/* Base icon container styles */
.wishlist-icon-empty,
.wishlist-icon-filled {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

/* SVG icon styles */
.wishlist-icon-empty svg,
.wishlist-icon-filled svg {
    width: 20px;
    height: 20px;
    transition: all 0.2s ease;
}

/* ==========================================================================
   WISHLIST ICON VISIBILITY STATES
   ========================================================================== */

/* Default state - show empty heart, hide filled heart */
.wishlist-button .wishlist-icon-empty {
    display: flex;
    padding: 8px;
    background: transparent;
    border: 2px solid var(--e-global-color-primary);
    border-radius: 999px;
}

.wishlist-button .wishlist-icon-filled {
    display: none;
}

/* In wishlist state - hide empty heart, show filled heart */
.wishlist-button.in-wishlist .wishlist-icon-empty {
    display: none;
}

.wishlist-button.in-wishlist .wishlist-icon-filled {
    display: flex;
    padding: 8px;
    background: #dc0039;
    border-radius: 999px;
    border: 2px solid var(--e-global-color-primary);
}

/* ==========================================================================
   WISHLIST ICON HOVER STATES
   ========================================================================== */

/* Not in list + hover to add = red background */
.wishlist-button:hover .wishlist-icon-empty {
    padding: 8px;
    background: #dc003929;
    border-radius: 999px;
    border-color: #dc003929;
}

/* In list + hover to remove = red background with border */
.wishlist-button.in-wishlist:hover .wishlist-icon-filled {
    padding: 8px;
    background: #dc003939;
    border: 2px solid #dc003939;
    border-radius: 999px;
}

/* ==========================================================================
   WISHLIST TEXT
   ========================================================================== */

.wishlist-text {
    /* Action */
    font-size: var(--theme-font-size-action);
    font-weight: var(--theme-font-weight-action);
    line-height: var(--theme-line-height-action);
    letter-spacing: var(--theme-letter-spacing-action);
    text-transform: uppercase;
}

/* ==========================================================================
   WISHLIST HEADER COMPONENTS
   ========================================================================== */

/* Header link */
.wishlist-header-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.wishlist-header-link:hover {
    color: #DC0039;
    text-decoration: none;
}
.wishlist-header-link:hover path{
    fill: var(--e-global-color-primar, #DC0039);
}
/* Header icon container */
.wishlist-header-icon {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Icon wrapper with counter */
.wishlist-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.wishlist-icon-wrapper svg {
    width: 24px;
    height: 24px;
    transition: color 0.3s ease;
}

/* Counter badge */
.wishlist-counter-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #DC0039;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
    min-width: 18px;
}

/* Header text */
.wishlist-header-text {
    font-size: 14px;
    font-weight: 500;
}

/* Alternative counter implementation */
.wishlist-counter {
    position: relative;
}

.wishlist-counter::after {
    content: attr(data-count);
    position: absolute;
    top: -8px;
    right: -8px;
    background: #DC0039;
    color: #FFF;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    font-family: "Ebony";
}

.wishlist-counter[data-count="0"]::after {
    display: none;
}

/* ==========================================================================
   WISHLIST PAGE LAYOUT
   ========================================================================== */

/* Main page container */
.wishlist-page {
    width: auto;
}

/* Page header */
.wishlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}
.wishlist-header h2{
    /* H3 */
    color: var(--e-global-color-text);
    font-family: var(--theme-font-family);
    font-size: var(--theme-font-size-h3);
    font-weight: var(--theme-font-weight-h3);
    line-height: var(--theme-line-height-h3);
}

/* Item count badge */
.wishlist-count {
    background: #DC0039;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-family: var(--theme-font-family);

}

/* Products grid */
.wishlist-products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.wishlist-empty{
    /* Body */
    font-family: var(--theme-font-family);
    font-size: var(--theme-font-size-body);
    font-weight: var(--theme-font-weight-body);
    line-height: var(--theme-line-height-body);
}

/* ==========================================================================
   WISHLIST ITEM COMPONENTS - CROSS-SELL DESIGN
   ========================================================================== */

/* Individual wishlist item */
.wishlist-item {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    width: 100%;
    min-width: 0; /* Allow shrinking below content size */
}

/* Product card matching cross-sell design */
.wishlist-item .product-card {
    display: flex;
    flex-direction: column;
    padding: 12px;
    align-items: stretch;
    gap: 12px;
    flex: 1;
    border-radius: 8px;
    background: #EFEFEF;
    width: 100%;
    height: 100%;
    min-width: 0; /* Allow shrinking below content size */
    overflow: hidden; /* Prevent content overflow */
}

.wishlist-item .product-card .product-info {
    height: 100%;
}

.wishlist-item .product-card-link {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

/* Product image matching cross-sell */
.wishlist-item .product-image {
    width: 93px;
    aspect-ratio: 12 / 13;
    background: lightgray;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.wishlist-item .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product title container */
.wishlist-item .product-title-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wishlist-item .product-title {
    color: #000;
    font-family: "Ebony";
    font-size: 18px;
    font-style: normal;
    font-weight: 400;
    line-height: 100%; /* 18px */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Button and price container */
.wishlist-item .button-price-container {
    display: flex;
    gap: 6px;
    justify-content: space-between;
    align-items: flex-end;
}

.wishlist-item .product-card .button-price-container svg path {
    fill: #000;
}

/* Product price */
.wishlist-item .product-price {
    color: #000;
    font-family: "Ebony";
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 100%; /* 16px */
}

.wishlist-item .price-label {
    font-size: 12px;
    color: #666;
    margin-right: 4px;
}

/* Action buttons matching cross-sell */
.wishlist-item .add-to-order-btn,
.wishlist-item .view-more-btn {
    background-color: transparent;
    border: none;
    padding: 12px 0 0 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #000;
    font-family: "Ebony";
    font-size: 14px;
    font-weight: 400;
    line-height: 100%;
}

.wishlist-item .add-to-order-btn:hover,
.wishlist-item .view-more-btn:hover {
    opacity: 0.7;
}

/* Wishlist-specific actions */
.wishlist-actions {
    padding-top: 12px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
}

.wishlist-actions .remove-from-wishlist-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.wishlist-actions .remove-from-wishlist-btn:hover {
    background: #c82333;
}

/* ==========================================================================
   WISHLIST ITEM ACTIONS
   ========================================================================== */

/* Action buttons container */
.wishlist-item .product-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

/* Base button styles for wishlist items */
.wishlist-item .add-to-cart-btn,
.wishlist-item .remove-from-wishlist-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-family: "Ebony";
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

/* Add to cart button */
.add-to-cart-from-wishlist-btn {
    background-color: #DC0039;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.add-to-cart-from-wishlist-btn:hover {
    background-color: #b8002f;
    transform: translateY(-1px);
}

.add-to-cart-from-wishlist-btn:active {
    transform: translateY(0);
}

.add-to-cart-from-wishlist-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Remove from wishlist button */
.wishlist-item .remove-from-wishlist-btn {
    background: #dc3545;
    color: white;
}

.wishlist-item .remove-from-wishlist-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}



.wishlist-page .product-card .remove-from-wishlist-btn:hover{
    background-color: #c82333;
}
.wishlist-page .product-card:hover .view-more-btn, 
.wishlist-page .product-card:hover .add-to-order-btn{
    color: #c82333 !important;
}
/* ==========================================================================
   LOADING & INTERACTION STATES
   ========================================================================== */

/* Loading state */
.wishlist-button.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Removing animation */
.wishlist-item.removing {
    opacity: 0.5;
    transform: scale(0.98);
}

/* ==========================================================================
   PRODUCT CARD INTEGRATION
   ========================================================================== */

/* Wishlist button positioning on product cards */
.product-item .wishlist-button {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 999;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1024px) {
    .wishlist-products {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .wishlist-item .product-card-link {
        flex-direction: column;
    }
    
    .wishlist-item .product-image {
        width: 100%;
    }
}

@media (max-width: 767px) {
    .wishlist-page {
        padding: 16px;
    }
    
    .wishlist-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .wishlist-header h2 {
        font-size: 24px;
    }
    
    .wishlist-products {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    /* Wishlist responsive matching cross-sell */
    .wishlist-item {
        flex-direction: column;
        max-width: 100%;
    }
    
    .wishlist-item .product-card {
        max-width: 100%;
        width: 100%;
    }
    
    .wishlist-item .product-title {
        font-size: 14px;
        min-height: 40px;
    }
    
    .wishlist-item .product-image {
        height: 180px;
    }
}
