/**
 * DynamicSurplus Pro - Default Styles
 * Version: 2.0.0
 * 
 * These are the default styles for DynamicSurplus Pro.
 * You can customize these or replace with your own CSS.
 */

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

/* Product Grid Layout */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
    padding: 0;
}

/* Product Card */
.product-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #007cba;
}

/* Product Image */
.product-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

/* Product Content */
.product-content {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Product Title */
.product-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

/* Product Description */
.product-description {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    margin: 0 0 10px 0;
    flex: 1;
}

/* Product Price */
.product-price {
    font-size: 16px;
    font-weight: bold;
    color: #007cba;
    margin: 10px 0;
}

.product-price a {
    color: #007cba;
    text-decoration: none;
}

.product-price a:hover {
    text-decoration: underline;
}

/* Product Condition */
.product-condition {
    font-size: 12px;
    color: #888;
    margin: 5px 0;
    font-weight: 500;
}

/* Product Button */
.product-button {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    margin-top: 10px;
}

.product-button:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.product-button:active {
    transform: translateY(0);
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    gap: 5px;
}

.page-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.page-btn:hover {
    background: #f5f5f5;
    border-color: #007cba;
    color: #007cba;
}

.page-btn.active {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 40px 20px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    margin: 20px 0;
}

.error-message h3 {
    color: #856404;
    margin: 0 0 10px 0;
}

.error-message p {
    color: #856404;
    margin: 0 0 15px 0;
}

.error-message button {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.error-message button:hover {
    background: #005a87;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 15px 0;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-title {
        font-size: 16px;
    }
    
    .product-description {
        font-size: 13px;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 3px;
    }
    
    .page-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .product-grid {
        gap: 10px;
    }
    
    .product-content {
        padding: 12px;
    }
    
    .product-image {
        height: 160px;
    }
}

/* High-DPI/Retina Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .product-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print Styles */
@media print {
    .product-grid {
        display: block;
    }
    
    .product-card {
        break-inside: avoid;
        margin-bottom: 20px;
    }
    
    .product-button {
        display: none;
    }
    
    .pagination {
        display: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .product-card {
        background: #2d2d2d;
        border-color: #404040;
        color: #e0e0e0;
    }
    
    .product-title {
        color: #fff;
    }
    
    .product-description {
        color: #ccc;
    }
    
    .product-image {
        background: #1a1a1a;
    }
    
    .error-message {
        background: #3d3d3d;
        border-color: #555;
        color: #e0e0e0;
    }
    
    .error-message h3,
    .error-message p {
        color: #e0e0e0;
    }
}

/* Accessibility Improvements */
.product-button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.page-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .product-card,
    .product-image img,
    .product-button,
    .page-btn {
        transition: none;
    }
    
    .spinner {
        animation: none;
    }
}

/* Custom Properties for Easy Theming */
:root {
    --product-card-bg: #fff;
    --product-card-border: #e0e0e0;
    --product-card-hover-shadow: 0 8px 25px rgba(0,0,0,0.15);
    --primary-color: #007cba;
    --primary-hover: #005a87;
    --text-color: #333;
    --text-muted: #666;
    --border-radius: 8px;
}

/* Alternative Color Schemes */
.product-grid.theme-green {
    --primary-color: #28a745;
    --primary-hover: #218838;
}

.product-grid.theme-red {
    --primary-color: #dc3545;
    --primary-hover: #c82333;
}

.product-grid.theme-orange {
    --primary-color: #fd7e14;
    --primary-hover: #e66500;
}