/* product-history.css */
.product-history-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.product-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.product-history-header h1 {
    margin: 0;
    font-size: 24px;
}

.product-history-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Custom styles for Clear History button */
#clear-history {
    color: #ffffff;
    border: none;
    transition: background-color 0.3s ease;
}

#clear-history:hover {
    background-color: #3F3F3F;
}

/* Override any theme default styles */
#clear-history.button,
#clear-history.wp-element-button {
    color: #ffffff;
}

#clear-history.button:hover,
#clear-history.wp-element-button:hover {
    background-color: #3F3F3F;
}

.history-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    position: relative;
    background: #0F0F0F;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.history-item:hover {
    background: #1a1a1a;
}

/* Make the entire item clickable except for the close button */
.history-item-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.product-image {
    flex: 0 0 80px;  /* Reduced from 100px to make images smaller */
    z-index: 2;      /* Ensure it's above the link layer */
}

.product-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    max-width: 80px;  /* Ensure images don't exceed container width */
}

.product-info {
    flex: 1;
    padding-right: 40px; /* Make space for the close button */
}

.product-info h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.product-info .price {
    color: #77a464;
    font-weight: bold;
    margin: 5px 0;
}

.product-info .viewed-date {
    color: #666;
    font-size: 14px;
    margin: 5px 0;
}

.remove-item {
    position: absolute;
    top: 25%;
    right: 15px;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 36px;  /* Increased from 20px */
    cursor: pointer;
    padding: 8px 12px;  /* Increased padding for larger hit area */
    color: #666;
    z-index: 2;  /* Ensure it's above the link layer */
    transition: color 0.2s ease;
}

.remove-item:hover {
    color: #dc3545;
    background: transparent;
}

.no-history {
    text-align: center;
    padding: 30px;
    background: #0F0F0F;
    border-radius: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-history-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .history-item {
        flex-direction: row;  /* Keep horizontal layout on tablets */
        align-items: center;
    }
    
    .product-image {
        flex: 0 0 60px;  /* Even smaller on tablets */
    }
    
    .product-image img {
        max-width: 60px;
    }
}

@media (max-width: 480px) {
    .product-history-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .product-history-controls button,
    .product-history-controls select {
        width: 100%;
    }
    
    .product-image {
        flex: 0 0 50px;  /* Smallest size for mobile */
    }
    
    .product-image img {
        max-width: 50px;
    }
    
    .product-info {
        padding-right: 30px;
    }
}