/**
 * MSTires Tire Search - Frontend Styles
 * Minimal base styles - customize as needed
 */

.mstires-search-wrapper {
    width: 100%;
    max-width: 100%;
}

.mstires-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.mstires-search-field {
    flex: 0;
    min-width: 200px;
}

.mstires-search-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
}

.mstires-search-field select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    transition: all 0.3s ease;
}

.mstires-search-field select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.mstires-search-field select:disabled,
.mstires-search-field select.disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.mstires-search-field select.loading {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="8" fill="none" stroke="%230073aa" stroke-width="2" opacity="0.4"/><path d="M10 2a8 8 0 0 1 8 8" fill="none" stroke="%230073aa" stroke-width="2"/></svg>');
    background-repeat: no-repeat;
    background-position: calc(100% - 10px) center;
    background-size: 20px 20px;
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from { background-position: calc(100% - 10px) center; }
    to { background-position: calc(100% - 10px) center; }
}

.mstires-search-button-wrap {
    display: flex;
    align-items: flex-end;
    min-width: 150px;
}

.mstires-search-button {
    width: 100%;
    padding: 10px 30px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mstires-search-button:hover:not(:disabled) {
    background-color: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
}

.mstires-search-button:disabled,
.mstires-search-button.disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.mstires-search-button.loading {
    position: relative;
    color: transparent;
}

.mstires-search-button.loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Results */
.mstires-search-results {
    margin-top: 30px;
}

.mstires-results-container {
    width: 100%;
}

.mstires-results-count {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.mstires-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.mstires-product-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fff;
}

.mstires-product-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.mstires-product-image {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    overflow: hidden;
}

.mstires-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mstires-product-image .no-image {
    color: #999;
    font-size: 14px;
}

.mstires-product-info {
    padding: 15px;
}

.mstires-product-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
}

.mstires-product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mstires-product-title a:hover {
    color: #0073aa;
}

.mstires-product-price {
    font-size: 18px;
    font-weight: 700;
    color: #0073aa;
    margin-bottom: 10px;
}

.mstires-product-stock {
    font-size: 13px;
    margin-bottom: 15px;
    padding: 4px 8px;
    border-radius: 3px;
    display: inline-block;
}

.mstires-product-stock.in-stock {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.mstires-product-stock.out-of-stock {
    background-color: #ffebee;
    color: #c62828;
}

.mstires-product-button {
    display: inline-block;
    width: 100%;
    padding: 10px 20px;
    background-color: #333;
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.mstires-product-button:hover {
    background-color: #0073aa;
}

.mstires-no-results {
    padding: 40px;
    text-align: center;
    font-size: 16px;
    color: #666;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .mstires-search-form {
        flex-direction: column;
    }
    
    .mstires-search-field {
        width: 100%;
    }
    
    .mstires-search-button-wrap {
        width: 100%;
    }
    
    .mstires-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .mstires-results-grid {
        grid-template-columns: 1fr;
    }
}