/* Unified Product Card Styles - Simple and Clean */

/* All product cards use the same design */
.device-product-card,
.homepage-product-card,
.modern-product-card,
.product-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.device-product-card:hover,
.homepage-product-card:hover,
.modern-product-card:hover,
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.device-product-card .card-image-container,
.homepage-product-card .card-image-container,
.modern-product-card .card-image-container,
.product-card .card-image-container {
    height: 200px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.device-product-card .card-image-container img,
.homepage-product-card .card-image-container img,
.modern-product-card .card-image-container img,
.product-card .card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s ease;
    background: #f8fafc;
    padding: 0.5rem;
}

.device-product-card:hover .card-image-container img,
.homepage-product-card:hover .card-image-container img,
.modern-product-card:hover .card-image-container img,
.product-card:hover .card-image-container img {
    transform: scale(1.05);
}

.device-product-card .product-content,
.homepage-product-card .card-content,
.modern-product-card .card-content,
.product-card .product-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.device-product-card .product-actions,
.homepage-product-card .card-actions,
.modern-product-card .card-actions,
.product-card .product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    margin-top: auto;
}

.device-product-card .product-price,
.homepage-product-card .product-price,
.modern-product-card .product-price,
.product-card .product-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #059669;
    flex: 1;
}

.device-product-card .add-to-cart-btn,
.homepage-product-card .add-to-cart-btn,
.modern-product-card .add-to-cart-btn,
.product-card .add-to-cart-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.device-product-card .add-to-cart-btn:hover,
.homepage-product-card .add-to-cart-btn:hover,
.modern-product-card .add-to-cart-btn:hover,
.product-card .add-to-cart-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.device-product-card .add-to-cart-btn:active,
.homepage-product-card .add-to-cart-btn:active,
.modern-product-card .add-to-cart-btn:active,
.product-card .add-to-cart-btn:active {
    transform: translateY(0);
}

/* Grid Layout */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

/* Desktop-only fixed width for product cards */
@media (min-width: 769px) {
    /* Desktop grid behavior with fixed card width */
    .products-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, 350px);
        justify-content: center;
        gap: 24px;
    }
    
    /* Force fixed width for all product cards on desktop */
    .products-grid .device-product-card,
    .products-grid .homepage-product-card,
    .products-grid .modern-product-card,
    .products-grid .product-card {
        max-width: 350px;
        width: 350px;
    }
    
    /* Special case for single product - make it centered */
    .products-grid:has(.device-product-card:only-child),
    .products-grid:has(.homepage-product-card:only-child) {
        display: flex;
        justify-content: center;
        max-width: 100%;
        margin: 0 auto;
    }

    .products-grid:has(.device-product-card:only-child) .device-product-card,
    .products-grid:has(.homepage-product-card:only-child) .homepage-product-card {
        max-width: 350px;
        width: 350px;
        flex: 0 0 350px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
    
    .device-product-card .product-content,
    .homepage-product-card .card-content,
    .modern-product-card .card-content,
    .product-card .product-info {
        padding: 16px;
    }
    
    .device-product-card .add-to-cart-btn,
    .homepage-product-card .add-to-cart-btn,
    .modern-product-card .add-to-cart-btn,
    .product-card .add-to-cart-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}