/* REUSE YOUR INDEX.PHP NEOMORPHIC VARIABLES */
:root {
    --primary-color: #6366f1;
    --primary-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    --secondary-color: #f59e0b;
    --secondary-gradient: linear-gradient(135deg, #f59e0b, #f97316);
    --accent-color: #10b981;
    --accent-gradient: linear-gradient(135deg, #10b981, #34d399);
    --warning-color: #ef4444;
    --warning-gradient: linear-gradient(135deg, #ef4444, #f87171);
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --gray-light: #e5e7eb;
    --gray-medium: #9ca3af;
    --gray-dark: #4b5563;

    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --border-light: rgba(255, 255, 255, 0.2);
    --shadow-soft: 8px 8px 20px #d1d9e6, -8px -8px 20px #ffffff;
    --shadow-hard: 4px 4px 10px #d1d9e6, -4px -4px 10px #ffffff;
    --shadow-inset: inset 3px 3px 8px #d1d9e6, inset -3px -3px 8px #ffffff;
    --shadow-hover: 10px 10px 25px #c9d1de, -10px -10px 25px #ffffff;
    --shadow-glow: 0 6px 20px rgba(99, 102, 241, 0.12);
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --radius-xs: 5px;
    --radius-round: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    font-family: 'Poppins', 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--dark-color);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 15px;
}

/* Wishlist Header */
.wishlist-header {
    margin-bottom: 25px;
}

.wishlist-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 6px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.wishlist-subtitle {
    font-size: 0.95rem;
    color: var(--gray-dark);
    font-weight: 400;
}

.wishlist-count {
    background: var(--warning-gradient);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
}

/* Empty Wishlist */
.empty-wishlist {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 50px 20px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    margin: 30px 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.empty-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.2));
    border-radius: 50%;
    margin: 0 auto 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-hard);
}

.empty-icon i {
    font-size: 3rem;
    background: var(--warning-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.empty-text {
    color: var(--gray-medium);
    margin-bottom: 25px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

/* ULTRA COMPACT WISHLIST GRID */
.wishlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .wishlist-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 576px) {
    .wishlist-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Wishlist Card - COMPACT DESIGN */
.wishlist-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 15px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-hard);
    height: 380px;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.wishlist-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover), var(--shadow-glow);
}

/* Product Image Container */
.wishlist-image-container {
    width: 100%;
    height: 220px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--bg-primary), #f8fafc);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

@media (max-width: 768px) {
    .wishlist-image-container {
        height: 180px;
    }
}

@media (max-width: 576px) {
    .wishlist-image-container {
        height: 200px;
    }
}

.wishlist-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
    transition: transform 0.4s ease;
}

.wishlist-card:hover .wishlist-image {
    transform: scale(1.05);
}

/* Remove Button */
.remove-btn-container {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}

.remove-form {
    display: inline-block;
}

.remove-btn {
    background: var(--bg-card);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--warning-color);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-hard);
    font-size: 14px;
}

.remove-btn:hover {
    background: var(--warning-gradient);
    color: white;
    transform: rotate(90deg);
}

/* Product Badges */
.product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 2;
}

.product-badge {
    font-size: 10px;
    font-weight: 700;
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-round);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: var(--shadow-hard);
}

.badge-variant {
    background: var(--primary-gradient);
}

.badge-new {
    background: var(--accent-gradient);
}

/* Product Info */
.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
    line-height: 1.3;
    height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-name a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.product-name a:hover {
    color: var(--primary-color);
}

/* SKU Container - Centered */
.sku-container {
    margin: auto 0 10px 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sku-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--gray-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
}

.sku-label i {
    font-size: 12px;
    color: var(--primary-color);
}

.product-sku,
.sku-code {
    font-size: 13px;
    font-weight: 700;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    background: #f3f4f6;
    color: var(--primary-color);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid #d1d5db;
    display: inline-block;
    margin-bottom: 10px;
    width: fit-content;
}

/* Price Container */
.price-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.product-price-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mrp-price {
    font-size: 12px;
    color: var(--gray-medium);
    text-decoration: line-through;
    font-weight: 500;
}

.sale-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--dark-color);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.discount-badge {
    font-size: 10px;
    color: var(--accent-color);
    font-weight: 700;
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
}

.current-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--dark-color);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.original-price {
    font-size: 12px;
    color: var(--gray-medium);
    text-decoration: line-through;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.wishlist-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    font-family: 'Inter', sans-serif;
}

.btn-view {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-hard);
}

.btn-view:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-cart {
    background: var(--bg-card);
    color: var(--primary-color);
    box-shadow: var(--shadow-hard);
}

.btn-cart:hover {
    background: var(--accent-gradient);
    color: white;
    transform: translateY(-2px);
}

/* Bulk Actions */
.bulk-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.bulk-btn {
    background: var(--bg-card);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-hard);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--dark-color);
}

.bulk-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Image Fallback */
.image-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f2f5, #e5e7eb);
    color: var(--gray-medium);
    border-radius: var(--radius-sm);
    font-size: 10px;
    flex-direction: column;
    gap: 8px;
}

.image-fallback i {
    font-size: 24px;
    opacity: 0.3;
}

/* Mobile Optimizations - Enhanced Grid */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .wishlist-grid {
        /* Allows 3 columns on tablet */
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .wishlist-title {
        font-size: 1.7rem;
    }

    .wishlist-subtitle {
        font-size: 0.9rem;
    }

    .empty-wishlist {
        padding: 30px 15px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 8px;
        /* Stack buttons on tablet for better touch targets */
    }
}

@media (max-width: 576px) {
    .wishlist-grid {
        /* Allows 2 columns on mobile (approx 160px-180px each) */
        grid-template-columns: repeat(auto-fill, minmax(150px, 1px));
        gap: 10px;
    }

    .wishlist-card {
        padding: 10px;
        height: auto;
        /* Allow flexible height */
    }

    .wishlist-image-container {
        height: 150px;
        /* Reduced specific height */
        margin-bottom: 10px;
    }

    .product-name {
        font-size: 12px;
        height: 32px;
        /* 2 lines max */
        margin-bottom: 5px;
    }

    .current-price {
        font-size: 15px;
    }

    .mrp-price {
        font-size: 11px;
    }

    .wishlist-title {
        font-size: 1.4rem;
    }

    .wishlist-btn {
        padding: 8px;
        font-size: 11px;
    }

    .sku-container {
        display: none;
        /* Hide SKU on very small screens to save space */
    }
}

@media (max-width: 380px) {
    .wishlist-grid {
        grid-template-columns: 1fr 1fr;
        /* Force 2 columns */
        gap: 8px;
    }
}

/* Animation */
.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-card);
    padding: 15px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    border-left: 4px solid var(--accent-color);
}

.toast-error {
    border-left: 4px solid var(--warning-color);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
}