﻿/* ============================================
   WISHLIST UNIFIED STYLES
   Enterprise-Grade Design System for GroKarna
   Consolidated from 3 separate CSS files
   ============================================ */



/* ========== 1. WISHLIST PAGE OPTIMIZED ========== */
/* Source: wishlist-page-optimized.css */

/**
 * Optimized Wishlist Page Styles
 * High-performance CSS with minimal reflows and optimized animations
 */

/* Critical CSS - Load immediately */
.grokarna-wishlist-page-optimized {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    contain: layout style;
}

.wishlist-header {
    text-align: center;
    margin-bottom: 40px;
}

.wishlist-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #333;
    font-weight: 700;
}

.wishlist-header p {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
}

/* Optimized loading state */
.wishlist-loading-optimized {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    will-change: opacity;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Optimized grid layout with CSS Grid - Match products page */
.wishlist-products-grid-optimized {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    list-style: none;
    padding: 0;
    margin: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    contain: layout;
}

.wishlist-products-grid-optimized.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Product card optimizations - Match products page styling */
.wishlist-product-card {
    position: relative;
    background: white;
    border-radius: 18px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    contain: layout style;
    will-change: transform;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    overflow: visible;
    padding: 0;
}

.wishlist-product-card:hover {
    transform: none;
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    z-index: 5;
}

/* Remove button optimization */
.wishlist-product-card .remove-wishlist-heart {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    will-change: transform;
}

.wishlist-product-card .remove-wishlist-heart:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.wishlist-product-card .remove-wishlist-heart .heart-icon {
    font-size: 18px;
    line-height: 1;
    color: #e74c3c;
}

/* Product image optimization - Match products page dimensions */
.wishlist-product-card .shop-product-image {
    position: relative;
    overflow: hidden;
    border-radius: 18px 18px 0 0;
    height: 260px;
    max-height: 260px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wishlist-product-card .shop-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
    will-change: transform;
    transform: perspective(800px) translateZ(0) rotateX(0) rotateY(0) scale(1);
}

.wishlist-product-card:hover .shop-product-image img {
    transform: perspective(800px) translateZ(8px) rotateX(1.2deg) rotateY(-1.2deg) scale(1.08) !important;
}

/* Badge optimization */
.wishlist-product-card .product-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
}

.wishlist-product-card .badge {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.6875rem;
    font-weight: bold;
    margin-right: 3px;
    margin-bottom: 3px;
}

.wishlist-product-card .badge-organic {
    background: #66CC66;
    color: white;
}

.wishlist-product-card .badge-off {
    background: #ff6b35;
    color: white;
}

/* Product info optimization - Match products page padding */
.wishlist-product-card .shop-product-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.wishlist-product-card .gk-product-title {
    margin-bottom: 4px;
    line-height: 1.2;
    min-height: 36px;
}

.wishlist-product-card .gk-product-title .en {
    font-weight: 800;
    color: #111827;
    font-size: 2.25em;
    margin: 0;
    text-align: left;
    line-height: 1;
}

.wishlist-product-card .gk-product-title .kn {
    font-size: 1em;
    font-weight: 500;
    color: #6b7280;
    margin-top: 0px;
    display: block;
}

.wishlist-product-card .product-meta-row {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
}

.wishlist-product-card .product-rating {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 2px;
}

.wishlist-product-card .product-local {
    font-size: 0.75rem;
    color: #666;
}

/* Price optimization - Match products page styling */
.wishlist-product-card .shop-product-price {
    margin: 8px 0 12px 0;
    font-weight: 700;
    color: #222;
    opacity: 1;
    visibility: visible;
    display: block;
}

.wishlist-product-card .current-price {
    font-weight: 900;
    font-size: 1.25em;
    color: #2d6e3e;
    text-decoration: none;
    text-shadow: 0.5px 0.5px 0px #000;
    line-height: 1.4;
    display: block;
    margin: 10px 0;
}

.wishlist-product-card .prime-price,
.wishlist-product-card .member-price {
    font-size: 1.25em;
    color: #f05c0c;
    text-decoration: none;
    margin-top: 5px;
    display: block;
    line-height: 1.4;
}

