/**
 * Product Grid Styling
 */

.mm-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns for desktop */
    gap: 15px;
    margin: 20px 0;
}

.mm-product-card {
    display: flex;
    flex-direction: column;
    border: none;
    border-radius: 5px;
    overflow: hidden;
    height: 100%;
    background-color: #fff;
}

.mm-product-card:hover {
    /* Hover effect removed as requested */
}

.mm-product-image {
    position: relative !important;
    overflow: hidden;
    padding-top: 120%; /* Changed from 100% to 120% for taller images */
}

.mm-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    border-radius: 6px; /* Added border radius to images */
}

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

.mm-product-details {
    padding: 10px 0px; /* Changed from 15px all around to 10px top/bottom, 0px left/right */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.mm-product-title {
    font-size: 15px;
    margin: 0 0 2px;
    font-weight: 600;
    line-height: 1.4;
}

.mm-product-title a {
    color: #333;
    text-decoration: none;
}

.mm-product-title a:hover {
    color: #0066cc;
}

.mm-product-price {
    font-weight: 100;
    font-size: 15px;
    color: #4153dd;
}

.mm-product-availability {
    margin-bottom: 10px;
    font-size: 14px;
}

.mm-product-availability .in-stock {
    color: #0f834d;
    font-weight: 600;
}

.mm-product-availability .out-of-stock {
    color: #e2401c;
    font-weight: 600;
}

/* Variants section styling */
.mm-variants-section {
    margin: 10px 0;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.mm-variants-section h4 {
    font-size: 14px;
    margin: 0 0 8px;
    font-weight: 600;
}

.mm-variants-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
    font-size: 12px;
}

.mm-variants-list li {
    padding: 4px 0;
    border-bottom: 1px dotted #f0f0f0;
}

.mm-variants-list li:last-child {
    border-bottom: none;
}

.mm-variants-list .in-stock .stock-status {
    color: #0f834d;
}

.mm-variants-list .backorder .stock-status {
    color: #f68b1e;
}

.mm-variants-list .out-of-stock .stock-status {
    color: #e2401c;
}

/* Size options styling */
.mm-product-sizes {
    margin: 10px 0;
}

.mm-size-label {
    display: block;
    font-size: 13px;
    margin-bottom: 5px;
    color: #666;
    font-weight: 600;
}

.mm-size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.mm-size-option {
    display: inline-block;
    padding: 3px 8px;
    border: 1px solid #f5f5f5;
    border-radius: 3px;
    font-size: 10px;
    background: #fbfbfb;
}

/* Size visibility classes */
.mm-size-option.hidden-desktop {
    display: none;
}

.mm-size-option.hidden-mobile {
    display: inline-block;
}

.mm-more-sizes {
    display: inline-block;
    padding: 3px 8px;
    border: 1px solid #f5f5f5;
    border-radius: 3px;
    font-size: 10px;
    background: #fbfbfb;
    cursor: pointer;
    color: #0066cc;
    font-weight: 600;
}

.mm-product-action {
    margin-top: auto;
    padding-top: 15px;
}

.mm-view-product {
    display: inline-block;
    padding: 8px 16px;
    background-color: #0066cc;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    text-align: center;
    transition: background-color 0.3s;
}

.mm-view-product:hover {
    background-color: #0055aa;
}

.mm-view-product.out-of-stock {
    background-color: #777;
    cursor: pointer;
}

.mm-view-product.out-of-stock:hover {
    background-color: #666;
}

.mm-no-products-found {
    padding: 30px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 5px;
    margin: 20px 0;
}

/* Out of Stock badge */
.mm-out-of-stock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(226, 64, 28, 0.9);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 3px;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Product Labels Container */
.mm-product-labels {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    z-index: 999 !important;
    pointer-events: none !important; /* Allow clicks to pass through to the product link */
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
}

/* Discount Label */
.mm-discount-label {
    background: linear-gradient(135deg, #1D2027 0%, #2a2d36 100%) !important;
    color: white !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 7px 12px !important;
    border-radius: 6px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    line-height: 1.2 !important;
    display: inline-block !important;
    box-shadow: 0 3px 8px rgba(29, 32, 39, 0.4), 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    position: relative !important;
    z-index: 999 !important;
    opacity: 1 !important;
    visibility: visible !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    transition: all 0.2s ease !important;
}

/* Discount Label Hover Effect */
.mm-product-card-wrapper:hover .mm-discount-label {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(29, 32, 39, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* New Product Label */
.mm-new-label {
    background: linear-gradient(135deg, #F94469 0%, #ff5a7a 100%) !important;
    color: white !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    padding: 5px 8px !important;
    border-radius: 6px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    line-height: 1.2 !important;
    display: inline-block !important;
    box-shadow: 0 3px 8px rgba(249, 68, 105, 0.4), 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    position: relative !important;
    z-index: 999 !important;
    opacity: 1 !important;
    visibility: visible !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    transition: all 0.2s ease !important;
}

/* New Product Label Hover Effect */
.mm-product-card-wrapper:hover .mm-new-label {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(249, 68, 105, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* Clickable card styling */
.mm-product-card-wrapper {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
    transition: all 0.3s ease;
    opacity: 0;
    will-change: opacity, transform;
    animation: fadeSlideUp 0.6s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    animation-play-state: paused; /* Animation starts paused and is played via JS */
}

.mm-product-card-wrapper:hover {
    text-decoration: none;
    color: inherit;
}

.mm-product-card-wrapper:hover .mm-product-card {
    /* Hover effect removed as requested */
}

.mm-product-card-wrapper .mm-product-card {
    height: 100%;
}

/* Product animations */
@keyframes fadeSlideUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideDown {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(30px);
        visibility: hidden;
    }
}

/* Class for products that are animating out when a filter is clicked */
.mm-product-card-wrapper.animating-out {
    opacity: 1;
    animation: fadeSlideDown 0.4s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    animation-play-state: running;
}

/* Add a staggered delay for browsers without IntersectionObserver */
.mm-product-grid .mm-product-card-wrapper:nth-child(1) { animation-delay: 0.1s; }
.mm-product-grid .mm-product-card-wrapper:nth-child(2) { animation-delay: 0.15s; }
.mm-product-grid .mm-product-card-wrapper:nth-child(3) { animation-delay: 0.2s; }
.mm-product-grid .mm-product-card-wrapper:nth-child(4) { animation-delay: 0.25s; }
.mm-product-grid .mm-product-card-wrapper:nth-child(5) { animation-delay: 0.3s; }
.mm-product-grid .mm-product-card-wrapper:nth-child(6) { animation-delay: 0.35s; }
.mm-product-grid .mm-product-card-wrapper:nth-child(7) { animation-delay: 0.4s; }
.mm-product-grid .mm-product-card-wrapper:nth-child(8) { animation-delay: 0.45s; }
.mm-product-grid .mm-product-card-wrapper:nth-child(n+9) { animation-delay: 0.5s; }

/* Staggered delay for outro animation (faster and in reverse order) */
.mm-product-grid .mm-product-card-wrapper.animating-out:nth-child(n+9) { animation-delay: 0.05s; }
.mm-product-grid .mm-product-card-wrapper.animating-out:nth-child(8) { animation-delay: 0.1s; }
.mm-product-grid .mm-product-card-wrapper.animating-out:nth-child(7) { animation-delay: 0.15s; }
.mm-product-grid .mm-product-card-wrapper.animating-out:nth-child(6) { animation-delay: 0.2s; }
.mm-product-grid .mm-product-card-wrapper.animating-out:nth-child(5) { animation-delay: 0.25s; }
.mm-product-grid .mm-product-card-wrapper.animating-out:nth-child(4) { animation-delay: 0.3s; }
.mm-product-grid .mm-product-card-wrapper.animating-out:nth-child(3) { animation-delay: 0.35s; }
.mm-product-grid .mm-product-card-wrapper.animating-out:nth-child(2) { animation-delay: 0.4s; }
.mm-product-grid .mm-product-card-wrapper.animating-out:nth-child(1) { animation-delay: 0.45s; }

/* Disable animations for users with reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .mm-product-card-wrapper, 
    .mm-product-card-wrapper.animating-out {
        animation: none;
        opacity: 1;
    }
}

.mm-view-status {
    display: inline-block;
    padding: 8px 16px;
    background-color: #0066cc;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    text-align: center;
    transition: background-color 0.3s;
}

.mm-view-status.out-of-stock {
    background-color: #777;
}

.mm-view-status:hover {
    background-color: #0055aa;
}

.mm-view-status.out-of-stock:hover {
    background-color: #666;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .mm-product-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columns for tablet */
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .mm-product-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for mobile */
        gap: 10px;
    }
    
    .mm-product-details {
        padding: 10px;
    }
    
    .mm-product-title {
        font-size: 14px;
    }
    
    .mm-variants-list {
        max-height: 150px;
    }
    
    .mm-size-option.hidden-mobile {
        display: none;
    }
    
    .mm-size-option.hidden-desktop {
        display: inline-block;
    }
}

@media (max-width: 480px) {
    .mm-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 7px;
    }
} 