/**
 * Unified Product Card Styles
 * File: assets/css/unified-product-card.css
 *
 * Supports both regular and sale product cards with consistent styling
 */

/* Base Card Styles */
.dede-unified-product-card {
    background-color: #ffffff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.dede-unified-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* Sale Badge */
.dede-unified-product-card .sale-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #e74c3c;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

/* Product Image */
.dede-unified-product-card .product-image {
    height: 220px;
    position: relative;
    overflow: hidden;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dede-unified-product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.dede-unified-product-card .product-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    background-color: #ffffff;
    color: #999999;
    font-size: 14px;
}

/* Product Info Container */
.dede-unified-product-card .product-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Product Title */
.dede-unified-product-card .product-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    min-height: 44px;
}

.dede-unified-product-card .product-title a {
    color: #333333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.dede-unified-product-card .product-title a:hover {
    color: #24b18f;
}

/* Product Amount (e.g., 250 мл, 1 кг) */
.dede-unified-product-card .product-amount {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #666666;
    font-weight: 500;
}

/* Price Section */
.dede-unified-product-card .product-price-section {
    margin-bottom: 12px;
}

/* Regular Price Info */
.dede-unified-product-card .regular-price-info .price,
.dede-unified-product-card .regular-price-info .price-range {
    font-size: 20px;
    font-weight: 700;
    color: #000000;
    display: block;
}

/* Від/До text styling (dark grey, non-bold, smaller) */
.dede-unified-product-card .price-prefix,
.dede-unified-product-card .price-separator {
    font-weight: 400;
    color: #666666;
    font-size: 14px;
}

/* Sale Price Info */
.dede-unified-product-card .sale-price-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
    justify-content: flex-start;
}

.dede-unified-product-card .old-price {
    font-size: 16px;
    color: #999999;
    text-decoration: line-through;
}

.dede-unified-product-card .sale-price {
    font-size: 20px;
    font-weight: 700;
    color: #e74c3c;
}

.dede-unified-product-card .savings {
    font-size: 13px;
    color: #27ae60;
    font-weight: 600;
    width: 100%;
    text-align: left;
}

/* Shop Info Section */
.dede-unified-product-card .shop-info-section {
    margin-bottom: 8px;
}

/* Sale Card Shop Info (with logo) */
.dede-unified-product-card.is-sale .shop-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    background-color: transparent;
    border-radius: 0;
}

.dede-unified-product-card .shop-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.dede-unified-product-card .shop-name {
    font-size: 13px;
    color: #666666;
    font-weight: 500;
}

/* Regular Card Shop Count */
.dede-unified-product-card.is-regular .shop-count {
    font-size: 13px;
    color: #666666;
}

/* Sale End Date */
.dede-unified-product-card .sale-end-date {
    font-size: 12px;
    color: #e74c3c;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Action Button (sticks to bottom) */
.dede-unified-product-card .product-actions {
    margin-top: auto;
    padding-top: 12px;
}

.dede-unified-product-card .details-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #24b18f;
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.dede-unified-product-card .details-btn:hover {
    background-color: #1a9b75;
    transform: translateY(-2px);
}

/* Grid Container - 4 cards per row */
.dede-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dede-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

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

@media (max-width: 600px) {
    .dede-products-grid {
        grid-template-columns: 1fr;
    }

    .dede-unified-product-card .product-image {
        height: 200px;
    }

    .dede-unified-product-card .product-title {
        font-size: 15px;
        min-height: auto;
    }
}

/* Ensure consistent font colors */
.dede-unified-product-card * {
    box-sizing: border-box;
}

/* Consistent spacing */
.dede-unified-product-card p {
    margin: 0;
}
