/* Product Deals Grid - Mobile First (2 columns) */
.product-deals-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
    gap: 15px;
    margin: 20px 0;
    align-items: stretch;
}

.product-deal-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-deal-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Product Name Styles */
.product-name {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eaeaea;
}

.product-name h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 34px;
}

/* Product Image - Mobile size */
.product-image {
    margin-bottom: 10px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 6px;
    flex-shrink: 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.placeholder-image {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 11px;
    border-radius: 6px;
    border: 2px dashed #ddd;
}

.product-price {
    font-size: 16px;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 10px;
}

.product-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 11px;
    color: #666;
    padding: 0 5px;
    flex-shrink: 0;
}

.company {
    font-weight: bold;
    color: #2c3e50;
    font-size: 10px;
}

.date {
    color: #7f8c8d;
    font-size: 10px;
}

.see-deal-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: auto;
    flex-shrink: 0;
}

.see-deal-btn:hover {
    background: linear-gradient(135deg, #2980b9, #3498db);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Tablet - 3 columns */
@media (min-width: 768px) {
    .product-deals-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .product-deal-item {
        padding: 15px;
    }
    
    .product-name h3 {
        font-size: 14px;
        min-height: 38px;
    }
    
    .product-image {
        height: 120px;
    }
    
    .product-price {
        font-size: 17px;
    }
    
    .product-details {
        font-size: 12px;
    }
    
    .company,
    .date {
        font-size: 11px;
    }
    
    .see-deal-btn {
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* Desktop - 4 columns */
@media (min-width: 992px) {
    .product-deals-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }
    
    .product-deal-item {
        padding: 18px;
    }
    
    .product-name h3 {
        font-size: 15px;
        min-height: 42px;
    }
    
    .product-image {
        height: 140px;
    }
    
    .product-price {
        font-size: 18px;
    }
    
    .product-details {
        font-size: 13px;
    }
    
    .company,
    .date {
        font-size: 12px;
    }
    
    .see-deal-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* Large Desktop - 5 columns */
@media (min-width: 1200px) {
    .product-deals-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 25px;
    }
    
    .product-deal-item {
        padding: 20px;
    }
    
    .product-name h3 {
        font-size: 16px;
        min-height: 44px;
    }
    
    .product-image {
        height: 150px;
    }
    
    .product-price {
        font-size: 20px;
    }
    
    .product-details {
        font-size: 14px;
    }
    
    .company,
    .date {
        font-size: 13px;
    }
    
    .see-deal-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 15px;
    top: 10px;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* Popup Product Details */
.popup-product-details {
    display: flex;
    gap: 30px;
    margin-top: 15px;
}

.popup-left-column {
    flex: 1;
}

.popup-right-column {
    flex: 2;
}

.popup-price {
    font-size: 24px;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 15px;
}

.popup-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.popup-right-column h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 20px;
}

.product-description {
    color: #555;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.deal-info {
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.info-row .label {
    font-weight: bold;
    width: 100px;
    flex-shrink: 0;
}

.info-row .value {
    flex-grow: 1;
}

.alternative-store, .credit-card-offer {
    background-color: #f9f9f9;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 13px;
}

.get-deal-btn {
    display: inline-block;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
}

.get-deal-btn:hover {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    transform: translateY(-2px);
    color: white;
}

/* Mobile Modal */
@media (max-width: 768px) {
    .popup-product-details {
        flex-direction: column;
        gap: 20px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 15px;
    }
}