/* ===========================================
   PRODUCT CARDS - UNIFIED STYLES FOR ALL PAGES
   All pages share the same compact card style
   =========================================== */

/* Products Grid - auto-fill based on card width (235px) */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 235px));
    gap: 20px;
    margin-bottom: 40px;
    justify-content: center;
}

/* Featured section grid */
.featured-section .products-grid {
    justify-content: center;
}

/* Clothing page specific - ensure no gaps */
body.clothing-page .product-card,
body.clothing-page .product-card-link,
body.clothing-page .product-image {
    padding: 0 !important;
    margin: 0 !important;
}

body.clothing-page .product-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Responsive Grid Breakpoints */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .product-card {
        width: 100%;
        height: auto;
        min-height: 320px;
    }
    
    .product-image {
        height: 170px;
    }
    
    .product-info {
        min-height: 130px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-card {
        min-height: 300px;
    }
    
    .product-image {
        height: 150px;
    }
    
    .product-info {
        min-height: 120px;
        padding: 8px 10px;
    }
}

/* Product Card - Fixed dimensions 235px x 340px */
.product-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    width: 235px;
    height: 340px;
    padding: 0;
    margin: 0;
}

/* Product card link wrapper - absolute overlay for click */
.product-card-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

/* Ensure card is positioned for absolute child */
.product-card {
    position: relative;
    cursor: pointer;
}

/* Content passes clicks through to the link overlay */
.product-info,
.product-image {
    pointer-events: none;
}

/* Interactive elements catch their own clicks */
.wishlist-btn,
.add-to-cart,
.product-actions button,
.product-actions {
    pointer-events: auto;
    position: relative;
    z-index: 10;
}