/* Controls optimization - Match products page styling */
.wishlist-product-card .shop-product-controls {
    margin-top: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 20;
    width: 100%;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.wishlist-product-card .shop-gk-weight-select,
.wishlist-product-card .gk-weight-select {
    width: 100%;
    padding: 8px 30px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 0.875em;
    cursor: pointer;
    transition: border-color 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1em;
}

.wishlist-product-card .shop-gk-weight-select:focus {
    outline: none;
    border-color: #2d6e3e;
    box-shadow: 0 0 0 3px rgba(45, 110, 62, 0.1);
}

/* Button optimization - Match products page styling */
.wishlist-product-card .wishlist-move-to-cart-btn,
.wishlist-product-card .gk-add-to-cart-btn {
    background: #f05c0c;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-width: 80px;
    max-width: 120px;
    text-decoration: none;
    z-index: 21;
    position: relative;
}

.wishlist-product-card .wishlist-move-to-cart-btn:hover {
    background: #f05c0c;
}

.wishlist-product-card .wishlist-move-to-cart-btn:active {
    transform: translateY(0);
}

.wishlist-product-card .wishlist-move-to-cart-btn.loading {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Empty state optimization */
.wishlist-empty-optimized {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    will-change: opacity;
}

.wishlist-empty-optimized h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.5rem;
}

.wishlist-empty-optimized p {
    color: #666;
    margin-bottom: 20px;
    font-size: 1rem;
}

.wishlist-empty-optimized .btn {
    display: inline-block;
    background: #ff6b35;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background 0.2s ease, transform 0.2s ease;
    will-change: background, transform;
}

.wishlist-empty-optimized .btn:hover {
    background: #e55a2b;
    transform: translateY(-1px);
}

/* Error state */
.wishlist-error-optimized {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.wishlist-error-optimized h3 {
    margin-bottom: 15px;
    color: #e74c3c;
    font-size: 1.5rem;
}

.wishlist-error-optimized p {
    color: #666;
    margin-bottom: 20px;
}

.wishlist-error-optimized .btn {
    display: inline-block;
    background: #ff6b35;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background 0.2s ease;
}

.wishlist-error-optimized .btn:hover {
    background: #e55a2b;
}

/* Responsive optimizations */
@media (max-width: 768px) {
    .grokarna-wishlist-page-optimized {
        padding: 10px;
    }
    
    .wishlist-products-grid-optimized {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
    
    .wishlist-header h1 {
        font-size: 2rem;
    }
    
    .wishlist-product-card .shop-product-image {
        height: 200px;
        max-height: 200px;
    }
}

@media (max-width: 480px) {
    .wishlist-products-grid-optimized {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .wishlist-header h1 {
        font-size: 1.75rem;
    }
}

/* Performance optimizations */
.wishlist-product-card * {
    box-sizing: border-box;
}

.wishlist-product-card img {
    max-width: 100%;
    height: auto;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .wishlist-product-card,
    .wishlist-product-card .remove-wishlist-heart,
    .wishlist-product-card .wishlist-move-to-cart-btn,
    .wishlist-empty-optimized .btn {
        transition: none;
    }
    
    .loading-spinner {
        animation: none;
    }
    
    .wishlist-products-grid-optimized {
        transition: none;
    }
}

/* Print styles */
@media print {
    .wishlist-product-card .remove-wishlist-heart,
    .wishlist-product-card .shop-product-controls {
        display: none;
    }
    
    .wishlist-product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}


/* ========== 2. WISHLIST REDESIGN ========== */
/* Source: wishlist-redesign.css */



/* =============================================
   UNIFIED WISHLIST SYSTEM - RED BASKET DESIGN
   Universal Basket Icons with Consistent Behavior
   ============================================= */

/* Universal Basket Styles - Works for all wishlist selectors */
.wishlist-heart-redesign,
.wishlist-heart-btn,
.wishlist-heart-container {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 32px !important;
    height: 32px !important;
    cursor: pointer !important;
    z-index: 2147483647 !important;

    /* HOVER EFFECT: Hidden by default for non-wishlisted items */
    opacity: 0 !important;
    visibility: hidden !important;

    /* NO BACKGROUND - Just the basket icon */
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;

    /* Smooth transitions */
    transition: all 0.3s ease !important;

    /* Reset any inherited styles */
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    
    /* Use SVG basket icon as background */
    background-image: url('../icons/basket-inactive.svg') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

/* Hide the heart icon span - we're using SVG background instead */
.wishlist-heart-redesign .heart-icon,
.wishlist-heart-btn .heart-icon,
.wishlist-heart-container .heart-icon {
    display: none !important;
}

/* Show basket on hover */
.product-card:hover .wishlist-heart-redesign,
.product-card:hover .wishlist-heart-btn,
.product-card:hover .wishlist-heart-container,
.shop-product-card:hover .wishlist-heart-redesign,
.shop-product-card:hover .wishlist-heart-btn,
.shop-product-card:hover .wishlist-heart-container,
.featured-products .product-card:hover .wishlist-heart-redesign,
.featured-products .product-card:hover .wishlist-heart-btn,
.featured-products .product-card:hover .wishlist-heart-container {
    opacity: 0.375 !important;
    visibility: visible !important;
}

/* Always show basket when wishlisted */
.wishlist-heart-redesign.wishlisted,
.wishlist-heart-redesign.in-wishlist,
.wishlist-heart-btn.wishlisted,
.wishlist-heart-btn.in-wishlist,
.wishlist-heart-container.wishlisted,
.wishlist-heart-container.in-wishlist,
.featured-products .wishlist-heart-redesign.wishlisted,
.featured-products .wishlist-heart-redesign.in-wishlist,
.featured-products .wishlist-heart-btn.wishlisted,
.featured-products .wishlist-heart-btn.in-wishlist,
.featured-products .wishlist-heart-container.wishlisted,
.featured-products .wishlist-heart-container.in-wishlist {
    opacity: 0.375 !important;
    visibility: visible !important;
    background-image: url('../icons/basket-active.svg') !important;
}

/* Hover effect - scale up */
.wishlist-heart-redesign:hover,
.wishlist-heart-btn:hover,
.wishlist-heart-container:hover {
    transform: scale(1.15) !important;
}

/* Single product page wishlist - always visible with proper positioning */
.single-product-wishlist {
    opacity: 0.375 !important;
    visibility: visible !important;
    top: 15px !important;
    right: 15px !important;
    position: absolute !important;
    z-index: 100 !important;
}

/* Ensure product images wrapper has relative positioning for single product pages */
.single-product .product-images-wrapper {
    position: relative !important;
}

/* Wishlist page - Move to Cart button basket icon */
.wishlist-page .wishlist-heart-redesign {
    position: relative !important;
    top: 0 !important;
    right: 0 !important;
    opacity: 0.375 !important;
    visibility: visible !important;
    display: inline-flex !important;
    width: 24px !important;
    height: 24px !important;
    margin-right: 8px !important;
}

/* Remove white padding from product cards on /products/ page */
.shop-product-card {
    padding: 0 !important;
    margin: 0 !important;
}

.shop-product-card .shop-product-image {
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
}

.shop-product-card .shop-product-info {
    padding: 16px !important;
}

/* Ensure featured product cards also have no extra padding */
.featured-products .product-card {
    padding: 0 !important;
    margin: 0 !important;
}

.featured-products .product-card .product-image {
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
}

.featured-products .product-card .product-info {
    padding: 12px 12px 58px !important;
}



/* ========== 3. WISHLIST PAGE FIXES ========== */
/* Source: wishlist-page-fixes.css */

/* =============================================
   WISHLIST PAGE PRODUCT CARD FIXES
   Removes white space/padding and fixes button alignment
   ============================================= */

/* Remove excessive padding from wishlist product cards */
.wishlist-products-grid li.product,
.wishlist-products-grid .wishlist-product-card,
.wishlist-products-grid .shop-product-card {
    padding: 0 !important;
}

/* Remove padding from product info section - make it more compact */
.wishlist-products-grid .shop-product-info {
    padding: 8px 12px 4px 12px !important;
}

/* Adjust product controls container - minimize padding and gap */
.wishlist-products-grid .shop-product-controls {
    padding: 0 12px 12px 12px !important;
    margin-top: 4px !important;
    gap: 8px !important;
}

/* Fix "Move to Cart" button alignment and styling */
.wishlist-move-to-cart-btn {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 10px 16px !important;
    background: #ff6b35 !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
    margin: 0 !important;
}

.wishlist-move-to-cart-btn:hover {
    background: #e55a2b !important;
}

/* Ensure weight select takes full width and aligns properly with minimal spacing */
.wishlist-products-grid .shop-gk-weight-select,
.wishlist-products-grid .gk-weight-select {
    width: 100% !important;
    margin: 0 !important;
    padding: 8px 30px 8px 10px !important;
}

/* Remove any extra spacing around the product image */
.wishlist-products-grid .shop-product-image {
    margin: 0 !important;
    border-radius: 16px 16px 0 0 !important;
}

/* Ensure product link doesn't add extra padding */
.wishlist-products-grid li.product > a {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Compact the product meta row */
.wishlist-products-grid .product-meta-row {
    margin-top: 2px !important;
    margin-bottom: 4px !important;
}

/* Adjust price section spacing - make it more compact */
.wishlist-products-grid .shop-product-price {
    margin: 4px 0 6px 0 !important;
}

/* Remove any extra padding from the title */
.wishlist-products-grid .gk-product-title {
    padding: 0 !important;
    margin: 0 0 2px 0 !important;
}

/* Ensure the current price has minimal spacing */
.wishlist-products-grid .current-price {
    margin: 0 !important;
    line-height: 1.2 !important;
}

/* Ensure the prime/member price has minimal spacing */
.wishlist-products-grid .prime-price,
.wishlist-products-grid .member-price {
    margin: 2px 0 0 0 !important;
    line-height: 1.2 !important;
}


/* Fix product title wrapping - English text on one line, Kannada on second line */
.wishlist-products-grid .gk-product-title .en {
    white-space: nowrap !important;
    overflow: visible !important;
    font-size: 1.8em !important;
    max-width: 100% !important;
}

/* Ensure Kannada text wraps to second line */
.wishlist-products-grid .gk-product-title .kn {
    white-space: normal !important;
    display: block !important;
}
