/* ============================================
   Phase 4: Modern Minimalist Product Cards & Grid
   ============================================ */

/* Product Grid Container */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
    padding: var(--space-8) 0;
    transition: var(--transition-base);
}

/* Product Card */
.product-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

/* Product Image Container */
.product-card__image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: var(--color-gray-100);
}

.product-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--ease-smooth);
}

.product-card:hover .product-card__image {
    transform: scale(1.08);
}

/* Product Badges */
.product-card__badges {
    position: absolute;
    top: var(--space-3);
    left: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    z-index: 2;
}

.product-card__badge {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    backdrop-filter: blur(var(--blur-md));
    box-shadow: var(--shadow-sm);
}

.product-card__badge--new {
    background: rgba(0, 102, 255, 0.95);
    color: var(--color-white);
}

.product-card__badge--sale {
    background: rgba(239, 68, 68, 0.95);
    color: var(--color-white);
}

.product-card__badge--low-stock {
    background: rgba(245, 158, 11, 0.95);
    color: var(--color-white);
}

/* Quick Action Buttons */
.product-card__actions {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    opacity: 0;
    transform: translateX(8px);
    transition: all var(--duration-base) var(--ease-smooth);
    z-index: 2;
}

.product-card:hover .product-card__actions {
    opacity: 1;
    transform: translateX(0);
}

.product-card__action-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(var(--blur-md));
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-smooth);
    box-shadow: var(--shadow-md);
}

.product-card__action-btn:hover {
    background: var(--color-accent);
    color: var(--color-white);
    transform: scale(1.1);
}

.product-card__action-btn i {
    font-size: var(--text-base);
}

/* Quick View Overlay */
.product-card__quick-view {
    position: absolute;
    bottom: var(--space-4);
    left: var(--space-4);
    right: var(--space-4);
    opacity: 0;
    transform: translateY(8px);
    transition: all var(--duration-base) var(--ease-smooth);
    z-index: 2;
}

.product-card:hover .product-card__quick-view {
    opacity: 1;
    transform: translateY(0);
}

.product-card__quick-view-btn {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--color-accent);
    color: var(--color-white);
    border: none;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-smooth);
    backdrop-filter: blur(var(--blur-md));
}

.product-card__quick-view-btn:hover {
    background: var(--color-primary-dark);
    transform: scale(1.02);
    box-shadow: var(--shadow-accent);
}

/* Product Details */
.product-card__details {
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    flex: 1;
}

.product-card__category {
    font-size: var(--text-xs);
    color: var(--color-gray-600);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    font-weight: var(--font-medium);
}

.product-card__title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--color-primary-dark);
    line-height: var(--leading-tight);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    transition: color var(--duration-fast);
}

.product-card:hover .product-card__title {
    color: var(--color-accent);
}

.product-card__description {
    font-size: var(--text-sm);
    color: var(--color-gray-600);
    line-height: var(--leading-relaxed);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Rating */
.product-card__rating {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-1);
}

.product-card__stars {
    display: flex;
    gap: var(--space-1);
}

.product-card__star {
    color: #fbbf24;
    font-size: var(--text-sm);
}

.product-card__star--empty {
    color: var(--color-gray-300);
}

.product-card__rating-count {
    font-size: var(--text-xs);
    color: var(--color-gray-500);
}

/* Price Section */
.product-card__price-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-gray-200);
}

.product-card__price-container {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
}

.product-card__price {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--color-primary-dark);
}

.product-card__price--sale {
    color: var(--color-error);
}

.product-card__price-original {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
    text-decoration: line-through;
}

/* Add to Cart Button */
.product-card__add-to-cart {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--color-primary-dark);
    color: var(--color-white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-smooth);
}

.product-card__add-to-cart:hover {
    background: var(--color-accent);
    transform: scale(1.1);
    box-shadow: var(--shadow-accent);
}

.product-card__add-to-cart i {
    font-size: var(--text-base);
}

/* Color Swatches */
.product-card__colors {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.product-card__color-swatch {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    border: 2px solid var(--color-gray-300);
    cursor: pointer;
    transition: all var(--duration-fast);
    position: relative;
}

.product-card__color-swatch:hover,
.product-card__color-swatch--active {
    border-color: var(--color-primary-dark);
    transform: scale(1.15);
    box-shadow: var(--shadow-md);
}

.product-card__color-swatch--active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--color-white);
    font-size: 10px;
    font-weight: bold;
}

/* Size Options */
.product-card__sizes {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-2);
    flex-wrap: wrap;
}

.product-card__size {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-gray-300);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--duration-fast);
    background: var(--color-white);
}

.product-card__size:hover,
.product-card__size--active {
    border-color: var(--color-accent);
    background: var(--color-accent);
    color: var(--color-white);
}

.product-card__size--out-of-stock {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Loading State */
.product-card--loading {
    pointer-events: none;
}

.product-card--loading .product-card__image-container {
    background: linear-gradient(
        90deg,
        var(--color-gray-200) 25%,
        var(--color-gray-100) 50%,
        var(--color-gray-200) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

/* Grid Responsive Breakpoints */
@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-5);
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

    .product-card__details {
        padding: var(--space-3);
    }

    .product-card__title {
        font-size: var(--text-sm);
    }

    .product-card__price {
        font-size: var(--text-lg);
    }

    .product-card__action-btn {
        width: 36px;
        height: 36px;
    }

    /* Show actions on mobile by default */
    .product-card__actions {
        opacity: 1;
        transform: translateX(0);
    }

    .product-card__quick-view {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .product-card__image-container {
        aspect-ratio: 4/5;
    }
}

/* Special Product Grid Variations */
.products-grid--featured {
    grid-template-columns: repeat(3, 1fr);
}

.products-grid--featured .product-card:first-child {
    grid-column: span 2;
    grid-row: span 2;
}

@media (max-width: 992px) {
    .products-grid--featured {
        grid-template-columns: repeat(2, 1fr);
    }

    .products-grid--featured .product-card:first-child {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* List View Alternative */
.products-grid--list {
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

.products-grid--list .product-card {
    flex-direction: row;
}

.products-grid--list .product-card__image-container {
    width: 200px;
    flex-shrink: 0;
    aspect-ratio: 1/1;
}

.products-grid--list .product-card__details {
    flex: 1;
}

@media (max-width: 768px) {
    .products-grid--list .product-card {
        flex-direction: column;
    }

    .products-grid--list .product-card__image-container {
        width: 100%;
        aspect-ratio: 3/4;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .product-card,
    .product-card__image,
    .product-card__actions,
    .product-card__quick-view {
        transition: none;
    }
}

/* Focus States */
.product-card:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.product-card__action-btn:focus-visible,
.product-card__quick-view-btn:focus-visible,
.product-card__add-to-cart:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}
