/**
 * CodeOn Sales Showcase - Ultra Minimal CSS
 * Clean, colorless design focused on content
 */

/* Reset and Base */
.codeon-sales-showcase {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.codeon-sales-showcase *,
.codeon-sales-showcase *::before,
.codeon-sales-showcase *::after {
    box-sizing: border-box;
}

/* Typography */
.codeon-sales-showcase h1,
.codeon-sales-showcase h2,
.codeon-sales-showcase h3,
.codeon-sales-showcase h4,
.codeon-sales-showcase h5,
.codeon-sales-showcase h6 {
    margin: 0 0 1rem 0;
    font-weight: 600;
    line-height: 1.2;
    color: #1a1a1a;
}

.codeon-sales-showcase p {
    margin: 0 0 1rem 0;
}

.codeon-sales-showcase a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.codeon-sales-showcase a:hover {
    color: #000;
}

/* Header */
.codeon-sales-showcase .codeon-sales-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.codeon-sales-showcase .codeon-sales-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: #1a1a1a;
}

/* Filters */
.codeon-sales-showcase .codeon-sales-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: end;
}

.codeon-sales-showcase .codeon-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.codeon-sales-showcase .codeon-filter-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #666;
}

.codeon-sales-showcase .codeon-filter-select {
    padding: 0px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: white;
    font-size: 0.875rem;
    color: #333;
    min-width: 120px;
}

.codeon-sales-showcase .codeon-filter-select:focus {
    outline: none;
    border-color: #999;
}

/* Hierarchical category options */
.codeon-sales-showcase .codeon-filter-select option.category-child {
    padding-left: 1.5rem;
    font-size: 0.8125rem;
    color: #666;
}

.codeon-sales-showcase .codeon-filter-select option.category-child:before {
    content: "└─ ";
    color: #999;
}

/* Product Grid */
.codeon-sales-showcase .codeon-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

/* Product Grid - 4 columns */
.codeon-sales-showcase[data-columns="4"] .codeon-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}

/* Product Card */
.codeon-sales-showcase .codeon-product-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 0;
    transition: border-color 0.2s ease;
    display: flex;
    flex-direction: column;
}

.codeon-sales-showcase .codeon-product-card:hover {
    border-color: #999;
}

/* Product Image */
.codeon-sales-showcase .codeon-product-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-bottom: 1px solid #e0e0e0;
}

.codeon-sales-showcase .codeon-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Discount Badge - RED and prominent */
.codeon-sales-showcase .codeon-discount-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #dc3545;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Product Info */
.codeon-sales-showcase .codeon-product-info {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.codeon-sales-showcase .codeon-product-title {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.3;
    color: #1a1a1a;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.codeon-sales-showcase .codeon-product-title a {
    color: inherit;
}

.codeon-sales-showcase .codeon-product-excerpt {
    font-size: 0.75rem;
    color: #666;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* Product Meta */
.codeon-sales-showcase .codeon-product-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.5rem 0;
}

.codeon-sales-showcase .codeon-product-category {
    font-size: 0.75rem;
    color: #666;
    background: #f5f5f5;
    padding: 0.125rem 0.375rem;
    border-radius: 2px;
    text-decoration: none;
}

.codeon-sales-showcase .codeon-product-category:hover {
    background: #e8e8e8;
}

/* Rating */
.codeon-sales-showcase .codeon-product-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0.5rem 0;
}

.codeon-sales-showcase .codeon-stars {
    display: flex;
    gap: 1px;
    font-size: 0.75rem;
}

.codeon-sales-showcase .codeon-stars .star {
    color: #ddd;
}

.codeon-sales-showcase .codeon-stars .star.filled {
    color: #1a1a1a;
}

.codeon-sales-showcase .codeon-rating-count {
    font-size: 0.75rem;
    color: #999;
}

/* Price */
.codeon-sales-showcase .codeon-product-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    flex-wrap: wrap;
}

.codeon-sales-showcase .codeon-current-price {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
}

.codeon-sales-showcase .codeon-original-price {
    font-size: 0.875rem;
    color: #999;
    text-decoration: line-through;
}

.codeon-sales-showcase .codeon-you-save {
    font-size: 0.75rem;
    color: #666;
    background: #f0f0f0;
    padding: 0.125rem 0.25rem;
    border-radius: 2px;
    margin-left: auto;
}

