/**
 * Public Styles
 *
 * Styles for public-facing pages
 */

/* Buy button styles */
.buy-button {
    display: inline-block;
    padding: 6px 16px;
    background-color: #2e7d32;  /* ЗЕЛЕНЫЙ ФОН */
    color: white !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.2s;
    border: none;
    cursor: pointer;
    text-align: center;
}

.buy-button:hover {
    background-color: #1b5e20;  /* ТЕМНО-ЗЕЛЕНЫЙ при наведении */
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.buy-button:active {
    transform: translateY(0);
}

/* Product Selector */
.mpc-product-selector {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    margin: 20px 0;
}

.mpc-selector-header h3 {
    margin: 0 0 20px;
    font-size: 24px;
    color: #333;
}

/* Categories */
.mpc-categories {
    margin-bottom: 30px;
}

.mpc-categories h4 {
    margin: 0 0 15px;
    font-size: 18px;
    color: #555;
}

.mpc-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.mpc-category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.mpc-category-item:hover {
    border-color: #0073aa;
    background: #f8f9fa;
}

.mpc-category-item.active {
    border-color: #0073aa;
    background: #e7f3f8;
}

.mpc-category-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.mpc-category-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* Vehicle Selector */
.mpc-vehicle-selector {
    margin-bottom: 30px;
}

.mpc-vehicle-selector h4 {
    margin: 0 0 15px;
    font-size: 18px;
    color: #555;
}

.mpc-selector-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.mpc-field {
    display: flex;
    flex-direction: column;
}

.mpc-field label {
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.mpc-select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.mpc-select:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.mpc-button {
    padding: 12px 24px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.mpc-button:hover:not(:disabled) {
    background: #005a87;
}

.mpc-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* OEM Search */
.mpc-oem-search {
    margin-bottom: 30px;
}

.mpc-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.mpc-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
}

.mpc-divider span {
    position: relative;
    background: #fff;
    padding: 0 15px;
    color: #999;
}

.mpc-oem-search h4 {
    margin: 0 0 15px;
    font-size: 18px;
    color: #555;
}

.mpc-oem-field {
    display: flex;
    gap: 10px;
}

.mpc-oem-field input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Results */
.mpc-results {
    margin-top: 30px;
}

.mpc-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #0073aa;
}

.mpc-results-header h4 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.mpc-results-count {
    font-size: 14px;
    color: #666;
}

.mpc-results-content {
    display: grid;
    gap: 20px;
}

/* Product Item */
.mpc-product-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.mpc-product-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.mpc-product-image {
    flex-shrink: 0;
    width: 150px;
}

.mpc-product-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.mpc-product-details {
    flex: 1;
}

.mpc-product-details h5 {
    margin: 0 0 10px;
    font-size: 18px;
    color: #333;
}

.mpc-product-sku,
.mpc-product-oem,
.mpc-vehicle-info {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

.mpc-product-meta {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.mpc-product-stock {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.mpc-product-stock.instock {
    background: #d4edda;
    color: #155724;
}

.mpc-product-stock.outofstock {
    background: #f8d7da;
    color: #721c24;
}

.mpc-compatibility-type {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.mpc-compatibility-type.alternative {
    background: #fff3cd;
    color: #856404;
}

.mpc-compatibility-type.upgrade {
    background: #d1ecf1;
    color: #0c5460;
}

.mpc-product-price {
    margin: 15px 0;
    font-size: 20px;
    font-weight: 700;
    color: #0073aa;
}

.mpc-product-actions {
    display: flex;
    gap: 10px;
}

.mpc-button-primary {
    background: #0073aa;
}

.mpc-button-secondary {
    background: #6c757d;
}

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

.mpc-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: mpc-spin 1s linear infinite;
    margin-bottom: 10px;
}

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

/* Responsive */
@media (max-width: 768px) {
    .mpc-category-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .mpc-selector-fields {
        grid-template-columns: 1fr;
    }
    
    .mpc-product-item {
        flex-direction: column;
    }
    
    .mpc-product-image {
        width: 100%;
    }
    
    .mpc-product-actions {
        flex-direction: column;
    }
}