/**
 * Product Card Component Styles
 * Matching Next.js ProductCardAlt component - Modern E-commerce Design
 * 
 * @component ProductCard
 * @version 2.0.0
 */

/* Product Card Base Styles */
.modeo-product-card {
    display: flex;
    flex-direction: column;
    height: auto !important;
    /* Changed from 100% to auto to prevent clipping */
    cursor: pointer;
    overflow: visible !important;
    /* Changed from hidden to visible to prevent clipping */
    max-height: none !important;
    /* Remove any max-height restrictions */
}

/* For featured products section - ensure cards can grow to full height */
.modeo-featured-products-section .modeo-product-card {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Ensure rounded corners don't cause clipping */
.modeo-featured-products-section .modeo-product-card.rounded-2xl {
    border-radius: 1rem;
    overflow: visible !important;
}

/* Product Card Image Container */
.modeo-product-card .aspect-square {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    /* 1:1 aspect ratio */
    overflow: hidden;
    background-color: #f3f4f6;
    /* gray-100 */
    border-radius: 12px;
}

/* Image with loading state */
.modeo-product-card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease-in-out, filter 0.3s ease-in-out;
}

.modeo-product-card-image:not(.loaded) {
    opacity: 0.6;
    filter: blur(4px);
}

.modeo-product-card-image.loaded {
    opacity: 1;
    filter: blur(0);
}

/* Discount Badge */
.modeo-product-card .aspect-square>div[class*="absolute"] {
    z-index: 10;
}

/* Color Variants - Overlay on bottom of image */
.modeo-product-card-color-dot {
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    width: 1.5rem;
    /* 24px / w-6 */
    height: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modeo-product-card-color-dot:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Size Selector - Visual Circles */
.modeo-product-card-size-dot {
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    min-width: 2rem;
    min-height: 2rem;
}

.modeo-product-card-size-dot:hover {
    transform: scale(1.1);
}

.modeo-product-card-size-dot.selected {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: #000000 !important;
    transform: scale(1.15);
}

.modeo-product-card-size-dot.selected::after {
    content: '';
    position: absolute;
    inset: -2px;
    border: 2px solid #000000;
    border-radius: 50%;
    opacity: 0.3;
}

/* Hide scrollbar for size selector */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Line clamp for product names */
.modeo-product-card .line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Brand badge styles */
.modeo-product-card .bg-black {
    background-color: #000000;
}

/* Rating styles */
.modeo-product-card .text-yellow-400 {
    color: #fbbf24;
}

/* Smooth hover transitions */
.modeo-product-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modeo-product-card:hover {
    transform: translateY(-2px);
}

/* Button states for variable products */
.modeo-product-card[data-has-selected-size="false"] .modeo-button--black {
    background-color: #f9fafb !important;
    color: #4b5563 !important;
    border: 1px solid #e5e7eb !important;
}

.modeo-product-card[data-has-selected-size="false"] .modeo-button--black:hover {
    background-color: #f3f4f6 !important;
    border-color: #d1d5db !important;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .modeo-product-card {
        max-width: 100%;
    }

    .modeo-product-card-size-btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}


/* ============================================
   Related Products & Product Loop Fixes
   ============================================ */

/* Remove list bullets from any ul/li that might wrap product cards */
.products,
.products ul,
ul.products,
ul.woocommerce-product-gallery__wrapper,
.related-products ul,
.woocommerce ul.products {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0 !important;
}

.products li,
ul.products li,
.related-products li,
.woocommerce ul.products li {
    list-style: none !important;
    list-style-type: none !important;
}

.products li::marker,
ul.products li::marker {
    display: none !important;
    content: none !important;
}

/* Ensure all product cards have equal height in grids */
.products,
.grid[class*="grid-cols"] {
    display: grid;
}

.products .modeo-product-card,
.grid .modeo-product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Ensure content section expands to fill available space */
.modeo-product-card>.p-4,
.modeo-product-card>.sm\:p-5 {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Push button to bottom */
.modeo-product-card .pt-3.mt-auto {
    margin-top: auto;
}