/* Stock Status - HIDDEN */
.codeon-sales-showcase .codeon-stock-status {
    display: none;
}

/* Product Actions - HIDDEN */
.codeon-sales-showcase .codeon-product-actions {
    display: none;
}

/* Main Action Button */
.codeon-sales-showcase .codeon-product-action {
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid #f0f0f0;
}

.codeon-sales-showcase .codeon-product-select-btn {
    width: 100%;
    padding: 0.75rem;
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: center;
    display: block;
    text-decoration: none;
}

.codeon-sales-showcase .codeon-product-select-btn:hover {
    background: #000;
    color: white;
}

/* Load More Button */
.codeon-sales-showcase .codeon-load-more {
    text-align: center;
    margin: 2rem 0;
}

.codeon-sales-showcase .codeon-load-more-btn {
    padding: 0.75rem 1.5rem;
    background: white;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.codeon-sales-showcase .codeon-load-more-btn:hover {
    background: #f8f8f8;
    border-color: #999;
}

.codeon-sales-showcase .codeon-load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Pagination */
.codeon-sales-showcase .codeon-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.codeon-sales-showcase .codeon-pagination a,
.codeon-sales-showcase .codeon-pagination span {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    font-size: 0.875rem;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.codeon-sales-showcase .codeon-pagination a:hover {
    background: #f8f8f8;
    border-color: #ccc;
}

.codeon-sales-showcase .codeon-pagination .current {
    background: #1a1a1a;
    color: white;
    border-color: #1a1a1a;
}

/* No Products */
.codeon-sales-showcase .codeon-no-products {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #f8f8f8;
}

.codeon-sales-showcase .codeon-no-products h3 {
    margin: 0 0 0.5rem 0;
    color: #666;
}

.codeon-sales-showcase .codeon-no-products p {
    margin: 0;
    font-size: 0.875rem;
    color: #999;
}

/* Loading State */
.codeon-sales-showcase .codeon-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 0.875rem;
}

.codeon-sales-showcase .codeon-loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #999;
    border-radius: 50%;
    animation: codeon-spin 1s linear infinite;
}

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

/* Quick View Modal */
.codeon-sales-showcase .codeon-quickview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.codeon-sales-showcase .codeon-quickview-modal.active {
    display: flex;
}

.codeon-sales-showcase .codeon-quickview-content {
    background: white;
    border-radius: 4px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid #e0e0e0;
}

.codeon-sales-showcase .codeon-quickview-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    z-index: 1001;
}

.codeon-sales-showcase .codeon-quickview-close:hover {
    background: #e8e8e8;
}

/* Notifications */
.codeon-sales-showcase .codeon-notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: white;
    color: #333;
    padding: 0.75rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.875rem;
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.codeon-sales-showcase .codeon-notification.show {
    transform: translateX(0);
}

.codeon-sales-showcase .codeon-notification.error {
    background: #fff5f5;
    border-color: #fecaca;
    color: #991b1b;
}

.codeon-sales-showcase .codeon-notification.success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

/* Responsive Design */
@media (max-width: 768px) {
    .codeon-sales-showcase {
        padding: 1rem;
    }
    
    .codeon-sales-showcase .codeon-sales-filters {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .codeon-sales-showcase .codeon-filter-group {
        width: 100%;
    }
    
    .codeon-sales-showcase .codeon-filter-select {
        width: 100%;
        min-width: unset;
    }
    
    .codeon-sales-showcase .codeon-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .codeon-sales-showcase .codeon-product-info {
        padding: 0.75rem;
    }
    
    .codeon-sales-showcase .codeon-notification {
        right: 0.5rem;
        left: 0.5rem;
        transform: translateY(-100%);
    }
    
    .codeon-sales-showcase .codeon-notification.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .codeon-sales-showcase .codeon-products-grid {
        grid-template-columns: 1fr;
    }
    
    .codeon-sales-showcase .codeon-product-image {
        aspect-ratio: 4/3;
    }
    
    .codeon-sales-showcase .codeon-pagination {
        flex-wrap: wrap;
    }
}

/* Print Styles */
@media print {
    .codeon-sales-showcase .codeon-load-more,
    .codeon-sales-showcase .codeon-sales-filters,
    .codeon-sales-showcase .codeon-notification {
        display: none;
    }
    
    .codeon-sales-showcase .codeon-product-card {
        break-inside: avoid;
        border: 1px solid #ccc;
    }
}