/* Dark mode styling for product card */
body.dark .product-card,
body.dark-mode .product-card {
    background-color: #232342;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* The purple wave animation at the bottom - DISABLED */
.product-card::after {
    display: none; /* Completely hide the wave effect */
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(120deg, #7928ca, #ff0080);
    background-size: 200% 100%;
    transform: scaleX(0);
    transition: transform 0.5s ease;
    z-index: 1;
}

.product-card:hover::after {
    /* Disabled animation */
    transform: scaleX(0); /* Keep it hidden even on hover */
    animation: none;
}

/* Dark mode teal gradient */
body.dark .product-card::after,
body.dark-mode .product-card::after {
    background: linear-gradient(120deg, #35a79c, #209cb3, #1e4a69);
    background-size: 200% 100%;
}

/* Product hover effect */
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1);
}

/* Product image - fills card width completely */
.product-image {
    position: relative;
    height: 200px;
    width: 100%;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    box-sizing: border-box;
    background-color: #f5f5f5;
}

body.dark .product-image,
body.dark-mode .product-image {
    background-color: #1a1a2e;
}

/* Old Price Row - ensure visibility */
.old-price-row {
    margin-top: 4px;
    display: block;
}

.old-price-row .original-price {
    font-size: 0.85rem;
    color: #999;
    text-decoration: line-through;
}

body.dark .old-price-row .original-price,
body.dark-mode .old-price-row .original-price {
    color: #888;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    margin: 0;
    padding: 0;
    backface-visibility: hidden;
    will-change: transform;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

/* All pages use the same compact style - no page-specific overrides needed */

/* Discount badge */
.discount-badge, .new-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: linear-gradient(120deg, #7928ca, #ff0080);
    background-size: 200% 100%;
    animation: gradientShift 5s ease infinite;
    color: white;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 16px;
    z-index: 2;
}

/* Marketing badge (top-right) */
.marketing-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 16px;
    z-index: 2;
    background: linear-gradient(120deg, #7928ca, #ff0080);
    background-size: 200% 100%;
    animation: gradientShift 5s ease infinite;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.marketing-badge.left {
    left: 6px;
    right: auto;
}

/* Badge color themes */
.marketing-badge.badge-hot { background: linear-gradient(120deg, #ff7a00, #ff3d00); }
.marketing-badge.badge-special { background: linear-gradient(120deg, #8e2de2, #4a00e0); }
.marketing-badge.badge-featured { background: linear-gradient(120deg, #00b09b, #96c93d); }
.marketing-badge.badge-trending { background: linear-gradient(120deg, #ff0080, #ff512f); }

body.dark .discount-badge,
body.dark-mode .discount-badge,
body.dark .new-badge,
body.dark-mode .new-badge {
    background: linear-gradient(120deg, #35a79c, #209cb3, #1e4a69);
    background-size: 200% 100%;
}

/* Product info - fills remaining space in card */
.product-info {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    flex-grow: 1;
    width: 100%;
    min-height: 140px;
}

/* Product category */
.product-category {
    font-size: 0.75rem;
    color: #7928ca;
    margin-bottom: 4px;
}

body.dark .product-category,
body.dark-mode .product-category {
    background: linear-gradient(270deg, #35a79c, #209cb3, #1e4a69, #35a79c);
    background-size: 800% 800%;
    animation: cosmic-gradient 8s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: inline-block;
    font-weight: bold;
}

/* Product title - COMPACT FOR ALL PAGES */
.product-title,
.product-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

body.dark .product-title,
body.dark .product-name,
body.dark-mode .product-title,
body.dark-mode .product-name {
    color: #e0e0e0 !important;
}

/* Ensure product info text is visible in dark mode on all pages */
body.dark .product-info,
body.dark-mode .product-info {
    color: #e0e0e0;
}

body.dark .product-info h3,
body.dark-mode .product-info h3,
body.dark .product-info .product-name,
body.dark-mode .product-info .product-name {
    color: #e0e0e0 !important;
}

/* Product price */
.product-price,
.current-price {
    font-weight: 600;
    font-size: 1.1rem;
    color: #7928ca;
    margin-bottom: 0;
}

body.dark .product-price,
body.dark .current-price,
body.dark-mode .product-price,
body.dark-mode .current-price {
    background: linear-gradient(270deg, #35a79c, #209cb3, #1e4a69, #35a79c);
    background-size: 800% 800%;
    animation: cosmic-gradient 8s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: inline-block;
    font-weight: bold;
}

.original-price {
    font-size: 0.9rem;
    color: #999;
    text-decoration: line-through;
    margin-right: 8px;
}

.price-row {
    display: flex;
    gap: 8px;
    align-items: baseline;
    margin-bottom: 8px;
}

/* Ensure discounted price (current) shows before original within price rows */
.price-row .current-price { order: 0; }
.price-row .original-price { order: 1; }

/* Product actions */
.product-actions,
.product-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

/* Add to cart button */
.add-to-cart,
.snipcart-add-item {
    flex: 1;
    padding: 10px 15px;
    background: linear-gradient(120deg, #7928ca, #ff0080);
    background-size: 200% 100%;
    animation: gradientShift 5s ease infinite;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

body.dark .add-to-cart,
body.dark .snipcart-add-item,
body.dark-mode .add-to-cart,
body.dark-mode .snipcart-add-item {
    background: linear-gradient(120deg, #35a79c, #209cb3, #1e4a69);
    background-size: 200% 100%;
}

.add-to-cart:hover,
.snipcart-add-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(121, 40, 202, 0.3);
}

body.dark .add-to-cart:hover,
body.dark .snipcart-add-item:hover,
body.dark-mode .add-to-cart:hover,
body.dark-mode .snipcart-add-item:hover {
    box-shadow: 0 5px 10px rgba(53, 167, 156, 0.3);
}

.add-to-cart:hover i,
.snipcart-add-item:hover i {
    transform: scale(1.1);
}

/* Wishlist button */
.wishlist-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    /* Must be above .product-card-link overlay (z-index: 5) */
    position: relative;
    z-index: 10;
}

body.dark .wishlist-btn,
body.dark-mode .wishlist-btn {
    background-color: #333;
}

.wishlist-btn i {
    font-size: 1rem;
    color: #aaa; /* Medium gray for better visibility */
    transition: all 0.3s ease;
}

body.dark .wishlist-btn i,
body.dark-mode .wishlist-btn i {
    color: #888; /* Lighter gray for dark mode - better visibility */
}

/* Active state - when item is in wishlist */
.wishlist-btn.active i {
    color: #7928ca; /* Purple color for active state */
    background: linear-gradient(120deg, #7928ca, #ff0080);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.dark .wishlist-btn.active i,
body.dark-mode .wishlist-btn.active i {
    color: #35a79c; /* Teal color for active state in dark mode */
    background: linear-gradient(120deg, #35a79c, #209cb3, #1e4a69);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Only change background color on hover, no transform */
.wishlist-btn:hover {
    background-color: #dedede;
}

body.dark .wishlist-btn:hover,
body.dark-mode .wishlist-btn:hover {
    background-color: #444;
}

/* Only scale the icon, not the button */
.wishlist-btn:hover i {
    transform: scale(1.1);
}

/* On active state (when clicked) */
.wishlist-btn:active {
    background-color: #d1d1d1; /* Slightly darker background when clicked */
    transform: none; /* Prevent any movement */
}

body.dark .wishlist-btn:active,
body.dark-mode .wishlist-btn:active {
    background-color: #3a3a3a; /* Slightly darker background in dark mode when clicked */
}

.wishlist-btn:active i {
    transform: scale(1.2);
    transition: transform 0.05s ease-in-out;
}

/* Compact Price-Actions Row for Clothing Pages */
.price-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 6px;
    position: relative;
    z-index: 10;
}

.price-actions-row .current-price {
    font-size: 1.05rem;
    font-weight: 600;
    color: #7928ca;
    flex-shrink: 0;
}

body.dark .price-actions-row .current-price {
    background: linear-gradient(270deg, #35a79c, #209cb3, #1e4a69, #35a79c);
    background-size: 800% 800%;
    animation: cosmic-gradient 8s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.price-actions-row .product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 6px;
}

.price-actions-row .product-rating i {
    color: #f5a623;
    font-size: 14px;
}

body.dark .price-actions-row .product-rating {
    color: #bbb;
}

/* Green animated star in dark mode */
body.dark .price-actions-row .product-rating i,
body.dark-mode .price-actions-row .product-rating i {
    background: linear-gradient(270deg, #35a79c, #209cb3, #1e4a69, #35a79c);
    background-size: 800% 800%;
    animation: cosmic-gradient 8s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.price-actions-row .wishlist-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    flex-shrink: 0;
}

.price-actions-row .wishlist-btn i {
    font-size: 0.9rem;
}

/* Legacy Product Meta - for other pages */
.product-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.product-rating i {
    color: #f5a623;
    font-size: 14px;
}

body.dark .product-rating {
    color: #e0e0e0;
}

/* Green animated star in dark mode for legacy product-rating */
body.dark .product-rating i,
body.dark-mode .product-rating i {
    background: linear-gradient(270deg, #35a79c, #209cb3, #1e4a69, #35a79c);
    background-size: 800% 800%;
    animation: cosmic-gradient 8s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}


/* Wave Animation */
@keyframes waveAnimation {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 100% 0%;
    }
}

/* Gradient Shift Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Cosmic Gradient Animation for dark mode elements */
@keyframes cosmic-gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Hide the view product button */
.view-product {
    display: none;
}

/* View Button Styling */
.view-btn {
    padding: 8px 10px;
    background-color: #f5f5f5;
    color: #333;
    border: none;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    margin: 0 5px;
}

.view-btn:hover {
    transform: translateY(-2px);
    background-color: #e0e0e0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

body.dark .view-btn,
body.dark-mode .view-btn {
    background-color: #333;
    color: #e0e0e0;
}

body.dark .view-btn:hover,
body.dark-mode .view-btn:hover {
    background-color: #444;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* Component Cards - Matched to product cards */
.component-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    margin: 10px 0;
}

body.dark .component-card {
    background-color: #232342;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.component-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1);
}

body.dark .component-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.component-card.selected {
    border: 2px solid #8e24aa;
    box-shadow: 0 0 0 3px rgba(142, 36, 170, 0.2);
}

.component-image-container {
    position: relative;
    height: 220px;
    width: 100%;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
}

.component-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    background-color: white;
    padding: 10px;
}

.component-card:hover .component-image {
    transform: scale(1.05);
}

body.dark .component-image {
    background-color: #444;
}

.component-info {
    display: flex;
    flex-direction: column;
    padding: 15px;
    flex-grow: 1;
}

.component-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 2.6em;
    order: 1;
}

body.dark .component-name {
    color: #e0e0e0;
}

.component-specs {
    font-size: 0.8rem;
    color: #7928ca;
    margin-bottom: 8px;
    order: 0;
}

body.dark .component-specs {
    background: linear-gradient(270deg, #35a79c, #209cb3, #1e4a69, #35a79c);
    background-size: 800% 800%;
    animation: cosmic-gradient 8s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: inline-block;
    font-weight: bold;
}

.component-price {
    font-weight: 600;
    font-size: 1.1rem;
    color: #7928ca;
    margin-bottom: 15px;
    order: 2;
}

body.dark .component-price {
    background: linear-gradient(270deg, #35a79c, #209cb3, #1e4a69, #35a79c);
    background-size: 800% 800%;
    animation: cosmic-gradient 8s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: inline-block;
    font-weight: bold;
}

.component-card .select-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #8e24aa;
    color: white;
    padding: 2px 8px;
    font-size: 0.7rem;
    border-radius: 0 0 0 8px;
    display: none;
}

.component-card.selected .select-badge {
    display: block;
}

/* Price and View button wrapper */
.price-view-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 5px;
    gap: 10px;
    order: 2;
}

.price-view-wrapper .view-btn {
    padding: 4px 10px;
    font-size: 0.8rem;
    margin: 0;
}

.price-view-wrapper .component-price {
    margin-bottom: 0;
    order: unset;
}
