/* Product card styles */
.product-card {
    position: absolute;
    left: 10px;
    bottom: 65px;
    width: 95%;
    z-index: 1000;
    transition: all 0.3s ease;
    animation: slideInUp 0.5s ease-out;
    display: none; /* Hidden by default */
}

.product-card-content {
    position: relative;
    background-color: rgba(128, 128, 128, 0.3); /* Reference bottom functional area background color */
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2); /* Reference bottom functional area border */
    height: 100%;
}

.product-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Adjust product information layout to place price and button on the same line */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.product-title {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: keep-all; /* Based on words */
    word-wrap: normal; /* No line break */
    width: 200px; /* Set width to 230px */
}

.product-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Display 2 lines */
    -webkit-box-orient: vertical;
    word-break: break-word; /* Allow word wrapping */
    max-height: calc(1.4em * 2); /* Height for 2 lines */
}

/* Price and button container */
.price-button-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.price-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.current-price {
    color: #ff6b6b;
    font-size: 16px;
    font-weight: 700;
}

.original-price {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    text-decoration: line-through;
}

.buy-button {
    background-color: #ff6b6b;
    color: #ffffff;
    border: none;
    border-radius: 15px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0; /* Prevent button from being compressed */
}

.buy-button:hover {
    background-color: #ff5252;
    transform: scale(1.05);
}

.buy-button:active {
    transform: scale(0.95);
}

.close-button {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 30px;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.close-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.close-button:active {
    transform: scale(0.9);
}

/* Responsive design */
@media (max-width: 480px) {
    
    .product-card-content {
        padding: 10px;
        gap: 10px;
    }
    
    .current-price {
        font-size: 14px;
    }
    
    .original-price {
        font-size: 11px;
    }
    
    .buy-button {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .price-button-container {
        gap: 6px;
    }
}

/* Animation effects */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Product information area adjustment when product card is displayed */
.comment-section.with-product-card {
    bottom: 180px;
}

/* Loading state */
.product-card.loading .product-image {
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card.loading .product-image::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.product-card.loading .product-title,
.product-card.loading .product-description,
.product-card.loading .product-price {
    background-color: rgba(255, 255, 255, 0.1);
    height: 12px;
    border-radius: 4px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Error state */
.product-card.error .product-card-content {
    border-color: rgba(255, 107, 107, 0.5);
}

.product-card.error .product-title {
    color: #ff6b6b;
}

/* Empty state */
.product-card.empty {
    display: none;
}

/* Product card hide animation */
.product-card.hiding {
    animation: slideOutDown 0.3s ease-out forwards;
}

@keyframes slideOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
} 