/* EcoChance Amazon Search Styles */

.ecochance-search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.ecochance-search-header {
    text-align: center;
    margin-bottom: 30px;
}

.ecochance-search-header h2 {
    font-size: 2em;
    color: #2c5f2d;
    margin-bottom: 10px;
}

.ecochance-search-header p {
    color: #666;
    font-size: 1.1em;
}

/* Category Buttons */
.ecochance-search-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.ecochance-category-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
}

.ecochance-category-btn:hover {
    border-color: #4caf50;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.ecochance-category-btn.active {
    background: #4caf50;
    border-color: #4caf50;
    color: white;
}

.category-icon {
    font-size: 1.5em;
}

.category-name {
    font-weight: 600;
}

/* Loading */
.ecochance-search-loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4caf50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results */
.ecochance-results-header {
    text-align: center;
    margin-bottom: 25px;
}

.ecochance-results-header h3 {
    font-size: 1.8em;
    color: #2c5f2d;
    margin-bottom: 5px;
}

.ecochance-results-header p {
    color: #666;
}

.ecochance-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.ecochance-product-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ecochance-product-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.product-image {
    position: relative;
    height: 200px;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.no-image {
    color: #999;
    font-size: 0.9em;
}

.eco-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #4caf50;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.product-info {
    padding: 15px;
}

.product-title {
    font-size: 1em;
    margin: 0 0 10px 0;
    color: #333;
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 1.3em;
    font-weight: bold;
    color: #2c5f2d;
    margin-bottom: 8px;
}

.product-rating {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 12px;
}

.product-link {
    display: inline-block;
    background: #4caf50;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
}

.product-link:hover {
    background: #45a049;
}

/* Error and No Results */
.ecochance-no-results,
.ecochance-error {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 12px;
    margin-top: 20px;
}

.ecochance-error {
    background: #ffebee;
    color: #c62828;
}

/* Responsive */
@media (max-width: 768px) {
    .ecochance-search-categories {
        grid-template-columns: 1fr;
    }
    
    .ecochance-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}