.grok-woo-loop {
    display: grid;
    gap: 25px;
}

.grok-woo-loop.columns-2 { grid-template-columns: repeat(2, 1fr); }
.grok-woo-loop.columns-3 { grid-template-columns: repeat(3, 1fr); }
.grok-woo-loop.columns-4 { grid-template-columns: repeat(4, 1fr); }
.grok-woo-loop.columns-5 { grid-template-columns: repeat(5, 1fr); }
.grok-woo-loop.columns-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 1024px) {
    .grok-woo-loop.columns-5,
    .grok-woo-loop.columns-6 { 
        grid-template-columns: repeat(3, 1fr); 
    }
}

@media (max-width: 768px) {
    .grok-woo-loop { 
        grid-template-columns: repeat(2, 1fr) !important; 
    }
}

/* Main Card */
.grok-product-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.3s ease;
}

.grok-product-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Clickable Image */
.product-image-link {
    display: block;
    text-decoration: none;
}

/* Image Container */
.product-image-wrapper {
    position: relative;
    overflow: hidden;
    padding-top: 100%;
    background: #f8f8f8;
}

.product-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100% !important;
    object-fit: contain;
    background: #f8f8f8;
    transition: opacity 0.4s ease;
}

.product-hover-image {
    opacity: 0;
    z-index: 2;
}

.product-image-wrapper:hover .product-image { 
    opacity: 0; 
}

.product-image-wrapper:hover .product-hover-image { 
    opacity: 1; 
}

/* Clickable Title */
.product-title-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-title-link:hover .product-title {
    color: #e74c3c;
}

/* Content */
.product-info {
    flex-grow: 1;
    padding: 15px 15px 8px;
    display: flex;
    flex-direction: column;
}

.product-title {
    margin: 0 0 8px 0;
    min-height: 2.8em;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-category {
    margin-bottom: 8px;
    color: #666;
    font-size: 0.95em;
}

/* Price + Wishlist Row */
.product-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px 12px;
    border-top: 1px solid #f0f0f0;
}

.product-price {
    font-weight: bold;
    font-size: 1.1em;
}

.product-wishlist {
    display: flex;
    align-items: center;
    padding: 4px;
}

/* Buttons */
.product-actions {
    padding: 0 15px 15px;
}

/* Add to Cart + Remind Me Buttons */
.product-button-single a,
.remind-me-btn {
    display: block;
    width: 100%;
    padding: 10px 20px;
    text-align: center;
    border-radius: 6px;
    box-sizing: border-box;
    text-decoration: none;
    background: transparent;
    color: #e74c3c;
    border: 2px solid #e74c3c;
    cursor: pointer;
    transition: all 0.3s ease;
}
/* Hover State */
.product-button-single a:hover,
.remind-me-btn:hover {
    background: #e74c3c;
    color: #ffffff;
    border-color: #e74c3c;
}

/* YITH Wishlist - Heart Icon Only */
.product-wishlist .yith-wcwl-add-to-wishlist-button__label {
    display: none !important;
}

.product-wishlist .yith-wcwl-add-to-wishlist-button {
    background: none !important;
    border: none !important;
    padding: 0 !important;
}

.product-wishlist svg {
    width: 24px;
    height: 24px;
    transition: all 0.2s ease;
}

.product-wishlist svg:hover {
    transform: scale(1.2);
    color: #e74c3c !important;
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .product-price-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Hover Effect - Only apply when gallery image exists */
.product-image-wrapper.has-hover:hover .product-image {
    opacity: 0;
}

.product-image-wrapper.has-hover:hover .product-hover-image {
    opacity: 1;
}

/* Products without hover image - no effect */
.product-image-wrapper:not(.has-hover) .product-hover-image {
    display: none;
}

/* Out of Stock */
.grok-product-card.out-of-stock .product-image {
    filter: brightness(0.75) grayscale(0.9);
}

.grok-product-card.out-of-stock .product-price {
    color: #999 !important;
    opacity: 0.85;
}

/* Ribbon - High z-index so it doesn't break hover */
.out-of-stock-ribbon {
    position: absolute;
    top: 23px;
    left: -43px;
    background: #e74c3c;
    color: white;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 38px;
    text-transform: uppercase;
    transform: rotate(-45deg);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    z-index: 20;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

/* Make sure hover image stays on top */
.product-image-wrapper.has-hover .product-hover-image {
    z-index: 10;
}

.product-image-wrapper {
    position: relative;
    overflow: hidden;
}